vendor: 26,292 bytes, lines 1-2
1import{a as N,r as h,j as e}from"./vendor-trpc-D6ZkT7iM.js";import{u as Da}from"./useAuth-C5R2dKPb.js";import{f as wn,g as Ae,u as yn,h as Zn,i as Ra,j as Jn,k as Y,l as Ct,m as Ma,n as Ta,o as Wa,p as ec,q as tc,r as jn,s as nc,t as sc,v as ac,w as ic,x as oc,y as cc,F as rc,D as dc,z as lc,B as mc,E as _a,G as xc,J as uc,K as pc,L as hc,M as fc,N as bc,O as gc,S as Ac,Q as vc,U as wc,V as yc,W as jc}from"./vendor-radix-BoZQToVs.js";import{b as ze,s as Nc,d as M,T as Cc,e as kc,f as Pc,g as Sc,h as Oc,B as L,t as j,i as R,j as Ms,k as Dc}from"./index-D7bKc13a.js";import{X as Ue,P as La,b as Kt,o as ls,U as He,h as ct,F as Ea,p as Ia,q as zt,r as _t,s as Lt,t as rt,u as me,B as At,v as Ge,L as Ce,w as ms,x as Ba,y as Et,m as Me,n as Te,E as ln,M as Fa,D as Gt,g as Ve,z as Dt,I as Xn,J as xs,T as Ts,K as mn,N as vt,O as qe,d as In,Q as Bn,V as Rc,Y as Mc,_ as It,$ as $a,a0 as es,f as it,a1 as Tc,R as Wc,a2 as ts,a3 as _c,a as Lc,C as Ec,a4 as xn,a5 as Ua,a6 as Ic,a7 as Bc,a8 as un,a9 as us,aa as Fc,i as Ya,ab as Ws,ac as ns,ad as _s,ae as Fn,af as pn,ag as Ka,A as hn,ah as $c,ai as Uc,aj as Yc,ak as Kc,j as zc,W as za,al as Ls,am as Gc,an as Vc,ao as qc,ap as Hc,aq as Qc,e as Zc}from"./vendor-icons-CpBmPy1A.js";import{f as ae,r as Ga,b as Jc,c as Va,d as Xc,i as nt,e as ps,p as Be,L as be,g as qa,h as hs,j as Ha,D as er,k as tr,l as gt,m as ut,S as nr,n as sr,o as ar,q as Es,s as ir,t as ht,u as Qa,v as or,G as cr,w as rn,x as rr,y as Le,z as dr,B as en,E as Is,F as Za,H as fs,X as De,Y as Re,I as lr,J as mr,T as xr,R as ur,A as ot,C as Fe,a as ke,K as Ja}from"./AreaChart-hNjVJrl2.js";import{M as pr}from"./index-CkU3RIa_.js";import{g as Xa}from"./vendor-react-C6WdkbZm.js";import"./vendor-react-dom-CbT1Y-B1.js";var hr=["points","className","baseLinePoints","connectNulls"];function ft(){return ft=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(t[s]=a[s])}return t},ft.apply(this,arguments)}function fr(t,n){if(t==null)return{};var a=br(t,n),s,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)s=o[i],!(n.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(a[s]=t[s])}return a}function br(t,n){if(t==null)return{};var a={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(n.indexOf(s)>=0)continue;a[s]=t[s]}return a}function Bs(t){return wr(t)||vr(t)||Ar(t)||gr()}function gr(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ar(t,n){if(t){if(typeof t=="string")return ss(t,n);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Array.from(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ss(t,n)}}function vr(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wr(t){if(Array.isArray(t))return ss(t)}function ss(t,n){(n==null||n>t.length)&&(n=t.length);for(var a=0,s=new Array(n);a<n;a++)s[a]=t[a];return s}var Fs=function(n){return n&&n.x===+n.x&&n.y===+n.y},yr=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=[[]];return n.forEach(function(s){Fs(s)?a[a.length-1].push(s):a[a.length-1].length>0&&a.push([])}),Fs(n[0])&&a[a.length-1].push(n[0]),a[a.length-1].length<=0&&(a=a.slice(0,-1)),a},Tt=function(n,a){var s=yr(n);a&&(s=[s.reduce(function(o,c){return[].concat(Bs(o),Bs(c))},[])]);var i=s.map(function(o){return o.reduce(function(c,d,l){return"".concat(c).concat(l===0?"M":"L").concat(d.x,",").concat(d.y)},"")}).join("");return s.length===1?"".concat(i,"Z"):i},jr=function(n,a,s){var i=Tt(n,s);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Tt(a.reverse(),s).slice(1))},Nr=function(n){var a=n.points,s=n.className,i=n.baseLinePoints,o=n.connectNulls,c=fr(n,hr);if(!a||!a.length)return null;var d=ze("recharts-polygon",s);if(i&&i.length){var l=c.stroke&&c.stroke!=="none",x=jr(a,i,o);return N.createElement("g",{className:d},N.createElement("path",ft({},ae(c,!0),{fill:x.slice(-1)==="Z"?c.fill:"none",stroke:"none",d:x})),l?N.createElement("path",ft({},ae(c,!0),{fill:"none",d:Tt(a,o)})):null,l?N.createElement("path",ft({},ae(c,!0),{fill:"none",d:Tt(i,o)})):null)}var r=Tt(a,o);return N.createElement("path",ft({},ae(c,!0),{fill:r.slice(-1)==="Z"?c.fill:"none",className:d,d:r}))},$n,$s;function Cr(){if($s)return $n;$s=1;var t=Ga(),n=Jc(),a=Va();function s(i,o){return i&&i.length?t(i,a(o,2),n):void 0}return $n=s,$n}var kr=Cr();const Pr=Xa(kr);var Un,Us;function Sr(){if(Us)return Un;Us=1;var t=Ga(),n=Va(),a=Xc();function s(i,o){return i&&i.length?t(i,n(o,2),a):void 0}return Un=s,Un}var Or=Sr();const Dr=Xa(Or);var Rr=["cx","cy","angle","ticks","axisLine"],Mr=["ticks","tick","angle","tickFormatter","stroke"];function wt(t){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},wt(t)}function Wt(){return Wt=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(t[s]=a[s])}return t},Wt.apply(this,arguments)}function Ys(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);n&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,s)}return a}function Je(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Ys(Object(a),!0).forEach(function(s){Nn(t,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ys(Object(a)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(a,s))})}return t}function Ks(t,n){if(t==null)return{};var a=Tr(t,n),s,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)s=o[i],!(n.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(a[s]=t[s])}return a}function Tr(t,n){if(t==null)return{};var a={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(n.indexOf(s)>=0)continue;a[s]=t[s]}return a}function Wr(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function zs(t,n){for(var a=0;a<n.length;a++){var s=n[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,ti(s.key),s)}}function _r(t,n,a){return n&&zs(t.prototype,n),a&&zs(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lr(t,n,a){return n=fn(n),Er(t,ei()?Reflect.construct(n,a||[],fn(t).constructor):n.apply(t,a))}function Er(t,n){if(n&&(wt(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ir(t)}function Ir(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ei(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ei=function(){return!!t})()}function fn(t){return fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},fn(t)}function Br(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&as(t,n)}function as(t,n){return as=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},as(t,n)}function Nn(t,n,a){return n=ti(n),n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function ti(t){var n=Fr(t,"string");return wt(n)=="symbol"?n:n+""}function Fr(t,n){if(wt(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var s=a.call(t,n);if(wt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Cn=(function(t){function n(){return Wr(this,n),Lr(this,n,arguments)}return Br(n,t),_r(n,[{key:"getTickValueCoord",value:function(s){var i=s.coordinate,o=this.props,c=o.angle,d=o.cx,l=o.cy;return Be(d,l,i,c)}},{key:"getTickTextAnchor",value:function(){var s=this.props.orientation,i;switch(s){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var s=this.props,i=s.cx,o=s.cy,c=s.angle,d=s.ticks,l=Pr(d,function(r){return r.coordinate||0}),x=Dr(d,function(r){return r.coordinate||0});return{cx:i,cy:o,startAngle:c,endAngle:c,innerRadius:x.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var s=this.props,i=s.cx,o=s.cy,c=s.angle,d=s.ticks,l=s.axisLine,x=Ks(s,Rr),r=d.reduce(function(p,A){return[Math.min(p[0],A.coordinate),Math.max(p[1],A.coordinate)]},[1/0,-1/0]),m=Be(i,o,r[0],c),b=Be(i,o,r[1],c),f=Je(Je(Je({},ae(x,!1)),{},{fill:"none"},ae(l,!1)),{},{x1:m.x,y1:m.y,x2:b.x,y2:b.y});return N.createElement("line",Wt({className:"recharts-polar-radius-axis-line"},f))}},{key:"renderTicks",value:function(){var s=this,i=this.props,o=i.ticks,c=i.tick,d=i.angle,l=i.tickFormatter,x=i.stroke,r=Ks(i,Mr),m=this.getTickTextAnchor(),b=ae(r,!1),f=ae(c,!1),p=o.map(function(A,g){var w=s.getTickValueCoord(A),C=Je(Je(Je(Je({textAnchor:m,transform:"rotate(".concat(90-d,", ").concat(w.x,", ").concat(w.y,")")},b),{},{stroke:"none",fill:x},f),{},{index:g},w),{},{payload:A});return N.createElement(be,Wt({className:ze("recharts-polar-radius-axis-tick",qa(c)),key:"tick-".concat(A.coordinate)},hs(s.props,A,g)),n.renderTickItem(c,C,l?l(A.value,g):A.value))});return N.createElement(be,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var s=this.props,i=s.ticks,o=s.axisLine,c=s.tick;return!i||!i.length?null:N.createElement(be,{className:ze("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),c&&this.renderTicks(),Ha.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(s,i,o){var c;return N.isValidElement(s)?c=N.cloneElement(s,i):nt(s)?c=s(i):c=N.createElement(ps,Wt({},i,{className:"recharts-polar-radius-axis-tick-value"}),o),c}}])})(h.PureComponent);Nn(Cn,"displayName","PolarRadiusAxis");Nn(Cn,"axisType","radiusAxis");Nn(Cn,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function yt(t){"@babel/helpers - typeof";return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},yt(t)}function st(){return st=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(t[s]=a[s])}return t},st.apply(this,arguments)}function Gs(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);n&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,s)}return a}function Xe(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Gs(Object(a),!0).forEach(function(s){kn(t,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Gs(Object(a)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(a,s))})}return t}function $r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Vs(t,n){for(var a=0;a<n.length;a++){var s=n[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,si(s.key),s)}}function Ur(t,n,a){return n&&Vs(t.prototype,n),a&&Vs(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yr(t,n,a){return n=bn(n),Kr(t,ni()?Reflect.construct(n,a||[],bn(t).constructor):n.apply(t,a))}function Kr(t,n){if(n&&(yt(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zr(t)}function zr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ni=function(){return!!t})()}function bn(t){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},bn(t)}function Gr(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&is(t,n)}function is(t,n){return is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},is(t,n)}function kn(t,n,a){return n=si(n),n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function si(t){var n=Vr(t,"string");return yt(n)=="symbol"?n:n+""}function Vr(t,n){if(yt(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var s=a.call(t,n);if(yt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var qr=Math.PI/180,qs=1e-5,Pn=(function(t){function n(){return $r(this,n),Yr(this,n,arguments)}return Gr(n,t),Ur(n,[{key:"getTickLineCoord",value:function(s){var i=this.props,o=i.cx,c=i.cy,d=i.radius,l=i.orientation,x=i.tickSize,r=x||8,m=Be(o,c,d,s.coordinate),b=Be(o,c,d+(l==="inner"?-1:1)*r,s.coordinate);return{x1:m.x,y1:m.y,x2:b.x,y2:b.y}}},{key:"getTickTextAnchor",value:function(s){var i=this.props.orientation,o=Math.cos(-s.coordinate*qr),c;return o>qs?c=i==="outer"?"start":"end":o<-qs?c=i==="outer"?"end":"start":c="middle",c}},{key:"renderAxisLine",value:function(){var s=this.props,i=s.cx,o=s.cy,c=s.radius,d=s.axisLine,l=s.axisLineType,x=Xe(Xe({},ae(this.props,!1)),{},{fill:"none"},ae(d,!1));if(l==="circle")return N.createElement(er,st({className:"recharts-polar-angle-axis-line"},x,{cx:i,cy:o,r:c}));var r=this.props.ticks,m=r.map(function(b){return Be(i,o,c,b.coordinate)});return N.createElement(Nr,st({className:"recharts-polar-angle-axis-line"},x,{points:m}))}},{key:"renderTicks",value:function(){var s=this,i=this.props,o=i.ticks,c=i.tick,d=i.tickLine,l=i.tickFormatter,x=i.stroke,r=ae(this.props,!1),m=ae(c,!1),b=Xe(Xe({},r),{},{fill:"none"},ae(d,!1)),f=o.map(function(p,A){var g=s.getTickLineCoord(p),w=s.getTickTextAnchor(p),C=Xe(Xe(Xe({textAnchor:w},r),{},{stroke:"none",fill:x},m),{},{index:A,payload:p,x:g.x2,y:g.y2});return N.createElement(be,st({className:ze("recharts-polar-angle-axis-tick",qa(c)),key:"tick-".concat(p.coordinate)},hs(s.props,p,A)),d&&N.createElement("line",st({className:"recharts-polar-angle-axis-tick-line"},b,g)),c&&n.renderTickItem(c,C,l?l(p.value,A):p.value))});return N.createElement(be,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var s=this.props,i=s.ticks,o=s.radius,c=s.axisLine;return o<=0||!i||!i.length?null:N.createElement(be,{className:ze("recharts-polar-angle-axis",this.props.className)},c&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(s,i,o){var c;return N.isValidElement(s)?c=N.cloneElement(s,i):nt(s)?c=s(i):c=N.createElement(ps,st({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),c}}])})(h.PureComponent);kn(Pn,"displayName","PolarAngleAxis");kn(Pn,"axisType","angleAxis");kn(Pn,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var dn;function jt(t){"@babel/helpers - typeof";return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},jt(t)}function bt(){return bt=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(t[s]=a[s])}return t},bt.apply(this,arguments)}function Hs(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);n&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,s)}return a}function H(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Hs(Object(a),!0).forEach(function(s){pe(t,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Hs(Object(a)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(a,s))})}return t}function Hr(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Qs(t,n){for(var a=0;a<n.length;a++){var s=n[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,ii(s.key),s)}}function Qr(t,n,a){return n&&Qs(t.prototype,n),a&&Qs(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function Zr(t,n,a){return n=gn(n),Jr(t,ai()?Reflect.construct(n,a||[],gn(t).constructor):n.apply(t,a))}function Jr(t,n){if(n&&(jt(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xr(t)}function Xr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ai(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ai=function(){return!!t})()}function gn(t){return gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},gn(t)}function ed(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&os(t,n)}function os(t,n){return os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},os(t,n)}function pe(t,n,a){return n=ii(n),n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function ii(t){var n=td(t,"string");return jt(n)=="symbol"?n:n+""}function td(t,n){if(jt(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var s=a.call(t,n);if(jt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var xe=(function(t){function n(a){var s;return Hr(this,n),s=Zr(this,n,[a]),pe(s,"pieRef",null),pe(s,"sectorRefs",[]),pe(s,"id",or("recharts-pie-")),pe(s,"handleAnimationEnd",function(){var i=s.props.onAnimationEnd;s.setState({isAnimationFinished:!0}),nt(i)&&i()}),pe(s,"handleAnimationStart",function(){var i=s.props.onAnimationStart;s.setState({isAnimationFinished:!1}),nt(i)&&i()}),s.state={isAnimationFinished:!a.isAnimationActive,prevIsAnimationActive:a.isAnimationActive,prevAnimationId:a.animationId,sectorToFocus:0},s}return ed(n,t),Qr(n,[{key:"isActiveIndex",value:function(s){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(s)!==-1:s===i}},{key:"hasActiveIndex",value:function(){var s=this.props.activeIndex;return Array.isArray(s)?s.length!==0:s||s===0}},{key:"renderLabels",value:function(s){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.label,d=o.labelLine,l=o.dataKey,x=o.valueKey,r=ae(this.props,!1),m=ae(c,!1),b=ae(d,!1),f=c&&c.offsetRadius||20,p=s.map(function(A,g){var w=(A.startAngle+A.endAngle)/2,C=Be(A.cx,A.cy,A.outerRadius+f,w),v=H(H(H(H({},r),A),{},{stroke:"none"},m),{},{index:g,textAnchor:n.getTextAnchor(C.x,A.cx)},C),P=H(H(H(H({},r),A),{},{fill:"none",stroke:A.fill},b),{},{index:g,points:[Be(A.cx,A.cy,A.outerRadius,w),C]}),u=l;return gt(l)&>(x)?u="value":gt(l)&&(u=x),N.createElement(be,{key:"label-".concat(A.startAngle,"-").concat(A.endAngle,"-").concat(A.midAngle,"-").concat(g)},d&&n.renderLabelLineItem(d,P,"line"),n.renderLabelItem(c,v,ut(A,u)))});return N.createElement(be,{className:"recharts-pie-labels"},p)}},{key:"renderSectorsStatically",value:function(s){var i=this,o=this.props,c=o.activeShape,d=o.blendStroke,l=o.inactiveShape;return s.map(function(x,r){if(x?.startAngle===0&&x?.endAngle===0&&s.length!==1)return null;var m=i.isActiveIndex(r),b=l&&i.hasActiveIndex()?l:null,f=m?c:b,p=H(H({},x),{},{stroke:d?x.fill:x.stroke,tabIndex:-1});return N.createElement(be,bt({ref:function(g){g&&!i.sectorRefs.includes(g)&&i.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},hs(i.props,x,r),{key:"sector-".concat(x?.startAngle,"-").concat(x?.endAngle,"-").concat(x.midAngle,"-").concat(r)}),N.createElement(nr,bt({option:f,isActive:m,shapeType:"sector"},p)))})}},{key:"renderSectorsWithAnimation",value:function(){var s=this,i=this.props,o=i.sectors,c=i.isAnimationActive,d=i.animationBegin,l=i.animationDuration,x=i.animationEasing,r=i.animationId,m=this.state,b=m.prevSectors,f=m.prevIsAnimationActive;return N.createElement(sr,{begin:d,duration:l,isActive:c,easing:x,from:{t:0},to:{t:1},key:"pie-".concat(r,"-").concat(f),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(p){var A=p.t,g=[],w=o&&o[0],C=w.startAngle;return o.forEach(function(v,P){var u=b&&b[P],y=P>0?ar(v,"paddingAngle",0):0;if(u){var S=Es(u.endAngle-u.startAngle,v.endAngle-v.startAngle),O=H(H({},v),{},{startAngle:C+y,endAngle:C+S(A)+y});g.push(O),C=O.endAngle}else{var B=v.endAngle,E=v.startAngle,D=Es(0,B-E),K=D(A),Q=H(H({},v),{},{startAngle:C+y,endAngle:C+K+y});g.push(Q),C=Q.endAngle}}),N.createElement(be,null,s.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(s){var i=this;s.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var c=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[c].focus(),i.setState({sectorToFocus:c});break}case"ArrowRight":{var d=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[d].focus(),i.setState({sectorToFocus:d});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var s=this.props,i=s.sectors,o=s.isAnimationActive,c=this.state.prevSectors;return o&&i&&i.length&&(!c||!ir(c,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var s=this,i=this.props,o=i.hide,c=i.sectors,d=i.className,l=i.label,x=i.cx,r=i.cy,m=i.innerRadius,b=i.outerRadius,f=i.isAnimationActive,p=this.state.isAnimationFinished;if(o||!c||!c.length||!ht(x)||!ht(r)||!ht(m)||!ht(b))return null;var A=ze("recharts-pie",d);return N.createElement(be,{tabIndex:this.props.rootTabIndex,className:A,ref:function(w){s.pieRef=w}},this.renderSectors(),l&&this.renderLabels(c),Ha.renderCallByParent(this.props,null,!1),(!f||p)&&Qa.renderCallByParent(this.props,c,!1))}}],[{key:"getDerivedStateFromProps",value:function(s,i){return i.prevIsAnimationActive!==s.isAnimationActive?{prevIsAnimationActive:s.isAnimationActive,prevAnimationId:s.animationId,curSectors:s.sectors,prevSectors:[],isAnimationFinished:!0}:s.isAnimationActive&&s.animationId!==i.prevAnimationId?{prevAnimationId:s.animationId,curSectors:s.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:s.sectors!==i.curSectors?{curSectors:s.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(s,i){return s>i?"start":s<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(s,i,o){if(N.isValidElement(s))return N.cloneElement(s,i);if(nt(s))return s(i);var c=ze("recharts-pie-label-line",typeof s!="boolean"?s.className:"");return N.createElement(tr,bt({},i,{key:o,type:"linear",className:c}))}},{key:"renderLabelItem",value:function(s,i,o){if(N.isValidElement(s))return N.cloneElement(s,i);var c=o;if(nt(s)&&(c=s(i),N.isValidElement(c)))return c;var d=ze("recharts-pie-label-text",typeof s!="boolean"&&!nt(s)?s.className:"");return N.createElement(ps,bt({},i,{alignmentBaseline:"middle",className:d}),c)}}])})(h.PureComponent);dn=xe;pe(xe,"displayName","Pie");pe(xe,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!cr.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});pe(xe,"parseDeltaAngle",function(t,n){var a=rn(n-t),s=Math.min(Math.abs(n-t),360);return a*s});pe(xe,"getRealPieData",function(t){var n=t.data,a=t.children,s=ae(t,!1),i=rr(a,Le);return n&&n.length?n.map(function(o,c){return H(H(H({payload:o},s),o),i&&i[c]&&i[c].props)}):i&&i.length?i.map(function(o){return H(H({},s),o.props)}):[]});pe(xe,"parseCoordinateOfPie",function(t,n){var a=n.top,s=n.left,i=n.width,o=n.height,c=dr(i,o),d=s+en(t.cx,i,i/2),l=a+en(t.cy,o,o/2),x=en(t.innerRadius,c,0),r=en(t.outerRadius,c,c*.8),m=t.maxRadius||Math.sqrt(i*i+o*o)/2;return{cx:d,cy:l,innerRadius:x,outerRadius:r,maxRadius:m}});pe(xe,"getComposedData",function(t){var n=t.item,a=t.offset,s=n.type.defaultProps!==void 0?H(H({},n.type.defaultProps),n.props):n.props,i=dn.getRealPieData(s);if(!i||!i.length)return null;var o=s.cornerRadius,c=s.startAngle,d=s.endAngle,l=s.paddingAngle,x=s.dataKey,r=s.nameKey,m=s.valueKey,b=s.tooltipType,f=Math.abs(s.minAngle),p=dn.parseCoordinateOfPie(s,a),A=dn.parseDeltaAngle(c,d),g=Math.abs(A),w=x;gt(x)&>(m)?(Is(!1,`Use "dataKey" to specify the value of pie,
3 the props "valueKey" will be deprecated in 1.1.0`),w="value"):gt(x)&&(Is(!1,`Use "dataKey" to specify the value of pie, 4 the props "valueKey" will be deprecated in 1.1.0`),w=m);var C=i.filter(function(O){return ut(O,w,0)!==0}).length,v=(g>=360?C:C-1)*l,P=g-C*f-v,u=i.reduce(function(O,B){var E=ut(B,w,0);return O+(ht(E)?E:0)},0),y;if(u>0){var S;y=i.map(function(O,B){var E=ut(O,w,0),D=ut(O,r,B),K=(ht(E)?E:0)/u,Q;B?Q=S.endAngle+rn(A)*l*(E!==0?1:0):Q=c;var ie=Q+rn(A)*((E!==0?f:0)+K*P),te=(Q+ie)/2,_=(p.innerRadius+p.outerRadius)/2,ve=[{name:D,value:E,payload:O,dataKey:w,type:b}],J=Be(p.cx,p.cy,_,te);return S=H(H(H({percent:K,cornerRadius:o,name:D,tooltipPayload:ve,midAngle:te,middleRadius:_,tooltipPosition:J},O),p),{},{value:ut(O,w),startAngle:Q,endAngle:ie,payload:O,paddingAngle:rn(A)*l}),S})}return H(H({},p),{},{sectors:y,data:i})});var oi=Za({chartName:"BarChart",GraphicalChild:fs,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:De},{axisType:"yAxis",AxisComp:Re}],formatAxisMap:lr}),Bt=Za({chartName:"PieChart",GraphicalChild:xe,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Pn},{axisType:"radiusAxis",AxisComp:Cn}],formatAxisMap:mr,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function nd(){return Nc.useSyncExternalStore(sd,()=>!0,()=>!1)}function sd(){return()=>{}}var bs="Avatar",[ad]=wn(bs),[id,ci]=ad(bs),ri=h.forwardRef((t,n)=>{const{__scopeAvatar:a,...s}=t,[i,o]=h.useState("idle");return e.jsx(id,{scope:a,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(Ae.span,{...s,ref:n})})});ri.displayName=bs;var di="AvatarImage",od=h.forwardRef((t,n)=>{const{__scopeAvatar:a,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=ci(di,a),d=cd(s,o),l=yn(x=>{i(x),c.onImageLoadingStatusChange(x)});return Zn(()=>{d!=="idle"&&l(d)},[d,l]),d==="loaded"?e.jsx(Ae.img,{...o,ref:n,src:s}):null});od.displayName=di;var li="AvatarFallback",mi=h.forwardRef((t,n)=>{const{__scopeAvatar:a,delayMs:s,...i}=t,o=ci(li,a),[c,d]=h.useState(s===void 0);return h.useEffect(()=>{if(s!==void 0){const l=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(l)}},[s]),c&&o.imageLoadingStatus!=="loaded"?e.jsx(Ae.span,{...i,ref:n}):null});mi.displayName=li;function Zs(t,n){return t?n?(t.src!==n&&(t.src=n),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function cd(t,{referrerPolicy:n,crossOrigin:a}){const s=nd(),i=h.useRef(null),o=s?(i.current||(i.current=new window.Image),i.current):null,[c,d]=h.useState(()=>Zs(o,t));return Zn(()=>{d(Zs(o,t))},[o,t]),Zn(()=>{const l=m=>()=>{d(m)};if(!o)return;const x=l("loaded"),r=l("error");return o.addEventListener("load",x),o.addEventListener("error",r),n&&(o.referrerPolicy=n),typeof a=="string"&&(o.crossOrigin=a),()=>{o.removeEventListener("load",x),o.removeEventListener("error",r)}},[o,a,n]),c}var rd=ri,dd=mi;function ld({className:t,...n}){return e.jsx(rd,{"data-loc":"client/src/components/ui/avatar.tsx:11","data-slot":"avatar",className:M("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...n})}function md({className:t,...n}){return e.jsx(dd,{"data-loc":"client/src/components/ui/avatar.tsx:40","data-slot":"avatar-fallback",className:M("bg-muted flex size-full items-center justify-center rounded-full",t),...n})}var Yn="rovingFocusGroup.onEntryFocus",xd={bubbles:!1,cancelable:!0},Vt="RovingFocusGroup",[cs,xi,ud]=Ra(Vt),[pd,ui]=wn(Vt,[ud]),[hd,fd]=pd(Vt),pi=h.forwardRef((t,n)=>e.jsx(cs.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(cs.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(bd,{...t,ref:n})})}));pi.displayName=Vt;var bd=h.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:l,onEntryFocus:x,preventScrollOnEntryFocus:r=!1,...m}=t,b=h.useRef(null),f=Ct(n,b),p=Ma(o),[A,g]=Ta({prop:c,defaultProp:d??null,onChange:l,caller:Vt}),[w,C]=h.useState(!1),v=yn(x),P=xi(a),u=h.useRef(!1),[y,S]=h.useState(0);return h.useEffect(()=>{const O=b.current;if(O)return O.addEventListener(Yn,v),()=>O.removeEventListener(Yn,v)},[v]),e.jsx(hd,{scope:a,orientation:s,dir:p,loop:i,currentTabStopId:A,onItemFocus:h.useCallback(O=>g(O),[g]),onItemShiftTab:h.useCallback(()=>C(!0),[]),onFocusableItemAdd:h.useCallback(()=>S(O=>O+1),[]),onFocusableItemRemove:h.useCallback(()=>S(O=>O-1),[]),children:e.jsx(Ae.div,{tabIndex:w||y===0?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:Y(t.onMouseDown,()=>{u.current=!0}),onFocus:Y(t.onFocus,O=>{const B=!u.current;if(O.target===O.currentTarget&&B&&!w){const E=new CustomEvent(Yn,xd);if(O.currentTarget.dispatchEvent(E),!E.defaultPrevented){const D=P().filter(_=>
vendor: 4,185 bytes, line 4
4_.focusable),K=D.find(_=>_.active),Q=D.find(_=>_.id===A),te=[K,Q,...D].filter(Boolean).map(_=>_.ref.current);bi(te,r)}}u.current=!1}),onBlur:Y(t.onBlur,()=>C(!1))})})}),hi="RovingFocusGroupItem",fi=h.forwardRef((t,n)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...d}=t,l=Jn(),x=o||l,r=fd(hi,a),m=r.currentTabStopId===x,b=xi(a),{onFocusableItemAdd:f,onFocusableItemRemove:p,currentTabStopId:A}=r;return h.useEffect(()=>{if(s)return f(),()=>p()},[s,f,p]),e.jsx(cs.ItemSlot,{scope:a,id:x,focusable:s,active:i,children:e.jsx(Ae.span,{tabIndex:m?0:-1,"data-orientation":r.orientation,...d,ref:n,onMouseDown:Y(t.onMouseDown,g=>{s?r.onItemFocus(x):g.preventDefault()}),onFocus:Y(t.onFocus,()=>r.onItemFocus(x)),onKeyDown:Y(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){r.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=vd(g,r.orientation,r.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let v=b().filter(P=>P.focusable).map(P=>P.ref.current);if(w==="last")v.reverse();else if(w==="prev"||w==="next"){w==="prev"&&v.reverse();const P=v.indexOf(g.currentTarget);v=r.loop?wd(v,P+1):v.slice(P+1)}setTimeout(()=>bi(v))}}),children:typeof c=="function"?c({isCurrentTabStop:m,hasTabStop:A!=null}):c})})});fi.displayName=hi;var gd={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ad(t,n){return n!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function vd(t,n,a){const s=Ad(t.key,a);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return gd[s]}function bi(t,n=!1){const a=document.activeElement;for(const s of t)if(s===a||(s.focus({preventScroll:n}),document.activeElement!==a))return}function wd(t,n){return t.map((a,s)=>t[(n+s)%t.length])}var yd=pi,jd=fi,rs=["Enter"," "],Nd=["ArrowDown","PageUp","Home"],gi=["ArrowUp","PageDown","End"],Cd=[...Nd,...gi],kd={ltr:[...rs,"ArrowRight"],rtl:[...rs,"ArrowLeft"]},Pd={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qt="Menu",[Ft,Sd,Od]=Ra(qt),[dt,Ai]=wn(qt,[Od,Wa,ui]),Sn=Wa(),vi=ui(),[Dd,lt]=dt(qt),[Rd,Ht]=dt(qt),wi=t=>{const{__scopeMenu:n,open:a=!1,children:s,dir:i,onOpenChange:o,modal:c=!0}=t,d=Sn(n),[l,x]=h.useState(null),r=h.useRef(!1),m=yn(o),b=Ma(i);return h.useEffect(()=>{const f=()=>{r.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>r.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),e.jsx(ec,{...d,children:e.jsx(Dd,{scope:n,open:a,onOpenChange:m,content:l,onContentChange:x,children:e.jsx(Rd,{scope:n,onClose:h.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:r,dir:b,modal:c,children:s})})})};wi.displayName=qt;var Md="MenuAnchor",gs=h.forwardRef((t,n)=>{const{__scopeMenu:a,...s}=t,i=Sn(a);return e.jsx(tc,{...i,...s,ref:n})});gs.displayName=Md;var As="MenuPortal",[Td,yi]=dt(As,{forceMount:void 0}),ji=t=>{const{__scopeMenu:n,forceMount:a,children:s,container:i}=t,o=lt(As,n);return e.jsx(Td,{scope:n,forceMount:a,children:e.jsx(jn,{present:a||o.open,children:e.jsx(nc,{asChild:!0,container:i,children:s})})})};ji.displayName=As;var he="MenuContent",[Wd,vs]=dt(he),Ni=h.forwardRef((t,n)=>{const a=yi(he,t.__scopeMenu),{forceMount:s=a.forceMount,...i}=t,o=lt(he,t.__scopeMenu),c=Ht(he,t.__scopeMenu);return e.jsx(Ft.Provider,{scope:t.__scopeMenu,children:e.jsx(jn,{present:s||o.open,children:e.jsx(Ft.Slot,{scope:t.__scopeMenu,children:c.modal?e.jsx(_d,{...i,ref:n}):e.jsx(Ld,{...i,ref:n})})})})}),_d=h.forwardRef((t,n)=>{const a=lt(he,t.__scopeMenu),s=h.useRef(null),i=Ct(n,s);return h.useEffect(()=>{const o=s.current;if(o)return sc(o)},[]),e.jsx(ws,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Y(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}
vendor: 19,097 bytes, line 4
4),Ld=h.forwardRef((t,n)=>{const a=lt(he,t.__scopeMenu);return e.jsx(ws,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),Ed=cc("MenuContent.ScrollLock"),ws=h.forwardRef((t,n)=>{const{__scopeMenu:a,loop:s=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:l,onEscapeKeyDown:x,onPointerDownOutside:r,onFocusOutside:m,onInteractOutside:b,onDismiss:f,disableOutsideScroll:p,...A}=t,g=lt(he,a),w=Ht(he,a),C=Sn(a),v=vi(a),P=Sd(a),[u,y]=h.useState(null),S=h.useRef(null),O=Ct(n,S,g.onContentChange),B=h.useRef(0),E=h.useRef(""),D=h.useRef(0),K=h.useRef(null),Q=h.useRef("right"),ie=h.useRef(0),te=p?oc:h.Fragment,_=p?{as:Ed,allowPinchZoom:!0}:void 0,ve=T=>{const ee=E.current+T,se=P().filter(V=>!V.disabled),re=document.activeElement,we=se.find(V=>V.ref.current===re)?.textValue,ye=se.map(V=>V.textValue),Qe=Hd(ye,ee,we),k=se.find(V=>V.textValue===Qe)?.ref.current;(function V(Ze){E.current=Ze,window.clearTimeout(B.current),Ze!==""&&(B.current=window.setTimeout(()=>V(""),1e3))})(ee),k&&setTimeout(()=>k.focus())};h.useEffect(()=>()=>window.clearTimeout(B.current),[]),ic();const J=h.useCallback(T=>Q.current===K.current?.side&&Zd(T,K.current?.area),[]);return e.jsx(Wd,{scope:a,searchRef:E,onItemEnter:h.useCallback(T=>{J(T)&&T.preventDefault()},[J]),onItemLeave:h.useCallback(T=>{J(T)||(S.current?.focus(),y(null))},[J]),onTriggerLeave:h.useCallback(T=>{J(T)&&T.preventDefault()},[J]),pointerGraceTimerRef:D,onPointerGraceIntentChange:h.useCallback(T=>{K.current=T},[]),children:e.jsx(te,{..._,children:e.jsx(rc,{asChild:!0,trapped:i,onMountAutoFocus:Y(o,T=>{T.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:e.jsx(dc,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:x,onPointerDownOutside:r,onFocusOutside:m,onInteractOutside:b,onDismiss:f,children:e.jsx(yd,{asChild:!0,...v,dir:w.dir,orientation:"vertical",loop:s,currentTabStopId:u,onCurrentTabStopIdChange:y,onEntryFocus:Y(l,T=>{w.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:e.jsx(lc,{role:"menu","aria-orientation":"vertical","data-state":Fi(g.open),"data-radix-menu-content":"",dir:w.dir,...C,...A,ref:O,style:{outline:"none",...A.style},onKeyDown:Y(A.onKeyDown,T=>{const se=T.target.closest("[data-radix-menu-content]")===T.currentTarget,re=T.ctrlKey||T.altKey||T.metaKey,we=T.key.length===1;se&&(T.key==="Tab"&&T.preventDefault(),!re&&we&&ve(T.key));const ye=S.current;if(T.target!==ye||!Cd.includes(T.key))return;T.preventDefault();const k=P().filter(V=>!V.disabled).map(V=>V.ref.current);gi.includes(T.key)&&k.reverse(),Vd(k)}),onBlur:Y(t.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(B.current),E.current="")}),onPointerMove:Y(t.onPointerMove,$t(T=>{const ee=T.target,se=ie.current!==T.clientX;if(T.currentTarget.contains(ee)&&se){const re=T.clientX>ie.current?"right":"left";Q.current=re,ie.current=T.clientX}}))})})})})})})});Ni.displayName=he;var Id="MenuGroup",ys=h.forwardRef((t,n)=>{const{__scopeMenu:a,...s}=t;return e.jsx(Ae.div,{role:"group",...s,ref:n})});ys.displayName=Id;var Bd="MenuLabel",Ci=h.forwardRef((t,n)=>{const{__scopeMenu:a,...s}=t;return e.jsx(Ae.div,{...s,ref:n})});Ci.displayName=Bd;var An="MenuItem",Js="menu.itemSelect",On=h.forwardRef((t,n)=>{const{disabled:a=!1,onSelect:s,...i}=t,o=h.useRef(null),c=Ht(An,t.__scopeMenu),d=vs(An,t.__scopeMenu),l=Ct(n,o),x=h.useRef(!1),r=()=>{const m=o.current;if(!a&&m){const b=new CustomEvent(Js,{bubbles:!0,cancelable:!0});m.addEventListener(Js,f=>s?.(f),{once:!0}),ac(m,b),b.defaultPrevented?x.current=!1:c.onClose()}};return e.jsx(ki,{...i,ref:l,disabled:a,onClick:Y(t.onClick,r),onPointerDown:m=>{t.onPointerDown?.(m),x.current=!0},onPointerUp:Y(t.onPointerUp,m=>{x.current||m.currentTarget?.click()}),onKeyDown:Y(t.onKeyDown,m=>{const b=d.searchRef.current!=="";a||b&&m.key===" "||rs.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});On.displayName=An;var ki=h.forwardRef((t,n)=>{const{__scopeMenu:a,disabled:s=!1,textValue:i,...o}=t,c=vs(An,a),d=vi(a),l=h.useRef(null),x=Ct(n,l),[r,m]=h.useState(!1),[b,f]=h.useState("");return h.useEffect(()=>{const p=l.current;p&&f((p.textContent??"").trim())},[o.children]),e.jsx(Ft.ItemSlot,{scope:a,disabled:s,textValue:i??b,children:e.jsx(jd,{asChild:!0,...d,focusable:!s,children:e.jsx(Ae.div,{role:"menuitem","data-highlighted":r?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...o,ref:x,onPointerMove:Y(t.onPointerMove,$t(p=>{s?c.onItemLeave(p):(c.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(t.onPointerLeave,$t(p=>c.onItemLeave(p))),onFocus:Y(t.onFocus,()=>m(!0)),onBlur:Y(t.onBlur,()=>m(!1))})})})}),Fd="MenuCheckboxItem",Pi=h.forwardRef((t,n)=>{const{checked:a=!1,onCheckedChange:s,...i}=t;return e.jsx(Mi,{scope:t.__scopeMenu,checked:a,children:e.jsx(On,{role:"menuitemcheckbox","aria-checked":vn(a)?"mixed":a,...i,ref:n,"data-state":Ns(a),onSelect:Y(i.onSelect,()=>s?.(vn(a)?!0:!a),{checkForDefaultPrevented:!1})})})});Pi.displayName=Fd;var Si="MenuRadioGroup",[$d,Ud]=dt(Si,{value:void 0,onValueChange:()=>{}}),Oi=h.forwardRef((t,n)=>{const{value:a,onValueChange:s,...i}=t,o=yn(s);return e.jsx($d,{scope:t.__scopeMenu,value:a,onValueChange:o,children:e.jsx(ys,{...i,ref:n})})});Oi.displayName=Si;var Di="MenuRadioItem",Ri=h.forwardRef((t,n)=>{const{value:a,...s}=t,i=Ud(Di,t.__scopeMenu),o=a===i.value;return e.jsx(Mi,{scope:t.__scopeMenu,checked:o,children:e.jsx(On,{role:"menuitemradio","aria-checked":o,...s,ref:n,"data-state":Ns(o),onSelect:Y(s.onSelect,()=>i.onValueChange?.(a),{checkForDefaultPrevented:!1})})})});Ri.displayName=Di;var js="MenuItemIndicator",[Mi,Yd]=dt(js,{checked:!1}),Ti=h.forwardRef((t,n)=>{const{__scopeMenu:a,forceMount:s,...i}=t,o=Yd(js,a);return e.jsx(jn,{present:s||vn(o.checked)||o.checked===!0,children:e.jsx(Ae.span,{...i,ref:n,"data-state":Ns(o.checked)})})});Ti.displayName=js;var Kd="MenuSeparator",Wi=h.forwardRef((t,n)=>{const{__scopeMenu:a,...s}=t;return e.jsx(Ae.div,{role:"separator","aria-orientation":"horizontal",...s,ref:n})});Wi.displayName=Kd;var zd="MenuArrow",_i=h.forwardRef((t,n)=>{const{__scopeMenu:a,...s}=t,i=Sn(a);return e.jsx(mc,{...i,...s,ref:n})});_i.displayName=zd;var Gd="MenuSub",[Lh,Li]=dt(Gd),Rt="MenuSubTrigger",Ei=h.forwardRef((t,n)=>{const a=lt(Rt,t.__scopeMenu),s=Ht(Rt,t.__scopeMenu),i=Li(Rt,t.__scopeMenu),o=vs(Rt,t.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:l}=o,x={__scopeMenu:t.__scopeMenu},r=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>r,[r]),h.useEffect(()=>{const m=d.current;return()=>{window.clearTimeout(m),l(null)}},[d,l]),e.jsx(gs,{asChild:!0,...x,children:e.jsx(ki,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":i.contentId,"data-state":Fi(a.open),...t,ref:_a(n,i.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:Y(t.onPointerMove,$t(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!a.open&&!c.current&&(o.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{a.onOpenChange(!0),r()},100))})),onPointerLeave:Y(t.onPointerLeave,$t(m=>{r();const b=a.content?.getBoundingClientRect();if(b){const f=a.content?.dataset.side,p=f==="right",A=p?-5:5,g=b[p?"left":"right"],w=b[p?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+A,y:m.clientY},{x:g,y:b.top},{x:w,y:b.top},{x:w,y:b.bottom},{x:g,y:b.bottom}],side:f}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Y(t.onKeyDown,m=>{const b=o.searchRef.current!=="";t.disabled||b&&m.key===" "||kd[s.dir].includes(m.key)&&(a.onOpenChange(!0),a.content?.focus(),m.preventDefault())})})})});Ei.displayName=Rt;var Ii="MenuSubContent",Bi=h.forwardRef((t,n)=>{const a=yi(he,t.__scopeMenu),{forceMount:s=a.forceMount,...i}=t,o=lt(he,t.__scopeMenu),c=Ht(he,t.__scopeMenu),d=Li(Ii,t.__scopeMenu),l=h.useRef(null),x=Ct(n,l);return e.jsx(Ft.Provider,{scope:t.__scopeMenu,children:e.jsx(jn,{present:s||o.open,children:e.jsx(Ft.Slot,{scope:t.__scopeMenu,children:e.jsx(ws,{id:d.contentId,"aria-labelledby":d.triggerId,...i,ref:x,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:r=>{c.isUsingKeyboardRef.current&&l.current?.focus(),r.preventDefault()},onCloseAutoFocus:r=>r.preventDefault(),onFocusOutside:Y(t.onFocusOutside,r=>{r.target!==d.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Y(t.onEscapeKeyDown,r=>{c.onClose(),r.preventDefault()}),onKeyDown:Y(t.onKeyDown,r=>{const m=r.currentTarget.contains(r.target),b=Pd[c.dir].includes(r.key);m&&b&&(o.onOpenChange(!1),d.trigger?.focus(),r.preventDefault())})})})})})});Bi.displayName=Ii;function Fi(t){return t?"open":"closed"}function vn(t){return t==="indeterminate"}function Ns(t){return vn(t)?"indeterminate":t?"checked":"unchecked"}function Vd(t){const n=document.activeElement;for(const a of t)if(a===n||(a.focus(),document.activeElement!==n))return}function qd(t,n){return t.map((a,s)=>t[(n+s)%t.length])}function Hd(t,n,a){const i=n.length>1&&Array.from(n).every(x=>x===n[0])?n[0]:n,o=a?t.indexOf(a):-1;let c=qd(t,Math.max(o,0));i.length===1&&(c=c.filter(x=>x!==a));const l=c.find(x=>x.toLowerCase().startsWith(i.toLowerCase()));return l!==a?l:void 0}function Qd(t,n){const{x:a,y:s}=t;let i=!1;for(let o=0,c=n.length-1;o<n.length;c=o++){const d=n[o],l=n[c],x=d.x,r=d.y,m=l.x,b=l.y;r>s!=b>s&&a<(m-x)*(s-r)/(b-r)+x&&(i=!i)}return i}function Zd(t,n){if(!n)return!1;const a={x:t.clientX,y:t.clientY};return Qd(a,n)}function $t(t){return n=>n.pointerType==="mouse"?t(n):void 0}var Jd=wi,Xd=gs,el=ji,tl=Ni,nl=ys,sl=Ci,al=On,il=Pi,ol=Oi,cl=Ri,rl=Ti,dl=Wi,ll=_i,ml=Ei,xl=Bi,Dn="DropdownMenu",[ul]=wn(Dn,[Ai]),ce=Ai(),[pl,$i]=ul(Dn),Ui=t=>{const{__scopeDropdownMenu:n,children:a,dir:s,open:i,defaultOpen:o,onOpenChange:c,modal:d=!0}=t,l=ce(n),x=h.useRef(null),[r,m]=Ta({prop:i,defaultProp:o??!1,onChange:c,caller:Dn});return e.jsx(pl,{scope:n,triggerId:Jn(),triggerRef:x,contentId:Jn(),open:r,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(b=>!b),[m]),modal:d,children:e.jsx(Jd,{...l,open:r,onOpenChange:m,dir:s,modal:d,children:a})})};Ui.displayName=Dn;var Yi="DropdownMenuTrigger",Ki=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,disabled:s=!1,...i}=t,o=$i(Yi,a),c=ce(a);return e.jsx(Xd,{asChild:!0,...c,children:e.jsx(Ae.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...i,ref:_a(n,o.triggerRef),onPointerDown:Y(t.onPointerDown,d=>{!s&&d.button===0&&d.ctrlKey===!1&&(o.onOpenToggle(),o.open||d.preventDefault())}),onKeyDown:Y(t.onKeyDown,d=>{s||(["Enter"," "].includes(d.key)&&o.onOpenToggle(),d.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});Ki.displayName=Yi;var hl="DropdownMenuPortal",zi=t=>{const{__scopeDropdownMenu:n,...a}=t,s=ce(n);return e.jsx(el,{...s,...a})};zi.displayName=hl;var Gi="DropdownMenuContent",Vi=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=$i(Gi,a),o=ce(a),c=h.useRef(!1);return e.jsx(tl,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...s,ref:n,onCloseAutoFocus:Y(t.onCloseAutoFocus,d=>{c.current||i.triggerRef.current?.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Y(t.onInteractOutside,d=>{const l=d.detail.originalEvent,x=l.button===0&&l.ctrlKey===!0,r=l.button===2||x;(!i.modal||r)&&(c.current=!0)}),style:{...t.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)"}})});Vi.displayName=Gi;var fl="DropdownMenuGroup",bl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(nl,{...i,...s,ref:n})});bl.displayName=fl;var gl="DropdownMenuLabel",Al=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(sl,{...i,...s,ref:n})});Al.displayName=gl;var vl="DropdownMenuItem",qi=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(al,{...i,...s,ref:n})});qi.displayName=vl;var wl="DropdownMenuCheckboxItem",yl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(il,{...i,...s,ref:n})});yl.displayName=wl;var jl="DropdownMenuRadioGroup",Nl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(ol,{...i,...s,ref:n})});Nl.displayName=jl;var Cl="DropdownMenuRadioItem",kl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(cl,{...i,...s,ref:n})});kl.displayName=Cl;var Pl="DropdownMenuItemIndicator",Sl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(rl,{...i,...s,ref:n})});Sl.displayName=Pl;var Ol="DropdownMenuSeparator",Dl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(dl,{...i,...s,ref:n})});Dl.displayName=Ol;var Rl="DropdownMenuArrow",Ml=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(ll,{...i,...s,ref:n})});Ml.displayName=Rl;var Tl="DropdownMenuSubTrigger",Wl=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(ml,{...i,...s,ref:n})});Wl.displayName=Tl;var _l="DropdownMenuSubContent",Ll=h.forwardRef((t,n)=>{const{__scopeDropdownMenu:a,...s}=t,i=ce(a);return e.jsx(xl,{...i,...s,ref:n,style:{...t.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)"}})});Ll.displayName=_l;var El=Ui,Il=Ki,Bl=zi,Fl=Vi,$l=qi;function Ul({...t}){return e.jsx(El,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:10","data-slot":"dropdown-menu",...t})}function Yl({...t}){return e.jsx(Il,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:25","data-slot":"dropdown-menu-trigger",...t})}function Kl({className:t,sideOffset:n=4,...a}){return e.jsx(Bl,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:38",children:e.jsx(Fl,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:39","data-slot":"dropdown-menu-content",sideOffset:n,className:M("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...a})})}function zl({className:t,inset:n,variant:a="default",...s}){return e.jsx($l,{"data-loc":"client/src/components/ui/dropdown-menu.tsx:70","data-slot":"dropdown-menu-item","data-inset":n,"data-variant":a,className:M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s})}h.createContext({isComposing:()=>!1,setComposing:()=>{},justEndedComposing:()=>!1,markCompositionEnd:()=>{}});function Gl({...t}){return e.jsx(xc,{"data-loc":"client/src/components/ui/sheet.tsx:10","data-slot":"sheet",...t})}function Vl({...t}){return e.jsx(bc,{"data-loc":"client/src/components/ui/sheet.tsx:28","data-slot":"sheet-portal",...t})}function ql({className:t,...n}){return e.jsx(gc,{"data-loc":"client/src/components/ui/sheet.tsx:36","data-slot":"sheet-overlay",className:M("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...n})}function Hl({className:t,children:n,side:a="right",...s}){return e.jsxs(Vl,{"data-loc":"client/src/components/ui/sheet.tsx:56",children:[e.jsx(ql,{"data-loc":"client/src/components/ui/sheet.tsx:57"}),e.jsxs(uc,{"data-loc":"client/src/components/ui/sheet.tsx:58","data-slot":"sheet-content",className:M("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[n,e.jsxs(pc,{"data-loc":"client/src/components/ui/sheet.tsx:75",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(Ue,{"data-loc":"client/src/components/ui/sheet.tsx:76",className:"size-4"}),e.jsx("span",{"data-loc":"client/src/components/ui/sheet.tsx:77",className:"sr-only",children:"Close"})]})]})]})}function Ql({className:t,...n}){return e.jsx("div",{"data-loc":"client/src/components/ui/sheet.tsx:86","data-slot":"sheet-header",className:M("flex flex-col gap-1.5 p-4",t),...n})}function Zl({className:t,...n}){return e.jsx(hc,{"data-loc":"client/src/components/ui/sheet.tsx:109","data-slot":"sheet-title",className:M("text-foreground font-semibold",t),...n})}function Jl({className:t,...n}){return e.jsx(fc,{"data-loc":"client/src/components/ui/sheet.tsx:122","data-slot":"sheet-
4description",className:M("text-muted-foreground text-sm",t),...n})}const Kn=768;function Cs(){const[t,n]=h.useState(void 0);return h.useEffect(()=>{const a=window.matchMedia(`(max-width: ${Kn-1}px)`),s=()=>{n(window.innerWidth<Kn)};return a.addEventListener("change",s),n(window.innerWidth<Kn),()=>a.removeEventListener("change",s)},[]),!!t}const Xl="sidebar_state",em=3600*24*7,tm="16rem",nm="18rem",sm="3rem",am="b",Hi=h.createContext(null);function Rn(){const t=h.useContext(Hi);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function im({defaultOpen:t=!0,open:n,onOpenChange:a,className:s,style:i,children:o,...c}){const d=Cs(),[l,x]=h.useState(!1),[r,m]=h.useState(t),b=n??r,f=h.useCallback(w=>{const C=typeof w=="function"?w(b):w;a?a(C):m(C),document.cookie=`${Xl}=${C}; path=/; max-age=${em}`},[a,b]),p=h.useCallback(()=>d?x(w=>!w):f(w=>!w),[d,f,x]);h.useEffect(()=>{const w=C=>{C.key===am&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),p())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)}
vendor: 9,430 bytes, line 4
4,[p]);const A=b?"expanded":"collapsed",g=h.useMemo(()=>({state:A,open:b,setOpen:f,isMobile:d,openMobile:l,setOpenMobile:x,toggleSidebar:p}),[A,b,f,d,l,x,p]);return e.jsx(Hi.Provider,{"data-loc":"client/src/components/ui/sidebar.tsx:129",value:g,children:e.jsx(Cc,{"data-loc":"client/src/components/ui/sidebar.tsx:130",delayDuration:0,children:e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:131","data-slot":"sidebar-wrapper",style:{"--sidebar-width":tm,"--sidebar-width-icon":sm,...i},className:M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...c,children:o})})})}function om({side:t="left",variant:n="sidebar",collapsible:a="offcanvas",disableTransition:s=!1,className:i,children:o,...c}){const{isMobile:d,state:l,openMobile:x,setOpenMobile:r}=Rn();return a==="none"?e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:171","data-slot":"sidebar",className:M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...c,children:o}):d?e.jsx(Gl,{"data-loc":"client/src/components/ui/sidebar.tsx:186",open:x,onOpenChange:r,...c,children:e.jsxs(Hl,{"data-loc":"client/src/components/ui/sidebar.tsx:187","data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":nm},side:t,children:[e.jsxs(Ql,{"data-loc":"client/src/components/ui/sidebar.tsx:199",className:"sr-only",children:[e.jsx(Zl,{"data-loc":"client/src/components/ui/sidebar.tsx:200",children:"Sidebar"}),e.jsx(Jl,{"data-loc":"client/src/components/ui/sidebar.tsx:201",children:"Displays the mobile sidebar."})]}),e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:203",className:"flex h-full w-full flex-col",children:o})]})}):e.jsxs("div",{"data-loc":"client/src/components/ui/sidebar.tsx:210",className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?a:"","data-variant":n,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:219","data-slot":"sidebar-gap",className:M("relative w-(--sidebar-width) bg-transparent",s?"transition-none":"transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:233","data-slot":"sidebar-container",className:M("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex",s?"transition-none":"transition-[left,right,width] duration-200 ease-linear",t==="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)]",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...c,children:e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:251","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:o})})]})}function cm({className:t,onClick:n,...a}){const{toggleSidebar:s}=Rn();return e.jsxs(L,{"data-loc":"client/src/components/ui/sidebar.tsx:271","data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:M("size-7",t),onClick:i=>{n?.(i),s()},...a,children:[e.jsx(La,{"data-loc":"client/src/components/ui/sidebar.tsx:283"}),e.jsx("span",{"data-loc":"client/src/components/ui/sidebar.tsx:284",className:"sr-only",children:"Toggle Sidebar"})]})}function rm({className:t,...n}){return e.jsx("main",{"data-loc":"client/src/components/ui/sidebar.tsx:316","data-slot":"sidebar-inset",className:M("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...n})}function dm({className:t,...n}){return e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:344","data-slot":"sidebar-header","data-sidebar":"header",className:M("flex flex-col gap-2 p-2",t),...n})}function lm({className:t,...n}){return e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:355","data-slot":"sidebar-footer","data-sidebar":"footer",className:M("flex flex-col gap-2 p-2",t),...n})}function mm({className:t,...n}){return e.jsx("div",{"data-loc":"client/src/components/ui/sidebar.tsx:380","data-slot":"sidebar-content","data-sidebar":"content",className:M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...n})}function xm({className:t,...n}){return e.jsx("ul",{"data-loc":"client/src/components/ui/sidebar.tsx:463","data-slot":"sidebar-menu","data-sidebar":"menu",className:M("flex w-full min-w-0 flex-col gap-1",t),...n})}function um({className:t,...n}){return e.jsx("li",{"data-loc":"client/src/components/ui/sidebar.tsx:474","data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:M("group/menu-item relative",t),...n})}const pm=kc("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]:size-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 hm({asChild:t=!1,isActive:n=!1,variant:a="default",size:s="default",tooltip:i,className:o,...c}){const d=t?Ac:"button",{isMobile:l,state:x}=Rn(),r=e.jsx(d,{"data-loc":"client/src/components/ui/sidebar.tsx:522","data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":n,className:M(pm({variant:a,size:s}),o),...c});return i?(typeof i=="string"&&(i={children:i}),e.jsxs(Pc,{"data-loc":"client/src/components/ui/sidebar.tsx:543",children:[e.jsx(Sc,{"data-loc":"client/src/components/ui/sidebar.tsx:544",asChild:!0,children:r}),e.jsx(Oc,{"data-loc":"client/src/components/ui/sidebar.tsx:545",side:"right",align:"center",hidden:x!=="collapsed"||l,...i})]})):r}function fm(){return e.jsx("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:3",className:"flex items-center justify-center min-h-screen bg-[#0a0a0a]",children:e.jsxs("div",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:4",className:"flex flex-col items-center gap-4 animate-pulse",children:[e.jsx("svg",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:6",xmlns:"http://www.w3.org/2000/svg",width:"56",height:"56",viewBox:"0 0 39 26",fill:"none",children:e.jsx("path",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:7",d:"M38.7765 3.00096L38.4393 6.44027L38.3044 8.1262L38.0009 11.3295L36.3824 9.71097L31.5944 13.6898L30.7514 14.3979L36.7871 21.7148L32.1339 25.5925L26.0645 18.2755L25.3564 18.8825L20.9056 22.5578L20.8381 22.6252C20.6583 22.7826 20.4672 22.9287 20.2649 23.0636C18.1744 24.6146 15.578 25.525 12.7457 25.525C10.2842 25.525 8.02504 24.8169 6.06936 23.6368C3.03468 21.7485 0.809248 18.6127 0.168593 14.9711C0.0561978 14.2518 0 13.5099 0 12.7457C0 6.71001 4.21483 1.6185 9.87957 0.337187C10.8012 0.112396 11.7566 0 12.7457 0C16.3873 0 19.658 1.51734 21.9846 3.9788L17.3651 7.82272L17.3314 7.85644C16.6233 7.11463 15.8478 6.64257 14.9374 6.3391C14.263 6.13679 13.5549 6.03564 12.7457 6.03564C9.0366 6.03564 6.03564 9.0366 6.03564 12.7457C6.03564 13.6898 6.23795 14.5665 6.57514 15.3757C7.31695 17.1291 8.80057 18.5115 10.6214 19.1185C11.2958 19.3545 12.0038 19.4557 12.7457 19.4557C14.1281 19.4557 15.3757 19.051 16.4547 18.3767C16.8593 18.0844 17.2415 17.7697 17.6011 17.4325L21.4451 14.1956L22.1532 13.6223L25.3902 10.9586L26.8401 9.71097L27.683 9.00288L32.0665 5.39499L30.448 3.77648L34.157 3.40559H34.4605L35.8092 3.2707L38.7765 3.00096Z",fill:"white",fillOpacity:"0.7"})}),e.jsx("span",{"data-loc":"client/src/components/DashboardLayoutSkeleton.tsx:9",className:"text-white/30 text-xs font-medium tracking-wider up
4percase",children:"Loading"})]})})}function bm(){const t=j.leads.stats.useQuery(),n=j.affiliates.stats.useQuery(),a=j.challenges.listAll.useQuery(),s=j.promoCodes.list.useQuery(),i=j.blogPosts.listAll.useQuery({page:1,limit:1}),o=[{label:"Total Challenges",value:a.data?.length??0,icon:Kt,color:"#0781fe"},{label:"Active Promo Codes",value:s.data?.filter(c=>c.isActive).length??0,icon:ls,color:"#4ade80"},{label:"Total Leads",value:t.data?.total??0,icon:He,color:"#f59e0b"},{label:"New Leads",value:t.data?.new??0,icon:ct,color:"#ef4444"},{label:"Blog Posts",value:i.data?.total??0,icon:Ea,color:"#8b5cf6"},{label:"Affiliate Clicks",value:n.data?.totalClicks??0,icon:Ia,color:"#06b6d4"}];return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:51",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:52",className:"mb-4 md:mb-6",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminOverview.tsx:53",className:"text-lg md:text-2xl font-bold text-white",children:"Dashboard Overview"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOverview.tsx:54",className:"text-white/40 text-xs md:text-sm mt-1",children:"Manage your Alpha Trader Firm data"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:57",className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-3 gap-2 md:gap-4",children:o.map(c=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:59",className:"bg-[#141414] border border-white/10 rounded-xl p-5 hover:border-white/20 transition-colors",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:63",className:"flex items-center justify-between mb-3",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:64",className:"text-xs font-medium text-white/50 uppercase tracking-wider",children:c.label}),e.jsx(c.icon,{"data-loc":"client/src/components/admin/AdminOverview.tsx:65",className:"w-4 h-4",style:{color:c.color}})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOverview.tsx:67",className:"text-xl md:text-3xl font-bold text-white",children:c.value})]},c.label))}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:72",className:"mt-8 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:74",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOverview.tsx:75",className:"text-sm font-semibold text-white mb-4",children:"Affiliate Summary"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:76",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:77",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:78",className:"text-white/50 text-sm",children:"Total Conversions"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:79",className:"text-white font-medium",children:n.data?.totalConversions??0})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:81",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:82",className:"text-white/50 text-sm",children:"Total Commission (Approved)"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:83",className:"text-[#4ade80] font-medium",children:["$",((n.data?.totalCommission??0)/100).toFixed(2)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:85",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:86",className:"text-white/50 text-sm",children:"Pending Commission"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:87",className:"text-[#f59e0b] font-medium",children:["$",((n.data?.pendingCommission??0)/100).toFixed(2)]})]})]})]}
4),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:93",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOverview.tsx:94",className:"text-sm font-semibold text-white mb-4",children:"Lead Breakdown"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:95",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:96",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:97",className:"text-white/50 text-sm",children:"New"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:98",className:"text-[#0781fe] font-medium",children:t.data?.new??0})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:100",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:101",className:"text-white/50 text-sm",children:"Contacted"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:102",className:"text-[#f59e0b] font-medium",children:t.data?.contacted??0})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOverview.tsx:104",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:105",className:"text-white/50 text-sm",children:"Converted"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOverview.tsx:106",className:"text-[#4ade80] font-medium",children:t.data?.converted??0})]})]})]})]})]})}function gm(){const t=j.useUtils(),n=j.challenges.listAll.useQuery(),a=j.challenges.toggleActive.useMutation({onSuccess:()=>{t.challenges.listAll.invalidate(),R.success("Status updated")},onError:l=>R.error(l.message)}),s=j.challenges.delete.useMutation({onSuccess:()=>{t.challenges.listAll.invalidate(),R.success("Challenge deleted")},onError:l=>R.error(l.message)}),[i,o]=h.useState(!1),[c,d]=h.useState(null);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:23",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:24",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:25",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:26",className:"text-lg md:text-2xl font-bold text-white",children:"Challenges"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:27",className:"text-white/60 text-xs md:text-sm mt-1",children:"Manage pricing configurations and challenge types"})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:29",onClick:()=>{d(null),o(!0)},className:"bg-[#0b6fd9] hover:bg-[#0668d1] text-white w-full sm:w-auto",size:"sm",children:[e.jsx(zt,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:34",className:"w-4 h-4 mr-1.5"})," Add Challenge"]})]}),i&&e.jsx(Am,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:39",editId:c,onClose:()=>{o(!1),d(null)}}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:45",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:47",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:48",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:49",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:50",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:51",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Balance"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:52",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Mode"}
4),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:53",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Price"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:54",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Original"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:55",className:"text-center text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Refund"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:56",className:"text-center text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Traders"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:57",className:"text-center text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Active"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:58",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:61",children:[n.data?.map(l=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:63",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:64",className:"px-4 py-3 text-white font-medium",children:l.balanceLabel}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:65",className:"px-4 py-3 text-white/70",children:l.modeLabel}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:66",className:"px-4 py-3 text-right text-[#4ade80] font-medium",children:["$",l.price]}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:67",className:"px-4 py-3 text-right text-white/50 line-through",children:["$",l.originalPrice]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:68",className:"px-4 py-3 text-center",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:69",className:`text-xs px-2 py-0.5 rounded-full ${l.refundable?"bg-[#4ade80]/10 text-[#4ade80]":"bg-white/5 text-white/50"}`,children:l.refundable?"Yes":"No"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:73",className:"px-4 py-3 text-center text-white/60",children:l.traderCount??"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:74",className:"px-4 py-3 text-center",children:e.jsx("button",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:75",onClick:()=>a.mutate({id:l.id,isActive:!l.isActive}),className:"inline-flex items-center",children:l.isActive?e.jsx(_t,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:80",className:"w-6 h-6 text-[#4ade80]"}):e.jsx(Lt,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:81",className:"w-6 h-6 text-white/40"})})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:84",className:"px-4 py-3 text-right",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:85",className:"flex items-center justify-end gap-1",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:86",onClick:()=>{d(l.id),o(!0)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/60 hover:text-white transition-colors",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:90",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:92",onClick:()=>{confirm("Delete this challenge?")&&s.mutate({id:l.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:96",className:"w-3.5 h-3.5"})})]})})]},l.id)),n.data?.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:103",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:104",colSpan:8,className:"px-4 py-12 text-center text-white/50",children:'No challenges configured yet. Click "Add Challenge" to create one.'})})]})]})}
4),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:113",className:"md:hidden divide-y divide-white/5",children:[n.data?.map(l=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:115",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:116",className:"flex items-center justify-between mb-1.5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:117",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:118",className:"text-sm font-medium text-white",children:l.balanceLabel}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:119",className:"text-xs text-white/50",children:l.modeLabel})]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:121",onClick:()=>a.mutate({id:l.id,isActive:!l.isActive}),className:"inline-flex items-center",children:l.isActive?e.jsx(_t,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:126",className:"w-5 h-5 text-[#4ade80]"}):e.jsx(Lt,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:127",className:"w-5 h-5 text-white/40"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:130",className:"flex items-center gap-3 mb-2",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:131",className:"text-sm font-bold text-[#4ade80]",children:["$",l.price]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:132",className:"text-xs text-white/40 line-through",children:["$",l.originalPrice]}),l.refundable&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:134",className:"text-[10px] px-1.5 py-0.5 rounded bg-[#4ade80]/10 text-[#4ade80]",children:"Refundable"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:137",className:"flex items-center justify-between",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:138",className:"text-[10px] text-white/40",children:[l.traderCount??0," traders"]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:139",className:"flex items-center gap-1",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:140",onClick:()=>{d(l.id),o(!0)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/60 hover:text-white transition-colors",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:144",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:146",onClick:()=>{confirm("Delete this challenge?")&&s.mutate({id:l.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:150",className:"w-3.5 h-3.5"})})]})]})]},l.id)),n.data?.length===0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:157",className:"p-8 text-center text-white/50 text-sm",children:'No challenges configured yet. Click "Add Challenge" to create one.'})]})]})]})}function Am({editId:t,onClose:n}){const a=j.useUtils(),s=j.challenges.getById.useQuery({id:t},{enabled:t!==null}),i=j.challenges.create.useMutation({onSuccess:()=>{a.challenges.listAll.invalidate(),R.success("Challenge created"),n()},onError:x=>R.error(x.message)}),o=j.challenges.update.useMutation({onSuccess:()=>{a.challenges.listAll.invalidate(),R.success("Challenge updated"),n()},onError:x=>R.error(x.message)}),[c,d]=h.useState({balanceKey:"",balanceLabel:"",modeKey:"",modeLabel:"",price:0,originalPrice:0,refundable:!1,isActive:!0,sortOrder:0,rulesLink:"",traderCount:5e3,avgPayoutPct:"0.0587",mt5PriceMultiplier:"1.25",metricsJson:"",productIdsJson:""});h.useEffect(()=>{if(t&&s.data){const x=s.data;d({balanceKey:x.balanceKey,balanceLabel:x.balanceLabel,modeKey:x.modeKey,modeLabel:x.modeLabel,price:x.price,originalPrice:x.originalPrice,refundable:x.refundable,isActive:x.isActive,sortOrder:x.sortOrder,rulesLink:x.rulesLink||"",traderCount:x.traderCount??5e3,avgPayoutPct:x.avgPayoutPct??"0.0587",mt5PriceMultiplier:x.mt5PriceMultiplier??"1.25",metricsJson:x.metrics?JSON.stringify(x.metrics,null,2):"",productIdsJson:x.productIds?JSON.stringify(x.productIds,null,2):""})}},[t,s.data]);const l=x=>{x.preventDefault();const r={balanceKey:c.balanceKey,balanceLabel:c.balanceLabel,modeKey:c.modeKey,modeLabel:c.modeLabel,price:c.price,originalPrice
4:c.originalPrice,refundable:c.refundable,isActive:c.isActive,sortOrder:c.sortOrder,rulesLink:c.rulesLink||void 0,traderCount:c.traderCount,avgPayoutPct:c.avgPayoutPct,mt5PriceMultiplier:c.mt5PriceMultiplier,metrics:c.metricsJson?JSON.parse(c.metricsJson):void 0,productIds:c.productIdsJson?JSON.parse(c.productIdsJson):void 0};t?o.mutate({id:t,...r}):i.mutate(r)};return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:239",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5 mb-4 md:mb-6",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:240",className:"text-white font-semibold mb-3 md:mb-4 text-sm md:text-base",children:[t?"Edit":"New"," Challenge"]}),e.jsxs("form",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:241",onSubmit:l,className:"space-y-3 md:space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:242",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 md:gap-4",children:[e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:243",label:"Balance Key",value:c.balanceKey,onChange:x=>d(r=>({...r,balanceKey:x})),placeholder:"e.g. 100k"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:244",label:"Balance Label",value:c.balanceLabel,onChange:x=>d(r=>({...r,balanceLabel:x})),placeholder:"e.g. $100K"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:245",label:"Mode Key",value:c.modeKey,onChange:x=>d(r=>({...r,modeKey:x})),placeholder:"e.g. 1step"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:246",label:"Mode Label",value:c.modeLabel,onChange:x=>d(r=>({...r,modeLabel:x})),placeholder:"e.g. 1 Step"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:248",className:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4 gap-3 md:gap-4",children:[e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:249",label:"Price ($)",value:String(c.price),onChange:x=>d(r=>({...r,price:parseInt(x)||0})),type:"number"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:250",label:"Original ($)",value:String(c.originalPrice),onChange:x=>d(r=>({...r,originalPrice:parseInt(x)||0})),type:"number"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:251",label:"MT5 Multiplier",value:c.mt5PriceMultiplier,onChange:x=>d(r=>({...r,mt5PriceMultiplier:x})),placeholder:"1.25"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:252",label:"Trader Count",value:String(c.traderCount),onChange:x=>d(r=>({...r,traderCount:parseInt(x)||0})),type:"number"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:254",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-4",children:[e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:255",label:"Avg Payout %",value:c.avgPayoutPct,onChange:x=>d(r=>({...r,avgPayoutPct:x})),placeholder:"0.0587"}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:256",label:"Rules Link",value:c.rulesLink,onChange:x=>d(r=>({...r,rulesLink:x})),placeholder:"https://..."}),e.jsx(fe,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:257",label:"Sort Order",value:String(c.sortOrder),onChange:x=>d(r=>({...r,sortOrder:parseInt(x)||0})),type:"number"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:259",className:"grid grid-cols-1 lg:grid-cols-2 gap-3 md:gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:260",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:261",className:"block text-[10px] md:text-xs text-white/50 mb-1 md:mb-1.5 uppercase tracking-wider",children:"Metrics (JSON)"}),e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:262",value:c.metricsJson,onChange:x=>d(r=>({...r,metricsJson:x.target.value})),rows:3,placeholder:'{"tp1":"8%","tp2":"0%","dd":"3%","md":"6%",...}',className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-xs font-mono focus:border-[#0781fe] focus:outline-none resize-y"})]}
4),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:270",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:271",className:"block text-[10px] md:text-xs text-white/50 mb-1 md:mb-1.5 uppercase tracking-wider",children:"Product IDs (JSON)"}),e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:272",value:c.productIdsJson,onChange:x=>d(r=>({...r,productIdsJson:x.target.value})),rows:3,placeholder:'{"mt5":10459,"tradelocker":127,"matchtrader":84903}',className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-xs font-mono focus:border-[#0781fe] focus:outline-none resize-y"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:281",className:"flex flex-wrap items-center gap-4 md:gap-6",children:[e.jsxs("label",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:282",className:"flex items-center gap-2 text-xs md:text-sm text-white/70",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:283",type:"checkbox",checked:c.refundable,onChange:x=>d(r=>({...r,refundable:x.target.checked})),className:"rounded"}),"Refundable"]}),e.jsxs("label",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:286",className:"flex items-center gap-2 text-xs md:text-sm text-white/70",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:287",type:"checkbox",checked:c.isActive,onChange:x=>d(r=>({...r,isActive:x.target.checked})),className:"rounded"}),"Active"]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:291",className:"flex flex-col sm:flex-row gap-2 md:gap-3 pt-2",children:[e.jsxs(L,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:292",type:"submit",className:"bg-[#0b6fd9] hover:bg-[#0668d1] text-white w-full sm:w-auto",size:"sm",disabled:i.isPending||o.isPending,children:[t?"Update":"Create"," Challenge"]}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminChallenges.tsx:295",type:"button",variant:"outline",onClick:n,className:"border-white/10 text-white/60 hover:text-white w-full sm:w-auto",size:"sm",children:"Cancel"})]})]})]})}function fe({label:t,value:n,onChange:a,placeholder:s,type:i="text"}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:308",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:309",className:"block text-[10px] md:text-xs text-white/50 mb-1 md:mb-1.5 uppercase tracking-wider",children:t}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminChallenges.tsx:310",type:i,value:n,onChange:o=>a(o.target.value),placeholder:s,className:"w-full h-8 md:h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-xs md:text-sm focus:border-[#0781fe] focus:outline-none transition-colors"})]})}function Xs({couponId:t,couponCode:n,onClose:a,onUpdate:s}){const[i,o]=h.useState([]),[c,d]=h.useState(""),l=j.couponAI.chat.useMutation({onSuccess:r=>{o(m=>[...m,{role:"assistant",content:r.summary,applied:r.applied,updatedFields:r.updatedFields}]),r.applied&&(R.success(`Updated ${n}: ${r.summary}`),s())},onError:r=>{o(m=>[...m,{role:"assistant",content:`Error: ${r.message}`}]),R.error(r.message)}}),x=()=>{if(!c.trim()||l.isPending)return;const r=c.trim();d(""),o(m=>[...m,{role:"user",content:r}]),l.mutate({couponId:t,message:r})};return e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:62",className:"bg-[#0d0d0d] border border-[#0781fe]/30 rounded-xl p-4 mt-2 mb-2 shadow-[0_4px_20px_rgba(7,129,254,.15)]",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:64",className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:65",className:"flex items-center gap-2",children:[e.jsx(At,{"data-loc":"client/src/components/admin/CouponAIChat.tsx:66",className:"w-4 h-4 text-[#0781fe]"}),e.jsxs("span",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:67",className:"text-xs font-semibold text-white/80",children:["AI Assistant â ",n]})]}
4),e.jsx("button",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:71",onClick:a,className:"p-1 rounded hover:bg-white/10 text-white/40 hover:text-white transition-colors",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/CouponAIChat.tsx:75",className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:80",className:"max-h-[200px] overflow-y-auto space-y-2 mb-3",children:[i.length===0&&e.jsx("p",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:82",className:"text-white/30 text-xs italic",children:'Tell me what to change on this coupon. For example: "Only allow 200k, 300k, 400k accounts" or "Set discount to 70% and expire tomorrow"'}),i.map((r,m)=>e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:87",className:`text-xs px-3 py-2 rounded-lg ${r.role==="user"?"bg-[#0781fe]/10 text-[#0781fe] ml-8":"bg-white/5 text-white/80 mr-8"}`,children:[r.role==="assistant"&&r.applied&&e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:96",className:"flex items-center gap-1 text-[#4ade80] text-[10px] font-medium mb-1",children:[e.jsx(Ge,{"data-loc":"client/src/components/admin/CouponAIChat.tsx:97",className:"w-3 h-3"}),"Applied: ",r.updatedFields?.join(", ")]}),r.content]},m)),l.isPending&&e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:105",className:"flex items-center gap-2 text-white/40 text-xs px-3 py-2",children:[e.jsx(Ce,{"data-loc":"client/src/components/admin/CouponAIChat.tsx:106",className:"w-3 h-3 animate-spin"}),"Analyzing and executing..."]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:113",className:"flex gap-2",children:[e.jsx("input",{"data-loc":"client/src/components/admin/CouponAIChat.tsx:114",value:c,onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},placeholder:"e.g. Make this only work on 200k, 300k, 400k",className:"flex-1 h-9 px-3 rounded-lg bg-[#141414] border border-white/10 text-white text-xs focus:border-[#0781fe] focus:outline-none placeholder:text-white/30",disabled:l.isPending}),e.jsx(L,{"data-loc":"client/src/components/admin/CouponAIChat.tsx:127",size:"sm",onClick:x,disabled:!c.trim()||l.isPending,className:"bg-[#0781fe] hover:bg-[#0668d1] text-white h-9 px-3",children:e.jsx(ms,{"data-loc":"client/src/components/admin/CouponAIChat.tsx:133",className:"w-3.5 h-3.5"})})]})]})}function vm({onCreated:t}){const[n,a]=h.useState([]),[s,i]=h.useState(""),[o,c]=h.useState(!1),d=h.useRef(null),l=j.couponAI.create.useMutation({onSuccess:r=>{a(m=>[...m,{role:"assistant",content:r.summary,created:r.created,couponId:r.couponId}]),r.created&&(R.success(`Coupon created: ${r.summary}`),t())},onError:r=>{a(m=>[...m,{role:"assistant",content:`Error: ${r.message}`}]),R.error(r.message)}}),x=()=>{if(!s.trim()||l.isPending)return;const r=s.trim();i(""),c(!0),a(m=>[...m,{role:"user",content:r}]),l.mutate({message:r})};return h.useEffect(()=>{d.current?.scrollIntoView({behavior:"smooth"})},[n]),e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:63",className:"bg-gradient-to-r from-[#0781fe]/5 to-[#4ade80]/5 border border-[#0781fe]/20 rounded-xl p-4 mb-6 shadow-[0_4px_24px_rgba(7,129,254,.08)]",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:65",className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:66",className:"flex items-center gap-2.5",children:[e.jsx("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:67",className:"w-8 h-8 rounded-lg bg-[#0781fe]/10 flex items-center justify-center",children:e.jsx(Ba,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:68",className:"w-4 h-4 text-[#0781fe]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:70",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:71",className:"text-sm font-semibold text-white",children:"AI Coupon Creator"}
4),e.jsx("p",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:72",className:"text-[10px] text-white/40",children:"Describe a coupon in plain English and I'll create it instantly"})]})]}),o&&n.length>0&&e.jsx("button",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:76",onClick:()=>{a([]),c(!1)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/40 hover:text-white transition-colors",title:"Clear chat",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:81",className:"w-4 h-4"})})]}),o&&n.length>0&&e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:88",className:"max-h-[240px] overflow-y-auto space-y-2 mb-3 px-1",children:[n.map((r,m)=>e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:90",className:`text-xs px-3 py-2.5 rounded-lg ${r.role==="user"?"bg-[#0781fe]/10 text-[#0781fe] ml-12":"bg-white/5 text-white/80 mr-12"}`,children:[r.role==="assistant"&&r.created&&e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:99",className:"flex items-center gap-1 text-[#4ade80] text-[10px] font-medium mb-1",children:[e.jsx(Ge,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:100",className:"w-3 h-3"}),"Coupon created successfully"]}),r.content]},m)),l.isPending&&e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:108",className:"flex items-center gap-2 text-white/40 text-xs px-3 py-2",children:[e.jsx(Ce,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:109",className:"w-3 h-3 animate-spin"}),"Creating coupon..."]}),e.jsx("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:113",ref:d})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:118",className:"flex gap-2",children:[e.jsx("input",{"data-loc":"client/src/components/admin/CouponAICreator.tsx:119",value:s,onChange:r=>i(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},placeholder:'e.g. "Create a 55% coupon called VIP55 for 200k and 300k accounts, expires in 7 days"',className:"flex-1 h-10 px-4 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none placeholder:text-white/30",disabled:l.isPending}),e.jsx(L,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:132",onClick:x,disabled:!s.trim()||l.isPending,className:"bg-[#0781fe] hover:bg-[#0668d1] text-white h-10 px-4",children:l.isPending?e.jsx(Ce,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:138",className:"w-4 h-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(At,{"data-loc":"client/src/components/admin/CouponAICreator.tsx:141",className:"w-4 h-4 mr-1.5"}),"Create"]})})]})]})}function wm(){const t=j.useUtils(),n=j.promoCodes.list.useQuery(),a=j.promoCodes.toggleActive.useMutation({onSuccess:()=>{t.promoCodes.list.invalidate(),R.success("Status updated")},onError:f=>R.error(f.message)}),s=j.promoCodes.delete.useMutation({onSuccess:()=>{t.promoCodes.list.invalidate(),R.success("Promo code deleted")},onError:f=>R.error(f.message)}),[i,o]=h.useState(!1),[c,d]=h.useState(null),[l,x]=h.useState(null),[r,m]=h.useState("all"),b=n.data?.filter(f=>r==="all"?!0:f.category===r);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:33",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:34",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:35",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:36",className:"text-lg md:text-2xl font-bold text-white",children:"Coupons"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:37",className:"text-white/40 text-xs md:text-sm mt-1",children:"Server-side coupon management"})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:39",onClick:()=>{d(null),o(!0)},className:"bg-[#0b6fd9] hover:bg-[#0668d1] text-white w-full sm:w-auto",size:"sm",children:[e.jsx(zt,{"data-loc":"client/src/components/
4admin/AdminPromoCodes.tsx:40",className:"w-4 h-4 mr-1.5"})," Add Coupon"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:45",className:"flex gap-2 mb-4",children:["all","forex","futures","both"].map(f=>e.jsxs("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:47",onClick:()=>m(f),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${r===f?f==="forex"?"bg-blue-500/20 text-blue-400 border border-blue-500/30":f==="futures"?"bg-orange-500/20 text-orange-400 border border-orange-500/30":f==="both"?"bg-purple-500/20 text-purple-400 border border-purple-500/30":"bg-white/10 text-white border border-white/20":"bg-white/5 text-white/50 border border-white/5 hover:bg-white/10"}`,children:[f==="all"?"All":f==="both"?"Both":f.charAt(0).toUpperCase()+f.slice(1),f!=="all"&&n.data&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:61",className:"ml-1.5 text-[10px] opacity-60",children:["(",n.data.filter(p=>p.category===f).length,")"]})]},f))}),e.jsx(vm,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:69",onCreated:()=>t.promoCodes.list.invalidate()}),i&&e.jsx(ym,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:71",editId:c,onClose:()=>{o(!1),d(null)}}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:73",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:75",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:76",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:77",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:78",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:79",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Code"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:80",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Discount"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:81",className:"text-center text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Type"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:82",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Uses"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:83",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Per User"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:84",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Balances"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:85",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Expires"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:86",className:"text-center text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Active"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:87",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:90",children:[b?.map(f=>{const p=!!f.tieredDiscount,A=f.category||"both";return e.jsxs(N.Fragment,{children:[e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:96",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:97",className:"px-4 py-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:98",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/
4admin/AdminPromoCodes.tsx:99",className:"bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-mono font-bold px-2.5 py-1 rounded",children:f.code}),p&&e.jsx(Et,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:100",className:"w-3.5 h-3.5 text-amber-400"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:101",className:`text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded ${A==="forex"?"bg-blue-500/15 text-blue-400":A==="futures"?"bg-orange-500/15 text-orange-400":"bg-purple-500/15 text-purple-400"}`,children:A})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:108",className:"px-4 py-3 text-right text-[#4ade80] font-medium",children:p?"Tiered":f.discountType==="percent"?`${f.discountPercent}%`:`$${(f.discountAmount??0)/100}`}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:111",className:"px-4 py-3 text-center text-white/50 text-xs capitalize",children:f.discountType}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:112",className:"px-4 py-3 text-right text-white/60",children:[f.currentUses,f.maxUses?` / ${f.maxUses}`:" / â"]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:115",className:"px-4 py-3 text-right text-white/60",children:f.maxUsesPerUser?`${f.maxUsesPerUser}x`:"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:118",className:"px-4 py-3 text-white/40 text-xs",children:f.applicableBalances?f.applicableBalances.join(", "):"All"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:123",className:"px-4 py-3 text-white/40 text-xs",children:f.expiresAt?new Date(f.expiresAt).toLocaleDateString():"Never"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:126",className:"px-4 py-3 text-center",children:e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:127",onClick:()=>a.mutate({id:f.id,isActive:!f.isActive}),children:f.isActive?e.jsx(_t,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:129",className:"w-6 h-6 text-[#4ade80]"}):e.jsx(Lt,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:130",className:"w-6 h-6 text-white/40"})})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:133",className:"px-4 py-3 text-right",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:134",className:"flex items-center justify-end gap-1",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:135",onClick:()=>x(l===f.id?null:f.id),className:`p-1.5 rounded-lg hover:bg-[#0781fe]/10 transition-colors ${l===f.id?"text-[#0781fe] bg-[#0781fe]/10":"text-white/40 hover:text-[#0781fe]"}`,title:"AI Assistant",children:e.jsx(At,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:140",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:142",onClick:()=>{d(f.id),o(!0)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/40 hover:text-white transition-colors",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:146",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:148",onClick:()=>{confirm("Delete this coupon?")&&s.mutate({id:f.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/40 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:152",className:"w-3.5 h-3.5"})})]})})]}),l===f.id&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:158",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:159",colSpan:9,className:"px-4 py-0",children:e.jsx(Xs,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:160",couponId:f.id,couponCode:f.code,onClose:()=>x(null),onUpdate:()=>t.promoCodes.list.invalidate()})})})]},f.id)}),n.data?.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:173",children:e.jsx("td",{"data-loc":"client/src/components/
4admin/AdminPromoCodes.tsx:174",colSpan:9,className:"px-4 py-12 text-center text-white/50",children:'No coupons yet. Click "Add Coupon" to create one.'})})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:183",className:"md:hidden divide-y divide-white/5",children:[b?.map(f=>{const p=!!f.tieredDiscount,A=f.category||"both";return e.jsxs(N.Fragment,{children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:189",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:190",className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:191",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:192",className:"bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-mono font-bold px-2 py-0.5 rounded",children:f.code}),p&&e.jsx(Et,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:193",className:"w-3 h-3 text-amber-400"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:194",className:`text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded ${A==="forex"?"bg-blue-500/15 text-blue-400":A==="futures"?"bg-orange-500/15 text-orange-400":"bg-purple-500/15 text-purple-400"}`,children:A})]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:200",onClick:()=>a.mutate({id:f.id,isActive:!f.isActive}),children:f.isActive?e.jsx(_t,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:202",className:"w-5 h-5 text-[#4ade80]"}):e.jsx(Lt,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:203",className:"w-5 h-5 text-white/40"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:206",className:"flex items-center gap-3 mb-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:207",className:"text-sm font-bold text-[#4ade80]",children:p?"Tiered":f.discountType==="percent"?`${f.discountPercent}%`:`$${(f.discountAmount??0)/100}`}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:210",className:"text-[10px] text-white/40",children:[f.currentUses,f.maxUses?` / ${f.maxUses}`:""," uses"]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:211",className:"text-[10px] text-white/40",children:f.expiresAt?`Exp ${new Date(f.expiresAt).toLocaleDateString()}`:"No expiry"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:213",className:"flex items-center justify-between",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:214",className:"text-[10px] text-white/30",children:f.applicableBalances?f.applicableBalances.join(", "):"All balances"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:217",className:"flex items-center gap-1",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:218",onClick:()=>x(l===f.id?null:f.id),className:`p-1.5 rounded-lg hover:bg-[#0781fe]/10 transition-colors ${l===f.id?"text-[#0781fe] bg-[#0781fe]/10":"text-white/40 hover:text-[#0781fe]"}`,children:e.jsx(At,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:222",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:224",onClick:()=>{d(f.id),o(!0)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/40 hover:text-white transition-colors",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:228",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:230",onClick:()=>{confirm("Delete this coupon?")&&s.mutate({id:f.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/40 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:234",className:"w-3.5 h-3.5"})})]})]})]}),l===f.id&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:240",className:"px-3 py-2 border-t border-white/5",children:e.jsx(Xs,{"data-loc":"client/src/components/
4admin/AdminPromoCodes.tsx:241",couponId:f.id,couponCode:f.code,onClose:()=>x(null),onUpdate:()=>t.promoCodes.list.invalidate()})})]},f.id)}),n.data?.length===0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:253",className:"p-8 text-center text-white/50 text-sm",children:'No coupons yet. Click "Add Coupon" to create one.'})]})]})]})}function ym({editId:t,onClose:n}){const a=j.useUtils(),s=j.promoCodes.list.useQuery(),i=t?s.data?.find(r=>r.id===t):null,o=j.promoCodes.create.useMutation({onSuccess:()=>{a.promoCodes.list.invalidate(),R.success("Coupon created"),n()},onError:r=>R.error(r.message)}),c=j.promoCodes.update.useMutation({onSuccess:()=>{a.promoCodes.list.invalidate(),R.success("Coupon updated"),n()},onError:r=>R.error(r.message)}),[d,l]=h.useState({code:"",discountPercent:55,discountType:"percent",discountAmount:"",maxUses:"",maxUsesPerUser:"",minOrderValue:"",applicableModes:"",applicableBalances:"",tieredDiscount:"",category:"both",startsAt:"",expiresAt:"",isActive:!0});h.useEffect(()=>{if(t&&i){const r=i;l({code:r.code,discountPercent:r.discountPercent,discountType:r.discountType,discountAmount:r.discountAmount?String(r.discountAmount):"",maxUses:r.maxUses?String(r.maxUses):"",maxUsesPerUser:r.maxUsesPerUser?String(r.maxUsesPerUser):"",minOrderValue:r.minOrderValue?String(r.minOrderValue):"",applicableModes:r.applicableModes?r.applicableModes.join(", "):"",applicableBalances:r.applicableBalances?r.applicableBalances.join(", "):"",tieredDiscount:r.tieredDiscount?JSON.stringify(r.tieredDiscount):"",category:r.category||"both",startsAt:r.startsAt?new Date(r.startsAt).toISOString().split("T")[0]:"",expiresAt:r.expiresAt?new Date(r.expiresAt).toISOString().split("T")[0]:"",isActive:r.isActive})}},[t,i]);const x=r=>{r.preventDefault();const m={code:d.code,discountPercent:d.discountPercent,discountType:d.discountType,discountAmount:d.discountAmount?parseInt(d.discountAmount):void 0,maxUses:d.maxUses?parseInt(d.maxUses):void 0,maxUsesPerUser:d.maxUsesPerUser?parseInt(d.maxUsesPerUser):void 0,minOrderValue:d.minOrderValue?parseInt(d.minOrderValue):void 0,applicableModes:d.applicableModes?d.applicableModes.split(",").map(b=>b.trim()).filter(Boolean):void 0,applicableBalances:d.applicableBalances?d.applicableBalances.split(",").map(b=>b.trim()).filter(Boolean):void 0,tieredDiscount:d.tieredDiscount?JSON.parse(d.tieredDiscount):void 0,category:d.category,startsAt:d.startsAt?new Date(d.startsAt):void 0,expiresAt:d.expiresAt?new Date(d.expiresAt):void 0,isActive:d.isActive};t?c.mutate({id:t,...m}):o.mutate(m)};return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:344",className:"bg-[#141414] border border-white/10 rounded-xl p-5 mb-6",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:345",className:"text-white font-semibold mb-4",children:[t?"Edit":"New"," Coupon"]}),e.jsxs("form",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:346",onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:347",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:348",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:349",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Code"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:350",value:d.code,onChange:r=>l(m=>({...m,code:r.target.value})),placeholder:"e.g. SUMMER",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm font-mono focus:border-[#0781fe] focus:outline-none uppercase"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:357",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:358",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Discount Type"}),e.jsxs("select",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:359",value:d.discountType,onCh
4ange:r=>l(m=>({...m,discountType:r.target.value})),className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none",children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:364",value:"percent",children:"Percentage"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:365",value:"fixed",children:"Fixed Amount"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:368",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:369",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:d.discountType==="percent"?"Discount %":"Discount Amount (cents)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:372",type:"number",value:d.discountType==="percent"?d.discountPercent:d.discountAmount,onChange:r=>{d.discountType==="percent"?l(m=>({...m,discountPercent:parseInt(r.target.value)||0})):l(m=>({...m,discountAmount:r.target.value}))},className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:386",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:387",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:388",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Max Uses Total (empty = \\u221E)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:389",type:"number",value:d.maxUses,onChange:r=>l(m=>({...m,maxUses:r.target.value})),placeholder:"Unlimited",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:397",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:398",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Max Uses Per User (empty = \\u221E)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:399",type:"number",value:d.maxUsesPerUser,onChange:r=>l(m=>({...m,maxUsesPerUser:r.target.value})),placeholder:"Unlimited",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:407",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:408",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Starts At"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:409",type:"date",value:d.startsAt,onChange:r=>l(m=>({...m,startsAt:r.target.value})),className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:416",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:417",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Expires At"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:418",type:"date",value:d.expiresAt,onChange:r=>l(m=>({...m,expiresAt:r.target.value})),className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:426",className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:427",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:428",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Applicable Balances (comma-separated, empty = all)"}
4),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:429",value:d.applicableBalances,onChange:r=>l(m=>({...m,applicableBalances:r.target.value})),placeholder:"e.g. 200k, 300k, 400k",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:436",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:437",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Applicable Modes (comma-separated, empty = all)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:438",value:d.applicableModes,onChange:r=>l(m=>({...m,applicableModes:r.target.value})),placeholder:"e.g. 1step, 2step, instant",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:446",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:447",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Tiered Discount JSON (optional, overrides flat %)"}),e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:450",value:d.tieredDiscount,onChange:r=>l(m=>({...m,tieredDiscount:r.target.value})),placeholder:'[{"balances":["10k","25k","50k"],"percent":40},{"balances":["100k","200k"],"percent":50},{"balances":["300k","400k"],"percent":60}]',rows:2,className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-xs font-mono focus:border-[#0781fe] focus:outline-none resize-y"}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:457",className:"text-white/30 text-[10px] mt-1",children:["Format: array of ","{",'"balances": ["10k","25k"], "percent": 40',"}"," objects"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:459",className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:460",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:461",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Market Category"}),e.jsxs("select",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:462",value:d.category,onChange:r=>l(m=>({...m,category:r.target.value})),className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none",children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:467",value:"both",children:"Both (Forex + Futures)"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:468",value:"forex",children:"Forex Only"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:469",value:"futures",children:"Futures Only"})]})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:473",className:"flex items-center gap-4 pt-1",children:e.jsxs("label",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:474",className:"flex items-center gap-2 text-sm text-white/70",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:475",type:"checkbox",checked:d.isActive,onChange:r=>l(m=>({...m,isActive:r.target.checked})),className:"rounded"}),"Active"]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:479",className:"flex gap-3 pt-2",children:[e.jsxs(L,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:480",type:"submit",className:"bg-[#0b6fd9] hover:bg-[#0668d1] text-white",disabled:o.isPending||c.isPending,children:[t?"Update":"Create"," Coupon"]}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminPromoCodes.tsx:483",type:"button",variant:"outline",onClick:n,className:"border-white/10 text-white/60 hover:text-white",children:"Cancel"})]})]})]})}const ea={new:"bg-[#0b6fd9]/10 text-[#0781fe]",contacted:"bg-[#f59e0b]/10 text-[#f59e0b]",converted:"bg-[#4ade80]/10 text-[#4ade80]",unsubscribed:"bg-white/5 text-white/50"};function jm(){const t=j.useUtils(),[n,a]=h.useState(1),[s,i]=h.useState(),o=j.leads.list.useQuery({page:n,limit:25,status:s}),c=j.leads.stats.useQuery(),d=j.leads.updateStatus.useMutation({onSuccess:()=>
4{t.leads.list.invalidate(),t.leads.stats.invalidate(),R.success("Status updated")},onError:r=>R.error(r.message)}),l=j.leads.delete.useMutation({onSuccess:()=>{t.leads.list.invalidate(),t.leads.stats.invalidate(),R.success("Lead deleted")},onError:r=>R.error(r.message)}),x=Math.ceil((o.data?.total??0)/25);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:36",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:37",className:"mb-4 md:mb-6",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminLeads.tsx:38",className:"text-lg md:text-2xl font-bold text-white",children:"Leads"}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminLeads.tsx:39",className:"text-white/60 text-xs md:text-sm mt-1",children:[c.data?.total??0," total leads · ",c.data?.new??0," new"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:45",className:"flex gap-1.5 md:gap-2 mb-3 md:mb-4 flex-wrap",children:[void 0,"new","contacted","converted","unsubscribed"].map(r=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminLeads.tsx:47",onClick:()=>{i(r),a(1)},className:`px-2.5 md:px-3 py-1 md:py-1.5 rounded-lg text-[10px] md:text-xs font-medium transition-colors ${s===r?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/50 hover:text-white hover:bg-white/10"}`,children:r?r.charAt(0).toUpperCase()+r.slice(1):"All"},r??"all"))}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:61",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:63",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminLeads.tsx:64",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminLeads.tsx:65",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminLeads.tsx:66",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminLeads.tsx:67",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Email"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLeads.tsx:68",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Name"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLeads.tsx:69",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Source"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLeads.tsx:70",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Status"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLeads.tsx:71",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Date"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLeads.tsx:72",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminLeads.tsx:75",children:[o.data?.items.map(r=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminLeads.tsx:77",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:78",className:"px-4 py-3 text-white font-medium",children:r.email}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:79",className:"px-4 py-3 text-white/60",children:r.name||"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:80",className:"px-4 py-3 text-white/60 text-xs",children:r.source||"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:81",className:"px-4 py-3",children:e.jsxs("select",{"data-loc":"client/src/components/admin/AdminLeads.tsx:82",value:r.status,onChange:m=>d.mutate({id:r.id,status:m.target.value}),className:`text-xs font-medium px-2.5 py-1 rounded-full border-0 cursor-pointer ${ea[r.status]||""} bg-opacity-100`,style:{appearance:"auto"}
4,children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:88",value:"new",children:"New"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:89",value:"contacted",children:"Contacted"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:90",value:"converted",children:"Converted"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:91",value:"unsubscribed",children:"Unsubscribed"})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:94",className:"px-4 py-3 text-white/50 text-xs",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:97",className:"px-4 py-3 text-right",children:e.jsx("button",{"data-loc":"client/src/components/admin/AdminLeads.tsx:98",onClick:()=>{confirm("Delete this lead?")&&l.mutate({id:r.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminLeads.tsx:102",className:"w-3.5 h-3.5"})})})]},r.id)),o.data?.items.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminLeads.tsx:108",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminLeads.tsx:109",colSpan:6,className:"px-4 py-12 text-center text-white/50",children:"No leads found."})})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:118",className:"md:hidden divide-y divide-white/5",children:[o.data?.items.map(r=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:120",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:121",className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminLeads.tsx:122",className:"text-sm font-medium text-white truncate max-w-[200px]",children:r.email}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminLeads.tsx:123",onClick:()=>{confirm("Delete this lead?")&&l.mutate({id:r.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/40 hover:text-red-400 transition-colors shrink-0",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminLeads.tsx:127",className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:130",className:"flex items-center gap-2 mb-1.5",children:[r.name&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminLeads.tsx:131",className:"text-xs text-white/50",children:r.name}),r.source&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminLeads.tsx:132",className:"text-[10px] text-white/30",children:r.source})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:134",className:"flex items-center justify-between",children:[e.jsxs("select",{"data-loc":"client/src/components/admin/AdminLeads.tsx:135",value:r.status,onChange:m=>d.mutate({id:r.id,status:m.target.value}),className:`text-[10px] font-medium px-2 py-0.5 rounded-full border-0 cursor-pointer ${ea[r.status]||""}`,style:{appearance:"auto"},children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:141",value:"new",children:"New"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:142",value:"contacted",children:"Contacted"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:143",value:"converted",children:"Converted"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLeads.tsx:144",value:"unsubscribed",children:"Unsubscribed"})]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminLeads.tsx:146",className:"text-[10px] text-white/30",children:new Date(r.createdAt).toLocaleDateString()})]})]},r.id)),o.data?.items.length===0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:151",className:"p-8 text-center text-white/50 text-sm",children:"No leads found."})]}),x>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:157",className:"flex items-center justify-between px-3 md:px-4 py-2.5 md:py-3 border-t border-white/10",children:[e.jsxs("span",{"data-loc":"client/src/components/
4admin/AdminLeads.tsx:158",className:"text-[10px] md:text-xs text-white/60",children:["Page ",n,"/",x," (",o.data?.total,")"]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLeads.tsx:161",className:"flex gap-1",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminLeads.tsx:162",variant:"outline",size:"sm",onClick:()=>a(r=>Math.max(1,r-1)),disabled:n===1,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminLeads.tsx:169",className:"w-3.5 h-3.5 md:w-4 md:h-4"})}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminLeads.tsx:171",variant:"outline",size:"sm",onClick:()=>a(r=>Math.min(x,r+1)),disabled:n===x,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminLeads.tsx:178",className:"w-3.5 h-3.5 md:w-4 md:h-4"})})]})]})]})]})}const ta={draft:"bg-[#f59e0b]/10 text-[#f59e0b]",published:"bg-[#4ade80]/10 text-[#4ade80]",archived:"bg-white/5 text-white/50"};function Nm(){const t=j.useUtils(),[n,a]=h.useState(1),s=j.blogPosts.listAll.useQuery({page:n,limit:25}),i=j.blogPosts.delete.useMutation({onSuccess:()=>{t.blogPosts.listAll.invalidate(),R.success("Post deleted")},onError:r=>R.error(r.message)}),[o,c]=h.useState(!1),[d,l]=h.useState(null),x=Math.ceil((s.data?.total??0)/25);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:28",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:29",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:30",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:31",className:"text-lg md:text-2xl font-bold text-white",children:"Blog Posts"}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:32",className:"text-white/60 text-xs md:text-sm mt-1",children:[s.data?.total??0," total posts"]})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:34",onClick:()=>{l(null),c(!0)},className:"bg-[#0b6fd9] hover:bg-[#0668d1] text-white w-full sm:w-auto",size:"sm",children:[e.jsx(zt,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:35",className:"w-4 h-4 mr-1.5"})," New Post"]})]}),o&&e.jsx(Cm,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:40",editId:d,onClose:()=>{c(!1),l(null)}}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:43",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:45",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:46",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:47",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:48",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:49",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Title"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:50",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Category"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:51",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Status"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:52",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Views"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:53",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Date"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:54",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}
4),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:57",children:[s.data?.items.map(r=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:59",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:60",className:"px-4 py-3 text-white font-medium max-w-[300px] truncate",children:r.title}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:61",className:"px-4 py-3 text-white/60 text-xs",children:r.category||"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:62",className:"px-4 py-3",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:63",className:`text-xs font-medium px-2.5 py-1 rounded-full ${ta[r.status]||""}`,children:r.status})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:67",className:"px-4 py-3 text-right text-white/60",children:e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:68",className:"inline-flex items-center gap-1",children:[e.jsx(ln,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:69",className:"w-3 h-3"})," ",r.viewCount]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:72",className:"px-4 py-3 text-white/50 text-xs",children:r.publishedAt?new Date(r.publishedAt).toLocaleDateString():new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:75",className:"px-4 py-3 text-right",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:76",className:"flex items-center justify-end gap-1",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:77",onClick:()=>{l(r.id),c(!0)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/60 hover:text-white transition-colors",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:81",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:83",onClick:()=>{confirm("Delete this post?")&&i.mutate({id:r.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:87",className:"w-3.5 h-3.5"})})]})})]},r.id)),s.data?.items.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:94",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:95",colSpan:6,className:"px-4 py-12 text-center text-white/50",children:'No blog posts yet. Click "New Post" to create one.'})})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:104",className:"md:hidden divide-y divide-white/5",children:[s.data?.items.map(r=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:106",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:107",className:"flex items-start justify-between gap-2 mb-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:108",className:"text-sm font-medium text-white line-clamp-2",children:r.title}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:109",className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:110",onClick:()=>{l(r.id),c(!0)},className:"p-1.5 rounded-lg hover:bg-white/10 text-white/40 hover:text-white transition-colors",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:114",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:116",onClick:()=>{confirm("Delete this post?")&&i.mutate({id:r.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/40 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:120",className:"w-3.5 h-3.5"})})]})]}
4),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:124",className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:125",className:`text-[10px] font-medium px-2 py-0.5 rounded-full ${ta[r.status]||""}`,children:r.status}),r.category&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:128",className:"text-[10px] text-white/40",children:r.category}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:129",className:"text-[10px] text-white/30 inline-flex items-center gap-0.5",children:[e.jsx(ln,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:130",className:"w-2.5 h-2.5"})," ",r.viewCount]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:132",className:"text-[10px] text-white/30",children:r.publishedAt?new Date(r.publishedAt).toLocaleDateString():new Date(r.createdAt).toLocaleDateString()})]})]},r.id)),s.data?.items.length===0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:139",className:"p-8 text-center text-white/50 text-sm",children:'No blog posts yet. Click "New Post" to create one.'})]}),x>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:146",className:"flex items-center justify-between px-3 md:px-4 py-2.5 md:py-3 border-t border-white/10",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:147",className:"text-[10px] md:text-xs text-white/60",children:["Page ",n,"/",x]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:148",className:"flex gap-1",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:149",variant:"outline",size:"sm",onClick:()=>a(r=>Math.max(1,r-1)),disabled:n===1,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:150",className:"w-3.5 h-3.5 md:w-4 md:h-4"})}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:152",variant:"outline",size:"sm",onClick:()=>a(r=>Math.min(x,r+1)),disabled:n===x,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:153",className:"w-3.5 h-3.5 md:w-4 md:h-4"})})]})]})]})]})}function Cm({editId:t,onClose:n}){const a=j.useUtils(),s=j.blogPosts.getById.useQuery({id:t},{enabled:t!==null}),i=j.blogPosts.create.useMutation({onSuccess:()=>{a.blogPosts.listAll.invalidate(),R.success("Post created"),n()},onError:r=>R.error(r.message)}),o=j.blogPosts.update.useMutation({onSuccess:()=>{a.blogPosts.listAll.invalidate(),R.success("Post updated"),n()},onError:r=>R.error(r.message)}),[c,d]=h.useState({title:"",slug:"",excerpt:"",content:"",category:"",author:"Alpha Trader Firm",status:"draft",metaTitle:"",metaDescription:"",coverImage:"",tags:""});h.useEffect(()=>{if(t&&s.data){const r=s.data;d({title:r.title,slug:r.slug,excerpt:r.excerpt||"",content:r.content||"",category:r.category||"",author:r.author||"Alpha Trader Firm",status:r.status,metaTitle:r.metaTitle||"",metaDescription:r.metaDescription||"",coverImage:r.coverImage||"",tags:r.tags?r.tags.join(", "):""})}},[t,s.data]);const l=r=>r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),x=r=>{r.preventDefault();const m={title:c.title,slug:c.slug,excerpt:c.excerpt||void 0,content:c.content||void 0,category:c.category||void 0,author:c.author||void 0,status:c.status,metaTitle:c.metaTitle||void 0,metaDescription:c.metaDescription||void 0,coverImage:c.coverImage||void 0,tags:c.tags?c.tags.split(",").map(b=>b.trim()).filter(Boolean):void 0};t?o.mutate({id:t,...m}):i.mutate(m)};return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:229",className:"bg-[#141414] border border-white/10 rounded-xl p-5 mb-6",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:230",className:"text-white font-semibold mb-4",children:[t?"Edit":"New"," Blog Post"]}),e.jsxs("form",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:231",onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/components/
4admin/AdminBlogPosts.tsx:232",className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:233",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:234",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Title"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:235",value:c.title,onChange:r=>{const m=r.target.value;d(b=>({...b,title:m,slug:b.slug||l(m)}))},placeholder:"Post title",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:245",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:246",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Slug"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:247",value:c.slug,onChange:r=>d(m=>({...m,slug:r.target.value})),placeholder:"post-slug",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm font-mono focus:border-[#0781fe] focus:outline-none"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:256",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:257",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Excerpt"}),e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:258",value:c.excerpt,onChange:r=>d(m=>({...m,excerpt:r.target.value})),rows:2,placeholder:"Brief summary...",className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none resize-y"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:267",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:268",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Content (Markdown)"}),e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:269",value:c.content,onChange:r=>d(m=>({...m,content:r.target.value})),rows:10,placeholder:"Write your post content in Markdown...",className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm font-mono focus:border-[#0781fe] focus:outline-none resize-y"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:278",className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:279",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:280",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Category"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:281",value:c.category,onChange:r=>d(m=>({...m,category:r.target.value})),placeholder:"e.g. Trading Tips",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:288",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:289",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Author"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:290",value:c.author,onChange:r=>d(m=>({...m,author:r.target.value})),className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:296",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:297",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Status"}),e.jsxs("select",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:298",value:c.status,onChange:r=>d(m=>({...m,status:r.target.value})),className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none",children:[e.jsx("option",{"data-loc":"client/src/components/
4admin/AdminBlogPosts.tsx:303",value:"draft",children:"Draft"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:304",value:"published",children:"Published"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:305",value:"archived",children:"Archived"})]})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:310",className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:311",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:312",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Cover Image URL"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:313",value:c.coverImage,onChange:r=>d(m=>({...m,coverImage:r.target.value})),placeholder:"https://...",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:320",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:321",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Tags (comma-separated)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:322",value:c.tags,onChange:r=>d(m=>({...m,tags:r.target.value})),placeholder:"e.g. forex, funded, strategy",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:331",className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:332",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:333",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Meta Title (SEO)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:334",value:c.metaTitle,onChange:r=>d(m=>({...m,metaTitle:r.target.value})),placeholder:"SEO title override",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:341",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:342",className:"block text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Meta Description (SEO)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:343",value:c.metaDescription,onChange:r=>d(m=>({...m,metaDescription:r.target.value})),placeholder:"SEO description override",className:"w-full h-10 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:352",className:"flex gap-3 pt-2",children:[e.jsxs(L,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:353",type:"submit",className:"bg-[#0b6fd9] hover:bg-[#0668d1] text-white",disabled:i.isPending||o.isPending,children:[t?"Update":"Create"," Post"]}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminBlogPosts.tsx:356",type:"button",variant:"outline",onClick:n,className:"border-white/10 text-white/60 hover:text-white",children:"Cancel"})]})]})]})}const na={pending:"bg-[#f59e0b]/10 text-[#f59e0b]",approved:"bg-[#4ade80]/10 text-[#4ade80]",paid:"bg-[#0b6fd9]/10 text-[#0781fe]",rejected:"bg-red-500/10 text-red-400"};function km(){const t=j.affiliates.stats.useQuery(),[n,a]=h.useState("clicks");return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:19",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:20",className:"mb-4 md:mb-6",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:21",className:"text-lg md:text-2xl font-bold text-white",children:"Affiliate Tracking"}
4),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:22",className:"text-white/60 text-xs md:text-sm mt-1",children:"Monitor referral clicks and conversions"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:26",className:"grid grid-cols-2 lg:grid-cols-4 gap-2 md:gap-4 mb-4 md:mb-6",children:[e.jsx(tn,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:27",icon:Fa,label:"Total Clicks",value:t.data?.totalClicks??0,color:"#0781fe"}),e.jsx(tn,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:28",icon:ct,label:"Conversions",value:t.data?.totalConversions??0,color:"#4ade80"}),e.jsx(tn,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:29",icon:Gt,label:"Approved",value:`$${((t.data?.totalCommission??0)/100).toFixed(2)}`,color:"#4ade80"}),e.jsx(tn,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:30",icon:Ve,label:"Pending",value:`$${((t.data?.pendingCommission??0)/100).toFixed(2)}`,color:"#f59e0b"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:34",className:"flex gap-2 mb-3 md:mb-4",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:35",onClick:()=>a("clicks"),className:`px-3 md:px-4 py-1.5 md:py-2 rounded-lg text-xs md:text-sm font-medium transition-colors ${n==="clicks"?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/50 hover:text-white"}`,children:"Clicks"}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:43",onClick:()=>a("conversions"),className:`px-3 md:px-4 py-1.5 md:py-2 rounded-lg text-xs md:text-sm font-medium transition-colors ${n==="conversions"?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/50 hover:text-white"}`,children:"Conversions"})]}),n==="clicks"?e.jsx(Pm,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:53"}):e.jsx(Sm,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:53"})]})}function tn({icon:t,label:n,value:a,color:s}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:60",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:61",className:"flex items-center justify-between mb-1.5 md:mb-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:62",className:"text-[10px] md:text-xs text-white/50 uppercase tracking-wider",children:n}),e.jsx(t,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:63",className:"w-3.5 h-3.5 md:w-4 md:h-4",style:{color:s}})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:65",className:"text-lg md:text-2xl font-bold text-white",children:a})]})}function Pm(){const[t,n]=h.useState(1),[a,s]=h.useState(""),i=j.affiliates.listClicks.useQuery({page:t,limit:25,referralCode:a||void 0}),o=Math.ceil((i.data?.total??0)/25);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:81",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:82",className:"mb-3",children:e.jsx("input",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:83",value:a,onChange:c=>{s(c.target.value),n(1)},placeholder:"Filter by referral code...",className:"h-9 px-3 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-[#0781fe] focus:outline-none w-full sm:w-64"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:91",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:93",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:94",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:95",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:96",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:97",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Referral Code"}
4),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:98",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Country"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:99",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Landing Page"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:100",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Date"})]})}),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:103",children:[i.data?.items.map(c=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:105",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:106",className:"px-4 py-3",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:107",className:"bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-mono font-bold px-2 py-0.5 rounded",children:c.referralCode})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:109",className:"px-4 py-3 text-white/60",children:c.country||"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:110",className:"px-4 py-3 text-white/60 text-xs max-w-[200px] truncate",children:c.landingPage||"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:111",className:"px-4 py-3 text-white/50 text-xs",children:new Date(c.createdAt).toLocaleString()})]},c.id)),i.data?.items.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:115",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:116",colSpan:4,className:"px-4 py-12 text-center text-white/50",children:"No clicks recorded yet."})})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:123",className:"md:hidden divide-y divide-white/5",children:[i.data?.items.map(c=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:125",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:126",className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:127",className:"bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-mono font-bold px-2 py-0.5 rounded",children:c.referralCode}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:128",className:"text-[10px] text-white/40",children:c.country||"â"})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:130",className:"text-[10px] text-white/50 truncate",children:c.landingPage||"â"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:131",className:"text-[10px] text-white/30 mt-0.5",children:new Date(c.createdAt).toLocaleString()})]},c.id)),i.data?.items.length===0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:135",className:"p-8 text-center text-white/50 text-sm",children:"No clicks recorded yet."})]}),o>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:139",className:"flex items-center justify-between px-3 md:px-4 py-2.5 md:py-3 border-t border-white/10",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:140",className:"text-[10px] md:text-xs text-white/60",children:["Page ",t,"/",o]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:141",className:"flex gap-1",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:142",variant:"outline",size:"sm",onClick:()=>n(c=>Math.max(1,c-1)),disabled:t===1,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:143",className:"w-3.5 h-3.5 md:w-4 md:h-4"})}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:145",variant:"outline",size:"sm",onClick:()=>n(c=>Math.min(o,c+1)),disabled:t===o,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Te,{"data-loc":"client/src/components/
4admin/AdminAffiliates.tsx:146",className:"w-3.5 h-3.5 md:w-4 md:h-4"})})]})]})]})]})}function Sm(){const t=j.useUtils(),[n,a]=h.useState(1),[s,i]=h.useState(),o=j.affiliates.listConversions.useQuery({page:n,limit:25,status:s}),c=j.affiliates.updateConversionStatus.useMutation({onSuccess:()=>{t.affiliates.listConversions.invalidate(),t.affiliates.stats.invalidate(),R.success("Status updated")},onError:l=>R.error(l.message)}),d=Math.ceil((o.data?.total??0)/25);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:176",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:177",className:"flex gap-1.5 md:gap-2 mb-3 flex-wrap",children:[void 0,"pending","approved","paid","rejected"].map(l=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:179",onClick:()=>{i(l),a(1)},className:`px-2.5 md:px-3 py-1 md:py-1.5 rounded-lg text-[10px] md:text-xs font-medium transition-colors ${s===l?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/50 hover:text-white hover:bg-white/10"}`,children:l?l.charAt(0).toUpperCase()+l.slice(1):"All"},l??"all"))}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:191",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:193",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:194",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:195",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:196",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:197",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Referral Code"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:198",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Order Value"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:199",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Commission"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:200",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Challenge"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:201",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Status"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:202",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Date"})]})}),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:205",children:[o.data?.items.map(l=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:207",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:208",className:"px-4 py-3",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:209",className:"bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-mono font-bold px-2 py-0.5 rounded",children:l.referralCode})}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:211",className:"px-4 py-3 text-right text-white font-medium",children:["$",(l.orderValue/100).toFixed(2)]}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:212",className:"px-4 py-3 text-right text-[#4ade80] font-medium",children:["$",(l.commissionAmount/100).toFixed(2)]}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:213",className:"px-4 py-3 text-white/60 text-xs",children:[l.challengeType||"â"," ",l.balanceKey||""]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:214",className:"px-4 py-3",children:e.jsxs("select",{"data-loc":"client/src/components/
4admin/AdminAffiliates.tsx:215",value:l.status,onChange:x=>c.mutate({id:l.id,status:x.target.value}),className:`text-xs font-medium px-2.5 py-1 rounded-full border-0 cursor-pointer ${na[l.status]||""}`,children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:220",value:"pending",children:"Pending"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:221",value:"approved",children:"Approved"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:222",value:"paid",children:"Paid"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:223",value:"rejected",children:"Rejected"})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:226",className:"px-4 py-3 text-white/50 text-xs",children:new Date(l.createdAt).toLocaleDateString()})]},l.id)),o.data?.items.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:230",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:231",colSpan:6,className:"px-4 py-12 text-center text-white/50",children:"No conversions recorded yet."})})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:238",className:"md:hidden divide-y divide-white/5",children:[o.data?.items.map(l=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:240",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:241",className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:242",className:"bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-mono font-bold px-2 py-0.5 rounded",children:l.referralCode}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:243",className:"text-sm font-bold text-white",children:["$",(l.orderValue/100).toFixed(2)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:245",className:"flex items-center justify-between mb-1.5",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:246",className:"text-xs text-white/50",children:[l.challengeType||"â"," ",l.balanceKey||""]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:247",className:"text-xs text-[#4ade80] font-medium",children:["$",(l.commissionAmount/100).toFixed(2)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:249",className:"flex items-center justify-between",children:[e.jsxs("select",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:250",value:l.status,onChange:x=>c.mutate({id:l.id,status:x.target.value}),className:`text-[10px] font-medium px-2 py-0.5 rounded-full border-0 cursor-pointer ${na[l.status]||""}`,children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:255",value:"pending",children:"Pending"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:256",value:"approved",children:"Approved"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:257",value:"paid",children:"Paid"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:258",value:"rejected",children:"Rejected"})]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:260",className:"text-[10px] text-white/30",children:new Date(l.createdAt).toLocaleDateString()})]})]},l.id)),o.data?.items.length===0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:265",className:"p-8 text-center text-white/50 text-sm",children:"No conversions recorded yet."})]}),d>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:269",className:"flex items-center justify-between px-3 md:px-4 py-2.5 md:py-3 border-t border-white/10",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:270",className:"text-[10px] md:text-xs text-white/60",children:["Page ",n,"/",d]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:271",className:"flex gap-1",children:[e.jsx(L,{"data-loc":"client/src/components/
4admin/AdminAffiliates.tsx:272",variant:"outline",size:"sm",onClick:()=>a(l=>Math.max(1,l-1)),disabled:n===1,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:273",className:"w-3.5 h-3.5 md:w-4 md:h-4"})}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:275",variant:"outline",size:"sm",onClick:()=>a(l=>Math.min(d,l+1)),disabled:n===d,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminAffiliates.tsx:276",className:"w-3.5 h-3.5 md:w-4 md:h-4"})})]})]})]})]})}const sa={entered:"bg-[#0b6fd9]/10 text-[#0781fe]",winner:"bg-[#4ade80]/10 text-[#4ade80]",notified:"bg-[#fbbf24]/10 text-[#fbbf24]"};function Om(){const t=j.useUtils(),[n,a]=h.useState(1),[s,i]=h.useState(),o=new Date,c=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}`,d=j.lottery.list.useQuery({page:n,limit:25,status:s}),l=j.lottery.stats.useQuery(),x=j.lottery.updateStatus.useMutation({onSuccess:()=>{t.lottery.list.invalidate(),t.lottery.stats.invalidate(),R.success("Status updated")},onError:p=>R.error(p.message)}),r=j.lottery.pickWinners.useMutation({onSuccess:p=>{t.lottery.list.invalidate(),t.lottery.stats.invalidate(),p.winners.length>0?R.success(`ð ${p.winners.length} winner(s) selected!`,{description:p.winners.map(A=>A.email).join(", ")}):R.info("No eligible entries found for this month.")},onError:p=>R.error(p.message)}),m=j.lottery.delete.useMutation({onSuccess:()=>{t.lottery.list.invalidate(),t.lottery.stats.invalidate(),R.success("Entry removed")},onError:p=>R.error(p.message)}),b=Math.ceil((d.data?.total??0)/25),f=d.data?.total??0;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:69",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:71",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:72",children:[e.jsxs("h1",{"data-loc":"client/src/components/admin/AdminLottery.tsx:73",className:"text-lg md:text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Dt,{"data-loc":"client/src/components/admin/AdminLottery.tsx:74",className:"w-5 h-5 md:w-6 md:h-6 text-[#fbbf24]"}),"Lottery Entries"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:77",className:"text-white/60 text-xs md:text-sm mt-1",children:"Monthly $400K Instant Funding Giveaway · 3 winners/month"})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminLottery.tsx:81",onClick:()=>{confirm(`Pick 3 random winners for ${c}?`)&&r.mutate({drawMonth:c,count:3})},disabled:r.isPending,className:"bg-gradient-to-r from-[#fbbf24] to-[#f59e0b] text-black font-bold hover:from-[#f59e0b] hover:to-[#d97706] w-full sm:w-auto",size:"sm",children:[e.jsx(Ba,{"data-loc":"client/src/components/admin/AdminLottery.tsx:91",className:"w-4 h-4 mr-1.5"}),r.isPending?"Picking...":"Pick Winners"]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:97",className:"grid grid-cols-2 sm:grid-cols-4 gap-2 md:gap-4 mb-4 md:mb-6",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:98",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:99",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:100",className:"w-10 h-10 rounded-lg bg-[#0781fe]/10 flex items-center justify-center",children:e.jsx(He,{"data-loc":"client/src/components/admin/AdminLottery.tsx:101",className:"w-5 h-5 text-[#0781fe]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:103",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:104",className:"text-2xl font-bold text-white",children:l.data?.total??f}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:105",className:"text-xs text-white/50",children:"Total Entries"})]})]})}
4),e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:109",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:110",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:111",className:"w-10 h-10 rounded-lg bg-[#0781fe]/10 flex items-center justify-center",children:e.jsx(Xn,{"data-loc":"client/src/components/admin/AdminLottery.tsx:112",className:"w-5 h-5 text-[#0781fe]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:114",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:115",className:"text-2xl font-bold text-white",children:l.data?.entered??0}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:116",className:"text-xs text-white/50",children:"Active Entries"})]})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:120",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:121",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:122",className:"w-10 h-10 rounded-lg bg-[#4ade80]/10 flex items-center justify-center",children:e.jsx(Dt,{"data-loc":"client/src/components/admin/AdminLottery.tsx:123",className:"w-5 h-5 text-[#4ade80]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:125",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:126",className:"text-2xl font-bold text-white",children:l.data?.winner??0}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:127",className:"text-xs text-white/50",children:"Winners"})]})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:131",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:132",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:133",className:"w-10 h-10 rounded-lg bg-[#fbbf24]/10 flex items-center justify-center",children:e.jsx(Xn,{"data-loc":"client/src/components/admin/AdminLottery.tsx:134",className:"w-5 h-5 text-[#fbbf24]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:136",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:137",className:"text-2xl font-bold text-white",children:"NEW60"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminLottery.tsx:138",className:"text-xs text-white/50",children:"Code Offered"})]})]})})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:145",className:"flex gap-2 mb-4 flex-wrap",children:[void 0,"entered","winner","notified"].map(p=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminLottery.tsx:147",onClick:()=>{i(p),a(1)},className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${s===p?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/50 hover:text-white hover:bg-white/10"}`,children:p?p.charAt(0).toUpperCase()+p.slice(1):"All"},p??"all"))}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:162",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:164",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminLottery.tsx:165",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminLottery.tsx:166",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminLottery.tsx:167",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminLottery.tsx:168",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Email"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLottery.tsx:169",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Status"}
4),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLottery.tsx:170",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Draw Month"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLottery.tsx:171",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Country"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLottery.tsx:172",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Entry Date"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminLottery.tsx:173",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}),e.jsxs("tbody",{"data-loc":"client/src/components/admin/AdminLottery.tsx:176",children:[d.data?.items.map(p=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminLottery.tsx:178",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:179",className:"px-4 py-3 text-white font-medium",children:p.email}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:180",className:"px-4 py-3",children:e.jsxs("select",{"data-loc":"client/src/components/admin/AdminLottery.tsx:181",value:p.status,onChange:A=>x.mutate({id:p.id,status:A.target.value}),className:`text-xs font-medium px-2.5 py-1 rounded-full border-0 cursor-pointer ${sa[p.status]||""} bg-opacity-100`,style:{appearance:"auto"},children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminLottery.tsx:187",value:"entered",children:"Entered"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLottery.tsx:188",value:"winner",children:"Winner"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLottery.tsx:189",value:"notified",children:"Notified"})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:192",className:"px-4 py-3 text-white/50 text-xs",children:p.drawMonth}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:193",className:"px-4 py-3 text-white/50 text-xs",children:p.country||"â"}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:194",className:"px-4 py-3 text-white/50 text-xs flex items-center gap-1.5",children:[e.jsx(xs,{"data-loc":"client/src/components/admin/AdminLottery.tsx:195",className:"w-3.5 h-3.5"}),new Date(p.createdAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:198",className:"px-4 py-3 text-right",children:e.jsx("button",{"data-loc":"client/src/components/admin/AdminLottery.tsx:199",onClick:()=>{confirm("Remove this lottery entry?")&&m.mutate({id:p.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminLottery.tsx:203",className:"w-3.5 h-3.5"})})})]},p.id)),d.data?.items.length===0&&e.jsx("tr",{"data-loc":"client/src/components/admin/AdminLottery.tsx:209",children:e.jsxs("td",{"data-loc":"client/src/components/admin/AdminLottery.tsx:210",colSpan:6,className:"px-4 py-12 text-center text-white/50",children:[e.jsx(Dt,{"data-loc":"client/src/components/admin/AdminLottery.tsx:211",className:"w-8 h-8 mx-auto mb-2 opacity-30"}),"No lottery entries yet."]})})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:220",className:"md:hidden divide-y divide-white/5",children:[d.data?.items.map(p=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:222",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:223",className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminLottery.tsx:224",className:"text-sm font-medium text-white truncate max-w-[200px]",children:p.email}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminLottery.tsx:225",onClick:()=>{confirm("Remove this lottery entry?")&&m.mutate({id:p.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/40 hover:text-red-400 transition-colors shrink-0",children:e.jsx(me,{"data-loc":"client/src/components/
4admin/AdminLottery.tsx:229",className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:232",className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("select",{"data-loc":"client/src/components/admin/AdminLottery.tsx:233",value:p.status,onChange:A=>x.mutate({id:p.id,status:A.target.value}),className:`text-[10px] font-medium px-2 py-0.5 rounded-full border-0 cursor-pointer ${sa[p.status]||""}`,style:{appearance:"auto"},children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminLottery.tsx:239",value:"entered",children:"Entered"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLottery.tsx:240",value:"winner",children:"Winner"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminLottery.tsx:241",value:"notified",children:"Notified"})]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminLottery.tsx:243",className:"text-[10px] text-white/30",children:p.drawMonth}),p.country&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminLottery.tsx:244",className:"text-[10px] text-white/30",children:p.country}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminLottery.tsx:245",className:"text-[10px] text-white/30",children:new Date(p.createdAt).toLocaleDateString()})]})]},p.id)),d.data?.items.length===0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:250",className:"p-8 text-center text-white/50 text-sm",children:[e.jsx(Dt,{"data-loc":"client/src/components/admin/AdminLottery.tsx:251",className:"w-6 h-6 mx-auto mb-2 opacity-30"}),"No lottery entries yet."]})]}),b>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:259",className:"flex items-center justify-between px-3 md:px-4 py-2.5 md:py-3 border-t border-white/10",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminLottery.tsx:260",className:"text-[10px] md:text-xs text-white/60",children:["Page ",n,"/",b," (",d.data?.total,")"]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminLottery.tsx:263",className:"flex gap-1",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminLottery.tsx:264",variant:"outline",size:"sm",onClick:()=>a(p=>Math.max(1,p-1)),disabled:n===1,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminLottery.tsx:271",className:"w-3.5 h-3.5 md:w-4 md:h-4"})}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminLottery.tsx:273",variant:"outline",size:"sm",onClick:()=>a(p=>Math.min(b,p+1)),disabled:n===b,className:"h-7 md:h-8 border-white/10 text-white/50",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminLottery.tsx:280",className:"w-3.5 h-3.5 md:w-4 md:h-4"})})]})]})]})]})}function Qi({orderId:t,orderType:n="direct",onBack:a}){const{data:s,isLoading:i,error:o}=j.revenue.getOrderById.useQuery({id:t,orderType:n}),[c,d]=h.useState(null),[l,x]=h.useState(null),r=j.revenue.resendPaymentLink.useMutation({onSuccess:D=>{D.success&&D.paymentUrl?(d(D.paymentUrl),x(null)):x(D.error||"Failed to generate payment link")},onError:D=>{x(D.message)}}),m=j.tracking.rerunAttribution.useMutation({onSuccess:D=>{alert(D.message||"Attribution re-run complete")},onError:D=>{alert(`Error: ${D.message}`)}}),[b,f]=h.useState(null),p=j.revenue.retryAxceraWebhook.useMutation({onSuccess:D=>{f(D)},onError:D=>{f({success:!1,error:D.message})}}),[A,g]=h.useState(null),w=j.revenue.markAsCompleted.useMutation({onSuccess:D=>{g(D)},onError:D=>{g({success:!1,error:D.message})}}),[C,v]=h.useState(null),P=j.revenue.generateRetryLinkWithDiscount.useMutation({onSuccess:D=>{D.success?v({paymentUrl:D.paymentUrl,emailSent:D.emailSent,originalPrice:D.originalPrice,discountedPrice:D.discountedPrice}):v({error:D.error||"Failed to generate discount link"})},onError:D=>{v({error:D.message})}});if(i)return e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:78",className:"flex items-center justify-center py-20",children:e.jsx(Ce,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:79",className:"w-6 h-6 animate-spin text-white/40"})});if(o||!s)return e.jsxs("div",{"data-loc":"client/src/components/
4admin/AdminOrderDetail.tsx:86",className:"flex flex-col items-center justify-center py-20 gap-4",children:[e.jsx(Ts,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:87",className:"w-8 h-8 text-red-400"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:88",className:"text-white/60 text-sm",children:"Order not found"}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:89",onClick:a,className:"text-[#0b6fd9] text-sm hover:underline flex items-center gap-1",children:[e.jsx(mn,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:90",className:"w-4 h-4"})," Back to orders"]})]});const u={completed:{icon:Ge,color:"text-[#4ade80]",bg:"bg-[#4ade80]/10",border:"border-[#4ade80]/20",label:"Completed"},pending:{icon:Ve,color:"text-[#f59e0b]",bg:"bg-[#f59e0b]/10",border:"border-[#f59e0b]/20",label:"Pending"},failed:{icon:vt,color:"text-[#ef4444]",bg:"bg-[#ef4444]/10",border:"border-[#ef4444]/20",label:"Failed"}},y=u[s.status]||u.pending,S=y.icon,B=(()=>{if(s.status!=="failed")return null;if(s.failureReason)return s.failureReason;if(s.axceraWebhookResponse)try{const D=JSON.parse(s.axceraWebhookResponse);if(D.error||D.message||D.reason)return D.error||D.message||D.reason}catch{if(s.axceraWebhookResponse.toLowerCase().includes("error"))return s.axceraWebhookResponse}return s.transactionId?"Payment was rejected by the payment processor. The card may have been declined due to insufficient funds, fraud protection, or 3D Secure authentication failure.":"Payment was never initiated â customer likely abandoned checkout before completing payment on the Paytiko gateway."})(),E=s.addons;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:142",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:144",className:"flex items-center gap-4 mb-6",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:145",onClick:a,className:"h-9 w-9 flex items-center justify-center rounded-lg border border-white/10 hover:bg-white/5 transition-colors",children:e.jsx(mn,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:149",className:"w-4 h-4 text-white/60"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:151",className:"flex-1",children:[e.jsxs("h1",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:152",className:"text-xl font-bold text-white",children:["Order #",s.orderNumber||s.id]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:153",className:"text-xs text-white/40 mt-0.5",children:s.merchantOrderId})]}),n==="direct"&&e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:158",onClick:()=>m.mutate({orderId:s.id,orderType:"axcera"}),disabled:m.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-white/10 bg-white/5 text-white/60 hover:text-white hover:bg-white/10 transition-colors disabled:opacity-50",children:[e.jsx(qe,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:163",className:`w-3.5 h-3.5 ${m.isPending?"animate-spin":""}`}),m.isPending?"Running...":"Re-run Attribution"]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:167",className:`flex items-center gap-2 px-3 py-1.5 rounded-full border ${y.bg} ${y.border}`,children:[e.jsx(S,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:168",className:`w-4 h-4 ${y.color}`}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:169",className:`text-sm font-medium ${y.color}`,children:y.label})]})]}),s.status==="failed"&&B&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:175",className:"bg-[#ef4444]/5 border border-[#ef4444]/20 rounded-xl p-4 mb-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:176",className:"flex items-start gap-3",children:[e.jsx(Ts,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:177",className:"w-5 h-5 text-[#ef4444] mt-0.5 shrink-0"}
4),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:178",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:179",className:"text-sm font-semibold text-[#ef4444] mb-1",children:"Payment Failed"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:180",className:"text-sm text-white/70",children:B}),s.transactionId&&e.jsxs("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:182",className:"text-xs text-white/40 mt-2",children:["Transaction ID: ",s.transactionId]})]})]})}),(s.status==="pending"||s.status==="failed")&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:191",className:"bg-[#f59e0b]/5 border border-[#f59e0b]/20 rounded-xl p-4 mb-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:192",className:"flex items-start gap-3",children:[e.jsx(Ve,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:193",className:"w-5 h-5 text-[#f59e0b] mt-0.5 shrink-0"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:194",className:"flex-1",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:195",className:"text-sm font-semibold text-[#f59e0b] mb-1",children:s.status==="pending"?"Payment Pending":"Payment Failed"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:198",className:"text-sm text-white/70 mb-3",children:s.transactionId?"Payment has been initiated but not yet confirmed by the processor. This may resolve automatically.":"Customer created the order but has not yet completed payment on the gateway. This is likely an abandoned checkout."}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:204",className:"pt-2 border-t border-[#f59e0b]/20",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:205",className:"text-xs text-white/50 mb-2",children:"If this payment was confirmed externally (e.g. in Paytiko dashboard), mark it as completed to trigger the Axcera webhook."}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:208",onClick:()=>w.mutate({orderId:s.id,orderType:n}),disabled:w.isPending,className:"flex items-center gap-2 px-4 py-2 bg-[#4ade80]/10 hover:bg-[#4ade80]/20 border border-[#4ade80]/30 text-[#4ade80] text-sm font-medium rounded-lg transition-colors disabled:opacity-50",children:[w.isPending?e.jsx(Ce,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:214",className:"w-4 h-4 animate-spin"}):e.jsx(Ge,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:216",className:"w-4 h-4"}),w.isPending?"Processing...":"Mark as Completed"]}),A&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:221",className:`mt-2 text-xs p-2 rounded ${A.success?"bg-[#4ade80]/10 text-[#4ade80]":"bg-[#ef4444]/10 text-[#ef4444]"}`,children:[A.success?`Order marked as completed. Axcera webhook sent (HTTP ${A.statusCode})`:`Failed: ${A.error||`HTTP ${A.statusCode}`}`,A.response&&e.jsx("pre",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:227",className:"mt-1 text-[10px] opacity-70 font-mono whitespace-pre-wrap",children:A.response})]})]})]})]})}),s.status==="failed"&&n==="direct"&&s.retryCount>0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:239",className:"bg-[#8b5cf6]/5 border border-[#8b5cf6]/20 rounded-xl p-4 mb-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:240",className:"flex items-start gap-3",children:[e.jsx(qe,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:241",className:"w-5 h-5 text-[#8b5cf6] mt-0.5 shrink-0"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:242",className:"flex-1",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:243",className:"text-sm font-semibold text-[#8b5cf6] mb-1",children:"Auto-Retry Sent (5% Discount)"}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:244",className:"text-xs text-white/60 mb-2",children:["A retry payment link was automatically generated
4with a 5% discount (",s.retryTotal?`$${s.retryTotal}`:""," instead of $",s.total,") so the bank sees a different amount. The customer was notified via email."]}),s.retryPaymentUrl&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:250",className:"flex items-center gap-2 bg-black/30 border border-white/10 rounded-lg px-3 py-2",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:251",type:"text",value:s.retryPaymentUrl,readOnly:!0,className:"flex-1 bg-transparent text-xs text-white/80 font-mono outline-none"}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:257",onClick:()=>navigator.clipboard.writeText(s.retryPaymentUrl),className:"shrink-0 p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy retry link",children:e.jsx(In,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:262",className:"w-3.5 h-3.5 text-white/60"})}),e.jsx("a",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:264",href:s.retryPaymentUrl,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 p-1.5 hover:bg-white/10 rounded transition-colors",title:"Open in new tab",children:e.jsx(Bn,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:271",className:"w-3.5 h-3.5 text-white/60"})})]}),s.retryAt&&e.jsxs("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:276",className:"text-[10px] text-white/40 mt-2",children:["Retry generated: ",new Date(s.retryAt).toLocaleString()]})]})]})}),n==="direct"&&(s.status==="pending"||s.status==="failed")&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:285",className:"bg-[#0b6fd9]/5 border border-[#0b6fd9]/20 rounded-xl p-4 mb-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:286",className:"flex items-start gap-3",children:[e.jsx(ms,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:287",className:"w-5 h-5 text-[#0b6fd9] mt-0.5 shrink-0"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:288",className:"flex-1",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:289",className:"text-sm font-semibold text-[#0b6fd9] mb-1",children:"Resend Payment Link"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:290",className:"text-xs text-white/60 mb-3",children:"Generate a fresh payment link for this order. You can copy it and send to the customer via email or chat."}),c?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:307",className:"space-y-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:308",className:"flex items-center gap-2 bg-black/30 border border-white/10 rounded-lg px-3 py-2",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:309",type:"text",value:c,readOnly:!0,className:"flex-1 bg-transparent text-xs text-white/80 font-mono outline-none"}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:315",onClick:()=>navigator.clipboard.writeText(c),className:"shrink-0 p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy to clipboard",children:e.jsx(In,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:320",className:"w-3.5 h-3.5 text-white/60"})}),e.jsx("a",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:322",href:c,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 p-1.5 hover:bg-white/10 rounded transition-colors",title:"Open in new tab",children:e.jsx(Bn,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:329",className:"w-3.5 h-3.5 text-white/60"})})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:332",className:"text-[10px] text-[#4ade80]",children:"Payment link generated successfully. Send this to the customer."})]}):e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:294",onClick:()=>r.mutate({orderId:s.id}),disabled:r.isPending,className:"flex items-center gap-2 px-4 py-2 bg-[#0b6fd9] hover:bg-[#0b6fd9]/80 disabled:opacity-50 text-white text-sm font-medium rounded-lg transition-colors",children:[r.isPending?e.jsx(Ce,{"data-loc":"client/src/components/
4admin/AdminOrderDetail.tsx:300",className:"w-4 h-4 animate-spin"}):e.jsx(qe,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:302",className:"w-4 h-4"}),"Generate New Payment Link"]}),l&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:336",className:"text-xs text-[#ef4444] mt-2",children:l})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:343",className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:345",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:346",className:"flex items-center gap-2 mb-4",children:[e.jsx(Rc,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:347",className:"w-4 h-4 text-[#0b6fd9]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:348",className:"text-sm font-semibold text-white",children:"Customer Information"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:350",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:351",label:"Name",value:`${s.firstName} ${s.lastName}`}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:352",label:"Email",value:s.email,icon:Xn,copyable:!0}),s.phone&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:353",label:"Phone",value:s.phone,icon:Mc}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:354",label:"Country",value:Rm(s.country||""),icon:It})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:359",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:360",className:"flex items-center gap-2 mb-4",children:[e.jsx($a,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:361",className:"w-4 h-4 text-[#0b6fd9]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:362",className:"text-sm font-semibold text-white",children:"Billing Address"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:364",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:365",label:"Street",value:s.address||"â"}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:366",label:"City",value:s.city||"â"}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:367",label:"State",value:s.state||"â"}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:368",label:"Postcode",value:s.postcode||"â"}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:369",label:"Country",value:s.country||"â"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:374",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:375",className:"flex items-center gap-2 mb-4",children:[e.jsx(es,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:376",className:"w-4 h-4 text-[#f59e0b]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:377",className:"text-sm font-semibold text-white",children:"Product Details"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:379",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:380",label:"Product",value:s.productName}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:381",label:"Quantity",value:String(s.quantity)}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:382",label:"Base Price",value:`$${s.basePrice.toFixed(2)}`}),E&&E.length>0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:384",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:385",className:"text-xs text-white/40 block mb-1",children:"Add-ons:"}),E.map((D,K)=>
4e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:387",className:"flex items-center justify-between text-xs ml-2 py-0.5",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:388",className:"text-white/60",children:D.label}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:389",className:"text-white/80",children:D.amount>0?`+$${D.amount.toFixed(2)}`:"Included"})]},K))]})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:398",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:399",className:"flex items-center gap-2 mb-4",children:[e.jsx(ls,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:400",className:"w-4 h-4 text-[#4ade80]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:401",className:"text-sm font-semibold text-white",children:"Pricing Breakdown"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:403",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:404",label:"Base Price",value:`$${s.basePrice.toFixed(2)}`}),E&&E.length>0&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:406",label:"Add-ons Total",value:`+$${E.reduce((D,K)=>D+(K.amount||0),0).toFixed(2)}`}),s.couponCode&&e.jsxs(e.Fragment,{children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:413",label:"Coupon",value:s.couponCode.toUpperCase(),highlight:!0}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:414",label:"Discount",value:s.discountAmount?`-$${Number(s.discountAmount).toFixed(2)}`:"â",valueColor:"text-[#4ade80]"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:425",className:"border-t border-white/10 pt-3 mt-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:426",className:"flex items-center justify-between",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:427",className:"text-sm font-semibold text-white",children:"Total Charged"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:428",className:"text-lg font-bold text-white",children:["$",s.total.toFixed(2)]})]})})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:435",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:436",className:"flex items-center gap-2 mb-4",children:[e.jsx(it,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:437",className:"w-4 h-4 text-[#8b5cf6]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:438",className:"text-sm font-semibold text-white",children:"Payment Information"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:440",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:441",label:"Method",value:Dm(s.paymentMethod)}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:442",label:"Status",value:s.status.charAt(0).toUpperCase()+s.status.slice(1)}),s.transactionId&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:444",label:"Transaction ID",value:s.transactionId,copyable:!0,mono:!0}),!s.transactionId&&s.status!=="completed"&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:447",label:"Transaction ID",value:"Not available â payment not processed",valueColor:"text-white/30"})]})]}),s.cardBin&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:454",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:455",className:"flex items-center gap-2 mb-4",children:[e.jsx(it,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:456",className:"w-4 h-4 text-[#f59e0b]"}
4),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:457",className:"text-sm font-semibold text-white",children:"Card Intelligence"}),s.binRiskScore!==null&&s.binRiskScore!==void 0&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:459",className:`ml-auto text-[10px] font-bold px-2 py-0.5 rounded-full ${s.binRiskScore>=70?"bg-red-500/20 text-red-400":s.binRiskScore>=45?"bg-orange-500/20 text-orange-400":s.binRiskScore>=25?"bg-yellow-500/20 text-yellow-400":"bg-green-500/20 text-green-400"}`,children:["Risk: ",s.binRiskScore,"/100"]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:469",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:470",label:"BIN",value:s.cardBin,mono:!0}),s.cardScheme&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:472",label:"Scheme",value:s.cardScheme.toUpperCase()}),s.cardType&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:475",label:"Card Type",value:s.cardType==="prepaid"?"â ï¸ PREPAID":s.cardType.charAt(0).toUpperCase()+s.cardType.slice(1),valueColor:s.cardType==="prepaid"?"text-orange-400":void 0}),s.cardCountry&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:482",label:"Issuing Country",value:s.cardCountry}),s.cardIssuer&&s.cardIssuer!=="Unknown"&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:485",label:"Issuer",value:s.cardIssuer}),s.isPrepaid&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:488",className:"mt-2 p-2 bg-orange-500/10 border border-orange-500/20 rounded-lg",children:e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:489",className:"text-[11px] text-orange-400",children:"â ï¸ Prepaid/gift card â higher chargeback risk, limited balance"})})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:497",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:498",className:"flex items-center gap-2 mb-4",children:[e.jsx(Tc,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:499",className:"w-4 h-4 text-[#22d3ee]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:500",className:"text-sm font-semibold text-white",children:"Fulfillment"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:502",className:"space-y-3",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:503",label:"Axcera Webhook",value:s.axceraWebhookSent?"Sent":"Not sent",valueColor:s.axceraWebhookSent?"text-[#4ade80]":"text-white/40"}),s.axceraWebhookStatusCode!==null&&s.axceraWebhookStatusCode!==void 0&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:509",label:"Response Code",value:String(s.axceraWebhookStatusCode)}),s.axceraWebhookResponse&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:512",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:513",className:"text-xs text-white/40 block mb-1",children:"Webhook Response:"}),e.jsx("pre",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:514",className:"text-[10px] text-white/50 bg-black/30 rounded p-2 overflow-x-auto max-h-32 overflow-y-auto font-mono",children:s.axceraWebhookResponse})]}),(s.status==="completed"||n==="reset"||n==="activation")&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:521",className:"pt-3 border-t border-white/10",children:[e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:522",onClick:()=>p.mutate({orderId:s.id,orderType:n}),disabled:p.isPending,className:"flex items-center gap-2 px-4 py-2 bg-[#22d3ee]/10 hover:bg-[#22d3ee]/20 border border-[#22d3ee]/30 text-[#22d3ee] text-sm font-medium rounded-lg transition-colors disabled:opacity-50",children:[p.isPending?e.jsx(Ce,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:528",className:"w-4 h-4 animate-spin"}
4):e.jsx(Wc,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:530",className:"w-4 h-4"}),p.isPending?"Sending...":"Retry Axcera Webhook"]}),b&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:535",className:`mt-2 text-xs p-2 rounded ${b.success?"bg-[#4ade80]/10 text-[#4ade80]":"bg-[#ef4444]/10 text-[#ef4444]"}`,children:[b.success?`Webhook sent successfully (HTTP ${b.statusCode})`:`Failed: ${b.error||`HTTP ${b.statusCode}`}`,b.response&&e.jsx("pre",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:541",className:"mt-1 text-[10px] opacity-70 font-mono whitespace-pre-wrap",children:b.response})]})]})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:551",className:"bg-[#141414] border border-white/10 rounded-xl p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:552",className:"flex items-center gap-2 mb-4",children:[e.jsx(ts,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:553",className:"w-4 h-4 text-[#a78bfa]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:554",className:"text-sm font-semibold text-white",children:"Retry with Discount"})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:556",className:"text-xs text-white/60 mb-3",children:"Generate a new payment link with 5% off and auto-email it to the trader."}),C?.paymentUrl?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:573",className:"space-y-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:574",className:"flex items-center gap-2 bg-black/30 border border-white/10 rounded-lg px-3 py-2",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:575",type:"text",value:C.paymentUrl,readOnly:!0,className:"flex-1 bg-transparent text-xs text-white/80 font-mono outline-none"}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:581",onClick:()=>navigator.clipboard.writeText(C.paymentUrl),className:"shrink-0 p-1.5 hover:bg-white/10 rounded transition-colors",title:"Copy to clipboard",children:e.jsx(In,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:586",className:"w-3.5 h-3.5 text-white/60"})}),e.jsx("a",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:588",href:C.paymentUrl,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 p-1.5 hover:bg-white/10 rounded transition-colors",title:"Open in new tab",children:e.jsx(Bn,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:595",className:"w-3.5 h-3.5 text-white/60"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:598",className:"flex items-center gap-3 text-xs",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:599",className:"text-white/50",children:["Was $",C.originalPrice," â Now ",e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:599",className:"text-[#4ade80] font-semibold",children:["$",C.discountedPrice]})]}),C.emailSent&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:601",className:"text-[#4ade80] flex items-center gap-1",children:[e.jsx(Ge,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:602",className:"w-3.5 h-3.5"})," Email sent to trader"]})]})]}):e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:560",onClick:()=>P.mutate({orderId:s.id,orderType:n,discountPercent:5}),disabled:P.isPending,className:"flex items-center gap-2 px-4 py-2 bg-[#a78bfa]/10 hover:bg-[#a78bfa]/20 border border-[#a78bfa]/30 text-[#a78bfa] text-sm font-medium rounded-lg transition-colors disabled:opacity-50",children:[P.isPending?e.jsx(Ce,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:566",className:"w-4 h-4 animate-spin"}):e.jsx(ts,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:568",className:"w-4 h-4"}),P.isPending?"Generating...":"Generate 5% Off Link & Email"]}
4),C?.error&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:609",className:"text-xs text-[#ef4444] mt-2",children:C.error})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:614",className:"bg-[#141414] border border-white/10 rounded-xl p-5 lg:col-span-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:615",className:"flex items-center gap-2 mb-4",children:[e.jsx(Ve,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:616",className:"w-4 h-4 text-white/50"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:617",className:"text-sm font-semibold text-white",children:"Tracking & Timestamps"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:619",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:620",label:"Created",value:new Date(s.createdAt).toLocaleString()}),s.updatedAt&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:621",label:"Updated",value:new Date(s.updatedAt).toLocaleString()}),s.paidAt&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:622",label:"Paid",value:new Date(s.paidAt).toLocaleString()}),s.t360Ref&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:623",label:"T360 Ref",value:s.t360Ref,mono:!0}),s.t360Tracking&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:625",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:626",className:"text-xs text-white/40 block mb-1",children:"T360 Tracking:"}),e.jsx("pre",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:627",className:"text-[10px] text-white/50 bg-black/30 rounded p-2 overflow-x-auto max-h-20 overflow-y-auto font-mono",children:s.t360Tracking})]}),e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:632",label:"Order ID",value:`#${s.id}`,icon:_c}),s.variationId&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:633",label:"Variation ID",value:String(s.variationId)}),s.accountId&&e.jsx($,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:634",label:"Account ID",value:s.accountId,mono:!0,copyable:!0})]})]})]})]})}function $({label:t,value:n,icon:a,copyable:s,mono:i,highlight:o,valueColor:c}){const d=()=>{navigator.clipboard.writeText(n)};return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:664",className:"flex items-start justify-between gap-4",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:665",className:"text-xs text-white/40 shrink-0 flex items-center gap-1.5",children:[a&&e.jsx(a,{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:666",className:"w-3 h-3"}),t]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrderDetail.tsx:669",className:`text-xs text-right break-all ${c||"text-white/80"} ${i?"font-mono":""} ${o?"bg-white/5 border border-white/10 px-1.5 py-0.5 rounded":""} ${s?"cursor-pointer hover:text-white":""}`,onClick:s?d:void 0,title:s?"Click to copy":void 0,children:n})]})}function Dm(t){return{paytiko:"Credit/Debit Card (Paytiko)",crypto:"Cryptocurrency","apple-pay":"Apple Pay (via Paytiko)",paypal:"PayPal"}[t]||t}function Rm(t){try{const n=new Intl.DisplayNames(["en"],{type:"region"}).of(t.toUpperCase());return n?`${n} (${t.toUpperCase()})`:t}catch{return t}}const Mm={light:"",dark:".dark"},Zi=h.createContext(null);function Tm(){const t=h.useContext(Zi);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}function Pe({id:t,className:n,children:a,config:s,...i}){const o=h.useId(),c=`chart-${t||o.replace(/:/g,"")}`;return e.jsx(Zi.Provider,{"data-loc":"client/src/components/ui/chart.tsx:51",value:{config:s},children:e.jsxs("div",{"data-loc":"client/src/components/ui/chart.tsx:52","data-slot":"chart","data-chart":c,className:M("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",n),...i,children:[e.jsx(Wm,{"data-loc":"client/src/components/ui/chart.tsx:61",id:c,config:s}),e.jsx(ur,{"data-loc":"client/src/components/ui/chart.tsx:62",children:a})]})})}const Wm=({id:t,config:n})=>{const a=Object.entries(n).filter(([,s])=>s.theme||s.color);return a.length?e.jsx("style",{"data-loc":"client/src/components/ui/chart.tsx:80",dangerouslySetInnerHTML:{__html:Object.entries(Mm).map(([s,i])=>` 5${i} [data-chart=${t}] { 6${a.map(([o,c])=>{const d=c.theme?.[s]||c.color;return d?` --color-${o}: ${d};`:null}).join(` 7`)} 8} 9`).join(` 10`)}}):null},Se=xr;function $e({active:t,payload:n,className:a,indicator:s="dot",hideLabel:i=!1,hideIndicator:o=!1,label:c,labelFormatter:d,labelClassName:l,formatter:x,color:r,nameKey:m,labelKey:b}){const{config:f}=Tm(),p=h.useMemo(()=>
10{if(i||!n?.length)return null;const[g]=n,w=`${b||g?.dataKey||g?.name||"value"}`,C=aa(f,g,w),v=!b&&typeof c=="string"?f[c]?.label||c:C?.label;return d?e.jsx("div",{"data-loc":"client/src/components/ui/chart.tsx:144",className:M("font-medium",l),children:d(v,n)}):v?e.jsx("div",{"data-loc":"client/src/components/ui/chart.tsx:154",className:M("font-medium",l),children:v}):null},[c,d,n,i,l,f,b]);if(!t||!n?.length)return null;const A=n.length===1&&s!=="dot";return e.jsxs("div",{"data-loc":"client/src/components/ui/chart.tsx:172",className:M("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",a),children:[A?null:p,e.jsx("div",{"data-loc":"client/src/components/ui/chart.tsx:179",className:"grid gap-1.5",children:n.filter(g=>g.type!=="none").map((g,w)=>{const C=`${m||g.name||g.dataKey||"value"}`,v=aa(f,g,C),P=r||g.payload.fill||g.color;return e.jsx("div",{"data-loc":"client/src/components/ui/chart.tsx:188",className:M("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",s==="dot"&&"items-center"),children:x&&g?.value!==void 0&&g.name?x(g.value,g.name,g,w,g.payload):e.jsxs(e.Fragment,{children:[v?.icon?e.jsx(v.icon,{"data-loc":"client/src/components/ui/chart.tsx:200"}):!o&&e.jsx("div",{"data-loc":"client/src/components/ui/chart.tsx:203",className:M("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":s==="dot","w-1":s==="line","w-0 border-[1.5px] border-dashed bg-transparent":s==="dashed","my-0.5":A&&s==="dashed"}),style:{"--color-bg":P,"--color-border":P}}),e.jsxs("div",{"data-loc":"client/src/components/ui/chart.tsx:223",className:M("flex flex-1 justify-between leading-none",A?"items-end":"items-center"),children:[e.jsxs("div",{"data-loc":"client/src/components/ui/chart.tsx:229",className:"grid gap-1.5",children:[A?p:null,e.jsx("span",{"data-loc":"client/src/components/ui/chart.tsx:231",className:"text-muted-foreground",children:v?.label||g.name})]}),g.value&&e.jsx("span",{"data-loc":"client/src/components/ui/chart.tsx:236",className:"text-foreground font-mono font-medium tabular-nums",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})}function aa(t,n,a){if(typeof n!="object"||n===null)return;const s="payload"in n&&typeof n.payload=="object"&&n.payload!==null?n.payload:void 0;let i=a;return a in n&&typeof n[a]=="string"?i=n[a]:s&&a in s&&typeof s[a]=="string"&&(i=s[a]),i in t?t[i]:t[a]}function _m(t,n,a="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:a}).format(n).split(/\s/g).slice(2).join(" ")}const Lm={},Mt={};function at(t,n){try{const s=(Lm[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(n).split("GMT")[1];return s in Mt?Mt[s]:ia(s,s.split(":"))}catch{if(t in Mt)return Mt[t];const a=t?.match(Em);return a?ia(t,a.slice(1)):NaN}}const Em=/([+-]\d\d):?(\d\d)?/;function ia(t,n){const a=+(n[0]||0),s=+(n[1]||0),i=+(n[2]||0)/60;return Mt[t]=a*60+s>0?a*60+s+i:a*60-s-i}class Oe extends Date{constructor(...n){super(),n.length>1&&typeof n[n.length-1]=="string"&&(this.timeZone=n.pop()),this.internal=new Date,isNaN(at(this.timeZone,this))?this.setTime(NaN):n.length?typeof n[0]=="number"&&(n.length===1||n.length===2&&typeof n[1]!="number")?this.setTime(n[0]):typeof n[0]=="string"?this.setTime(+new Date(n[0])):n[0]instanceof Date?this.setTime(+n[0]):(this.setTime(+new Date(...n)),Ji(this),ds(this)):this.setTime(Date.now())}static tz(n,...a){return a.length?new Oe(...a,n):new Oe(Date.now(),n)}withTimeZone(n){return new Oe(+this,n)}getTimezoneOffset(){const n=-at(this.timeZone,this);return n>0?Math.floor(n):Math.ceil(n)}setTime(n){return Date.prototype.setTime.apply(this,arguments),ds(this),+this}[Symbol.for("constructDateFrom")](n){return new Oe(+new Date(n),this.timeZone)}}const oa=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!oa.test(t))return;const n=t.replace(oa,"$1UTC");Oe.prototype[n]&&(t.startsWith("get")?Oe.prototype[t]=function(){return this.internal[n]()}:(Oe.prototype[t]=function(){return Date.prototype[n].apply(this.internal,arguments),Im(this),+this},Oe.prototype[n]=function(){return Date.prototype[n].apply(this,arguments),ds(this),+this}))});function ds(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-at(t.timeZone,t)*60))}function Im(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),Ji(t)}function Ji(t){const n=at(t.timeZone,t),a=n>0?Math.floor(n):Math.ceil(n),s=new Date(+t);s.setUTCHours(s.getUTCHours()-1);const i=-new Date(+t).getTimezoneOffset(),o=-new Date(+s).getTimezoneOffset(),c=i-o,d=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();c&&d&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+c);const l=i-a;l&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);const x=new Date(+t);x.setUTCSeconds(0);const r=i>0?x.getSeconds():(x.getSeconds()-60)%60,m=Math.round(-(at(t.timeZone,t)*60))%60;(m||r)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+r));const b=at(t.timeZone,t),f=b>0?Math.floor(b):Math.ceil(b),A=-new Date(+t).getTimezoneOffset()-f,g=f!==a,w=A-l;if(g&&w){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+w);const C=at(t.timeZone,t),v=C>0?Math.floor(C):Math.ceil(C),P=f-v;P&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+P),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+P))}}class oe extends Oe{static tz(n,...a){return a.length?new oe(...a,n):new oe(Date.now(),n)}toISOString(){const[n,a,s]=this.tzComponents(),i=`${n}${a}:${s}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()}
10 ${this.toTimeString()}`}toDateString(){const[n,a,s,i]=this.internal.toUTCString().split(" ");return`${n?.slice(0,-1)} ${s} ${a} ${i}`}toTimeString(){const n=this.internal.toUTCString().split(" ")[4],[a,s,i]=this.tzComponents();return`${n} GMT${a}${s}${i} (${_m(this.timeZone,this)})`}toLocaleString(n,a){return Date.prototype.toLocaleString.call(this,n,{...a,timeZone:a?.timeZone||this.timeZone})}toLocaleDateString(n,a){return Date.prototype.toLocaleDateString.call(this,n,{...a,timeZone:a?.timeZone||this.timeZone})}toLocaleTimeString(n,a){return Date.prototype.toLocaleTimeString.call(this,n,{...a,timeZone:a?.timeZone||this.timeZone})}tzComponents(){const n=this.getTimezoneOffset(),a=n>0?"-":"+",s=String(Math.floor(Math.abs(n)/60)).padStart(2,"0"),i=String(Math.abs(n)%60).padStart(2,"0");return[a,s,i]}withTimeZone(n){return new oe(+this,n)}[Symbol.for("constructDateFrom")](n){return new oe(+new Date(n),this.timeZone)}}const Xi=6048e5,Bm=864e5,ca=Symbol.for("constructDateFrom");function ne(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&ca in t?t[ca](n):t instanceof Date?new t.constructor(n):new Date(n)}function G(t,n){return ne(n||t,t)}function eo(t,n,a){const s=G(t,a?.in);return isNaN(n)?ne(t,NaN):(n&&s.setDate(s.getDate()+n),s)}function to(t,n,a){const s=G(t,a?.in);if(isNaN(n))return ne(t,NaN);if(!n)return s;const i=s.getDate(),o=ne(t,s.getTime());o.setMonth(s.getMonth()+n+1,0);const c=o.getDate();return i>=c?o:(s.setFullYear(o.getFullYear(),o.getMonth(),i),s)}let Fm={};function Qt(){return Fm}function Nt(t,n){const a=Qt(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,i=G(t,n?.in),o=i.getDay(),c=(o<s?7:0)+o-s;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Ut(t,n){return Nt(t,{...n,weekStartsOn:1})}function no(t,n){const a=G(t,n?.in),s=a.getFullYear(),i=ne(a,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const o=Ut(i),c=ne(a,0);c.setFullYear(s,0,4),c.setHours(0,0,0,0);const d=Ut(c);return a.getTime()>=o.getTime()?s+1:a.getTime()>=d.getTime()?s:s-1}function ra(t){const n=G(t),a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),+t-+a}function kt(t,...n){const a=ne.bind(null,n.find(s=>typeof s=="object"));return n.map(a)}function Yt(t,n){const a=G(t,n?.in);return a.setHours(0,0,0,0),a}function so(t,n,a){const[s,i]=kt(a?.in,t,n),o=Yt(s),c=Yt(i),d=+o-ra(o),l=+c-ra(c);return Math.round((d-l)/Bm)}
10function $m(t,n){const a=no(t,n),s=ne(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),Ut(s)}function Um(t,n,a){return eo(t,n*7,a)}function Ym(t,n,a){return to(t,n*12,a)}function Km(t,n){let a,s=n?.in;return t.forEach(i=>{!s&&typeof i=="object"&&(s=ne.bind(null,i));const o=G(i,s);(!a||a<o||isNaN(+o))&&(a=o)}),ne(s,a||NaN)}function zm(t,n){let a,s=n?.in;return t.forEach(i=>{!s&&typeof i=="object"&&(s=ne.bind(null,i));const o=G(i,s);(!a||a>o||isNaN(+o))&&(a=o)}),ne(s,a||NaN)}function Gm(t,n,a){const[s,i]=kt(a?.in,t,n);return+Yt(s)==+Yt(i)}function ao(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Vm(t){return!(!ao(t)&&typeof t!="number"||isNaN(+G(t)))}function qm(t,n,a){const[s,i]=kt(a?.in,t,n),o=s.getFullYear()-i.getFullYear(),c=s.getMonth()-i.getMonth();return o*12+c}function Hm(t,n){const a=G(t,n?.in),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function io(t,n){const[a,s]=kt(t,n.start,n.end);return{start:a,end:s}}function Qm(t,n){const{start:a,end:s}=io(n?.in,t);let i=+a>+s;const o=i?+a:+s,c=i?s:a;c.setHours(0,0,0,0),c.setDate(1);let d=1;const l=[];for(;+c<=o;)l.push(ne(a,c)),c.setMonth(c.getMonth()+d);return i?l.reverse():l}function Zm(t,n){const a=G(t,n?.in);return a.setDate(1),a.setHours(0,0,0,0),a}function Jm(t,n){const a=G(t,n?.in),s=a.getFullYear();return a.setFullYear(s+1,0,0),a.setHours(23,59,59,999),a}function oo(t,n){const a=G(t,n?.in);return a.setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a}function Xm(t,n){const{start:a,end:s}=io(n?.in,t);let i=+a>+s;const o=i?+a:+s,c=i?s:a;c.setHours(0,0,0,0),c.setMonth(0,1);let d=1;const l=[];for(;+c<=o;)l.push(ne(a,c)),c.setFullYear(c.getFullYear()+d);return i?l.reverse():l}function co(t,n){const a=Qt(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,i=G(t,n?.in),o=i.getDay(),c=(o<s?-7:0)+6-(o-s);return i.setDate(i.getDate()+c),i.setHours(23,59,59,999),i}function ex(t,n){return co(t,{...n,weekStartsOn:1})}const tx={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"}},nx=(t,n,a)=>{let s;const i=tx[t];return typeof i=="string"?s=i:n===1?s=i.one:s=i.other.replace("{{count}}",n.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+s:s+" ago":s};function zn(t){return(n={})=>{const a=n.width?String(n.width):t.defaultWidth;return t.formats[a]||t.formats[t.defaultWidth]}}const sx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ax={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ix={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ox={date:zn({formats:sx,defaultWidth:"full"}),time:zn({formats:ax,defaultWidth:"full"}),dateTime:zn({formats:ix,defaultWidth:"full"})},cx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rx=(t,n,a,s)=>cx[t];function Pt(t){return(n,a)=>{const s=a?.context?String(a.context):"standalone";let i;if(s==="formatting"&&t.formattingValues){const c=t.defaultFormattingWidth||t.defaultWidth,d=a?.width?String(a.width):c;i=t.formattingValues[d]||t.formattingValues[c]}else{const c=t.defaultWidth,d=a?.width?String(a.width):t.defaultWidth;i=t.values[d]||t.values[c]}const o=t.argumentCallback?t.argumentCallback(n):n;return i[o]}}const dx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mx={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"]},xx={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","Frid
10ay","Saturday"]},ux={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"}},px={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"}},hx=(t,n)=>{const a=Number(t),s=a%100;if(s>20||s<10)switch(s%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},fx={ordinalNumber:hx,era:Pt({values:dx,defaultWidth:"wide"}),quarter:Pt({values:lx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Pt({values:mx,defaultWidth:"wide"}),day:Pt({values:xx,defaultWidth:"wide"}),dayPeriod:Pt({values:ux,defaultWidth:"wide",formattingValues:px,defaultFormattingWidth:"wide"})};function St(t){return(n,a={})=>{const s=a.width,i=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],o=n.match(i);if(!o)return null;const c=o[0],d=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(d)?gx(d,m=>m.test(c)):bx(d,m=>m.test(c));let x;x=t.valueCallback?t.valueCallback(l):l,x=a.valueCallback?a.valueCallback(x):x;const r=n.slice(c.length);return{value:x,rest:r}}}function bx(t,n){for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n(t[a]))return a}function gx(t,n){for(let a=0;a<t.length;a++)if(n(t[a]))return a}function Ax(t){return(n,a={})=>{const s=n.match(t.matchPattern);if(!s)return null;const i=s[0],o=n.match(t.parsePattern);if(!o)return null;let c=t.valueCallback?t.valueCallback(o[0]):o[0];c=a.valueCallback?a.valueCallback(c):c;const d=n.slice(i.length);return{value:c,rest:d}}}const vx=/^(\d+)(th|st|nd|rd)?/i,wx=/\d+/i,yx={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},jx={any:[/^b/i,/^(a|c)/i]},Nx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cx={any:[/1/i,/2/i,/3/i,/4/i]},kx={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},Px={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]},Sx={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},Ox={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]},Dx={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},Rx={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}},Mx={ordinalNumber:Ax({matchPattern:vx,parsePattern:wx,valueCallback:t=>parseInt(t,10)}),era:St({matchPatterns:yx,defaultMatchWidth:"wide",parsePatterns:jx,defaultParseWidth:"any"}),quarter:St({matchPatterns:Nx,defaultMatchWidth:"wide",parsePatterns:Cx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:St({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any"}),day:St({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Ox,defaultParseWidth:"any"}),dayPeriod:St({matchPatterns:Dx,defaultMatchWidth:"any",parsePatterns:Rx,defaultParseWidth:"any"})},ks={code:"en-US",formatDistance:nx,formatLong:ox,formatRelative:rx,localize:fx,match:Mx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Tx(t,n){const a=G(t,n?.in);return so(a,oo(a))+1}function ro(t,n){const a=G(t,n?.in),s=+Ut(a)-+$m(a);return Math.round(s/Xi)+1}function lo(t,n){const a=G(t,n?.in),s=a.getFullYear(),i=Qt(),o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=ne(n?.in||t,0);c.setFullYear(s+1,0,o),c.setHours(0,0,0,0);const d=Nt(c,n),l=ne(n?.in||t,0);l.setFullYear(s,0,o),l.setHours(0,0,0,0);const x=Nt(l,n);return+a>=+d?s+1:+a>=+x?s:s-1}function Wx(t,n){const a=Qt(),s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=lo(t,n),o=ne(n?.in||t,0);return o.setFullYear(i,0,s),o.setHours(0,0,0,0),Nt(o,n)}function mo(t,n){const a=G(t,n?.in),s=+Nt(a,n)-+Wx(a,n);return Math.round(s/Xi)+1}function z(t,n){const a=t<0?"-":"",s=Math.abs(t).toString().padStart(n,"0");return a+s}const Ye={y(t,n){const a=t.getFullYear(),s=a>0?a:1-a;return z(n==="yy"?s%100:s,n.length)},M(t,n){const a=t.getMonth();return n==="M"?String(a+1):z(a+1,2)},d(t,n){return z(t.getDate(),n.length)},a(t,n){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h(t,n){return z(t.getHours()%12||12,n.length)},H(t,n){return z(t.getHours(),n.length)},m(t,n){return z(t.getMinutes(),n.length)},s(t,n){return z(t.getSeconds(),n.length)},S(t,n){const a=n.length,s=t.getMilliseconds(),i=Math.trunc(s*Math.pow(10,a-3));return z(i,n.length)}},mt={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},da={G:function(t,n,a){const s=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return a.era(s,{width:"abbreviated"});case"GGGGG":return a.era(s,{width:"narrow"});case"GGGG":default:return a.era(s,{width:"wide"})}},y:function(t,n,a){if(n==="yo"){const s=t.getFullYear(),i=s>0?s:1-s;return a.ordinalNumber(i,{unit:"year"})}return Ye.y(t,n)},Y:function(t,n,a,s){const i=lo(t,s),o=i>0?i:1-i;if(n==="YY"){const c=o%100;return z(c,2)}return n==="Yo"?a.ordinalNumber(o,{unit:"year"}):z(o,n.length)},R:function(t,n){const a=no(t);return z(a,n.length)},u:function(t,n){const a=t.getFullYear();return z(a,n.length)},Q:function(t,n,a){const s=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(s);case"QQ":return z(s,2);case"Qo":return a.ordinalNumber(s,{unit:"quarter"});case"QQQ":return a.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,n,a){const s=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(s);case"qq":return z(s,2);case"qo":return a.ordinalNumber(s,{unit:"quarter"});case"qqq":return a.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,n,a){const s=t.getMonth();switch(n){case"M":case"MM":return Ye.M(t,n);case"Mo":return a.ordinalNumber(s+1,{unit:"month"});case"MMM":return a.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(s,{width:"wide",context:"formatting"})}},L:function(t,n,a){const s=t.getMonth();switch(n){case"L":return String(s+1);case"LL":return z(s+1,2);case"Lo":return a.ordinalNumber(s+1,{unit:"month"});case"LLL":return a.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(s,{width:"wide",context:"standalone"})}},w:function(t,n,a,s){const i=mo(t,s);return n==="wo"?a.ordinalNumber(i,{unit:"week"}):z(i,n.length)},I:function(t,n,a){const s=ro(t);return n==="Io"?a.ordinalNumber(s,{unit:"week"}):z(s,n.length)},d:function(t,n,a){return n==="do"?a.ordinalNumber(t.getDate(),{unit:"date"}):Ye.d(t,n)},D:function(t,n,a){const s=Tx(t);return n==="Do"?a.ordinalNumber(s,{unit:"dayOfYear"}):z(s,n.length)},E:function(t,n,a){const s=t.getDay();switch(n){case"E":case"EE":case"EEE":return a.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(s,{width:"short",context:"formatting"});case"EEEE":default:return a.day(s,{width:"wide",context:"formatting"})}},e:function(t,n,a,s){const i=t.getDay(),o=(i-s.weekStartsOn+8)%7||7;switch(n){case"e":return String(o);case"ee":return z(o,2);case"eo":return a.ordinalNumber(o,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,a,s){const i=t.getDay(),o=(i-s.weekStartsOn+8)%7||7;switch(n){case"c":return String(o);case"cc":return z(o,n.length);case"co":return a.ordinalNumber(o,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,a){const s=t.getDay(),i=s===0?7:s;switch(n){case"i":return String(i);case"ii":return z(i,n.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(s,{width:"short",context:"formatting"});case"iiii":default:return a.day(s,{width:"wide",context:"formatting"})}},a:function(t,n,a){const i=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,a){const s=t.getHours();let i;switch(s===12?i=mt.noon:s===0?i=mt.midnight:i=s/12>
vendor: 4,414 bytes, line 10
10=1?"pm":"am",n){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,a){const s=t.getHours();let i;switch(s>=17?i=mt.evening:s>=12?i=mt.afternoon:s>=4?i=mt.morning:i=mt.night,n){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,a){if(n==="ho"){let s=t.getHours()%12;return s===0&&(s=12),a.ordinalNumber(s,{unit:"hour"})}return Ye.h(t,n)},H:function(t,n,a){return n==="Ho"?a.ordinalNumber(t.getHours(),{unit:"hour"}):Ye.H(t,n)},K:function(t,n,a){const s=t.getHours()%12;return n==="Ko"?a.ordinalNumber(s,{unit:"hour"}):z(s,n.length)},k:function(t,n,a){let s=t.getHours();return s===0&&(s=24),n==="ko"?a.ordinalNumber(s,{unit:"hour"}):z(s,n.length)},m:function(t,n,a){return n==="mo"?a.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ye.m(t,n)},s:function(t,n,a){return n==="so"?a.ordinalNumber(t.getSeconds(),{unit:"second"}):Ye.s(t,n)},S:function(t,n){return Ye.S(t,n)},X:function(t,n,a){const s=t.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return ma(s);case"XXXX":case"XX":return et(s);case"XXXXX":case"XXX":default:return et(s,":")}},x:function(t,n,a){const s=t.getTimezoneOffset();switch(n){case"x":return ma(s);case"xxxx":case"xx":return et(s);case"xxxxx":case"xxx":default:return et(s,":")}},O:function(t,n,a){const s=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+la(s,":");case"OOOO":default:return"GMT"+et(s,":")}},z:function(t,n,a){const s=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+la(s,":");case"zzzz":default:return"GMT"+et(s,":")}},t:function(t,n,a){const s=Math.trunc(+t/1e3);return z(s,n.length)},T:function(t,n,a){return z(+t,n.length)}};function la(t,n=""){const a=t>0?"-":"+",s=Math.abs(t),i=Math.trunc(s/60),o=s%60;return o===0?a+String(i):a+String(i)+n+z(o,2)}function ma(t,n){return t%60===0?(t>0?"-":"+")+z(Math.abs(t)/60,2):et(t,n)}function et(t,n=""){const a=t>0?"-":"+",s=Math.abs(t),i=z(Math.trunc(s/60),2),o=z(s%60,2);return a+i+n+o}const xa=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},xo=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},_x=(t,n)=>{const a=t.match(/(P+)(p+)?/)||[],s=a[1],i=a[2];if(!i)return xa(t,n);let o;switch(s){case"P":o=n.dateTime({width:"short"});break;case"PP":o=n.dateTime({width:"medium"});break;case"PPP":o=n.dateTime({width:"long"});break;case"PPPP":default:o=n.dateTime({width:"full"});break}return o.replace("{{date}}",xa(s,n)).replace("{{time}}",xo(i,n))},Lx={p:xo,P:_x},Ex=/^D+$/,Ix=/^Y+$/,Bx=["D","DD","YY","YYYY"];function Fx(t){return Ex.test(t)}function $x(t){return Ix.test(t)}function Ux(t,n,a){const s=Yx(t,n,a);if(console.warn(s),Bx.includes(t))throw new RangeError(s)}function Yx(t,n,a){const s=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${s} to the input \`${a}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Kx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gx=/^'([^]*?)'?$/,Vx=/''/g,qx=/[a-zA-Z]/;function _e(t,n,a){const s=Qt(),i=a?.locale??s.locale??ks,o=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,d=G(t,a?.in);if(!Vm(d))throw new RangeError("Invalid time value");let l=n.match(zx).map(r=>{const m=r[0];if(m==="p"||m==="P"){const b=Lx[m];return b(r,i.formatLong)}return r}).join("").match(Kx).map(r=>{if(r==="''")return{isToken:!1,value:"'"};const m=r[0];if(m==="'")return{isToken:!1,value:Hx(r)};if(da[m])return{isToken:!0,value:r};
10if(m.match(qx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:r}});i.localize.preprocessor&&(l=i.localize.preprocessor(d,l));const x={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return l.map(r=>{if(!r.isToken)return r.value;const m=r.value;(!a?.useAdditionalWeekYearTokens&&$x(m)||!a?.useAdditionalDayOfYearTokens&&Fx(m))&&Ux(m,n,String(t));const b=da[m[0]];return b(d,m,i.localize,x)}).join("")}function Hx(t){const n=t.match(Gx);return n?n[1].replace(Vx,"'"):t}function Qx(t,n){const a=G(t,n?.in),s=a.getFullYear(),i=a.getMonth(),o=ne(a,0);return o.setFullYear(s,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Zx(t,n){return G(t,n?.in).getMonth()}function Jx(t,n){return G(t,n?.in).getFullYear()}function Xx(t,n){return+G(t)>+G(n)}function eu(t,n){return+G(t)<+G(n)}function tu(t,n,a){const[s,i]=kt(a?.in,t,n);return s.getFullYear()===i.getFullYear()&&s.getMonth()===i.getMonth()}function nu(t,n,a){const[s,i]=kt(a?.in,t,n);return s.getFullYear()===i.getFullYear()}function su(t,n,a){const s=G(t,a?.in),i=s.getFullYear(),o=s.getDate(),c=ne(t,0);c.setFullYear(i,n,15),c.setHours(0,0,0,0);const d=Qx(c);return s.setMonth(n,Math.min(o,d)),s}function au(t,n,a){const s=G(t,a?.in);return isNaN(+s)?ne(t,NaN):(s.setFullYear(n),s)}const ua=5,iu=4;function ou(t,n){const a=n.startOfMonth(t),s=a.getDay()>0?a.getDay():7,i=n.addDays(t,-s+1),o=n.addDays(i,ua*7-1);return n.getMonth(t)===n.getMonth(o)?ua:iu}function uo(t,n){const a=n.startOfMonth(t),s=a.getDay();return s===1?a:s===0?n.addDays(a,-6):n.addDays(a,-1*(s-1))}function cu(t,n){const a=uo(t,n),s=ou(t,n);return n.addDays(a,s*7-1)}class ue{constructor(n,a){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?oe.tz(this.options.timeZone):new this.Date,this.newDate=(s,i,o)=>this.overrides?.newDate?this.overrides.newDate(s,i,o):this.options.timeZone?new oe(s,i,o,this.options.timeZone):new Date(s,i,o),this.addDays=(s,i)=>this.overrides?.addDays?this.overrides.addDays(s,i):eo(s,i),this.addMonths=(s,i)=>this.overrides?.addMonths?this.overrides.addMonths(s,i):to(s,i),this.addWeeks=(s,i)=>this.overrides?.addWeeks?this.overrides.addWeeks(s,i):Um(s,i),this.addYears=(s,i)=>this.overrides?.addYears?this.overrides.addYears(s,i):Ym(s,i),this.differenceInCalendarDays=(s,i)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,i):so(s,i),this.differenceInCalendarMonths=(s,i)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,i):qm(s,i),this.eachMonthOfInterval=s=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):Qm(s),this.eachYearOfInterval=s=>{const i=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(s):Xm(s),o=new Set(i.map(d=>this.getYear(d)));if(o.size===i.length)return i;const c=[];return o.forEach(d=>{c.push(new Date(d,0,1))}),c},this.endOfBroadcastWeek=s=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):cu(s,this),this.endOfISOWeek=s=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(s):ex(s),this.endOfMonth=s=>this.overrides?.endOfMonth?this.overrides.endOfMonth(s):Hm(s),this.endOfWeek=(s,i)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(s,i):co(s,this.options),this.endOfYear=s=>this.overrides?.endOfYear?this.overrides.endOfYear(s):Jm(s),this.format=(s,i,o)=>{const c=this.overrides?.format?this.overrides.format(s,i,this.options):_e(s,i,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(c):c},this.getISOWeek=s=>this.overrides?.getISOWeek?this.overrides.getISOWeek(s):ro(s),this.getMonth=(s,i)=>this.overrides?.getMonth?this.overrides.getMonth(s,this.options):Zx(s,this.options),this.getYear=(s,i)=>this.overrides?.getYear?this.overrides.getYear(s,this.options):Jx(s,this.options),this.getWeek=(s,i)=>this.overrides?.getWeek?this.overrides.getWeek(s,this.options):mo(s,this.options),this.isAfter=(s,i)=>this.overrides?.isAfter?this.overrides.isAfter(s,i):Xx(s,i),this.isBefore=(s,i)=>this.overrides?.isBefore?this.overrides.isBefore(s,i):eu(s,i),this.isDate=s=>this.overrides?.isDate?this.overrides.isDate(s):ao(s),this.isSameDay=(s,i)=>this.overrides?.isSameDay?this.overrides.isSameDay(s,i):Gm(s,i),this.isSameMonth=(s,i)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(s,i):tu(s,i),this.isSameYear=(s,i)=>this.overrides?.isSameYear?this.overrides.isSameYear(s,i):nu(s,i),this.max=s=>this.overrides?.max?this.overrides.max(s):Km(s),this.min=s=>this.overrides?.min?this.overrides.min(s):zm(s),this.setMonth=(s,i)=>this.overrides?.setMonth?this.overrides.setMonth(s,i):su(s,i),this.setYear=(s,i)=>this.overrides?.setYear?this.overrides.setYear(s,i):au(s,i),this.startOfBroadcastWeek=(s,i)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):uo(s,this),this.startOfDay=s=>this.overrides?.startOfDay?this.overrides.startOfDay(s):Yt(s),this.startOfISOWeek=s=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(s):Ut(s),this.startOfMonth=s=>this.overrides?.startOfMonth?this.overrides.startOfMonth(s):Zm(s),this.startOfWeek=(s,i)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(s,this.options):Nt(s,this.options),this.startOfYear=s=>this.overrides?.startOfYear?this.overrides.startOfYear(s):oo(s),this.options={locale:ks,...n},this.overrides=a}getDigitMap(){const{numerals:n="latn"}=this.options,a=new Intl.NumberFormat("en-US",{numberingSystem:n}),s={};for(let i=0;i<10;i++)s[i.toString()]=a.format(i);return s}replaceDigits(n){const a=this.getDigitMap();return n.replace(/\d/g,s=>a[s]||s)}formatNumber(n){return this.replaceDigits(n.toString())}getMonthYearOrder(){const n=this.options.locale?.code;return n&&ue.yearFirstLocales.has(n)?"year-first":"month-first"}formatMonthYear(n){const{locale:a,timeZone:s,numerals:i}=this.options,o=a?.code;if(o&&ue.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:s,numberingSystem:i}).format(n)}catch{}const c=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(n,c)}}ue.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const We=new ue;class po{constructor(n,a,s=We){this.date=n,this.displayMonth=a,this.outside=!!(a&&!s.isSameMonth(n,a)),this.dateLib=s}isEqualTo(n){return this.dateLib.isSameDay(n.date,this.date)&&this.dateLib.isSameMonth(n.displayMonth,this.displayMonth)}}class ru{constructor(n,a){this.date=n,this.weeks=a}}class du{constructor(n,a){this.days=a,this.weekNumber=n}}function lu(t){return N.createElement("button",{...t})}function mu(t){return N.createElement("span",{...t})}function xu(t){const{size:n=24,orientation:a="left",className:s}=t;return N.createElement("svg",{className:s,width:n,height:n,viewBox:"0 0 24 24"},a==="up"&&N.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),a==="down"&&N.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),a==="left"&&N.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),a==="right"&&N.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function uu(t){const{day:n,modifiers:a,...s}=t;return N.createElement("td",{...s})}function pu(t){const{day:n,modifiers:a,...s}=t,i=N.useRef(null);return N.useEffect(()=>{a.focused&&i.current?.focus()},[a.focused]),N.createElement("button",{ref:i,...s})}var W;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(W||(W={}));var X;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(X||(X={}));var ge;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(ge||(ge={}));var le;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(le||(le={}));function hu(t){const{options:n,className:a,components:s,classNames:i,...o}=t,c=[i[W.Dropdown],a].join(" "),d=n?.find(({value:l})=>l===o.value);return N.createElement("span",{"data-disabled":o.disabled,className:i[W.DropdownRoot]},N.createElement(s.Select,{className:c,...o},n?.map(({value:l,label:x,disabled:r})=>N.createElement(s.Option,{key:l,value:l,disabled:r},x))),N.createElement("span",{className:i[W.CaptionLabel],"aria-hidden":!0},d?.label,N.createElement(s.Chevron,{orientation:"down",size:18,className:i[W.Chevron]}
vendor: 14,193 bytes, line 10
10)))}function fu(t){return N.createElement("div",{...t})}function bu(t){return N.createElement("div",{...t})}function gu(t){const{calendarMonth:n,displayIndex:a,...s}=t;return N.createElement("div",{...s},t.children)}function Au(t){const{calendarMonth:n,displayIndex:a,...s}=t;return N.createElement("div",{...s})}function vu(t){return N.createElement("table",{...t})}function wu(t){return N.createElement("div",{...t})}const ho=h.createContext(void 0);function Zt(){const t=h.useContext(ho);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function yu(t){const{components:n}=Zt();return N.createElement(n.Dropdown,{...t})}function ju(t){const{onPreviousClick:n,onNextClick:a,previousMonth:s,nextMonth:i,...o}=t,{components:c,classNames:d,labels:{labelPrevious:l,labelNext:x}}=Zt(),r=h.useCallback(b=>{i&&a?.(b)},[i,a]),m=h.useCallback(b=>{s&&n?.(b)},[s,n]);return N.createElement("nav",{...o},N.createElement(c.PreviousMonthButton,{type:"button",className:d[W.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":l(s),onClick:m},N.createElement(c.Chevron,{disabled:s?void 0:!0,className:d[W.Chevron],orientation:"left"})),N.createElement(c.NextMonthButton,{type:"button",className:d[W.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":x(i),onClick:r},N.createElement(c.Chevron,{disabled:i?void 0:!0,orientation:"right",className:d[W.Chevron]})))}function Nu(t){const{components:n}=Zt();return N.createElement(n.Button,{...t})}function Cu(t){return N.createElement("option",{...t})}function ku(t){const{components:n}=Zt();return N.createElement(n.Button,{...t})}function Pu(t){const{rootRef:n,...a}=t;return N.createElement("div",{...a,ref:n})}function Su(t){return N.createElement("select",{...t})}function Ou(t){const{week:n,...a}=t;return N.createElement("tr",{...a})}function Du(t){return N.createElement("th",{...t})}function Ru(t){return N.createElement("thead",{"aria-hidden":!0},N.createElement("tr",{...t}))}function Mu(t){const{week:n,...a}=t;return N.createElement("th",{...a})}function Tu(t){return N.createElement("th",{...t})}function Wu(t){return N.createElement("tbody",{...t})}function _u(t){const{components:n}=Zt();return N.createElement(n.Dropdown,{...t})}const Lu=Object.freeze(Object.defineProperty({__proto__:null,Button:lu,CaptionLabel:mu,Chevron:xu,Day:uu,DayButton:pu,Dropdown:hu,DropdownNav:fu,Footer:bu,Month:gu,MonthCaption:Au,MonthGrid:vu,Months:wu,MonthsDropdown:yu,Nav:ju,NextMonthButton:Nu,Option:Cu,PreviousMonthButton:ku,Root:Pu,Select:Su,Week:Ou,WeekNumber:Mu,WeekNumberHeader:Tu,Weekday:Du,Weekdays:Ru,Weeks:Wu,YearsDropdown:_u},Symbol.toStringTag,{value:"Module"}));function Ee(t,n,a=!1,s=We){let{from:i,to:o}=t;const{differenceInCalendarDays:c,isSameDay:d}=s;return i&&o?(c(o,i)<0&&([i,o]=[o,i]),c(n,i)>=(a?1:0)&&c(o,n)>=(a?1:0)):!a&&o?d(o,n):!a&&i?d(i,n):!1}function fo(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Ps(t){return!!(t&&typeof t=="object"&&"from"in t)}function bo(t){return!!(t&&typeof t=="object"&&"after"in t)}function go(t){return!!(t&&typeof t=="object"&&"before"in t)}function Ao(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function vo(t,n){return Array.isArray(t)&&t.every(n.isDate)}function Ie(t,n,a=We){const s=Array.isArray(n)?n:[n],{isSameDay:i,differenceInCalendarDays:o,isAfter:c}=a;return s.some(d=>{if(typeof d=="boolean")return d;if(a.isDate(d))return i(t,d);if(vo(d,a))return d.includes(t);if(Ps(d))return Ee(d,t,!1,a);if(Ao(d))return Array.isArray(d.dayOfWeek)?d.dayOfWeek.includes(t.getDay()):d.dayOfWeek===t.getDay();if(fo(d)){const l=o(d.before,t),x=o(d.after,t),r=l>0,m=x<0;return c(d.before,d.after)?m&&r:r||m}return bo(d)?o(t,d.after)>0:go(d)?o(d.before,t)>0:typeof d=="function"?d(t):!1})}function Eu(t,n,a,s,i){const{disabled:o,hidden:c,modifiers:d,showOutsideDays:l,broadcastCalendar:x,today:r}=n,{isSameDay:m,isSameMonth:b,startOfMonth:f,isBefore:p,endOfMonth:A,isAfter:g}=i,w=a&&f(a),C=s&&A(s),v={[X.focused]:[],[X.outside]:[],[X.disabled]:[],[X.hidden]:[],[X.today]:[]},P={};for(const u of t){const{date:y,displayMonth:S}=u,O=!!(S&&!b(y,S)),B=!!(w&&p(y,w)),E=!!(C&&g(y,C)),D=!!(o&&Ie(y,o,i)),K=!!(c&&Ie(y,c,i))||B||E||!x&&!l&&O||x&&l===!1&&O,Q=m(y,r??i.today());O&&v.outside.push(u),D&&v.disabled.push(u),K&&v.hidden.push(u),Q&&v.today.push(u),d&&Object.keys(d).forEach(ie=>{const te=d?.[ie];te&&Ie(y,te,i)&&(P[ie]?P[ie].push(u):P[ie]=[u])})}return u=>{const y={[X.focused]:!1,[X.disabled]:!1,[X.hidden]:!1,[X.outside]:!1,[X.today]:!1},S={};for(const O in v){const B=v[O];y[O]=B.some(E=>E===u)}for(const O in P)S[O]=P[O].some(B=>B===u);return{...y,...S}}}function Iu(t,n,a={}){return Object.entries(t).filter(([,i])=>i===!0).reduce((i,[o])=>(a[o]?i.push(a[o]):n[X[o]]?i.push(n[X[o]]):n[ge[o]]&&i.push(n[ge[o]]),i),[n[W.Day]])}function Bu(t){return{...Lu,...t}}function Fu(t){const n={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([a,s])=>{a.startsWith("data-")&&(n[a]=s)}),n}function Ss(){const t={};for(const n in W)t[W[n]]=`rdp-${W[n]}`;for(const n in X)t[X[n]]=`rdp-${X[n]}`;for(const n in ge)t[ge[n]]=`rdp-${ge[n]}`;for(const n in le)t[le[n]]=`rdp-${le[n]}`;return t}function wo(t,n,a){return(a??new ue(n)).formatMonthYear(t)}const $u=wo;function Uu(t,n,a){return(a??new ue(n)).format(t,"d")}function Yu(t,n=We){return n.format(t,"LLLL")}function Ku(t,n,a){return(a??new ue(n)).format(t,"cccccc")}function zu(t,n=We){return t<10?n.formatNumber(`0${t.toLocaleString()}`):n.formatNumber(`${t.toLocaleString()}`)}function Gu(){return""}function yo(t,n=We){return n.format(t,"yyyy")}const Vu=yo,qu=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:wo,formatDay:Uu,formatMonthCaption:$u,formatMonthDropdown:Yu,formatWeekNumber:zu,formatWeekNumberHeader:Gu,formatWeekdayName:Ku,formatYearCaption:Vu,formatYearDropdown:yo},Symbol.toStringTag,{value:"Module"}));function Hu(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...qu,...t}}function Qu(t,n,a,s,i){const{startOfMonth:o,startOfYear:c,endOfYear:d,eachMonthOfInterval:l,getMonth:x}=i;return l({start:c(t),end:d(t)}).map(b=>{const f=s.formatMonthDropdown(b,i),p=x(b),A=n&&b<o(n)||a&&b>o(a)||!1;return{value:p,label:f,disabled:A}})}function Zu(t,n={},a={}){let s={...n?.[W.Day]};return Object.entries(t).filter(([,i])=>i===!0).forEach(([i])=>{s={...s,...a?.[i]}}),s}function Ju(t,n,a){const s=t.today(),i=n?t.startOfISOWeek(s):t.startOfWeek(s),o=[];for(let c=0;c<7;c++){const d=t.addDays(i,c);o.push(d)}return o}function Xu(t,n,a,s,i=!1){if(!t||!n)return;const{startOfYear:o,endOfYear:c,eachYearOfInterval:d,getYear:l}=s,x=o(t),r=c(n),m=d({start:x,end:r});return i&&m.reverse(),m.map(b=>{const f=a.formatYearDropdown(b,s);return{value:l(b),label:f,disabled:!1}})}function jo(t,n,a,s){let i=(s??new ue(a)).format(t,"PPPP");return n.today&&(i=`Today, ${i}`),n.selected&&(i=`${i}, selected`),i}const ep=jo;function No(t,n,a){return(a??new ue(n)).formatMonthYear(t)}const tp=No;function np(t,n,a,s){let i=(s??new ue(a)).format(t,"PPPP");return n?.today&&(i=`Today, ${i}`),i}function sp(t){return"Choose the Month"}function ap(){return""}function ip(t){return"Go to the Next Month"}function op(t){return"Go to the Previous Month"}function cp(t,n,a){return(a??new ue(n)).format(t,"cccc")}function rp(t,n){return`Week ${t}`}function dp(t){return"Week Number"}function lp(t){return"Choose the Year"}const mp=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:tp,labelDay:ep,labelDayButton:jo,labelGrid:No,labelGridcell:np,labelMonthDropdown:sp,labelNav:ap,labelNext:ip,labelPrevious:op,labelWeekNumber:rp,labelWeekNumberHeader:dp,labelWeekday:cp,labelYearDropdown:lp},Symbol.toStringTag,{value:"Module"})),Jt=t=>t instanceof HTMLElement?t:null,Gn=t=>[...t.querySelectorAll("[data-animated-month]")??[]],xp=t=>Jt(t.querySelector("[data-animated-month]")),Vn=t=>Jt(t.querySelector("[data-animated-caption]")),qn=t=>Jt(t.querySelector("[data-animated-weeks]")),up=t=>Jt(t.querySelector("[data-animated-nav]")),pp=t=>Jt(t.querySelector("[data-animated-weekdays]"));function hp(t,n,{classNames:a,months:s,focused:i,dateLib:o}){const c=h.useRef(null),d=h.useRef(s),l=h.useRef(!1);h.useLayoutEffect(()=>{const x=d.current;if(d.current=s,!n||!t.current||!(t.current instanceof HTMLElement)||s.length===0||x.length===0||s.length!==x.length)return;const r=o.isSameMonth(s[0].date,x[0].date),m=o.isAfter(s[0].date,x[0].date),b=m?a[le.caption_after_enter]:a[le.caption_before_enter],f=m?a[le.weeks_after_enter]:a[le.weeks_before_enter],p=c.current,A=t.current.cloneNode(!0);if(A instanceof HTMLElement?(Gn(A).forEach(v=>{if(!(v instanceof HTMLElement))return;const P=xp(v);P&&v.contains(P)&&v.removeChild(P);const u=Vn(v);u&&u.classList.remove(b);const y=qn(v);y&&y.classList.remove(f)}),c.current=A):c.current=null,l.current||r||i)return;const g=p instanceof HTMLElement?Gn(p):[],w=Gn(t.current);if(w?.every(C=>C instanceof HTMLElement)&&g&&g.every(C=>C instanceof HTMLElement)){l.current=!0,t.current.style.isolation="isolate";const C=up(t.current);C&&(C.style.zIndex="1"),w.forEach((v,P)=>{const u=g[P];if(!u)return;v.style.position="relative",v.style.overflow="hidden";const y=Vn(v);y&&y.classList.add(b);const S=qn(v);S&&S.classList.add(f);const O=()=>{l.current=!1,t.current&&(t.current.style.isolation=""),C&&(C.style.zIndex=""),y&&y.classList.remove(b),S&&S.classList.remove(f),v.style.position="",v.style.overflow="",v.contains(u)&&v.removeChild(u)};u.style.pointerEvents="none",u.style.position="absolute",u.style.overflow="hidden",u.setAttribute("aria-hidden","true");const B=pp(u);B&&(B.style.opacity="0");const E=Vn(u);E&&(E.classList.add(m?a[le.caption_before_exit]:a[le.caption_after_exit]),E.addEventListener("animationend",O));const D=qn(u);D&&D.classList.add(m?a[le.weeks_before_exit]:a[le.weeks_after_exit]),v.insertBefore(u,v.firstChild)})}})}function fp(t,n,a,s){const i=t[0],o=t[t.length-1],{ISOWeek:c,fixedWeeks:d,broadcastCalendar:l}=a??{},{addDays:x,differenceInCalendarDays:r,differenceInCalendarMonths:m,endOfBroadcastWeek:b,endOfISOWeek:f,endOfMonth:p,endOfWeek:A,isAfter:g,startOfBroadcastWeek:w,startOfISOWeek:C,startOfWeek:v}=s,P=l?w(i,s):c?C(i):v(i),u=l?b(o):c?f(p(o)):A(p(o)),y=r(u,P),S=m(o,i)+1,O=[];for(let D=0;D<=y;D++){const K=x(P,D);if(n&&g(K,n))break;O.push(K)}const E=(l?35:42)*S;if(d&&O.length<E){const D=E-O.length;for(let K=0;K<D;K++){const Q=x(O[O.length-1],1);O.push(Q)}}return O}function bp(t){const n=[];return t.reduce((a,s)=>{const i=s.weeks.reduce((o,c)=>o.concat(c.days.slice()),n.slice());return a.concat(i.slice())},n.slice())}function gp(t,n,a,s){const{numberOfMonths:i=1}=a,o=[];for(let c=0;c<i;c++){const d=s.addMonths(t,c);if(n&&d>n)break;o.push(d)}return o}function pa(t,n,a,s){const{month:i,defaultMonth:o,today:c=s.today(),numberOfMonths:d=1}=t;let l=i||o||c;const{differenceInCalendarMonths:x,addMonths:r,startOfMonth:m}=s;if(a&&x(a,l)<d-1){const b=-1*(d-1);l=r(a,b)}return n&&x(l,n)<0&&(l=n),m(l)}function Ap(t,n,a,s){const{addDays:i,endOfBroadcastWeek:o,endOfISOWeek:c,endOfMonth:d,endOfWeek:l,getISOWeek:x,getWeek:r,startOfBroadcastWeek:m,startOfISOWeek:b,startOfWeek:f}=s,p=t.reduce((A,g)=>{const w=a.broadcastCalendar?m(g,s):a.ISOWeek?b(g):f(g),C=a.broadcastCalendar?o(g):a.ISOWeek?c(d(g)):l(d(g)),v=n.filter(S=>S>=w&&S<=C),P=a.broadcastCalendar?35:42;if(a.fixedWeeks&&v.length<P){const S=n.filter(O=>{const B=P-v.length;return O>C&&O<=i(C,B)});v.push(...S)}const u=v.reduce((S,O)=>{const B=a.ISOWeek?x(O):r(O),E=S.find(K=>K.weekNumber===B),D=new po(O,g,s);return E?E.days.push(D):S.push(new du(B,[D])),S},[]),y=new ru(g,u);return A.push(y),A},[]);return a.reverseMonths?p.reverse():p}function vp(t,n){let{startMonth:a,endMonth:s}=t;const{startOfYear:i,startOfDay:o,startOfMonth:c,endOfMonth:d,addYears:l,endOfYear:x,newDate:r,today:m}=n,{fromYear:b,toYear:f,fromMonth:p,toMonth:A}=t;!a&&p&&(a=p),!a&&b&&(a=n.newDate(b,0,1)),!s&&A&&(s=A),!s&&f&&(s=r(f,11,31));const g=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return a?a=c(a):b?a=r(b,0,1):!a&&g&&(a=i(l(t.today??m(),-100))),s?s=d(s):f?s=r(f,11,31):!s&&g&&(s=x(t.today??m())),[a&&o(a),s&&o(s)]}function wp(t,n,a,s){if(a.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:o=1}=a,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:l}=s,x=i?o:1,r=c(t);if(!n)return d(r,x);if(!(l(n,t)<o))return d(r,x)}function yp(t,n,a,s){if(a.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:o}=a,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:l}=s,x=i?o??1:1,r=c(t);if(!n)return d(r,-x);if(!(l(r,n)<=0))return d(r,-x)}function jp(t){const n=[];return t.reduce((a,s)=>a.concat(s.weeks.slice()),n.slice())}function Mn(t,n){const[a,s]=h.useState(t);return[n===void 0?a:n,s]}function Np(t,n){const[a,s]=vp(t,n),{startOfMonth:i,endOfMonth:o}=n,c=pa(t,a,s,n),[d,l]=Mn(c,t.month?c:void 0);h.useEffect(()=>{const y=pa(t,a,s,n);l(y)},[t.timeZone]);const x=gp(d,s,t,n),r=fp(x,t.endMonth?o(t.endMonth):void 0,t,n),m=Ap(x,r,t,n),b=jp(m),f=bp(m),p=yp(d,a,t,n),A=wp(d,s,t,n),{disableNavigation:g,onMonthChange:w}=t,C=y=>b.some(S=>S.days.some(O=>O.isEqualTo(y))),v=y=>{if(g)return;let S=i(y);a&&S<i(a)&&(S=i(a)),s&&S>i(s)&&(S=i(s)),l(S),w?.(S)};return{months:m,weeks:b,days:f,navStart:a,navEnd:s,previousMonth:p,nextMonth:A,goToMonth:v,goToDay:y=>{C(y)||v(y.date)}}}var Ne;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Ne||(Ne={}));function ha(t){return!t[X.disabled]&&!t[X.hidden]&&!t[X.outside]}function Cp(t,n,a,s){let i,o=-1;for(const c of t){const d=n(c);ha(d)&&(d[X.focused]&&o<Ne.FocusedModifier?(i=c,o=Ne.FocusedModifier):s?.isEqualTo(c)&&o<Ne.LastFocused?(i=c,o=Ne.LastFocused):a(c.date)&&o<Ne.Selected?(i=c,o=Ne.Selected):d[X.today]&&o<Ne.Today&&(i=c,o=Ne.Today))}
10return i||(i=t.find(c=>ha(n(c)))),i}function kp(t,n,a,s,i,o,c){const{ISOWeek:d,broadcastCalendar:l}=o,{addDays:x,addMonths:r,addWeeks:m,addYears:b,endOfBroadcastWeek:f,endOfISOWeek:p,endOfWeek:A,max:g,min:w,startOfBroadcastWeek:C,startOfISOWeek:v,startOfWeek:P}=c;let y={day:x,week:m,month:r,year:b,startOfWeek:S=>l?C(S,c):d?v(S):P(S),endOfWeek:S=>l?f(S):d?p(S):A(S)}[t](a,n==="after"?1:-1);return n==="before"&&s?y=g([s,y]):n==="after"&&i&&(y=w([i,y])),y}function Co(t,n,a,s,i,o,c,d=0){if(d>365)return;const l=kp(t,n,a.date,s,i,o,c),x=!!(o.disabled&&Ie(l,o.disabled,c)),r=!!(o.hidden&&Ie(l,o.hidden,c)),m=l,b=new po(l,m,c);return!x&&!r?b:Co(t,n,b,s,i,o,c,d+1)}function Pp(t,n,a,s,i){const{autoFocus:o}=t,[c,d]=h.useState(),l=Cp(n.days,a,s||(()=>!1),c),[x,r]=h.useState(o?l:void 0);return{isFocusTarget:A=>!!l?.isEqualTo(A),setFocused:r,focused:x,blur:()=>{d(x),r(void 0)},moveFocus:(A,g)=>{if(!x)return;const w=Co(A,g,x,n.navStart,n.navEnd,t,i);w&&(t.disableNavigation&&!n.days.some(v=>v.isEqualTo(w))||(n.goToDay(w),r(w)))}}}function Sp(t,n){const{selected:a,required:s,onSelect:i}=t,[o,c]=Mn(a,i?a:void 0),d=i?a:o,{isSameDay:l}=n,x=f=>d?.some(p=>l(p,f))??!1,{min:r,max:m}=t;return{selected:d,select:(f,p,A)=>{let g=[...d??[]];if(x(f)){if(d?.length===r||s&&d?.length===1)return;g=d?.filter(w=>!l(w,f))}else d?.length===m?g=[f]:g=[...g,f];return i||c(g),i?.(g,f,p,A),g},isSelected:x}}function Op(t,n,a=0,s=0,i=!1,o=We){const{from:c,to:d}=n||{},{isSameDay:l,isAfter:x,isBefore:r}=o;let m;if(!c&&!d)m={from:t,to:a>0?void 0:t};else if(c&&!d)l(c,t)?a===0?m={from:c,to:t}:i?m={from:c,to:void 0}:m=void 0:r(t,c)?m={from:t,to:c}:m={from:c,to:t};else if(c&&d)if(l(c,t)&&l(d,t))i?m={from:c,to:d}:m=void 0;else if(l(c,t))m={from:c,to:a>0?void 0:t};else if(l(d,t))m={from:t,to:a>0?void 0:t};else if(r(t,c))m={from:t,to:d};else if(x(t,c))m={from:c,to:t};else if(x(t,d))m={from:c,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const b=o.differenceInCalendarDays(m.to,m.from);s>0&&b>s?m={from:t,to:void 0}:a>1&&b<a&&(m={from:t,to:void 0})}return m}function Dp(t,n,a=We){const s=Array.isArray(n)?n:[n];let i=t.from;const o=a.differenceInCalendarDays(t.to,t.from),c=Math.min(o,6);for(let d=0;d<=c;d++){if(s.includes(i.getDay()))return!0;i=a.addDays(i,1)}return!1}function fa(t,n,a=We){return Ee(t,n.from,!1,a)||Ee(t,n.to,!1,a)||Ee(n,t.from,!1,a)||Ee(n,t.to,!1,a)}function Rp(t,n,a=We){const s=Array.isArray(n)?n:[n];if(s.filter(d=>typeof d!="function").some(d=>typeof d=="boolean"?d:a.isDate(d)?Ee(t,d,!1,a):vo(d,a)?d.some(l=>Ee(t,l,!1,a)):Ps(d)?d.from&&d.to?fa(t,{from:d.from,to:d.to},a):!1:Ao(d)?Dp(t,d.dayOfWeek,a):fo(d)?a.isAfter(d.before,d.after)?fa(t,{from:a.addDays(d.after,1),to:a.addDays(d.before,-1)},a):Ie(t.from,d,a)||Ie(t.to,d,a):bo(d)||go(d)?Ie(t.from,d,a)||Ie(t.to,d,a):!1))return!0;const c=s.filter(d=>typeof d=="function");if(c.length){let d=t.from;const l=a.differenceInCalendarDays(t.to,t.from);for(let x=0;x<=l;x++){if(c.some(r=>r(d)))return!0;d=a.addDays(d,1)}}return!1}function Mp(t,n){const{disabled:a,excludeDisabled:s,selected:i,required:o,onSelect:c}=t,[d,l]=Mn(i,c?i:void 0),x=c?i:d;return{selected:x,select:(b,f,p)=>{const{min:A,max:g}=t,w=b?Op(b,x,A,g,o,n):void 0;return s&&a&&w?.from&&w.to&&Rp({from:w.from,to:w.to},a,n)&&(w.from=b,w.to=void 0),c||l(w),c?.(w,b,f,p),w},isSelected:b=>x&&Ee(x,b,!1,n)}}function Tp(t,n){const{selected:a,required:s,onSelect:i}=t,[o,c]=Mn(a,i?a:void 0),d=i?a:o,{isSameDay:l}=n;return{selected:d,select:(m,b,f)=>{let p=m;return!s&&d&&d&&l(m,d)&&(p=void 0),i||c(p),i?.(p,m,b,f),p},isSelected:m=>d?l(d,m):!1}}function Wp(t,n){const a=Tp(t,n),s=Sp(t,n),i=Mp(t,n);switch(t.mode){case"single":return a;case"multiple":return s;case"range":return i;default:return}}function _p(t){let n=t;n.timeZone&&(n={...t},n.today&&(n.today=new oe(n.today,n.timeZone)),n.month&&(n.month=new oe(n.month,n.timeZone)),n.defaultMonth&&(n.defaultMonth=new oe(n.defaultMonth,n.timeZone)),n.startMonth&&(n.startMonth=new oe(n.startMonth,n.timeZone)),n.endMonth&&(n.endMonth=new oe(n.endMonth,n.timeZone)),n.mode==="single"&&n.selected?n.selected=new oe(n.selected,n.timeZone):n.mode==="multiple"&&n.selected?n.selected=n.selected?.map(F=>new oe(F,n.timeZone)):n.mode==="range"&&n.selected&&(n.selected={from:n.selected.from?new oe(n.selected.from,n.timeZone):void 0,to:n.selected.to?new oe(n.selected.to,n.timeZone):void 0}));const{components:a,formatters:s,labels:i,dateLib:o,locale:c,classNames:d}=h.useMemo(()=>{const F={...ks,...n.locale};return{dateLib:new ue({locale:F,weekStartsOn:n.broadcastCalendar?1:n.weekStartsOn,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},n.dateLib),components:Bu(n.components),formatters:Hu(n.formatters),labels:{...mp,...n.labels},locale:F,classNames:{...Ss(),...n.classNames}}},[n.locale,n.broadcastCalendar,n.weekStartsOn,n.firstWeekContainsDate,n.useAdditionalWeekYearTokens,n.useAdditionalDayOfYearTokens,n.timeZone,n.numerals,n.dateLib,n.components,n.formatters,n.labels,n.classNames]),{captionLayout:l,mode:x,navLayout:r,numberOfMonths:m=1,onDayBlur:b,onDayClick:f,onDayFocus:p,onDayKeyDown:A,onDayMouseEnter:g,onDayMouseLeave:w,onNextClick:C,onPrevClick:v,showWeekNumber:P,styles:u}=n,{formatCaption:y,formatDay:S,formatMonthDropdown:O,formatWeekNumber:B,formatWeekNumberHeader:E,formatWeekdayName:D,formatYearDropdown:K}=s,Q=Np(n,o),{days:ie,months:te,navStart:_,navEnd:ve,previousMonth:J,nextMonth:T,goToMonth:ee}=Q,se=Eu(ie,n,_,ve,o),{isSelected:re,select:we,selected:ye}=Wp(n,o)??{},{blur:Qe,focused:k,isFocusTarget:V,moveFocus:Ze,setFocused:Xt}=Pp(n,Q,se,re??(()=>!1),o),{labelDayButton:So,labelGridcell:Oo,labelGrid:Do,labelMonthDropdown:Ro,labelNav:Os,labelPrevious:Mo,labelNext:To,labelWeekday:Wo,labelWeekNumber:_o,labelWeekNumberHeader:Lo,labelYearDropdown:Eo}=i,Io=h.useMemo(()=>Ju(o,n.ISOWeek),[o,n.ISOWeek]),Ds=x!==void 0||f!==void 0,Wn=h.useCallback(()=>{J&&(ee(J),v?.(J))},[J,ee,v]),_n=h.useCallback(()=>{T&&(ee(T),C?.(T))},[ee,T,C]),Bo=h.useCallback((F,Z)=>I=>{I.preventDefault(),I.stopPropagation(),Xt(F),we?.(F.date,Z,I),f?.(F.date,Z,I)},[we,f,Xt]),Fo=h.useCallback((F,Z)=>I=>{Xt(F),p?.(F.date,Z,I)},[p,Xt]),$o=h.useCallback((F,Z)=>I=>{Qe(),b?.(F.date,Z,I)},[Qe,b]),Uo=h.useCallback((F,Z)=>I=>{const q={ArrowLeft:[I.shiftKey?"month":"day",n.dir==="rtl"?"after":"before"],ArrowRight:[I.shiftKey?"month":"day",n.dir==="rtl"?"before":"after"],ArrowDown:[I.shiftKey?"year":"week","after"],ArrowUp:[I.shiftKey?"year":"week","before"],PageUp:[I.shiftKey?"year":"month","before"],PageDown:[I.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(q[I.key]){I.preventDefault(),I.stopPropagation();const[de,U]=q[I.key];Ze(de,U)}A?.(F.date,Z,I)},[Ze,A,n.dir]),Yo=h.useCallback((F,Z)=>I=>{g?.(F.date,Z,I)},[g]),Ko=h.useCallback((F,Z)=>I=>{w?.(F.date,Z,I)},[w]),zo=h.useCallback(F=>Z=>{const I=Number(Z.target.value),q=o.setMonth(o.startOfMonth(F),I);ee(q)},[o,ee]),Go=h.useCallback(F=>Z=>{const I=Number(Z.target.value),q=o.setYear(o.startOfMonth(F),I);ee(q)},[o,ee]),{className:Vo,style:qo}=h.useMemo(()=>
vendor: 5,641 bytes, line 10
10({className:[d[W.Root],n.className].filter(Boolean).join(" "),style:{...u?.[W.Root],...n.style}}),[d,n.className,n.style,u]),Ho=Fu(n),Rs=h.useRef(null);hp(Rs,!!n.animate,{classNames:d,months:te,focused:k,dateLib:o});const Qo={dayPickerProps:n,selected:ye,select:we,isSelected:re,months:te,nextMonth:T,previousMonth:J,goToMonth:ee,getModifiers:se,components:a,classNames:d,styles:u,labels:i,formatters:s};return N.createElement(ho.Provider,{value:Qo},N.createElement(a.Root,{rootRef:n.animate?Rs:void 0,className:Vo,style:qo,dir:n.dir,id:n.id,lang:n.lang,nonce:n.nonce,title:n.title,role:n.role,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],...Ho},N.createElement(a.Months,{className:d[W.Months],style:u?.[W.Months]},!n.hideNavigation&&!r&&N.createElement(a.Nav,{"data-animated-nav":n.animate?"true":void 0,className:d[W.Nav],style:u?.[W.Nav],"aria-label":Os(),onPreviousClick:Wn,onNextClick:_n,previousMonth:J,nextMonth:T}),te.map((F,Z)=>N.createElement(a.Month,{"data-animated-month":n.animate?"true":void 0,className:d[W.Month],style:u?.[W.Month],key:Z,displayIndex:Z,calendarMonth:F},r==="around"&&!n.hideNavigation&&Z===0&&N.createElement(a.PreviousMonthButton,{type:"button",className:d[W.PreviousMonthButton],tabIndex:J?void 0:-1,"aria-disabled":J?void 0:!0,"aria-label":Mo(J),onClick:Wn,"data-animated-button":n.animate?"true":void 0},N.createElement(a.Chevron,{disabled:J?void 0:!0,className:d[W.Chevron],orientation:n.dir==="rtl"?"right":"left"})),N.createElement(a.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:d[W.MonthCaption],style:u?.[W.MonthCaption],calendarMonth:F,displayIndex:Z},l?.startsWith("dropdown")?N.createElement(a.DropdownNav,{className:d[W.Dropdowns],style:u?.[W.Dropdowns]},(()=>{const I=l==="dropdown"||l==="dropdown-months"?N.createElement(a.MonthsDropdown,{key:"month",className:d[W.MonthsDropdown],"aria-label":Ro(),classNames:d,components:a,disabled:!!n.disableNavigation,onChange:zo(F.date),options:Qu(F.date,_,ve,s,o),style:u?.[W.Dropdown],value:o.getMonth(F.date)}):N.createElement("span",{key:"month"},O(F.date,o)),q=l==="dropdown"||l==="dropdown-years"?N.createElement(a.YearsDropdown,{key:"year",className:d[W.YearsDropdown],"aria-label":Eo(o.options),classNames:d,components:a,disabled:!!n.disableNavigation,onChange:Go(F.date),options:Xu(_,ve,s,o,!!n.reverseYears),style:u?.[W.Dropdown],value:o.getYear(F.date)}):N.createElement("span",{key:"year"},K(F.date,o));return o.getMonthYearOrder()==="year-first"?[q,I]:[I,q]})(),N.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},y(F.date,o.options,o))):N.createElement(a.CaptionLabel,{className:d[W.CaptionLabel],role:"status","aria-live":"polite"},y(F.date,o.options,o))),r==="around"&&!n.hideNavigation&&Z===m-1&&N.createElement(a.NextMonthButton,{type:"button",className:d[W.NextMonthButton],tabIndex:T?void 0:-1,"aria-disabled":T?void 0:!0,"aria-label":To(T),onClick:_n,"data-animated-button":n.animate?"true":void 0},N.createElement(a.Chevron,{disabled:T?void 0:!0,className:d[W.Chevron],orientation:n.dir==="rtl"?"left":"right"})),Z===m-1&&r==="after"&&!n.hideNavigation&&N.createElement(a.Nav,{"data-animated-nav":n.animate?"true":void 0,className:d[W.Nav],style:u?.[W.Nav],"aria-label":Os(),onPreviousClick:Wn,onNextClick:_n,previousMonth:J,nextMonth:T}),N.createElement(a.MonthGrid,{role:"grid","aria-multiselectable":x==="multiple"||x==="range","aria-label":Do(F.date,o.options,o)||void 0,className:d[W.MonthGrid],style:u?.[W.MonthGrid]},!n.hideWeekdays&&N.createElement(a.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:d[W.Weekdays],style:u?.[W.Weekdays]},P&&N.createElement(a.WeekNumberHeader,{"aria-label":Lo(o.options),className:d[W.WeekNumberHeader],style:u?.[W.WeekNumberHeader],scope:"col"},E()),Io.map(I=>N.createElement(a.Weekday,{"aria-label":Wo(I,o.options,o),className:d[W.Weekday],key:String(I),style:u?.[W.Weekday],scope:"col"},D(I,o.options,o)))),N.createElement(a.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:d[W.Weeks],style:u?.[W.Weeks]},F.weeks.map(I=>N.createElement(a.Week,{className:d[W.Week],key:I.weekNumber,style:u?.[W.Week],week:I},P&&N.createElement(a.WeekNumber,{week:I,style:u?.[W.WeekNumber],"aria-label":_o(I.weekNumber,{locale:c}),className:d[W.WeekNumber],scope:"row",role:"rowheader"},B(I.weekNumber,o)),I.days.map(q=>{const{date:de}=q,U=se(q);if(U[X.focused]=!U.hidden&&!!k?.isEqualTo(q),U[ge.selected]=re?.(de)||U.selected,Ps(ye)){const{from:Ln,to:En}=ye;U[ge.range_start]=!!(Ln&&En&&o.isSameDay(de,Ln)),U[ge.range_end]=!!(Ln&&En&&o.isSameDay(de,En)),U[ge.range_middle]=Ee(ye,de,!0,o)}const Zo=Zu(U,u,n.modifiersStyles),Jo=Iu(U,d,n.modifiersClassNames),Xo=!Ds&&!U.hidden?Oo(de,U,o.options,o):void 0;return N.createElement(a.Day,{key:`${o.format(de,"yyyy-MM-dd")}_${o.format(q.displayMonth,"yyyy-MM")}`,day:q,modifiers:U,className:Jo.join(" "),style:Zo,role:"gridcell","aria-selected":U.selected||void 0,"aria-label":Xo,"data-day":o.format(de,"yyyy-MM-dd"),"data-month":q.outside?o.format(de,"yyyy-MM"):void 0,"data-selected":U.selected||void 0,"data-disabled":U.disabled||void 0,"data-hidden":U.hidden||void 0,"data-outside":q.outside||void 0,"data-focused":U.focused||void 0,"data-today":U.today||void 0},!U.hidden&&Ds?N.createElement(a.DayButton,{className:d[W.DayButton],style:u?.[W.DayButton],type:"button",day:q,modifiers:U,disabled:U.disabled||void 0,tabIndex:V(q)?0:-1,"aria-label":So(de,U,o.options,o),onClick:Bo(q,U),onBlur:$o(q,U),onFocus:
10Fo(q,U),onKeyDown:Uo(q,U),onMouseEnter:Yo(q,U),onMouseLeave:Ko(q,U)},S(de,o.options,o)):!U.hidden&&S(q.date,o.options,o))})))))))),n.footer&&N.createElement(a.Footer,{className:d[W.Footer],style:u?.[W.Footer],role:"status","aria-live":"polite"},n.footer)))}function Lp({className:t,classNames:n,showOutsideDays:a=!0,captionLayout:s="label",buttonVariant:i="ghost",formatters:o,components:c,...d}){const l=Ss();return e.jsx(_p,{"data-loc":"client/src/components/ui/calendar.tsx:27",showOutsideDays:a,className:M("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:s,formatters:{formatMonthDropdown:x=>x.toLocaleString("default",{month:"short"}),...o},classNames:{root:M("w-fit",l.root),months:M("flex gap-4 flex-col md:flex-row relative",l.months),month:M("flex flex-col w-full gap-4",l.month),nav:M("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",l.nav),button_previous:M(Ms({variant:i}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_previous),button_next:M(Ms({variant:i}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_next),month_caption:M("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",l.month_caption),dropdowns:M("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",l.dropdowns),dropdown_root:M("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",l.dropdown_root),dropdown:M("absolute bg-popover inset-0 opacity-0",l.dropdown),caption_label:M("select-none font-medium",s==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",l.caption_label),table:"w-full border-collapse",weekdays:M("flex",l.weekdays),weekday:M("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",l.weekday),week:M("flex w-full mt-2",l.week),week_number_header:M("select-none w-(--cell-size)",l.week_number_header),week_number:M("text-[0.8rem] select-none text-muted-foreground",l.week_number),day:M("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",l.day),range_start:M("rounded-l-md bg-accent",l.range_start),range_middle:M("rounded-none",l.range_middle),range_end:M("rounded-r-md bg-accent",l.range_end),today:M("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",l.today),outside:M("text-muted-foreground aria-selected:text-muted-foreground",l.outside),disabled:M("text-muted-foreground opacity-50",l.disabled),hidden:M("invisible",l.hidden),...n},components:{Root:({className:x,rootRef:r,...m})=>e.jsx("div",{"data-loc":"client/src/components/ui/calendar.tsx:128","data-slot":"calendar",ref:r,className:M(x),...m}),Chevron:({className:x,orientation:r,...m})=>r==="left"?e.jsx(Me,{"data-loc":"client/src/components/ui/calendar.tsx:139",className:M("size-4",x),...m}):r==="right"?e.jsx(Te,{"data-loc":"client/src/components/ui/calendar.tsx:145",className:M("size-4",x),...m}):e.jsx(Lc,{"data-loc":"client/src/components/ui/calendar.tsx:153",className:M("size-4",x),...m}),DayButton:Ep,WeekNumber:({children:x,...r})=>e.jsx("td",{"data-loc":"client/src/components/ui/calendar.tsx:159",...r,children:e.jsx("div",{"data-loc":"client/src/components/ui/calendar.tsx:160",className:"flex size-(--cell-size) items-center justify-center text-center",children:x})}),...c},...d})}function Ep({className:t,day:n,modifiers:a,...s}){const i=Ss(),o=h.useRef(null);return h.useEffect(()=>{a.focused&&o.current?.focus()},[a.focused]),e.jsx(L,{"data-loc":"client/src/components/ui/calendar.tsx:187",ref:o,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:M("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",i.day,t),...s})}function Ip({...t}){return e.jsx(vc,{"data-loc":"client/src/components/ui/popover.tsx:9","data-slot":"popover",...t})}function Bp({...t}){return e.jsx(wc,{"data-loc":"client/src/components/ui/popover.tsx:15","data-slot":"popover-trigger",...t})}function Fp({className:t,align:n="center",sideOffset:a=4,...s}){return e.jsx(yc,{"data-loc":"client/src/components/ui/popover.tsx:25",children:e.jsx(jc,{"data-loc":"client/src/components/ui/popover.tsx:26","data-slot":"popover-content",align:n,sideOffset:a,className:M("bg-popover text-popover-foreground 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
10de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...s})})}const $p=[{label:"Today",days:0},{label:"7D",days:7},{label:"14D",days:14},{label:"30D",days:30},{label:"90D",days:90}],Up={revenue:{label:"Revenue",color:"#0b6fd9"},orders:{label:"Orders",color:"#4ade80"}},Yp={totalRevenue:{label:"Revenue",color:"#f59e0b"}};function ko(){return new Date().toLocaleDateString("en-CA",{timeZone:"America/New_York"})}function Kp(){const t=ko(),[n,a,s]=t.split("-").map(Number);return new Date(n,a-1,s)}function zp(){const[t,n]=h.useState(0),[a,s]=h.useState(0),[i,o]=h.useState("all"),[c,d]=h.useState("all"),[l,x]=h.useState(null),[r,m]=h.useState("direct"),[b,f]=h.useState(void 0),[p,A]=h.useState(!1),[g,w]=h.useState(!1),[C,v]=h.useState(!1),[P,u]=h.useState(""),[y,S]=h.useState(""),O=h.useMemo(()=>{if(p&&b?.from)return{startDate:_e(b.from,"yyyy-MM-dd"),endDate:_e(b.to||b.from,"yyyy-MM-dd")};const k=ko();if(t===0)return{startDate:k,endDate:k};const V=Kp(),Ze=new Date(V.getTime()-t*24*60*60*1e3);return{startDate:_e(Ze,"yyyy-MM-dd"),endDate:_e(V,"yyyy-MM-dd")}},[t,p,b]),[B,E]=h.useState(!1),[D,K]=h.useState(null),Q=j.wooImport.getStatus.useQuery(),ie=j.wooImport.importOrders.useMutation(),te=t===0&&!p,_=j.revenue.kpis.useQuery(O),ve=j.revenue.dailyChart.useQuery(O,{enabled:!te}),J=j.revenue.hourlyChart.useQuery(void 0,{enabled:te}),T=j.revenue.topProducts.useQuery({...O,limit:8}),ee=j.revenue.topCoupons.useQuery(O);h.useEffect(()=>{const k=setTimeout(()=>{S(P),s(0)},300);return()=>clearTimeout(k)},[P]);const se=j.revenue.recentOrders.useQuery({limit:15,offset:a*15,status:i==="all"?void 0:i,search:y||void 0,orderType:c==="all"?void 0:c}),re=te?J:ve,we=te?(J.data||[]).map(k=>({...k,date:k.label})):ve.data||[];if(l!==null)return e.jsx(Qi,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:130",orderId:l,orderType:r,onBack:()=>{x(null)}});const ye=_.data?_.data.prevRevenue>0?(_.data.totalRevenue-_.data.prevRevenue)/_.data.prevRevenue*100:_.data.totalRevenue>0?100:0:0,Qe=_.data?_.data.prevCompletedOrders>0?(_.data.completedOrders-_.data.prevCompletedOrders)/_.data.prevCompletedOrders*100:_.data.completedOrders>0?100:0:0;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:146",className:"max-w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:148",className:"flex flex-col gap-3 mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:150",className:"flex items-start justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:151",className:"min-w-0",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:152",className:"text-xl md:text-2xl font-bold text-white",children:"Revenue Analytics"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:153",className:"text-white/40 text-xs md:text-sm mt-1",children:"Track sales performance and conversion metrics (EST)"})]}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:156",onClick:()=>v(!C),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border transition-colors shrink-0 ml-2 ${C?"bg-[#0b6fd9] text-white border-[#0b6fd9]":"bg-[#1a1a1a] border-white/10 text-white/50 hover:text-white hover:bg-white/5"}`,children:[e.jsx(At,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:164",className:"w-3.5 h-3.5"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:165",className:"hidden sm:inline",children:"AI Assistant"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:170",className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:172",className:"flex items-center gap-2",children:[D&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:174",className:`flex items-center gap-1.5 px-2 py-1 text-[10px] md:text-xs rounded-lg border ${D.totalErrors>0?"bg-yellow-500/10 border-yellow-500/30 text-yellow-400":"bg-green-500/10 border-green-500/30 text-green-400"}`,children:[D.totalErrors>
100?e.jsx(Ec,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:179",className:"w-3 h-3"}):e.jsx(xn,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:179",className:"w-3 h-3"}),D.totalImported," imported, ",D.totalSkipped," skipped"]}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:183",onClick:async()=>{E(!0),K(null);try{const k=await ie.mutateAsync({pages:10,statuses:["completed","processing"]});K(k),_.refetch(),se.refetch(),Q.refetch()}catch(k){console.error("WooCommerce import failed:",k)}finally{E(!1)}},disabled:B,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[10px] md:text-xs font-medium rounded-lg bg-purple-600 hover:bg-purple-700 text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap",children:[B?e.jsx(Ce,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:202",className:"w-3 h-3 animate-spin"}):e.jsx(Ua,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:202",className:"w-3 h-3"}),B?"Importing...":"Import Woo"]}),Q.data&&Q.data.importedCount>0&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:206",className:"text-[10px] text-white/30 hidden sm:inline",children:[Q.data.importedCount," imported"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:211",className:"flex-1 min-w-0"}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:214",onClick:()=>w(!g),className:`flex items-center gap-1.5 px-2.5 py-1.5 text-[10px] md:text-xs font-medium rounded-lg border transition-colors whitespace-nowrap ${g?"bg-[#0b6fd9] text-white border-[#0b6fd9]":"bg-[#1a1a1a] border-white/10 text-white/50 hover:text-white hover:bg-white/5"}`,children:[e.jsx(Ic,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:222",className:"w-3 h-3"}),"Compare"]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:227",className:"flex items-center gap-1 bg-[#1a1a1a] border border-white/10 rounded-lg p-0.5 md:p-1 overflow-x-auto",children:$p.map(k=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:229",onClick:()=>{n(k.days),A(!1)},className:`px-2 md:px-3 py-1 md:py-1.5 text-[10px] md:text-xs font-medium rounded-md transition-colors whitespace-nowrap ${!p&&t===k.days?"bg-[#0b6fd9] text-white":"text-white/50 hover:text-white hover:bg-white/5"}`,children:k.label},k.days))}),e.jsxs(Ip,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:243",children:[e.jsx(Bp,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:244",asChild:!0,children:e.jsxs("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:245",className:`flex items-center gap-1 px-2.5 py-1.5 text-[10px] md:text-xs font-medium rounded-lg border transition-colors whitespace-nowrap ${p?"bg-[#0b6fd9] text-white border-[#0b6fd9]":"bg-[#1a1a1a] border-white/10 text-white/50 hover:text-white hover:bg-white/5"}`,children:[e.jsx(xs,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:252",className:"w-3 h-3"}),p&&b?.from?`${_e(b.from,"MMM d")}${b.to?" â "+_e(b.to,"MMM d"):""}`:"Custom"]})}),e.jsx(Fp,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:258",className:"w-auto p-0 bg-[#1a1a1a] border-white/10",align:"end",children:e.jsx(Lp,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:259",mode:"range",selected:b,onSelect:k=>{f(k),k?.from&&A(!0)},numberOfMonths:1,disabled:{after:new Date}})})]})]})]}),C&&e.jsx(Gp,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:275",onClose:()=>v(!1)}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:278",className:"grid grid-cols-2 sm:grid-cols-3 gap-3 md:gap-4 mb-6",children:[e.jsx(xt,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:279",label:"Today's Revenue",value:`$${(_.data?.todayRevenue??0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`,change:g?_.data?.yesterdayRevenue?(_.data.todayRevenue-_.data.yesterdayRevenue)/_.data.yesterdayRevenue*100:_.data?.todayRevenue?100:0:void 0,subtitle:`${_.data?.todayOrders??0} orders today`,icon:Bc,color:"#22d3ee",loading:_.isLoading}
10),e.jsx(xt,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:288",label:"Total Revenue",value:`$${(_.data?.totalRevenue??0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`,change:g?ye:void 0,icon:Gt,color:"#4ade80",loading:_.isLoading}),e.jsx(xt,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:296",label:"Completed Orders",value:String(_.data?.completedOrders??0),change:g?Qe:void 0,icon:un,color:"#0b6fd9",loading:_.isLoading}),e.jsx(xt,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:304",label:"Conversion Rate",value:`${(_.data?.conversionRate??0).toFixed(1)}%`,subtitle:`${_.data?.totalOrders??0} total orders`,icon:ts,color:"#f59e0b",loading:_.isLoading}),e.jsx(xt,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:312",label:"Avg Order Value",value:`$${(_.data?.avgOrderValue??0).toFixed(2)}`,subtitle:`${_.data?.completedOrders??0} completed orders`,icon:Kt,color:"#8b5cf6",loading:_.isLoading}),e.jsx(xt,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:320",label:"New vs Returning",value:`${_.data?.newCustomers??0} / ${_.data?.returningCustomers??0}`,subtitle:`${_.data?.totalUniqueCustomers?Math.round(_.data.newCustomers/_.data.totalUniqueCustomers*100):0}% new customers`,icon:He,color:"#ec4899",loading:_.isLoading})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:331",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5 mb-6",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:332",className:"text-sm font-semibold text-white mb-4",children:te?"Hourly Revenue (Today EST)":"Daily Revenue"}),re.isLoading&&!re.isError?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:336",className:"h-[200px] md:h-[280px] flex items-center justify-center",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:337",className:"animate-pulse text-white/30",children:"Loading chart..."})}):re.isError?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:340",className:"h-[200px] md:h-[280px] flex items-center justify-center",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:341",className:"text-red-400 text-sm",children:["Failed to load chart. ",e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:341",onClick:()=>re.refetch(),className:"underline hover:text-red-300",children:"Retry"})]})}):we.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:344",config:Up,className:"h-[200px] md:h-[280px] w-full !aspect-auto",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:345",data:we,margin:{top:10,right:10,left:0,bottom:0},children:[e.jsx("defs",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:346",children:e.jsxs("linearGradient",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:347",id:"revenueGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:348",offset:"5%",stopColor:"#0b6fd9",stopOpacity:.3}),e.jsx("stop",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:349",offset:"95%",stopColor:"#0b6fd9",stopOpacity:0})]})}),e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:352",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:353",dataKey:"date",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:k=>{if(te)return k;const V=new Date(k+"T00:00:00");return isNaN(V.getTime())?k:`${V.getMonth()+1}/${V.getDate()}`},interval:"preserveStartEnd"}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:365",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:k=>`$${k>=1e3?`${(k/1e3).toFixed(1)}k`:k}`,width:50}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:371",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:373",formatter:(k,V)=>V==="revenue"?[`$${Number(k).toLocaleString()}`,"Revenue"]:[k,"Orders"]})}
10),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:381",type:"monotone",dataKey:"revenue",stroke:"#0b6fd9",strokeWidth:2,fill:"url(#revenueGradient)"})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:391",className:"h-[200px] md:h-[280px] flex items-center justify-center text-white/30",children:"No data for selected range"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:398",className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6 mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:400",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:401",className:"text-sm font-semibold text-white mb-4",children:"Revenue by Category"}),T.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:403",className:"animate-pulse text-white/30 text-sm",children:"Loading..."}):T.data&&T.data.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:405",config:Yp,className:"h-[200px] md:h-[240px] w-full !aspect-auto",children:e.jsxs(oi,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:406",data:T.data.slice(0,6),layout:"vertical",margin:{top:0,right:10,left:0,bottom:0},children:[e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:411",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)",horizontal:!1}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:412",type:"number",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:k=>`$${k>=1e3?`${(k/1e3).toFixed(0)}k`:k}`}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:418",dataKey:"productName",type:"category",stroke:"rgba(255,255,255,0.3)",fontSize:10,width:80,tickFormatter:k=>k.length>12?k.slice(0,12)+"â¦":k}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:426",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:428",formatter:k=>[`$${Number(k).toLocaleString()}`,"Revenue"]})}),e.jsx(fs,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:433",dataKey:"totalRevenue",fill:"#f59e0b",radius:[0,4,4,0],children:e.jsx(Qa,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:434",dataKey:"orderCount",position:"right",formatter:k=>`${k} orders`,style:{fill:"rgba(255,255,255,0.6)",fontSize:11}})})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:444",className:"text-white/30 text-sm",children:"No product data"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:449",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:450",className:"text-sm font-semibold text-white mb-4",children:"Top Coupons Used"}),ee.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:452",className:"animate-pulse text-white/30 text-sm",children:"Loading..."}):ee.data&&ee.data.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:454",className:"space-y-3",children:ee.data.map((k,V)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:456",className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:457",className:"flex items-center gap-2 md:gap-3 min-w-0",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:458",className:"text-[10px] md:text-xs font-mono bg-white/5 border border-white/10 px-1.5 md:px-2 py-0.5 rounded text-white/70 truncate max-w-[80px] md:max-w-none",children:k.couponCode.toUpperCase()}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:461",className:"text-[10px] md:text-xs text-white/40 whitespace-nowrap",children:[k.usageCount," uses"]})]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:463",className:"text-xs md:text-sm font-medium text-white whitespace-nowrap",children:["$",k.totalRevenue.toLocaleStr
10ing()]})]},V))}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:470",className:"text-white/30 text-sm",children:"No coupon data"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:476",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:477",className:"flex flex-col gap-3 mb-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:478",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:479",className:"text-sm font-semibold text-white",children:"Recent Orders"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:480",className:"flex items-center gap-1 overflow-x-auto",children:[e.jsx(us,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:481",className:"w-3.5 h-3.5 text-white/40 mr-1 shrink-0"}),["all","completed","pending","failed"].map(k=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:483",onClick:()=>{o(k),s(0)},className:`px-2 py-1 text-[10px] md:text-xs rounded transition-colors whitespace-nowrap ${i===k?"bg-[#0b6fd9] text-white":"text-white/40 hover:text-white hover:bg-white/5"}`,children:k.charAt(0).toUpperCase()+k.slice(1)},k)),e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:495",className:"w-px h-4 bg-white/10 mx-1"}),["all","direct","reset","activation"].map(k=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:497",onClick:()=>{d(k),s(0)},className:`px-2 py-1 text-[10px] md:text-xs rounded transition-colors whitespace-nowrap ${c===k?"bg-[#8b5cf6] text-white":"text-white/40 hover:text-white hover:bg-white/5"}`,children:k==="all"?"All Types":k.charAt(0).toUpperCase()+k.slice(1)},k))]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:512",className:"relative",children:[e.jsx("svg",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:513",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:514",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:516",type:"text",value:P,onChange:k=>u(k.target.value),placeholder:"Search by name, email, or order ID...",className:"w-full pl-9 pr-8 py-2 text-xs bg-[#0d0d0d] border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-[#0b6fd9]/50 transition-colors"}),P&&e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:524",onClick:()=>u(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/30 hover:text-white/60 transition-colors",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:528",className:"w-3.5 h-3.5"})})]})]}),se.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:535",className:"animate-pulse text-white/30 text-sm py-8 text-center",children:"Loading orders..."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:539",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:540",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:541",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:542",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:543",className:"text-left text-white/50 font-medium py-2 px-2",children:"Date"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:544",className:"text-left text-white/50 font-medium py-2 px-2",children:"Customer"}
10),e.jsx("th",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:545",className:"text-left text-white/50 font-medium py-2 px-2",children:"Product"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:546",className:"text-left text-white/50 font-medium py-2 px-2",children:"Type"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:547",className:"text-right text-white/50 font-medium py-2 px-2",children:"Total"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:548",className:"text-center text-white/50 font-medium py-2 px-2",children:"Status"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:551",children:se.data?.orders.map(k=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:553",onClick:()=>{x(k.id),m(k.orderType||"direct")},className:"border-b border-white/5 hover:bg-white/[0.03] cursor-pointer transition-colors",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:558",className:"py-2.5 px-2 text-white/60 text-xs",children:new Date(k.createdAt).toLocaleDateString()}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:561",className:"py-2.5 px-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:562",className:"text-white text-xs",children:[k.firstName," ",k.lastName]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:563",className:"text-white/40 text-[10px]",children:k.email})]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:565",className:"py-2.5 px-2 text-white/70 text-xs max-w-[180px] truncate",children:k.productName}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:568",className:"py-2.5 px-2",children:e.jsx(ba,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:569",type:k.orderType||"direct"})}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:571",className:"py-2.5 px-2 text-right text-white font-medium text-xs",children:["$",k.total.toFixed(2)]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:574",className:"py-2.5 px-2 text-center",children:e.jsx(ga,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:575",status:k.status})})]},`${k.orderType||"direct"}-${k.id}`))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:584",className:"md:hidden space-y-2",children:se.data?.orders.map(k=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:586",onClick:()=>{x(k.id),m(k.orderType||"direct")},className:"bg-white/[0.02] border border-white/5 rounded-lg p-3 cursor-pointer active:bg-white/[0.05] transition-colors",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:591",className:"flex items-center justify-between mb-1.5",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:592",className:"text-white text-xs font-medium",children:[k.firstName," ",k.lastName]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:593",className:"flex items-center gap-1.5",children:[e.jsx(ba,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:594",type:k.orderType||"direct"}),e.jsx(ga,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:595",status:k.status})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:598",className:"flex items-center justify-between",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:599",className:"text-white/50 text-[10px] truncate max-w-[60%]",children:k.productName}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:600",className:"text-white font-bold text-xs",children:["$",k.total.toFixed(2)]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:602",className:"flex items-center justify-between mt-1",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:603",className:"text-white/30 text-[10px]",children:new Date(k.createdAt).toLocaleDateString()})})]},`${k.orderType||"direct"}-${k.id}`))}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:610",className:"flex items-center justify-between mt-4",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:611",className:"text-[10px] md:text-xs text-white/40",children:[se.data?.total??0," total orders"]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:614",className:"flex items-center gap-2",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:615",onClick:()=>s(k=>Math.max(0,k-1)),disabled:a===0,className:"p-1.5 rounded hover:bg-white/5 disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:620",className:"w-4 h-4 text-white/60"})}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:622",className:"text-xs text-white/50",children:["Page ",a+1]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:623",onClick:()=>s(k=>k+1),disabled:!se.data||(a+1)*15>=se.data.total,className:"p-1.5 rounded hover:bg-white/5 disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:628",className:"w-4 h-4 text-white/60"})})]})]})]})]})]})}function Gp({onClose:t}){const[n,a]=h.useState([]),[s,i]=h.useState(""),[o,c]=h.useState(!1),d=h.useRef(null),l=h.useRef(null),x=j.revenueAI.query.useMutation();h.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[n]);const r=async()=>{const b=s.trim();if(!(!b||o)){i(""),a(f=>[...f,{role:"user",content:b}]),c(!0);try{const f=await x.mutateAsync({message:b});a(p=>[...p,{role:"assistant",content:f.response}])}catch(f){a(p=>[...p,{role:"assistant",content:`Error: ${f.message||"Something went wrong"}`}])}finally{c(!1)}}},m=["Show all orders that used SUMMER coupon","Total revenue from today","Orders over $500 this week","Top 5 customers by spend"];return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:678",className:"bg-[#141414] border border-white/10 rounded-xl mb-6 overflow-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:680",className:"flex items-center justify-between px-3 md:px-4 py-2.5 border-b border-white/10",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:681",className:"flex items-center gap-2",children:[e.jsx(At,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:682",className:"w-4 h-4 text-[#0b6fd9]"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:683",className:"text-xs font-medium text-white",children:"Revenue AI Assistant"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:684",className:"text-[10px] text-white/30",children:"Ask questions about your orders"})]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:686",onClick:t,className:"p-1 rounded hover:bg-white/5 transition-colors",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:687",className:"w-4 h-4 text-white/40"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:692",ref:d,className:"max-h-[300px] md:max-h-[400px] overflow-y-auto p-3 md:p-4 space-y-3",children:[n.length===0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:694",className:"text-center py-4",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:695",className:"text-white/30 text-xs mb-3",children:"Ask me anything about your orders and revenue data"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:696",className:"flex flex-wrap gap-2 justify-center",children:m.map((b,f)=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:698",onClick:()=>{i(b),l.current?.focus()},className:"text-[10px] md:text-xs px-2.5 py-1.5 rounded-lg bg-white/5 border border-white/10 text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:b},f))})]}),n.map((b,f)=>e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:710",className:`flex ${b.role==="user"?"justify-end":"justify-start"}
10`,children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:711",className:`max-w-[85%] rounded-lg px-3 py-2 text-xs ${b.role==="user"?"bg-[#0b6fd9] text-white":"bg-white/5 border border-white/10 text-white/80"}`,children:b.role==="assistant"?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:717",className:"prose prose-invert prose-xs max-w-none [&_table]:text-[10px] [&_th]:px-2 [&_th]:py-1 [&_td]:px-2 [&_td]:py-1 [&_table]:border-white/10 [&_th]:border-white/10 [&_td]:border-white/10 [&_table]:border [&_th]:border [&_td]:border",children:e.jsx(pr,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:718",children:b.content})}):e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:721",children:b.content})})},f)),o&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:727",className:"flex justify-start",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:728",className:"bg-white/5 border border-white/10 rounded-lg px-3 py-2",children:e.jsx(Ce,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:729",className:"w-4 h-4 animate-spin text-[#0b6fd9]"})})})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:736",className:"border-t border-white/10 p-2 md:p-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:737",className:"flex items-end gap-2",children:[e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:738",ref:l,value:s,onChange:b=>i(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),r())},placeholder:"Ask about orders, revenue, coupons...",rows:1,className:"flex-1 resize-none bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-xs text-white placeholder:text-white/30 focus:outline-none focus:border-[#0b6fd9]/50 transition-colors"}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:752",onClick:r,disabled:!s.trim()||o,className:"p-2 rounded-lg bg-[#0b6fd9] hover:bg-[#0668d1] text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors shrink-0",children:e.jsx(ms,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:757",className:"w-4 h-4"})})]})})]})}function xt({label:t,value:n,change:a,subtitle:s,icon:i,color:o,loading:c}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:778",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5 hover:border-white/20 transition-colors",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:779",className:"flex items-center justify-between mb-2 md:mb-3",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:780",className:"text-[9px] md:text-xs font-medium text-white/50 uppercase tracking-wider leading-tight",children:t}),e.jsx(i,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:781",className:"w-3.5 h-3.5 md:w-4 md:h-4 shrink-0",style:{color:o}})]}),c?e.jsx("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:784",className:"h-7 md:h-9 bg-white/5 rounded animate-pulse"}):e.jsxs(e.Fragment,{children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:787",className:"text-lg md:text-2xl font-bold text-white truncate",children:n}),a!==void 0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:789",className:`flex items-center gap-1 mt-1 text-[10px] md:text-xs ${a>=0?"text-[#4ade80]":"text-[#ef4444]"}`,children:[a>=0?e.jsx(ct,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:790",className:"w-3 h-3"}):e.jsx(Fc,{"data-loc":"client/src/components/admin/AdminRevenue.tsx:790",className:"w-3 h-3"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:791",children:[a>=0?"+":"",a.toFixed(1),"%"]})]}),s&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:794",className:"text-[10px] md:text-xs text-white/40 mt-1 truncate",children:s})]})]})}function ba({type:t}){const n={direct:"bg-[#0b6fd9]/10 text-[#0b6fd9] border-[#0b6fd9]/20",reset:"bg-[#f59e0b]/10 text-[#f59e0b] border-[#f59e0b]/20",activation:"bg-[#8b5cf6]/10 text-[#8b5cf6] border-[#8b5cf6]/20"};
10return e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:809",className:`text-[9px] md:text-[10px] font-medium px-1.5 md:px-2 py-0.5 rounded-full border whitespace-nowrap ${n[t]||n.direct}`,children:t})}function ga({status:t}){const n={completed:"bg-[#4ade80]/10 text-[#4ade80] border-[#4ade80]/20",pending:"bg-[#f59e0b]/10 text-[#f59e0b] border-[#f59e0b]/20",failed:"bg-[#ef4444]/10 text-[#ef4444] border-[#ef4444]/20"};return e.jsx("span",{"data-loc":"client/src/components/admin/AdminRevenue.tsx:823",className:`text-[9px] md:text-[10px] font-medium px-1.5 md:px-2 py-0.5 rounded-full border whitespace-nowrap ${n[t]||n.pending}`,children:t})}const Vp=[{label:"Today",days:0},{label:"7D",days:7},{label:"14D",days:14},{label:"30D",days:30},{label:"90D",days:90}],tt={google_ads:"#4285F4",meta_ads:"#1877F2",microsoft_ads:"#00A4EF",organic_search:"#34A853",organic_social:"#E1306C",direct:"#6B7280",referral:"#F59E0B",email:"#8B5CF6",affiliate:"#EC4899",tiktok_ads:"#000000",paid_other:"#9CA3AF",unattributed:"#374151"},pt={google_ads:"Google Ads",meta_ads:"Meta Ads",microsoft_ads:"Microsoft Ads",organic_search:"Organic Search",organic_social:"Organic Social",direct:"Direct",referral:"Referral",email:"Email",affiliate:"Affiliate",tiktok_ads:"TikTok Ads",paid_other:"paid_other",unattributed:"Unattributed"},Hn=[{label:"Last Touch",value:"last_touch"},{label:"First Touch",value:"first_touch"},{label:"Linear",value:"linear"},{label:"Time Decay",value:"time_decay"},{label:"Position (40/20/40)",value:"position_based"}],qp={revenue:{label:"Revenue",color:"#0b6fd9"}},Hp={google_ads:{label:"Google Ads",color:"#4285F4"},meta_ads:{label:"Meta Ads",color:"#1877F2"},organic_search:{label:"Organic Search",color:"#34A853"},direct:{label:"Direct",color:"#6B7280"},referral:{label:"Referral",color:"#F59E0B"}};function Qp(){const[t,n]=h.useState(30),[a,s]=h.useState("last_touch"),[i,o]=h.useState("overview"),[c,d]=h.useState(void 0),l=h.useMemo(()=>{const u=new Date;return{startDate:(t===0?new Date(u.getFullYear(),u.getMonth(),u.getDate()):new Date(u.getTime()-t*24*60*60*1e3)).toISOString().split("T")[0],endDate:u.toISOString().split("T")[0]}},[t]),x=j.tracking.kpis.useQuery(l),r=j.tracking.channelBreakdown.useQuery({...l,model:a}),m=j.tracking.dailyChannelPerformance.useQuery({...l,model:a}),b=j.tracking.topCampaigns.useQuery({...l,model:a,limit:10}),f=j.tracking.conversionPaths.useQuery({...l,limit:8}),p=j.tracking.recentOrders.useQuery({...l,channel:c,limit:15}),A=j.tracking.multiTouchBreakdown.useQuery({model:a,...l},{enabled:i==="multitouch"}),g=j.tracking.dedupLedger.useQuery({...l,limit:50,offset:0},{enabled:i==="dedup"}),w=j.useUtils(),C=j.tracking.refreshAllAttribution.useMutation({onSuccess:u=>{alert(u.message||"Attribution refresh complete"),w.tracking.invalidate()},onError:u=>{alert(`Error: ${u.message}`)}});r.data?.reduce((u,y)=>u+y.revenue,0);const v=h.useMemo(()=>{if(!m.data)return[];const u=new Map;for(const y of m.data){const S=u.get(y.date)||{date:y.date};S[y.channel]=(S[y.channel]||0)+y.revenue,u.set(y.date,S)}return Array.from(u.values()).sort((y,S)=>String(y.date).localeCompare(String(S.date)))},[m.data]),P=h.useMemo(()=>{const u=new Set;return v.forEach(y=>{Object.keys(y).forEach(S=>{S!=="date"&&u.add(S)})}),Array.from(u)},[v]);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:157",className:"space-y-4 md:space-y-6 p-0 md:p-1 w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:159",className:"flex flex-col gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:160",children:[e.jsx("h2",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:161",className:"text-lg md:text-xl font-semibold text-white",children:"Ad Attribution"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:162",className:"text-xs md:text-sm text-white/50 mt-0.5",children:"First-party tracking with device fingerprinting"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:167",className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{"data-loc":"client/src/components/
10admin/AdminAttribution.tsx:169",onClick:()=>{confirm("This will re-run attribution for ALL completed orders. Continue?")&&C.mutate()},disabled:C.isPending,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-lg border border-white/10 bg-white/5 text-white/60 hover:text-white hover:bg-white/10 transition-colors disabled:opacity-50",children:[e.jsx(qe,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:178",className:`w-3.5 h-3.5 ${C.isPending?"animate-spin":""}`}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:179",className:"hidden sm:inline",children:C.isPending?"Refreshing...":"Refresh All"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:182",className:"flex items-center bg-white/5 rounded-lg border border-white/10 p-0.5 overflow-x-auto max-w-full",children:Hn.map(u=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:184",onClick:()=>s(u.value),className:`px-2 md:px-3 py-1.5 text-[10px] md:text-xs font-medium rounded-md transition-all whitespace-nowrap ${a===u.value?"bg-[#0b6fd9] text-white shadow-sm":"text-white/60 hover:text-white/80"}`,children:u.label},u.value))}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:198",className:"flex items-center bg-white/5 rounded-lg border border-white/10 p-0.5",children:Vp.map(u=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:200",onClick:()=>n(u.days),className:`px-2 md:px-3 py-1.5 text-[10px] md:text-xs font-medium rounded-md transition-all whitespace-nowrap ${t===u.days?"bg-[#0b6fd9] text-white shadow-sm":"text-white/60 hover:text-white/80"}`,children:u.label},u.days))})]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:217",className:"flex items-center gap-1 bg-white/5 rounded-lg border border-white/10 p-1 overflow-x-auto",children:["overview","multitouch","dedup"].map(u=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:219",onClick:()=>o(u),className:`px-3 md:px-4 py-2 text-[10px] md:text-xs font-medium rounded-md transition-all whitespace-nowrap ${i===u?"bg-[#0b6fd9] text-white shadow-sm":"text-white/60 hover:text-white/80"}`,children:u==="overview"?"Overview":u==="multitouch"?"Multi-Touch":"Dedup Ledger"},u))}),i==="overview"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:235",className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-2 md:gap-3",children:[e.jsx(Ot,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:236",icon:e.jsx(Ya,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:237",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Attributed Revenue",value:`$${(x.data?.attributedRevenue||0).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}`,loading:x.isLoading,accent:!0}),e.jsx(Ot,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:243",icon:e.jsx(ct,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:244",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Attribution Rate",value:`${x.data?.attributionRate||0}%`,loading:x.isLoading}),e.jsx(Ot,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:249",icon:e.jsx(He,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:250",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Unique Visitors",value:(x.data?.uniqueVisitors||0).toLocaleString(),loading:x.isLoading}),e.jsx(Ot,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:255",icon:e.jsx(Fa,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:256",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Touchpoints",value:(x.data?.totalTouchpoints||0).toLocaleString(),loading:x.isLoading}),e.jsx(Ot,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:261",icon:e.jsx(Ve,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:262",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Avg Days to Convert",value:`${x.data?.avgDaysToConvert||0}`,loading:x.isLoading})]}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:270",className:"grid grid-cols-1 lg:grid-cols-3 gap-3 md:gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:272",className:"lg:col-span-2 bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:273",className:"text-xs md:text-sm font-medium text-white/80 mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(Et,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:274",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Revenue by Channel"]}),r.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:278",className:"h-48 md:h-64 flex items-center justify-center text-white/30",children:"Loading..."}):r.data&&r.data.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:280",config:qp,className:"h-48 md:h-64 w-full",children:e.jsxs(oi,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:281",data:r.data.map(u=>({channel:pt[u.channel]||u.channel,revenue:u.revenue,fill:tt[u.channel]||"#6B7280"})),layout:"vertical",margin:{left:80,right:10,top:5,bottom:5},children:[e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:290",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:291",type:"number",tickFormatter:u=>`$${(u/1e3).toFixed(0)}k`,stroke:"rgba(255,255,255,0.3)",tick:{fontSize:10}}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:292",type:"category",dataKey:"channel",stroke:"rgba(255,255,255,0.5)",width:75,tick:{fontSize:10}}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:293",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:293"})}),e.jsx(fs,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:294",dataKey:"revenue",radius:[0,4,4,0]})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:298",className:"h-48 md:h-64 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No attribution data yet."})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:305",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:306",className:"text-xs md:text-sm font-medium text-white/80 mb-3 md:mb-4",children:"Revenue Share"}),r.data&&r.data.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:308",className:"h-48 md:h-64 flex items-center justify-center",children:e.jsxs(Bt,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:309",width:200,height:200,children:[e.jsx(xe,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:310",data:r.data.map(u=>({name:pt[u.channel]||u.channel,value:u.revenue})),cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:2,dataKey:"value",children:r.data.map((u,y)=>e.jsx(Le,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:323",fill:tt[u.channel]||"#6B7280"},y))}),e.jsx(Ja,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:326",layout:"vertical",align:"right",verticalAlign:"middle",formatter:u=>e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:330",className:"text-[10px] md:text-xs text-white/70",children:u})})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:335",className:"h-48 md:h-64 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No data yet"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:343",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:344",className:"text-xs md:text-sm font-medium text-white/80 mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(ct,{"data-loc":"client/src/components/
10admin/AdminAttribution.tsx:345",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Daily Revenue by Channel"]}),m.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:349",className:"h-48 md:h-64 flex items-center justify-center text-white/30",children:"Loading..."}):v.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:351",config:Hp,className:"h-48 md:h-64 w-full",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:352",data:v,margin:{left:0,right:5,top:5,bottom:5},children:[e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:353",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:354",dataKey:"date",stroke:"rgba(255,255,255,0.3)",tick:{fontSize:9},tickFormatter:u=>new Date(u+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:360",stroke:"rgba(255,255,255,0.3)",tickFormatter:u=>`$${(u/1e3).toFixed(0)}k`,tick:{fontSize:9}}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:361",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:361"})}),P.map(u=>e.jsx(ke,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:363",type:"monotone",dataKey:u,stackId:"1",stroke:tt[u]||"#6B7280",fill:tt[u]||"#6B7280",fillOpacity:.4},u))]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:376",className:"h-48 md:h-64 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No trend data yet"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:383",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:384",className:"text-xs md:text-sm font-medium text-white/80 mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(ln,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:385",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Top Campaigns"]}),b.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:389",className:"h-32 flex items-center justify-center text-white/30",children:"Loading..."}):b.data&&b.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:393",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:394",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:395",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:396",className:"border-b border-white/10 text-white/50",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:397",className:"text-left py-2 px-3 font-medium",children:"Channel"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:398",className:"text-left py-2 px-3 font-medium",children:"Campaign"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:399",className:"text-right py-2 px-3 font-medium",children:"Revenue"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:400",className:"text-right py-2 px-3 font-medium",children:"Conversions"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:401",className:"text-right py-2 px-3 font-medium",children:"AOV"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:404",children:b.data.map((u,y)=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:406",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:407",className:"py-2.5 px-3",children:e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:408",channel:u.channel})}
10),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:410",className:"py-2.5 px-3 text-white/80 max-w-[200px] truncate",children:u.campaign}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:411",className:"py-2.5 px-3 text-right text-white font-medium",children:["$",u.revenue.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:412",className:"py-2.5 px-3 text-right text-white/70",children:u.conversions}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:413",className:"py-2.5 px-3 text-right text-white/70",children:["$",u.avgOrderValue.toFixed(0)]})]},y))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:420",className:"md:hidden space-y-2",children:b.data.map((u,y)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:422",className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:423",className:"flex items-center justify-between mb-2",children:[e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:424",channel:u.channel}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:425",className:"text-sm font-bold text-white",children:["$",u.revenue.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})]})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:427",className:"text-xs text-white/60 truncate mb-1.5",children:u.campaign}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:428",className:"flex items-center gap-3 text-[10px] text-white/40",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:429",children:[u.conversions," conv"]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:430",children:["AOV $",u.avgOrderValue.toFixed(0)]})]})]},y))})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:437",className:"h-32 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No campaign data yet"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:444",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:445",className:"text-xs md:text-sm font-medium text-white/80 mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(Ws,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:446",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Recent Conversion Paths"]}),f.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:450",className:"h-32 flex items-center justify-center text-white/30",children:"Loading..."}):f.data&&f.data.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:452",className:"space-y-2 md:space-y-3",children:f.data.map((u,y)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:454",className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 p-2.5 md:p-3 bg-white/[0.02] rounded-lg border border-white/5",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:455",className:"flex items-center gap-1 flex-1 overflow-x-auto pb-1 sm:pb-0",children:u.journeySummary.map((S,O)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:457",className:"flex items-center gap-1 shrink-0",children:[O>0&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:458",className:"text-white/20 mx-0.5",children:"â"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:459",className:"px-1.5 md:px-2 py-0.5 rounded text-[10px] md:text-xs font-medium whitespace-nowrap",style:{backgroundColor:`${tt[S.channel]||"#6B7280"}20`,color:tt[S.channel]||"#6B7280"},children:pt[S.channel]||S.channel})]},O))}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:471",className:"text-left sm:text-right shrink-0 flex sm:flex-col items-center sm:items-end gap-2 sm:gap-0",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:472",className:"text-sm font-medium text-white",children:["$",u.revenue.toFixed(0)]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:473",className:"text-[10px] text-white/40",children:[u.daysToConvert,"d ⢠",u.touchpointCount," touches"]})]})]},y))}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:479",className:"h-32 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No conversion paths yet"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:486",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:487",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-3 md:mb-4",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:488",className:"text-xs md:text-sm font-medium text-white/80 flex items-center gap-2",children:[e.jsx(us,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:489",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Recent Attributed Orders"]}),e.jsxs("select",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:492",value:c||"all",onChange:u=>d(u.target.value==="all"?void 0:u.target.value),className:"bg-white/5 border border-white/10 rounded-lg px-2.5 py-1.5 text-xs text-white/80 focus:outline-none focus:ring-1 focus:ring-[#0b6fd9] w-full sm:w-auto",children:[e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:497",value:"all",children:"All Channels"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:498",value:"google_ads",children:"Google Ads"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:499",value:"meta_ads",children:"Meta Ads"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:500",value:"organic_search",children:"Organic Search"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:501",value:"direct",children:"Direct"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:502",value:"referral",children:"Referral"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:503",value:"email",children:"Email"}),e.jsx("option",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:504",value:"affiliate",children:"Affiliate"})]})]}),p.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:508",className:"h-32 flex items-center justify-center text-white/30",children:"Loading..."}):p.data&&p.data.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:512",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:513",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:514",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:515",className:"border-b border-white/10 text-white/50",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:516",className:"text-left py-2 px-3 font-medium",children:"Order"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:517",className:"text-left py-2 px-3 font-medium",children:"First Touch"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:518",className:"text-left py-2 px-3 font-medium",children:"Last Touch"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:519",className:"text-right py-2 px-3 font-medium",children:"Revenue"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:520",className:"text-right py-2 px-3 font-medium",children:"Touches"}
10),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:521",className:"text-right py-2 px-3 font-medium",children:"Days"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:522",className:"text-right py-2 px-3 font-medium",children:"Confidence"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:525",children:p.data.map((u,y)=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:527",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:528",className:"py-2.5 px-3 text-white/70 font-mono text-xs",children:u.merchantOrderId?.substring(0,16)||`#${u.id}`}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:529",className:"py-2.5 px-3",children:e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:530",channel:u.firstTouchChannel,campaign:u.firstTouchCampaign})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:532",className:"py-2.5 px-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:533",className:"flex items-center gap-1",children:[e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:534",channel:u.correctedChannel||u.lastTouchChannel,campaign:u.correctedCampaign||u.lastTouchCampaign}),u.isBrandedSearch&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:536",className:"text-[9px] px-1 py-0.5 rounded bg-amber-500/20 text-amber-400 font-medium",title:`Branded search corrected from Google Ads to ${u.correctedChannel||"none"}`,children:"BS"})]})}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:540",className:"py-2.5 px-3 text-right text-white font-medium",children:["$",parseFloat(u.orderRevenue).toFixed(0)]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:541",className:"py-2.5 px-3 text-right text-white/70",children:u.touchpointCount}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:542",className:"py-2.5 px-3 text-right text-white/70",children:u.daysToConvert??"â"}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:543",className:"py-2.5 px-3 text-right",children:e.jsx(Aa,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:544",confidence:parseFloat(u.matchConfidence||"0")})})]},y))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:552",className:"md:hidden space-y-2",children:p.data.map((u,y)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:554",className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:555",className:"flex items-center justify-between mb-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:556",className:"text-[10px] text-white/50 font-mono",children:u.merchantOrderId?.substring(0,12)||`#${u.id}`}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:557",className:"text-sm font-bold text-white",children:["$",parseFloat(u.orderRevenue).toFixed(0)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:559",className:"flex flex-wrap items-center gap-1.5 mb-2",children:[e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:560",channel:u.firstTouchChannel}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:561",className:"text-white/20 text-xs",children:"â"}),e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:562",channel:u.correctedChannel||u.lastTouchChannel}),u.isBrandedSearch&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:564",className:"text-[9px] px-1 py-0.5 rounded bg-amber-500/20 text-amber-400 font-medium",children:"BS"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:567",className:"flex items-center gap-3 text-[10px] text-white/40",children:[e.jsxs("span",{"data-loc":"client/src/components/
10admin/AdminAttribution.tsx:568",children:[u.touchpointCount," touches"]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:569",children:[u.daysToConvert??"â"," days"]}),e.jsx(Aa,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:570",confidence:parseFloat(u.matchConfidence||"0")})]})]},y))})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:577",className:"h-32 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No attributed orders yet."})]})]}),i==="multitouch"&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:586",className:"space-y-4 md:space-y-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:587",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:588",className:"text-xs md:text-sm font-medium text-white/80 mb-3 flex items-center gap-2",children:[e.jsx(Et,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:589",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Attribution Model Comparison"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:592",className:"text-[10px] md:text-xs text-white/40 mb-4",children:"Toggle between models to see how revenue attribution changes."}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:595",className:"flex flex-wrap gap-2 mb-4 md:mb-6",children:Hn.map(u=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:597",onClick:()=>s(u.value),className:`px-3 py-1.5 md:py-2 text-[10px] md:text-xs font-medium rounded-lg transition-all ${a===u.value?"bg-[#0b6fd9] text-white shadow-sm":"bg-white/5 text-white/60 hover:text-white/80 border border-white/10"}`,children:u.label},u.value))}),A.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:613",className:"h-48 flex items-center justify-center text-white/30",children:"Loading model data..."}):A.data&&Array.isArray(A.data.channelBreakdown)&&A.data.channelBreakdown.length>0?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:615",className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:616",className:"grid grid-cols-2 md:grid-cols-3 gap-2 md:gap-4 mb-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:617",className:"bg-white/[0.02] rounded-lg p-2.5 md:p-3 border border-white/5",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:618",className:"text-[10px] md:text-xs text-white/50",children:"Total Revenue"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:619",className:"text-sm md:text-lg font-semibold text-white",children:["$",A.data.totalRevenue.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:621",className:"bg-white/[0.02] rounded-lg p-2.5 md:p-3 border border-white/5",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:622",className:"text-[10px] md:text-xs text-white/50",children:"Total Orders"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:623",className:"text-sm md:text-lg font-semibold text-white",children:A.data.totalOrders})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:625",className:"bg-white/[0.02] rounded-lg p-2.5 md:p-3 border border-white/5 col-span-2 md:col-span-1",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:626",className:"text-[10px] md:text-xs text-white/50",children:"Model"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:627",className:"text-sm md:text-lg font-semibold text-[#0b6fd9]",children:Hn.find(u=>u.value===a)?.label})]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:631",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/
10admin/AdminAttribution.tsx:632",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:633",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:634",className:"border-b border-white/10 text-white/50",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:635",className:"text-left py-2 px-3 font-medium",children:"Channel"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:636",className:"text-right py-2 px-3 font-medium",children:"Attributed Revenue"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:637",className:"text-right py-2 px-3 font-medium",children:"Attributed Orders"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:638",className:"text-right py-2 px-3 font-medium",children:"% of Revenue"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:641",children:A.data.channelBreakdown.map((u,y)=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:643",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:644",className:"py-2.5 px-3",children:e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:645",channel:u.channel})}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:647",className:"py-2.5 px-3 text-right text-white font-medium",children:["$",u.revenue.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:648",className:"py-2.5 px-3 text-right text-white/70",children:u.orders.toFixed(1)}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:649",className:"py-2.5 px-3 text-right text-white/70",children:[u.percentage,"%"]})]},y))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:656",className:"md:hidden space-y-2",children:A.data.channelBreakdown.map((u,y)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:658",className:"bg-white/[0.02] border border-white/5 rounded-lg p-3 flex items-center justify-between",children:[e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:659",channel:u.channel}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:660",className:"text-right",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:661",className:"text-sm font-bold text-white",children:["$",u.revenue.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:662",className:"text-[10px] text-white/40",children:[u.percentage,"% ⢠",u.orders.toFixed(1)," orders"]})]})]},y))})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:669",className:"h-48 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No multi-touch data yet."})]})}),i==="dedup"&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:679",className:"space-y-4 md:space-y-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:680",className:"bg-white/[0.03] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:681",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-3 md:mb-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:682",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:683",className:"text-xs md:text-sm font-medium text-white/80 flex items-center gap-2",children:[e.jsx(Ws,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:684",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Cross-Platform Dedup Ledger"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:687",className:"text-[10px] md:text-xs text-white/40 mt-1",children:"Each order assigned to ONE deterministic source."})]}
10),g.data&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:692",className:"flex items-center gap-2",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:693",className:"text-[10px] md:text-xs text-white/50",children:[g.data.total," orders"]}),g.data.conflicts>0&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:695",className:"px-2 py-0.5 bg-amber-500/20 text-amber-400 rounded text-[10px] font-medium",children:[g.data.conflicts," conflicts"]})]})]}),g.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:704",className:"h-48 flex items-center justify-center text-white/30",children:"Loading dedup ledger..."}):g.data&&g.data.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:708",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:709",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:710",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:711",className:"border-b border-white/10 text-white/50",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:712",className:"text-left py-2 px-3 font-medium",children:"Order"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:713",className:"text-left py-2 px-3 font-medium",children:"Source"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:714",className:"text-left py-2 px-3 font-medium",children:"Click ID"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:715",className:"text-right py-2 px-3 font-medium",children:"Revenue"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:716",className:"text-center py-2 px-3 font-medium",children:"Conflict"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:717",className:"text-left py-2 px-3 font-medium",children:"Claiming Platforms"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:720",children:g.data.items.map((u,y)=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:722",className:`border-b border-white/5 hover:bg-white/[0.02] ${u.hasConflict?"bg-amber-500/[0.03]":""}`,children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:723",className:"py-2.5 px-3 text-white/70 font-mono text-xs",children:u.merchantOrderId?.substring(0,16)||`#${u.orderId}`}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:724",className:"py-2.5 px-3",children:e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:725",channel:u.deterministicSource})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:727",className:"py-2.5 px-3 text-white/50 font-mono text-[10px] max-w-[120px] truncate",children:u.deterministicClickId?`${u.deterministicClickType}: ${u.deterministicClickId.substring(0,20)}...`:"â"}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:730",className:"py-2.5 px-3 text-right text-white font-medium",children:["$",u.revenue?.toFixed(0)||"0"]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:731",className:"py-2.5 px-3 text-center",children:u.hasConflict?e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:733",className:"px-1.5 py-0.5 bg-amber-500/20 text-amber-400 rounded text-[10px] font-bold",children:"CONFLICT"}):e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:735",className:"text-white/20",children:"â"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:738",className:"py-2.5 px-3",children:u.claimingPlatforms&&u.claimingPlatforms.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:740",className:"flex gap-1 flex-wrap",children:u.claimingPlatforms.map((S,O)=>
10e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:742",className:"px-1.5 py-0.5 bg-white/5 text-white/60 rounded text-[10px]",children:pt[S]||S},O))}):e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:748",className:"text-white/20",children:"â"})})]},y))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:757",className:"md:hidden space-y-2",children:g.data.items.map((u,y)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:759",className:`bg-white/[0.02] border rounded-lg p-3 ${u.hasConflict?"border-amber-500/30":"border-white/5"}`,children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:760",className:"flex items-center justify-between mb-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:761",className:"text-[10px] text-white/50 font-mono",children:u.merchantOrderId?.substring(0,12)||`#${u.orderId}`}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:762",className:"text-sm font-bold text-white",children:["$",u.revenue?.toFixed(0)||"0"]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:764",className:"flex items-center gap-2 mb-2",children:[e.jsx(je,{"data-loc":"client/src/components/admin/AdminAttribution.tsx:765",channel:u.deterministicSource}),u.hasConflict&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:767",className:"px-1.5 py-0.5 bg-amber-500/20 text-amber-400 rounded text-[10px] font-bold",children:"CONFLICT"})]}),u.claimingPlatforms&&u.claimingPlatforms.length>0&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:771",className:"flex gap-1 flex-wrap",children:u.claimingPlatforms.map((S,O)=>e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:773",className:"px-1.5 py-0.5 bg-white/5 text-white/60 rounded text-[10px]",children:pt[S]||S},O))})]},y))})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:784",className:"h-48 flex items-center justify-center text-white/30 text-xs md:text-sm",children:"No dedup data yet."})]})})]})}function Ot({icon:t,label:n,value:a,loading:s,accent:i}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:805",className:`bg-white/[0.03] border rounded-xl p-3 md:p-4 ${i?"border-[#0b6fd9]/30":"border-white/10"}`,children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:806",className:"flex items-center gap-1.5 md:gap-2 text-white/50 mb-1.5 md:mb-2",children:[t,e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:808",className:"text-[10px] md:text-xs font-medium leading-tight",children:n})]}),s?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:811",className:"h-6 md:h-7 w-16 md:w-20 bg-white/5 rounded animate-pulse"}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:813",className:`text-sm md:text-lg font-semibold ${i?"text-[#0b6fd9]":"text-white"}`,children:a})]})}function je({channel:t,campaign:n}){const a=tt[t]||"#6B7280";return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:824",className:"flex flex-col",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:825",className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] md:text-xs font-medium w-fit",style:{backgroundColor:`${a}20`,color:a},children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:829",className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:a}}),pt[t]||t]}),n&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:833",className:"text-[9px] md:text-[10px] text-white/40 mt-0.5 truncate max-w-[100px] md:max-w-[120px]",children:n})]})}function Aa({confidence:t}){const n=Math.round(t*100);let a="text-red-400";return n>=90?a="text-green-400":n>=70?a="text-yellow-400":n>=50&&(a="text-orange-400"),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAttribution.tsx:847",className:`text-[10px] md:text-xs font-medium ${a}`,children:[n,"%"]})}const va={pending:"bg-yellow-500/10 text-yellow-400",approved:"bg-[#4ade80]/10 text-[#4ade80]",rejected:"bg-red-500/10 text-red-400"};function Zp(){const t=j.useUtils(),[n,a]=h.useState(1),[s,i]=h.useState("all"),[o,c]=h.useState(null),d=j.reviewSubmissions.list.useQuery({page:n,limit:20,status:s}),l=j.reviewSubmissions.stats.useQuery(),x=j.reviewSubmissions.updateStatus.useMutation({onSuccess:(p,A)=>
10{t.reviewSubmissions.list.invalidate(),t.reviewSubmissions.stats.invalidate(),R.success(`Submission ${A.status}`)},onError:p=>R.error(p.message)}),r=j.reviewSubmissions.bulkApprove.useMutation({onSuccess:p=>{t.reviewSubmissions.list.invalidate(),t.reviewSubmissions.stats.invalidate(),p.failed>0?R.warning(`Approved ${p.approved+p.failed} submissions. ${p.approved} accounts provisioned, ${p.failed} failed.`):R.success(`All ${p.approved} submissions approved & accounts provisioned!`)},onError:p=>R.error(p.message)}),[m,b]=h.useState(!1),f=Math.ceil((d.data?.total??0)/20);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:54",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:56",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:57",children:[e.jsxs("h1",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:58",className:"text-lg md:text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ns,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:59",className:"w-5 h-5 md:w-6 md:h-6 text-[#4ade80]"}),"Review Submissions"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:62",className:"text-white/60 text-xs md:text-sm mt-1",children:"FREE $5K Instant Funding â Review claims"})]}),(l.data?.pending??0)>0&&e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:67",onClick:()=>b(!0),disabled:r.isPending,className:"bg-[#4ade80] text-black hover:bg-[#4ade80]/80 font-bold gap-2",children:[e.jsx(_s,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:72",className:"w-4 h-4"}),r.isPending?"Provisioning...":`Approve All (${l.data?.pending})`]})]}),m&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:80",className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:81",className:"bg-[#1a1a1a] border border-white/10 rounded-xl p-6 max-w-md w-full space-y-4",children:[e.jsx("h2",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:82",className:"text-lg font-bold text-white",children:"Approve All Pending Submissions?"}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:83",className:"text-white/60 text-sm",children:["This will approve ",e.jsx("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:84",className:"text-[#4ade80] font-bold",children:l.data?.pending})," pending submissions and create a FREE $5K Instant Funding account for each one via Axcera."]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:86",className:"text-yellow-400/80 text-xs",children:"â ï¸ This action cannot be undone. Each approved customer will receive a $5K account."}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:89",className:"flex gap-3 pt-2",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:90",onClick:()=>b(!1),variant:"outline",className:"flex-1 border-white/10 text-white/60",children:"Cancel"}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:97",onClick:()=>{b(!1),r.mutate()},className:"flex-1 bg-[#4ade80] text-black hover:bg-[#4ade80]/80 font-bold",children:[e.jsx(_s,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:104",className:"w-4 h-4 mr-1"}),"Confirm Approve All"]})]})]})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:113",className:"grid grid-cols-2 sm:grid-cols-4 gap-2 md:gap-4 mb-4 md:mb-6",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:114",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/
10admin/AdminReviewSubmissions.tsx:115",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:116",className:"w-10 h-10 rounded-lg bg-[#0781fe]/10 flex items-center justify-center",children:e.jsx(Fn,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:117",className:"w-5 h-5 text-[#0781fe]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:119",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:120",className:"text-2xl font-bold text-white",children:l.data?.total??0}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:121",className:"text-xs text-white/50",children:"Total"})]})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:125",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:126",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:127",className:"w-10 h-10 rounded-lg bg-yellow-500/10 flex items-center justify-center",children:e.jsx(Ve,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:128",className:"w-5 h-5 text-yellow-400"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:130",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:131",className:"text-2xl font-bold text-white",children:l.data?.pending??0}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:132",className:"text-xs text-white/50",children:"Pending"})]})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:136",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:137",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:138",className:"w-10 h-10 rounded-lg bg-[#4ade80]/10 flex items-center justify-center",children:e.jsx(Ge,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:139",className:"w-5 h-5 text-[#4ade80]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:141",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:142",className:"text-2xl font-bold text-white",children:l.data?.approved??0}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:143",className:"text-xs text-white/50",children:"Approved"})]})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:147",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:148",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:149",className:"w-10 h-10 rounded-lg bg-red-500/10 flex items-center justify-center",children:e.jsx(vt,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:150",className:"w-5 h-5 text-red-400"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:152",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:153",className:"text-2xl font-bold text-white",children:l.data?.rejected??0}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:154",className:"text-xs text-white/50",children:"Rejected"})]})]})})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:161",className:"flex gap-2 mb-4 flex-wrap",children:["all","pending","approved","rejected"].map(p=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:163",onClick:()=>{i(p),a(1)},className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${s===p?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/50 hover:text-white hover:bg-white/10"}`,children:p.charAt(0).toUpperCase()+p.slice(1)},p))}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:178",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:180",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:181",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:182",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:183",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:184",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Email"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:185",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Order"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:186",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Screenshot"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:187",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Status"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:188",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Date"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:189",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:192",children:d.data?.items.map(p=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:194",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:195",className:"px-4 py-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:196",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:197",className:"text-white text-sm",children:p.email}),(p.firstName||p.lastName)&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:199",className:"text-white/40 text-xs",children:[p.firstName,p.lastName].filter(Boolean).join(" ")})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:203",className:"px-4 py-3",children:e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:204",className:"text-white/70 font-mono text-xs",children:["#",p.orderId]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:206",className:"px-4 py-3",children:e.jsxs("button",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:207",onClick:()=>c(p.screenshotUrl),className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-medium hover:bg-[#0b6fd9]/20 transition-colors",children:[e.jsx(Fn,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:211",className:"w-3 h-3"}),"View"]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:215",className:"px-4 py-3",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:216",className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase ${va[p.status]}`,children:p.status})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:220",className:"px-4 py-3 text-white/50 text-xs",children:new Date(p.createdAt).toLocaleDateString()}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:223",className:"px-4 py-3 text-right",children:[p.status==="pending"&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:225",className:"flex gap-1.5 justify-end",children:[e.jsxs(L,{"data-loc":"client/src/components/
10admin/AdminReviewSubmissions.tsx:226",size:"sm",onClick:()=>x.mutate({id:p.id,status:"approved"}),disabled:x.isPending,className:"bg-[#4ade80]/10 text-[#4ade80] hover:bg-[#4ade80]/20 border-0 h-7 px-2 text-xs",children:[e.jsx(Ge,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:232",className:"w-3 h-3 mr-1"}),"Approve"]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:235",size:"sm",onClick:()=>x.mutate({id:p.id,status:"rejected"}),disabled:x.isPending,className:"bg-red-500/10 text-red-400 hover:bg-red-500/20 border-0 h-7 px-2 text-xs",children:[e.jsx(vt,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:241",className:"w-3 h-3 mr-1"}),"Reject"]})]}),p.status!=="pending"&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:247",className:"text-white/30 text-xs italic",children:p.status==="approved"?"â Done":"â Rejected"})]})]},p.id))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:259",className:"md:hidden divide-y divide-white/5",children:d.data?.items.map(p=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:261",className:"p-4 space-y-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:262",className:"flex items-center justify-between",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:263",className:"text-white text-sm font-medium truncate max-w-[60%]",children:p.email}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:264",className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase ${va[p.status]}`,children:p.status})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:268",className:"flex items-center gap-3 text-xs text-white/50",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:269",className:"font-mono",children:["#",p.orderId]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:270",children:new Date(p.createdAt).toLocaleDateString()})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:272",className:"flex items-center gap-2 pt-1",children:[e.jsxs("button",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:273",onClick:()=>c(p.screenshotUrl),className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-[#0b6fd9]/10 text-[#0781fe] text-xs font-medium",children:[e.jsx(Fn,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:277",className:"w-3 h-3"}),"View Screenshot"]}),p.status==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:282",size:"sm",onClick:()=>x.mutate({id:p.id,status:"approved"}),className:"bg-[#4ade80]/10 text-[#4ade80] hover:bg-[#4ade80]/20 border-0 h-6 px-2 text-[10px]",children:"Approve"}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:289",size:"sm",onClick:()=>x.mutate({id:p.id,status:"rejected"}),className:"bg-red-500/10 text-red-400 hover:bg-red-500/20 border-0 h-6 px-2 text-[10px]",children:"Reject"})]})]})]},p.id))}),d.data?.items.length===0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:305",className:"p-8 text-center",children:[e.jsx(ns,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:306",className:"w-10 h-10 text-white/20 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:307",className:"text-white/50 text-sm",children:"No submissions yet"})]}),f>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:313",className:"flex items-center justify-between px-4 py-3 border-t border-white/10",children:[e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:314",className:"text-white/40 text-xs",children:["Page ",n," of ",f," (",d.data?.total," total)"]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:317",className:"flex gap-1.5",children:[e.jsx(L,{"data-loc":"client/src/components/
10admin/AdminReviewSubmissions.tsx:318",size:"sm",variant:"outline",onClick:()=>a(p=>Math.max(1,p-1)),disabled:n<=1,className:"h-7 px-2 border-white/10 text-white/50",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:325",className:"w-3.5 h-3.5"})}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:327",size:"sm",variant:"outline",onClick:()=>a(p=>Math.min(f,p+1)),disabled:n>=f,className:"h-7 px-2 border-white/10 text-white/50",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:334",className:"w-3.5 h-3.5"})})]})]})]}),o&&e.jsx("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:343",className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>c(null),children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:347",className:"max-w-3xl w-full max-h-[80vh] relative",onClick:p=>p.stopPropagation(),children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:348",onClick:()=>c(null),className:"absolute -top-10 right-0 text-white/60 hover:text-white text-sm",children:"Close â"}),e.jsx("img",{"data-loc":"client/src/components/admin/AdminReviewSubmissions.tsx:354",src:o,alt:"Review screenshot",className:"w-full h-auto max-h-[80vh] object-contain rounded-xl border border-white/10"})]})})]})}function Jp(){const t=j.useUtils(),[n,a]=h.useState(""),[s,i]=h.useState(""),[o,c]=h.useState(0),[d,l]=h.useState(!1);h.useEffect(()=>{const m=setTimeout(()=>{i(n),c(0)},300);return()=>clearTimeout(m)},[n]);
10const x=j.blacklist.list.useQuery({search:s||void 0,limit:20,offset:o*20}),r=j.blacklist.remove.useMutation({onSuccess:()=>{t.blacklist.list.invalidate(),R.success("Entry removed from blacklist")},onError:m=>R.error(m.message)});return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:38",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:40",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:41",children:[e.jsxs("h1",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:42",className:"text-lg md:text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(pn,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:43",className:"w-5 h-5 md:w-6 md:h-6 text-red-400"}),"Blacklist Manager"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:46",className:"text-white/60 text-xs md:text-sm mt-1",children:"Block customers from purchasing. Blocks by name OR email (case-insensitive)."})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:50",onClick:()=>l(!0),className:"bg-red-600 hover:bg-red-700 text-white w-full sm:w-auto",size:"sm",children:[e.jsx(zt,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:55",className:"w-4 h-4 mr-1.5"})," Add to Blacklist"]})]}),d&&e.jsx(Xp,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:61",onClose:()=>l(!1)}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:65",className:"relative mb-4",children:[e.jsx(Ka,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:66",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/30"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:67",type:"text",value:n,onChange:m=>a(m.target.value),placeholder:"Search blacklisted names or emails...",className:"w-full pl-9 pr-8 py-2.5 text-sm bg-[#0d0d0d] border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-red-500/50 transition-colors"}),n&&e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:75",onClick:()=>a(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/30 hover:text-white/60",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:79",className:"w-3.5 h-3.5"})})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:85",className:"bg-[#141414] border border-white/10 rounded-xl overflow-hidden",children:x.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:87",className:"animate-pulse text-white/30 text-sm py-12 text-center",children:"Loading blacklist..."}):x.data?.entries.length===0?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:89",className:"py-12 text-center",children:[e.jsx(pn,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:90",className:"w-10 h-10 text-white/10 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:91",className:"text-white/40 text-sm",children:n?"No matching entries found":"No one is blacklisted yet"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:98",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:99",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:100",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:101",className:"border-b border-white/10",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:102",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Name"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:103",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Email"}
10),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:104",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Reason"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:105",className:"text-left text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Added"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:106",className:"text-right text-white/50 text-xs uppercase tracking-wider px-4 py-3",children:"Actions"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:109",children:x.data?.entries.map(m=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:111",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:112",className:"px-4 py-3",children:e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:113",className:"text-white font-medium",children:[m.firstName," ",m.lastName]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:115",className:"px-4 py-3 text-white/60 text-xs",children:m.email||e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:116",className:"text-white/20",children:"â"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:118",className:"px-4 py-3 text-white/50 text-xs max-w-[200px] truncate",children:m.reason||e.jsx("span",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:119",className:"text-white/20",children:"No reason provided"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:121",className:"px-4 py-3 text-white/40 text-xs",children:new Date(m.createdAt).toLocaleDateString()}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:124",className:"px-4 py-3 text-right",children:e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:125",onClick:()=>{confirm(`Remove "${m.firstName} ${m.lastName}" from the blacklist?`)&&r.mutate({id:m.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",title:"Remove from blacklist",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:134",className:"w-3.5 h-3.5"})})})]},m.id))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:144",className:"md:hidden divide-y divide-white/5",children:x.data?.entries.map(m=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:146",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:147",className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:148",className:"text-sm font-medium text-white",children:[m.firstName," ",m.lastName]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:149",onClick:()=>{confirm(`Remove "${m.firstName} ${m.lastName}" from the blacklist?`)&&r.mutate({id:m.id})},className:"p-1.5 rounded-lg hover:bg-red-500/10 text-white/60 hover:text-red-400 transition-colors",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:157",className:"w-3.5 h-3.5"})})]}),m.email&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:161",className:"text-white/50 text-xs mb-1",children:m.email}),m.reason&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:164",className:"text-white/40 text-[10px] mb-1 truncate",children:m.reason}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:166",className:"text-white/30 text-[10px]",children:["Added ",new Date(m.createdAt).toLocaleDateString()]})]},m.id))}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:172",className:"flex items-center justify-between px-4 py-3 border-t border-white/5",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:173",className:"text-[10px] md:text-xs text-white/40",children:[x.data?.total??0," total entries"]}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:176",className:"flex items-center gap-2",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:177",onClick:()=>c(m=>Math.max(0,m-1)),disabled:o===0,className:"p-1.5 rounded hover:bg-white/5 disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(Me,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:182",className:"w-4 h-4 text-white/60"})}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:184",className:"text-xs text-white/50",children:["Page ",o+1]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:185",onClick:()=>c(m=>m+1),disabled:!x.data||(o+1)*20>=x.data.total,className:"p-1.5 rounded hover:bg-white/5 disabled:opacity-30 disabled:cursor-not-allowed",children:e.jsx(Te,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:190",className:"w-4 h-4 text-white/60"})})]})]})]})})]})}function Xp({onClose:t}){const n=j.useUtils(),a=j.blacklist.add.useMutation({onSuccess:()=>{n.blacklist.list.invalidate(),R.success("Added to blacklist"),t()},onError:c=>R.error(c.message)}),[s,i]=h.useState({firstName:"",lastName:"",email:"",reason:""}),o=c=>{if(c.preventDefault(),!s.firstName.trim()||!s.lastName.trim()){R.error("First name and last name are required");return}a.mutate({firstName:s.firstName.trim(),lastName:s.lastName.trim(),email:s.email.trim()||void 0,reason:s.reason.trim()||void 0})};return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:234",className:"bg-[#141414] border border-red-500/20 rounded-xl p-4 md:p-5 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:235",className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:236",className:"text-white font-semibold text-sm md:text-base flex items-center gap-2",children:[e.jsx(pn,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:237",className:"w-4 h-4 text-red-400"}),"Add to Blacklist"]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:240",onClick:t,className:"text-white/40 hover:text-white/70 transition-colors",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:241",className:"w-4 h-4"})})]}),e.jsxs("form",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:244",onSubmit:o,className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:245",className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:246",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:247",className:"block text-[10px] md:text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"First Name *"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:250",type:"text",value:s.firstName,onChange:c=>i(d=>({...d,firstName:c.target.value})),placeholder:"John",className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-red-500/50 focus:outline-none",required:!0})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:259",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:260",className:"block text-[10px] md:text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Last Name *"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:263",type:"text",value:s.lastName,onChange:c=>i(d=>({...d,lastName:c.target.value})),placeholder:"Doe",className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-red-500/50 focus:outline-none",required:!0})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:273",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:274",className:"block text-[10px] md:text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Email (blocks independently of name)"}
10),e.jsx("input",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:277",type:"email",value:s.email,onChange:c=>i(d=>({...d,email:c.target.value})),placeholder:"[email protected]",className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-red-500/50 focus:outline-none"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:285",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:286",className:"block text-[10px] md:text-xs text-white/50 mb-1.5 uppercase tracking-wider",children:"Reason (optional)"}),e.jsx("textarea",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:289",value:s.reason,onChange:c=>i(d=>({...d,reason:c.target.value})),placeholder:"Why is this person being blacklisted?",rows:2,className:"w-full px-3 py-2 rounded-lg bg-[#0d0d0d] border border-white/10 text-white text-sm focus:border-red-500/50 focus:outline-none resize-y"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:297",className:"flex items-center gap-3 pt-1",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:298",type:"submit",disabled:a.isPending,className:"bg-red-600 hover:bg-red-700 text-white",size:"sm",children:a.isPending?"Adding...":"Add to Blacklist"}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminBlacklist.tsx:306",type:"button",onClick:t,variant:"outline",size:"sm",className:"text-white/60 border-white/10 hover:bg-white/5",children:"Cancel"})]})]})]})}const eh={visits:{label:"Visits",color:"#0b6fd9"}},th={bounceRate:{label:"Bounce Rate",color:"#f59e0b"}},nh={visits:{label:"Visits",color:"#0b6fd9"}},wa={Direct:"#6366f1","Organic Search":"#22c55e","Paid Search":"#f59e0b",Social:"#ec4899",Referrals:"#06b6d4","Display Ads":"#8b5cf6",Mail:"#ef4444",Search:"#22c55e",Display:"#8b5cf6"},ya={840:"ðºð¸",356:"ð®ð³",360:"ð®ð©",710:"ð¿ð¦",826:"ð¬ð§",124:"ð¨ð¦",12:"ð©ð¿",404:"ð°ðª",231:"ðªð¹",608:"ðµð",566:"ð³ð¬",276:"ð©ðª",36:"ð¦ðº",250:"ð«ð·",76:"ð§ð·",682:"ð¸ð¦",784:"ð¦ðª",586:"ðµð°",288:"ð¬ð",818:"ðªð¬"};function Ke(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toFixed(0)}function ja(t){const n=Math.floor(t/60),a=Math.round(t%60);return n>0?`${n}m ${a}s`:`${a}s`}function Qn(t){return new Date(t).toLocaleDateString(void 0,{month:"short",year:"2-digit"})}function sh(){const{data:t,isLoading:n,error:a}=j.webAnalytics.getDashboard.useQuery({months:6}),s=h.useMemo(()=>{if(!t)return null;const l=t.visitsTotal||[],x=l.length>0?l[l.length-1].visits:0,r=l.reduce((w,C)=>w+C.visits,0),m=t.globalRank||[],b=m.length>0?m[m.length-1].global_rank:0,f=t.bounceRate||[],p=f.length>0?f.reduce((w,C)=>w+C.bounce_rate,0)/f.length:0,A=t.uniqueVisitors||[],g=A.length>0&&A[A.length-1].dedup_data?.total_deduplicated_audience||0;return{latestVisits:x,totalVisits:r,latestRank:b,avgBounce:p,latestUnique:g}},[t]),i=h.useMemo(()=>t?.visitsTotal?t.visitsTotal.map(l=>({month:Qn(l.date),visits:Math.round(l.visits)})):[],[t]),o=h.useMemo(()=>t?.bounceRate?t.bounceRate.map(l=>({month:Qn(l.date),bounceRate:+(l.bounce_rate*100).toFixed(1)})):[],[t]),c=h.useMemo(()=>{if(!t)return[];const l={};if(t.desktopSources)for(const x of t.desktopSources){const r=x.source_type==="Search"?"Organic Search":x.source_type==="Display Ads"?"Display Ads":x.source_type,m=(x.visits||[]).reduce((b,f)=>b+(f.organic||0)+(f.paid||0),0);if(x.source_type==="Search"){const b=(x.visits||[]).reduce((p,A)=>p+(A.organic||0),0),f=(x.visits||[]).reduce((p,A)=>p+(A.paid||0),0);l["Organic Search"]=(l["Organic Search"]||0)+b,l["Paid Search"]=(l["Paid Search"]||0)+f}else l[r]=(l[r]||0)+m}if(t.mobileSources)for(const x of t.mobileSources){const r=x.source_type,m=(x.visits||[]).reduce((b,f)=>b+(f.visits||0),0);l[r]=(l[r]||0)+m}return Object.entries(l).map(([x,r])=>({name:x,value:Math.round(r)})).sort((x,r)=>r.value-x.value)},[t]),d=h.useMemo(()=>{if(!t?.uniqueVisitors?.length)return[];const x=t.uniqueVisitors[t.uniqueVisitors.length-1].dedup_data;return x?[{name:"Mobile Only",value:+(x.mobile_web_only_audience_share*100).toFixed(1)},{name:"Desktop Only",value:+(x.desktop_only_audience_share*100).toFixed(1)},{name:"Both",value:+(x.desktop_and_mobile_web_audience_share*100).toFixed(1)}]:[]},[t]);
10return n?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:180",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:181",className:"mb-4 md:mb-6",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:182",className:"text-lg md:text-2xl font-bold text-white",children:"Web Analytics"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:183",className:"text-white/40 text-xs md:text-sm mt-1",children:"SimilarWeb data for alphafunded.com"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:185",className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[...Array(4)].map((l,x)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:187",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:188",className:"h-4 w-20 bg-white/5 rounded animate-pulse mb-3"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:189",className:"h-7 w-24 bg-white/5 rounded animate-pulse"})]},x))})]}):a?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:199",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:200",className:"mb-4 md:mb-6",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:201",className:"text-lg md:text-2xl font-bold text-white",children:"Web Analytics"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:202",className:"text-white/40 text-xs md:text-sm mt-1",children:"SimilarWeb data for alphafunded.com"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:204",className:"bg-[#141414] border border-red-500/30 rounded-xl p-6 text-center",children:e.jsx("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:205",className:"text-red-400 text-sm",children:"Failed to load analytics data. Please try again later."})})]}):e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:214",className:"w-full overflow-x-hidden space-y-4 md:space-y-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:216",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:217",className:"text-lg md:text-2xl font-bold text-white",children:"Web Analytics"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:218",className:"text-white/40 text-xs md:text-sm mt-1",children:"SimilarWeb traffic data for alphafunded.com â Last 6 months"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:224",className:"grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-3",children:[e.jsx(nn,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:225",icon:e.jsx(ct,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:226",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Latest Month Visits",value:Ke(s?.latestVisits||0),color:"#0b6fd9"}),e.jsx(nn,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:231",icon:e.jsx(It,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:232",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Global Rank",value:`#${(s?.latestRank||0).toLocaleString()}`,color:"#22c55e"}),e.jsx(nn,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:237",icon:e.jsx(hn,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:238",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Avg Bounce Rate",value:`${((s?.avgBounce||0)*100).toFixed(1)}%`,color:"#f59e0b"}),e.jsx(nn,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:243",icon:e.jsx(He,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:244",className:"w-3.5 h-3.5 md:w-4 md:h-4"}),label:"Unique Visitors",value:Ke(s?.latestUnique||0),color:"#8b5cf6"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:252",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/
10admin/AdminWebAnalytics.tsx:253",className:"text-xs md:text-sm font-semibold text-white mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(Kt,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:254",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Monthly Visits Trend"]}),i.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:258",config:eh,className:"h-48 md:h-64 w-full",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:259",data:i,margin:{left:0,right:5,top:5,bottom:5},children:[e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:260",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:261",dataKey:"month",stroke:"rgba(255,255,255,0.3)",tick:{fontSize:10}}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:262",stroke:"rgba(255,255,255,0.3)",tickFormatter:l=>Ke(l),tick:{fontSize:10}}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:263",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:263"})}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:264",type:"monotone",dataKey:"visits",stroke:"#0b6fd9",fill:"#0b6fd9",fillOpacity:.15,strokeWidth:2})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:275",className:"h-48 md:h-64 flex items-center justify-center text-white/30 text-sm",children:"No visits data available"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:282",className:"grid grid-cols-1 lg:grid-cols-3 gap-3 md:gap-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:284",className:"lg:col-span-2 bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:285",className:"text-xs md:text-sm font-semibold text-white mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx($a,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:286",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Traffic Sources (Combined Desktop + Mobile)"]}),c.length>0?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:290",className:"flex flex-col md:flex-row items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:291",className:"w-full md:w-1/2",children:e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:292",config:nh,className:"h-56 md:h-64 w-full",children:e.jsxs(Bt,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:293",children:[e.jsx(xe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:294",data:c,cx:"50%",cy:"50%",innerRadius:50,outerRadius:85,paddingAngle:2,dataKey:"value",nameKey:"name",children:c.map((l,x)=>e.jsx(Le,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:305",fill:wa[l.name]||"#6B7280"},x))}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:308",content:({active:l,payload:x})=>{if(!l||!x?.length)return null;const r=x[0].payload,m=c.reduce((b,f)=>b+f.value,0);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:314",className:"bg-[#1a1a1a] border border-white/10 rounded-lg px-3 py-2 shadow-xl",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:315",className:"text-xs font-medium text-white",children:r.name}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:316",className:"text-xs text-white/60",children:[Ke(r.value)," visits (",(r.value/m*100).toFixed(1),"%)"]})]})}})]})})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:326",className:"w-full md:w-1/2 space-y-2",children:c.map(l=>{const x=c.reduce((m,b)=>m+b.value,0),r=x>0?(l.value/x*100).toFixed(1):"0";return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:331",className:"flex items-center gap-2",children:[e.jsx("div",{"data-loc":"client/src/components/
10admin/AdminWebAnalytics.tsx:332",className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:wa[l.name]||"#6B7280"}}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:336",className:"text-xs text-white/70 flex-1 truncate",children:l.name}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:337",className:"text-xs font-medium text-white",children:[r,"%"]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:338",className:"text-[10px] text-white/40",children:Ke(l.value)})]},l.name)})})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:345",className:"h-56 md:h-64 flex items-center justify-center text-white/30 text-sm",children:"No traffic source data available"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:352",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:353",className:"text-xs md:text-sm font-semibold text-white mb-3 md:mb-4",children:"Device Breakdown"}),d.length>0?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:357",className:"space-y-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:358",className:"h-40 md:h-48 flex items-center justify-center",children:e.jsxs(Bt,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:359",width:180,height:180,children:[e.jsxs(xe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:360",data:d,cx:"50%",cy:"50%",innerRadius:40,outerRadius:70,paddingAngle:3,dataKey:"value",children:[e.jsx(Le,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:369",fill:"#6366f1"}),e.jsx(Le,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:370",fill:"#22c55e"}),e.jsx(Le,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:371",fill:"#f59e0b"})]}),e.jsx(Ja,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:373",layout:"vertical",align:"right",verticalAlign:"middle",formatter:l=>e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:377",className:"text-[10px] text-white/70",children:l})})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:381",className:"space-y-2",children:d.map((l,x)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:383",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:384",className:"flex items-center gap-2",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:385",className:"w-2 h-2 rounded-full",style:{backgroundColor:["#6366f1","#22c55e","#f59e0b"][x]}}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:389",className:"text-xs text-white/60",children:l.name})]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:391",className:"text-xs font-medium text-white",children:[l.value,"%"]})]},l.name))})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:397",className:"h-48 flex items-center justify-center text-white/30 text-sm",children:"No device data"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:405",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:406",className:"text-xs md:text-sm font-semibold text-white mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(hn,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:407",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#f59e0b]"}),"Bounce Rate Trend"]}),o.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:411",config:th,className:"h-40 md:h-52 w-full",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:412",data:o,margin:{left:0,right:5,top:5,bottom:5}
10,children:[e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:413",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:414",dataKey:"month",stroke:"rgba(255,255,255,0.3)",tick:{fontSize:10}}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:415",stroke:"rgba(255,255,255,0.3)",tickFormatter:l=>`${l}%`,tick:{fontSize:10},domain:[30,50]}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:421",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:421"})}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:422",type:"monotone",dataKey:"bounceRate",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.12,strokeWidth:2})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:433",className:"h-40 md:h-52 flex items-center justify-center text-white/30 text-sm",children:"No bounce rate data available"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:440",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:441",className:"text-xs md:text-sm font-semibold text-white mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(It,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:442",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#0b6fd9]"}),"Top Countries by Traffic"]}),t?.trafficByCountry&&t.trafficByCountry.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:448",className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:449",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:450",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:451",className:"border-b border-white/10 text-white/50",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:452",className:"text-left py-2 px-3 font-medium",children:"Country"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:453",className:"text-right py-2 px-3 font-medium",children:"Share"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:454",className:"text-right py-2 px-3 font-medium",children:"Visits"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:455",className:"text-right py-2 px-3 font-medium",children:"Pages/Visit"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:456",className:"text-right py-2 px-3 font-medium",children:"Avg Time"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:457",className:"text-right py-2 px-3 font-medium",children:"Bounce Rate"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:460",children:t.trafficByCountry.map((l,x)=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:462",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsxs("td",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:463",className:"py-2.5 px-3 text-white font-medium",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:464",className:"mr-2",children:ya[l.country]||"ð"}),l.country_name]}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:467",className:"py-2.5 px-3 text-right text-white/80",children:[(l.share*100).toFixed(1),"%"]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:470",className:"py-2.5 px-3 text-right text-white/80",children:Ke(l.visits)}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:473",className:"py-2.5 px-3 text-right text-white/60",children:l.pages_per_visit.toFixed(1)}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:476",className:"py-2.5 px-3 text-right text-white/60",children:ja(l.average_time)}
10),e.jsx("td",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:479",className:"py-2.5 px-3 text-right",children:e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:480",className:`${l.bounce_rate>.5?"text-red-400":l.bounce_rate>.4?"text-yellow-400":"text-green-400"}`,children:[(l.bounce_rate*100).toFixed(1),"%"]})})]},x))})]})}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:491",className:"md:hidden space-y-2",children:t.trafficByCountry.map((l,x)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:493",className:"bg-white/[0.02] border border-white/5 rounded-lg p-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:494",className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:495",className:"text-sm font-medium text-white",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:496",className:"mr-1.5",children:ya[l.country]||"ð"}),l.country_name]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:499",className:"text-sm font-bold text-white",children:[(l.share*100).toFixed(1),"%"]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:501",className:"flex flex-wrap gap-x-4 gap-y-1 text-[10px] text-white/40",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:502",children:[Ke(l.visits)," visits"]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:503",children:[l.pages_per_visit.toFixed(1)," pages/visit"]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:504",children:[ja(l.average_time)," avg"]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:505",className:`${l.bounce_rate>.5?"text-red-400":l.bounce_rate>.4?"text-yellow-400":"text-green-400"}`,children:[(l.bounce_rate*100).toFixed(1),"% bounce"]})]})]},x))})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:514",className:"h-32 flex items-center justify-center text-white/30 text-sm",children:"No country data available"})]}),t?.uniqueVisitors&&t.uniqueVisitors.length>0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:522",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:523",className:"text-xs md:text-sm font-semibold text-white mb-3 md:mb-4 flex items-center gap-2",children:[e.jsx(He,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:524",className:"w-3.5 h-3.5 md:w-4 md:h-4 text-[#8b5cf6]"}),"Unique Visitors Trend"]}),e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:527",config:{uniqueVisitors:{label:"Unique Visitors",color:"#8b5cf6"}},className:"h-40 md:h-52 w-full",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:528",data:t.uniqueVisitors.map(l=>({month:Qn(l.date),uniqueVisitors:Math.round(l.dedup_data?.total_deduplicated_audience||0)})),margin:{left:0,right:5,top:5,bottom:5},children:[e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:535",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:536",dataKey:"month",stroke:"rgba(255,255,255,0.3)",tick:{fontSize:10}}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:537",stroke:"rgba(255,255,255,0.3)",tickFormatter:l=>Ke(l),tick:{fontSize:10}}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:538",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:538"})}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:539",type:"monotone",dataKey:"uniqueVisitors",stroke:"#8b5cf6",fill:"#8b5cf6",fillOpacity:.12,strokeWidth:2})]})})]})]})}function nn({icon:t,label:n,value:a,color:s}
10){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:564",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-4 hover:border-white/20 transition-colors",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:565",className:"flex items-center gap-1.5 md:gap-2 mb-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:566",style:{color:s},children:t}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:567",className:"text-[9px] md:text-xs font-medium text-white/50 uppercase tracking-wider leading-tight",children:n})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminWebAnalytics.tsx:569",className:"text-base md:text-xl font-bold text-white",children:a})]})}const ah=[15,25,50,100];function ih(){const[t,n]=h.useState(""),[a,s]=h.useState(""),[i,o]=h.useState("all"),[c,d]=h.useState("all"),[l,x]=h.useState(0),[r,m]=h.useState(25),[b,f]=h.useState(null),[p,A]=h.useState("direct");h.useEffect(()=>{const u=setTimeout(()=>{s(t),x(0)},300);return()=>clearTimeout(u)},[t]);const g=j.revenue.recentOrders.useQuery({limit:r,offset:l*r,status:i==="all"?void 0:i,search:a||void 0,orderType:c==="all"?void 0:c}),w=h.useMemo(()=>g.data?Math.ceil(g.data.total/r):0,[g.data,r]);if(b!==null)return e.jsx(Qi,{"data-loc":"client/src/components/admin/AdminOrders.tsx:50",orderId:b,orderType:p,onBack:()=>f(null)});const C=u=>{switch(u){case"completed":return e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:62",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[e.jsx(Ge,{"data-loc":"client/src/components/admin/AdminOrders.tsx:63",className:"w-3 h-3"})," Completed"]});case"pending":return e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:68",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[e.jsx(Ve,{"data-loc":"client/src/components/admin/AdminOrders.tsx:69",className:"w-3 h-3"})," Pending"]});case"failed":return e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:74",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-red-500/10 text-red-400 border border-red-500/20",children:[e.jsx(vt,{"data-loc":"client/src/components/admin/AdminOrders.tsx:75",className:"w-3 h-3"})," Failed"]});default:return e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:79",className:"text-xs text-white/40",children:u})}},v=u=>{switch(u){case"direct":return e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:87",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-blue-500/10 text-blue-400 border border-blue-500/20",children:[e.jsx(un,{"data-loc":"client/src/components/admin/AdminOrders.tsx:88",className:"w-3 h-3"})," Direct"]});case"reset":return e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:93",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-purple-500/10 text-purple-400 border border-purple-500/20",children:[e.jsx(qe,{"data-loc":"client/src/components/admin/AdminOrders.tsx:94",className:"w-3 h-3"})," Reset"]});case"activation":return e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:99",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-teal-500/10 text-teal-400 border border-teal-500/20",children:[e.jsx(es,{"data-loc":"client/src/components/admin/AdminOrders.tsx:100",className:"w-3 h-3"})," Activation"]});default:return null}},P=u=>u?new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}):"â";return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:126",className:"max-w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/
10admin/AdminOrders.tsx:128",className:"flex flex-col gap-4 mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:129",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminOrders.tsx:130",className:"text-xl md:text-2xl font-bold text-white",children:"Orders"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrders.tsx:131",className:"text-white/40 text-xs md:text-sm mt-1",children:"Search and manage all orders across direct purchases, resets, and activations"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:137",className:"relative",children:[e.jsx(Ka,{"data-loc":"client/src/components/admin/AdminOrders.tsx:138",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-white/40"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminOrders.tsx:139",type:"text",value:t,onChange:u=>n(u.target.value),placeholder:"Search by name, email, order ID, transaction ID...",className:"w-full pl-10 pr-4 py-2.5 bg-white/5 border border-white/10 rounded-lg text-sm text-white placeholder:text-white/30 focus:outline-none focus:border-[#0b6fd9]/50 focus:ring-1 focus:ring-[#0b6fd9]/30 transition-colors"}),t&&e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:147",onClick:()=>n(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/60",children:e.jsx(vt,{"data-loc":"client/src/components/admin/AdminOrders.tsx:151",className:"w-4 h-4"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:157",className:"flex flex-wrap items-center gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:159",className:"flex items-center gap-1.5",children:[e.jsx(us,{"data-loc":"client/src/components/admin/AdminOrders.tsx:160",className:"w-3.5 h-3.5 text-white/40"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:161",className:"text-xs text-white/40",children:"Status:"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:162",className:"flex gap-1",children:["all","completed","pending","failed"].map(u=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:164",onClick:()=>{o(u),x(0)},className:`px-2.5 py-1 text-xs rounded-md font-medium transition-colors ${i===u?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/60 hover:bg-white/10 hover:text-white/80"}`,children:u==="all"?"All":u.charAt(0).toUpperCase()+u.slice(1)},u))})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:180",className:"flex items-center gap-1.5 ml-2",children:[e.jsx(es,{"data-loc":"client/src/components/admin/AdminOrders.tsx:181",className:"w-3.5 h-3.5 text-white/40"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:182",className:"text-xs text-white/40",children:"Type:"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:183",className:"flex gap-1",children:["all","direct","reset","activation"].map(u=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:185",onClick:()=>{d(u),x(0)},className:`px-2.5 py-1 text-xs rounded-md font-medium transition-colors ${c===u?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/60 hover:bg-white/10 hover:text-white/80"}`,children:u==="all"?"All":u.charAt(0).toUpperCase()+u.slice(1)},u))})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:201",className:"flex items-center gap-1.5 ml-auto",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:202",className:"text-xs text-white/40",children:"Show:"}),e.jsx("select",{"data-loc":"client/src/components/admin/AdminOrders.tsx:203",value:r,onChange:u=>{m(Number(u.target.value)),x(0)},className:"bg-white/5 border border-white/10 rounded-md text-xs text-white/80 px-2 py-1 focus:outline-none focus:border-[#0b6fd9]/50",children:ah.map(u=>e.jsxs("option",{"data-loc":"client/src/components/admin/AdminOrders.tsx:209",value:u,className:"bg-[#1a1a1a]",children:[u," per page"]},u))})]})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:219",className:"flex items-center justify-between mb-3",children:[e.jsx("p",{"data-loc":"client/src/components/
10admin/AdminOrders.tsx:220",className:"text-xs text-white/40",children:g.data?e.jsxs(e.Fragment,{children:["Showing ",l*r+1,"â",Math.min((l+1)*r,g.data.total)," of"," ",e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:224",className:"text-white/60 font-medium",children:g.data.total.toLocaleString()})," orders"]}):g.isLoading?"Loading...":"No orders found"}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:232",onClick:()=>g.refetch(),className:"flex items-center gap-1.5 text-xs text-white/40 hover:text-white/60 transition-colors",children:[e.jsx(qe,{"data-loc":"client/src/components/admin/AdminOrders.tsx:236",className:`w-3.5 h-3.5 ${g.isFetching?"animate-spin":""}`}),"Refresh"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:242",className:"bg-white/[0.02] border border-white/10 rounded-xl overflow-hidden",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:243",className:"overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminOrders.tsx:244",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminOrders.tsx:245",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminOrders.tsx:246",className:"border-b border-white/10 bg-white/[0.03]",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:247",className:"text-left px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Order"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:248",className:"text-left px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Customer"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:249",className:"text-left px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Product"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:250",className:"text-left px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Type"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:251",className:"text-right px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Amount"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:252",className:"text-center px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Status"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:253",className:"text-left px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Payment"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminOrders.tsx:254",className:"text-left px-4 py-3 text-xs font-medium text-white/50 uppercase tracking-wider",children:"Date"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminOrders.tsx:257",className:"divide-y divide-white/5",children:g.isLoading?Array.from({length:5}).map((u,y)=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminOrders.tsx:260",className:"animate-pulse",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:261",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:261",className:"h-4 bg-white/5 rounded w-20"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:262",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:262",className:"h-4 bg-white/5 rounded w-32"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:263",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:263",className:"h-4 bg-white/5 rounded w-40"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:264",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:264",className:"h-4 bg-white/5 rounded w-16"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:265",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/
10admin/AdminOrders.tsx:265",className:"h-4 bg-white/5 rounded w-16 ml-auto"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:266",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:266",className:"h-4 bg-white/5 rounded w-20 mx-auto"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:267",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:267",className:"h-4 bg-white/5 rounded w-24"})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:268",className:"px-4 py-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:268",className:"h-4 bg-white/5 rounded w-28"})})]},y)):g.data?.orders.length===0?e.jsx("tr",{"data-loc":"client/src/components/admin/AdminOrders.tsx:272",children:e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:273",colSpan:8,className:"px-4 py-12 text-center",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:274",className:"flex flex-col items-center gap-2",children:[e.jsx(un,{"data-loc":"client/src/components/admin/AdminOrders.tsx:275",className:"w-8 h-8 text-white/20"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrders.tsx:276",className:"text-white/40 text-sm",children:"No orders found"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminOrders.tsx:277",className:"text-white/25 text-xs",children:"Try adjusting your search or filters"})]})})}):g.data?.orders.map(u=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminOrders.tsx:283",onClick:()=>{f(u.id),A(u.orderType)},className:"hover:bg-white/[0.03] cursor-pointer transition-colors group",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:292",className:"px-4 py-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:293",className:"flex flex-col",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:294",className:"text-white/80 font-medium text-xs",children:["#",u.id]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:297",className:"text-white/30 text-[10px] font-mono truncate max-w-[120px]",children:u.merchantOrderId})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:304",className:"px-4 py-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:305",className:"flex flex-col",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:306",className:"text-white/80 text-xs font-medium",children:[u.firstName," ",u.lastName]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:309",className:"text-white/40 text-[10px] truncate max-w-[180px]",children:u.email})]})}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:316",className:"px-4 py-3",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:317",className:"text-white/70 text-xs truncate block max-w-[200px]",children:u.productName}),u.couponCode&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:321",className:"inline-flex items-center gap-0.5 mt-0.5 px-1.5 py-0.5 rounded text-[10px] bg-amber-500/10 text-amber-400 border border-amber-500/20",children:u.couponCode})]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:328",className:"px-4 py-3",children:v(u.orderType)}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:333",className:"px-4 py-3 text-right",children:e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:334",className:"text-white font-semibold text-sm",children:["$",u.total.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:340",className:"px-4 py-3 text-center",children:C(u.status)}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:345",className:"px-4 py-3",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:346",className:"flex flex-col",children:[e.jsx("span",{"data-loc":"client/src/components/
10admin/AdminOrders.tsx:347",className:"text-white/60 text-xs capitalize",children:u.paymentMethod||"â"}),u.transactionId&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:351",className:"text-white/30 text-[10px] font-mono truncate max-w-[100px]",children:u.transactionId})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminOrders.tsx:359",className:"px-4 py-3",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:360",className:"text-white/50 text-xs whitespace-nowrap",children:P(u.createdAt)})})]},`${u.orderType}-${u.id}`))})]})})}),w>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:374",className:"flex items-center justify-between mt-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:375",className:"flex items-center gap-2",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:376",onClick:()=>x(0),disabled:l===0,className:"px-2.5 py-1.5 text-xs rounded-md bg-white/5 text-white/60 hover:bg-white/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:"First"}),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:383",onClick:()=>x(Math.max(0,l-1)),disabled:l===0,className:"flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-md bg-white/5 text-white/60 hover:bg-white/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(Me,{"data-loc":"client/src/components/admin/AdminOrders.tsx:388",className:"w-3 h-3"})," Prev"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:392",className:"flex items-center gap-1.5",children:Array.from({length:Math.min(5,w)},(u,y)=>{let S;return w<=5||l<3?S=y:l>w-4?S=w-5+y:S=l-2+y,e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:406",onClick:()=>x(S),className:`w-7 h-7 text-xs rounded-md font-medium transition-colors ${l===S?"bg-[#0b6fd9] text-white":"bg-white/5 text-white/60 hover:bg-white/10"}`,children:S+1},S)})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:421",className:"flex items-center gap-2",children:[e.jsxs("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:422",onClick:()=>x(Math.min(w-1,l+1)),disabled:l>=w-1,className:"flex items-center gap-1 px-2.5 py-1.5 text-xs rounded-md bg-white/5 text-white/60 hover:bg-white/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:["Next ",e.jsx(Te,{"data-loc":"client/src/components/admin/AdminOrders.tsx:427",className:"w-3 h-3"})]}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminOrders.tsx:429",onClick:()=>x(w-1),disabled:l>=w-1,className:"px-2.5 py-1.5 text-xs rounded-md bg-white/5 text-white/60 hover:bg-white/10 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:"Last"})]})]}),g.data&&g.data.total>0&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminOrders.tsx:442",className:"mt-4 p-3 bg-white/[0.02] border border-white/10 rounded-lg flex items-center gap-6 text-xs text-white/40",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:443",children:["Total Orders: ",e.jsx("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:444",className:"text-white/70 font-medium",children:g.data.total.toLocaleString()})]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:446",children:["Page: ",e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:447",className:"text-white/70 font-medium",children:[l+1," of ",w]})]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:449",children:["Showing: ",e.jsxs("span",{"data-loc":"client/src/components/admin/AdminOrders.tsx:450",className:"text-white/70 font-medium",children:[r," per page"]})]})]})]})}const oh=[{label:"MTD",days:-1},{label:"7D",days:7},{label:"14D",days:14},{label:"30D",days:30},{label:"90D",days:90}],Na={Direct:"#0b6fd9",Reset:"#f59e0b",Activation:"#8b5cf6"},sn={forex:"#4ade80",futures:"#f97316"},ch={directRevenue:{label:"Direct",color:"#0b6fd9"},resetRevenue:{label:"Reset",color:"#f59e0b"},activationRevenue:{label:"Activation",color:"#8b5cf6"}},rh={forexRevenue:{label:"Forex",color:"#4ade80"},futuresRevenue:{label:"Futures",color:"#f97316"}};function Po(){return new Date().toLocaleDateString("en-CA",{timeZone:"America/Ne
10w_York"})}function dh(){const t=Po(),[n,a,s]=t.split("-").map(Number);return new Date(n,a-1,s)}function lh(){const[t,n]=h.useState(-1),[a,s]=h.useState(""),[i,o]=h.useState(""),[c,d]=h.useState(!1),l=h.useMemo(()=>{if(t===null&&a&&i)return{startDate:a,endDate:i};const v=Po(),P=dh();if(t===-1){const y=new Date(P.getFullYear(),P.getMonth(),1);return{startDate:_e(y,"yyyy-MM-dd"),endDate:v}}const u=new Date(P.getTime()-(t||30)*24*60*60*1e3);return{startDate:_e(u,"yyyy-MM-dd"),endDate:v}},[t,a,i]),x=j.analytics.orderTypeBreakdown.useQuery(l),r=j.analytics.forexVsFutures.useQuery(l),m=j.analytics.dailyByType.useQuery(l),b=j.analytics.dailyForexFutures.useQuery(l),f=j.analytics.performanceKPIs.useQuery(l),p=j.analytics.revenueByAccountSize.useQuery(l),A=j.analytics.paymentMethodBreakdown.useQuery(l),g=j.analytics.geographicBreakdown.useQuery(l),w=h.useMemo(()=>x.data?x.data.reduce((v,P)=>v+P.revenue,0):0,[x.data]),C=h.useMemo(()=>r.data?r.data.forex.revenue+r.data.futures.revenue:0,[r.data]);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:114",className:"max-w-full overflow-x-hidden",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:116",className:"flex flex-col gap-3 mb-6",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:117",className:"flex items-start justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:118",className:"min-w-0",children:[e.jsxs("h1",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:119",className:"text-xl md:text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(hn,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:120",className:"w-5 h-5 md:w-6 md:h-6 text-[#0b6fd9]"}),"Performance Analytics"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:123",className:"text-white/40 text-xs md:text-sm mt-1",children:"Deep insights to optimize toward $100M/year"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:128",className:"flex items-center gap-1 md:gap-2 flex-wrap justify-end",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:129",className:"flex items-center gap-1 bg-[#1a1a1a] border border-white/10 rounded-lg p-0.5 md:p-1",children:[oh.map(v=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:131",onClick:()=>{n(v.days),d(!1)},className:`px-2 md:px-3 py-1 md:py-1.5 text-[10px] md:text-xs font-medium rounded-md transition-colors whitespace-nowrap ${t===v.days&&!c?"bg-[#0b6fd9] text-white":"text-white/50 hover:text-white hover:bg-white/5"}`,children:v.label},v.days)),e.jsxs("button",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:143",onClick:()=>d(!c),className:`px-2 md:px-3 py-1 md:py-1.5 text-[10px] md:text-xs font-medium rounded-md transition-colors whitespace-nowrap flex items-center gap-1 ${c?"bg-[#0b6fd9] text-white":"text-white/50 hover:text-white hover:bg-white/5"}`,children:[e.jsx(xs,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:151",className:"w-3 h-3"}),"Custom"]})]}),c&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:156",className:"flex items-center gap-2 bg-[#1a1a1a] border border-white/10 rounded-lg p-1 md:p-1.5",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:157",type:"date",value:a,onChange:v=>{s(v.target.value),v.target.value&&i&&n(null)},className:"bg-transparent border border-white/10 rounded-md px-2 py-1 text-[10px] md:text-xs text-white focus:outline-none focus:border-[#0b6fd9] [color-scheme:dark]"}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:166",className:"text-white/30 text-xs",children:"to"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:167",type:"date",value:i,onChange:v=>{o(v.target.value),a&&v.target.value&&n(null)},className:"bg-transparent border border-white/10 rounded-md px-2 py-1 text-[10px] md:text-xs text-white focus:outline-none focus:border-[#0b6fd9] [color-scheme:dark]"})]})]})]})}
10),f.data&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:184",className:"bg-gradient-to-r from-[#0b6fd9]/10 to-[#4ade80]/10 border border-[#0b6fd9]/20 rounded-xl p-4 md:p-6 mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:185",className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:186",className:"flex items-center gap-2",children:[e.jsx($c,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:187",className:"w-5 h-5 text-[#0b6fd9]"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:188",className:"text-sm md:text-base font-bold text-white",children:"$100M Annual Target"})]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:190",className:"text-xs md:text-sm font-bold text-[#4ade80]",children:[f.data.progressPercent.toFixed(2),"% of daily target"]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:194",className:"w-full bg-white/5 rounded-full h-3 mb-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:195",className:"h-3 rounded-full bg-gradient-to-r from-[#0b6fd9] to-[#4ade80] transition-all duration-500",style:{width:`${Math.min(100,f.data.progressPercent)}%`}})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:200",className:"grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-4",children:[e.jsx(an,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:201",label:"Daily Average",value:`$${f.data.dailyAvg.toLocaleString(void 0,{maximumFractionDigits:0})}`,target:`$${Math.round(f.data.dailyTarget).toLocaleString()} needed`}),e.jsx(an,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:206",label:"Monthly Run Rate",value:`$${(f.data.monthlyRunRate/1e3).toFixed(0)}K`,target:"$8.3M needed"}),e.jsx(an,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:211",label:"Annualized",value:`$${(f.data.annualizedRunRate/1e6).toFixed(2)}M`,target:"$100M goal"}),e.jsx(an,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:216",label:"Gap to Close",value:`${((1-f.data.progressPercent/100)*100).toFixed(1)}%`,target:`${Math.ceil((f.data.dailyTarget-f.data.dailyAvg)/f.data.dailyAvg)}x growth needed`})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:226",className:"grid grid-cols-2 md:grid-cols-4 gap-3 md:gap-4 mb-6",children:[e.jsx(on,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:227",label:"Repeat Purchase Rate",value:`${(f.data?.repeatRate??0).toFixed(1)}%`,subtitle:`${f.data?.repeatCustomers??0} of ${f.data?.totalCustomers??0} customers`,icon:Uc,color:"#8b5cf6",loading:f.isLoading}),e.jsx(on,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:235",label:"Recovery Rate",value:`${(f.data?.recoveryRate??0).toFixed(1)}%`,subtitle:`${f.data?.recoveredEmails??0} recovered of ${f.data?.failedEmails??0} failed`,icon:Yc,color:"#22d3ee",loading:f.isLoading}),e.jsx(on,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:243",label:"Avg Revenue/Day",value:`$${(f.data?.dailyAvg??0).toLocaleString(void 0,{maximumFractionDigits:0})}`,subtitle:`${f.data?.daysInRange??0} days analyzed`,icon:Gt,color:"#4ade80",loading:f.isLoading}),e.jsx(on,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:251",label:"Total Orders",value:String(f.data?.totalOrders??0),subtitle:`$${(f.data?.totalRevenue??0).toLocaleString(void 0,{maximumFractionDigits:0})} revenue`,icon:Kt,color:"#f59e0b",loading:f.isLoading})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:262",className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6 mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:264",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:265",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Et,{"data-loc":"client/src/components/
10admin/AdminAnalytics.tsx:266",className:"w-4 h-4 text-[#0b6fd9]"}),"Revenue by Order Type"]}),x.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:270",className:"h-[220px] flex items-center justify-center text-white/30",children:"Loading..."}):x.data&&x.data.length>0?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:272",className:"flex flex-col md:flex-row items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:273",className:"w-[180px] h-[180px]",children:e.jsx(Bt,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:274",width:180,height:180,children:e.jsx(xe,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:275",data:x.data.map(v=>({name:v.orderType,value:v.revenue})),cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,paddingAngle:3,dataKey:"value",children:x.data.map((v,P)=>e.jsx(Le,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:288",fill:Na[v.orderType]||"#6B7280"},P))})})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:293",className:"flex-1 space-y-2",children:[x.data.map((v,P)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:295",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:296",className:"flex items-center gap-2",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:297",className:"w-3 h-3 rounded-full",style:{backgroundColor:Na[v.orderType]||"#6B7280"}}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:298",className:"text-xs text-white/70",children:v.orderType})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:300",className:"text-right",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:301",className:"text-xs font-medium text-white",children:["$",v.revenue.toLocaleString()]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:302",className:"text-[10px] text-white/40 ml-2",children:["(",w>0?(v.revenue/w*100).toFixed(1):0,"%)"]})]})]},P)),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:308",className:"pt-2 border-t border-white/10",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:309",className:"flex justify-between",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:310",className:"text-xs text-white/50",children:"Total"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:311",className:"text-xs font-bold text-white",children:["$",w.toLocaleString()]})]})})]})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:317",className:"h-[220px] flex items-center justify-center text-white/30 text-sm",children:"No data"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:322",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:323",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Kc,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:324",className:"w-4 h-4 text-[#4ade80]"}),"Forex vs Futures (Direct Sales)"]}),r.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:328",className:"h-[220px] flex items-center justify-center text-white/30",children:"Loading..."}):r.data?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:330",className:"flex flex-col md:flex-row items-center gap-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:331",className:"w-[180px] h-[180px]",children:e.jsx(Bt,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:332",width:180,height:180,children:e.jsxs(xe,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:333",data:[{name:"Forex",value:r.data.forex.revenue},{name:"Futures",value:r.data.futures.revenue}],cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,paddingAngle:3,dataKey:"value",children:[e.jsx(Le,{"data-loc":"client/src/components/
10admin/AdminAnalytics.tsx:345",fill:sn.forex}),e.jsx(Le,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:346",fill:sn.futures})]})})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:350",className:"flex-1 space-y-3",children:[e.jsx(Ca,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:351",label:"Forex",color:sn.forex,revenue:r.data.forex.revenue,orders:r.data.forex.orders,total:C}),e.jsx(Ca,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:358",label:"Futures",color:sn.futures,revenue:r.data.futures.revenue,orders:r.data.futures.orders,total:C}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:365",className:"pt-2 border-t border-white/10",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:366",className:"flex justify-between",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:367",className:"text-xs text-white/50",children:"Total Direct"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:368",className:"text-xs font-bold text-white",children:["$",C.toLocaleString()]})]})})]})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:374",className:"h-[220px] flex items-center justify-center text-white/30 text-sm",children:"No data"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:380",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5 mb-6",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:381",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(ct,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:382",className:"w-4 h-4 text-[#0b6fd9]"}),"Daily Revenue by Order Type"]}),m.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:386",className:"h-[240px] md:h-[300px] flex items-center justify-center text-white/30",children:"Loading..."}):m.data&&m.data.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:388",config:ch,className:"h-[240px] md:h-[300px] w-full !aspect-auto",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:389",data:m.data,margin:{top:10,right:10,left:0,bottom:0},children:[e.jsxs("defs",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:390",children:[e.jsxs("linearGradient",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:391",id:"directGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:392",offset:"5%",stopColor:"#0b6fd9",stopOpacity:.3}),e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:393",offset:"95%",stopColor:"#0b6fd9",stopOpacity:0})]}),e.jsxs("linearGradient",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:395",id:"resetGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:396",offset:"5%",stopColor:"#f59e0b",stopOpacity:.3}),e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:397",offset:"95%",stopColor:"#f59e0b",stopOpacity:0})]}),e.jsxs("linearGradient",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:399",id:"activationGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:400",offset:"5%",stopColor:"#8b5cf6",stopOpacity:.3}),e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:401",offset:"95%",stopColor:"#8b5cf6",stopOpacity:0})]})]}),e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:404",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:405",dataKey:"date",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:v=>{const P=new Date(v+"T00:00:00");return isNaN(P.getTime())?v:`${P.getMonth()+1}/${P.getDate()}`},interval:"preserveStartEnd"}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:415",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:v=>`$${v>=1e3?`${(v/1e3).toFixed(0)}k`:v}`,width:50}
10),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:421",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:423",formatter:(v,P)=>{const u={directRevenue:"Direct",resetRevenue:"Reset",activationRevenue:"Activation"};return[`$${Number(v).toLocaleString()}`,u[P]||P]}})}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:435",type:"monotone",dataKey:"directRevenue",stackId:"1",stroke:"#0b6fd9",strokeWidth:2,fill:"url(#directGrad)"}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:436",type:"monotone",dataKey:"resetRevenue",stackId:"1",stroke:"#f59e0b",strokeWidth:2,fill:"url(#resetGrad)"}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:437",type:"monotone",dataKey:"activationRevenue",stackId:"1",stroke:"#8b5cf6",strokeWidth:2,fill:"url(#activationGrad)"})]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:441",className:"h-[240px] md:h-[300px] flex items-center justify-center text-white/30 text-sm",children:"No data for selected range"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:446",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5 mb-6",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:447",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(zc,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:448",className:"w-4 h-4 text-[#4ade80]"}),"Forex vs Futures Daily Trend"]}),b.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:452",className:"h-[240px] md:h-[280px] flex items-center justify-center text-white/30",children:"Loading..."}):b.data&&b.data.length>0?e.jsx(Pe,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:454",config:rh,className:"h-[240px] md:h-[280px] w-full !aspect-auto",children:e.jsxs(ot,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:455",data:b.data,margin:{top:10,right:10,left:0,bottom:0},children:[e.jsxs("defs",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:456",children:[e.jsxs("linearGradient",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:457",id:"forexGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:458",offset:"5%",stopColor:"#4ade80",stopOpacity:.3}),e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:459",offset:"95%",stopColor:"#4ade80",stopOpacity:0})]}),e.jsxs("linearGradient",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:461",id:"futuresGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:462",offset:"5%",stopColor:"#f97316",stopOpacity:.3}),e.jsx("stop",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:463",offset:"95%",stopColor:"#f97316",stopOpacity:0})]})]}),e.jsx(Fe,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:466",strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.05)"}),e.jsx(De,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:467",dataKey:"date",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:v=>{const P=new Date(v+"T00:00:00");return isNaN(P.getTime())?v:`${P.getMonth()+1}/${P.getDate()}`},interval:"preserveStartEnd"}),e.jsx(Re,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:477",stroke:"rgba(255,255,255,0.3)",fontSize:10,tickFormatter:v=>`$${v>=1e3?`${(v/1e3).toFixed(0)}k`:v}`,width:50}),e.jsx(Se,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:483",content:e.jsx($e,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:485",formatter:(v,P)=>{const u={forexRevenue:"Forex",futuresRevenue:"Futures"};return[`$${Number(v).toLocaleString()}`,u[P]||P]}})}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:496",type:"monotone",dataKey:"forexRevenue",stroke:"#4ade80",strokeWidth:2,fill:"url(#forexGrad)"}),e.jsx(ke,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:497",type:"monotone",dataKey:"futuresRevenue",stroke:"#f97316",strokeWidth:2,fill:"url(#futuresGrad)"})]})}
10):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:501",className:"h-[240px] md:h-[280px] flex items-center justify-center text-white/30 text-sm",children:"No data for selected range"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:506",className:"grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6 mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:508",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:509",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(Ya,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:510",className:"w-4 h-4 text-[#f59e0b]"}),"Top Products"]}),p.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:514",className:"h-[240px] flex items-center justify-center text-white/30",children:"Loading..."}):p.data&&p.data.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:516",className:"space-y-2 max-h-[280px] overflow-y-auto",children:p.data.map((v,P)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:518",className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:519",className:"min-w-0 flex-1",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:520",className:"text-[10px] md:text-xs text-white/70 truncate",children:v.productName}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:521",className:"w-full bg-white/5 rounded-full h-1.5 mt-1",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:522",className:"h-1.5 rounded-full bg-[#f59e0b]",style:{width:`${v.revenue/(p.data[0]?.revenue||1)*100}%`}})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:528",className:"text-right shrink-0",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:529",className:"text-xs font-medium text-white",children:["$",v.revenue.toLocaleString()]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:530",className:"text-[10px] text-white/40",children:[v.orderCount," orders"]})]})]},P))}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:536",className:"h-[240px] flex items-center justify-center text-white/30 text-sm",children:"No data"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:541",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:542",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(it,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:543",className:"w-4 h-4 text-[#22d3ee]"}),"Payment Methods"]}),A.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:547",className:"h-[240px] flex items-center justify-center text-white/30",children:"Loading..."}):A.data&&A.data.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:549",className:"space-y-3",children:A.data.map((v,P)=>{const u=A.data.reduce((S,O)=>S+O.revenue,0),y=u>0?v.revenue/u*100:0;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:554",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:555",className:"flex items-center justify-between mb-1",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:556",className:"text-xs text-white/70 capitalize",children:v.paymentMethod||"Card"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:557",className:"text-xs font-medium text-white",children:["$",v.revenue.toLocaleString()]})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:559",className:"w-full bg-white/5 rounded-full h-2",children:e.jsx("div",{"data-loc":"client/src/components/
10admin/AdminAnalytics.tsx:560",className:"h-2 rounded-full bg-[#22d3ee] transition-all",style:{width:`${y}%`}})}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:565",className:"flex justify-between mt-0.5",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:566",className:"text-[10px] text-white/40",children:[v.orderCount," orders"]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:567",className:"text-[10px] text-white/40",children:[y.toFixed(1),"%"]})]})]},P)})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:574",className:"h-[240px] flex items-center justify-center text-white/30 text-sm",children:"No data"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:579",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5",children:[e.jsxs("h3",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:580",className:"text-sm font-semibold text-white mb-4 flex items-center gap-2",children:[e.jsx(It,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:581",className:"w-4 h-4 text-[#ec4899]"}),"Top Countries"]}),g.isLoading?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:585",className:"h-[240px] flex items-center justify-center text-white/30",children:"Loading..."}):g.data&&g.data.length>0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:587",className:"space-y-2 max-h-[280px] overflow-y-auto",children:g.data.slice(0,10).map((v,P)=>{const u=g.data[0]?.revenue||1;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:591",className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:592",className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:593",className:"text-xs font-mono text-white/50 w-6",children:v.country}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:594",className:"flex-1 bg-white/5 rounded-full h-1.5",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:595",className:"h-1.5 rounded-full bg-[#ec4899]",style:{width:`${v.revenue/u*100}%`}})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:601",className:"text-right shrink-0",children:[e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:602",className:"text-xs font-medium text-white",children:["$",v.revenue.toLocaleString()]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:603",className:"text-[10px] text-white/40 ml-1",children:["(",v.orderCount,")"]})]})]},P)})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:610",className:"h-[240px] flex items-center justify-center text-white/30 text-sm",children:"No data"})]})]})]})}function an({label:t,value:n,target:a}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:622",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:623",className:"text-[10px] md:text-xs text-white/50",children:t}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:624",className:"text-sm md:text-lg font-bold text-white",children:n}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:625",className:"text-[10px] text-white/30",children:a})]})}function on({label:t,value:n,subtitle:a,icon:s,color:i,loading:o}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:641",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-5 hover:border-white/20 transition-colors",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:642",className:"flex items-center justify-between mb-2 md:mb-3",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:643",className:"text-[9px] md:text-xs font-medium text-white/50 uppercase tracking-wider leading-tight",children:t}
10),e.jsx(s,{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:644",className:"w-3.5 h-3.5 md:w-4 md:h-4 shrink-0",style:{color:i}})]}),o?e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:647",className:"h-7 md:h-9 bg-white/5 rounded animate-pulse"}):e.jsxs(e.Fragment,{children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:650",className:"text-lg md:text-2xl font-bold text-white truncate",children:n}),a&&e.jsx("p",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:651",className:"text-[10px] md:text-xs text-white/40 mt-1 truncate",children:a})]})]})}function Ca({label:t,color:n,revenue:a,orders:s,total:i}){const o=i>0?a/i*100:0;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:667",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:668",className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:669",className:"flex items-center gap-2",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:670",className:"w-3 h-3 rounded-full",style:{backgroundColor:n}}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:671",className:"text-xs text-white/70",children:t})]}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:673",className:"text-xs font-medium text-white",children:["$",a.toLocaleString()]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:675",className:"flex items-center justify-between",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:676",className:"flex-1 bg-white/5 rounded-full h-1.5 mr-3",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:677",className:"h-1.5 rounded-full transition-all",style:{width:`${o}%`,backgroundColor:n}})}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminAnalytics.tsx:679",className:"text-[10px] text-white/40",children:[s," orders (",o.toFixed(1),"%)"]})]})]})}function mh(){const[t,n]=h.useState("liability");return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:11",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:12",className:"mb-4 md:mb-6",children:[e.jsx("h1",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:13",className:"text-lg md:text-2xl font-bold text-white",children:"Referral Wallet"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:14",className:"text-white/60 text-xs md:text-sm mt-1",children:"Manage affiliates, credits, and payout approvals"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:18",className:"flex gap-2 mb-4 flex-wrap",children:[{id:"liability",label:"Liability"},{id:"referrers",label:"Referrers"},{id:"withdrawals",label:"Withdrawals"},{id:"create",label:"Create Affiliate"},{id:"config",label:"Config"}].map(a=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:26",onClick:()=>n(a.id),className:`px-3 md:px-4 py-1.5 md:py-2 rounded-lg text-xs md:text-sm font-medium transition-colors ${t===a.id?"bg-emerald-500 text-black":"bg-white/5 text-white/50 hover:text-white"}`,children:a.label},a.id))}),t==="liability"&&e.jsx(xh,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:38"}),t==="referrers"&&e.jsx(ph,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:39"}),t==="withdrawals"&&e.jsx(hh,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:40"}),t==="create"&&e.jsx(fh,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:41"}),t==="config"&&e.jsx(bh,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:42"})]})}function xh(){const t=j.referralWallet.adminGetLiability.useQuery();if(t.isLoading)return e.jsx(Tn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:50"});const n=t.data;
10return n?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:56",className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:57",className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[e.jsx(cn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:58",icon:za,label:"Total Liability",value:`$${((n.totalAvailableCredit+n.totalPendingCredit)/100).toFixed(2)}`,color:"#f59e0b"}),e.jsx(cn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:64",icon:xn,label:"Available Credits",value:`$${(n.totalAvailableCredit/100).toFixed(2)}`,color:"#4ade80"}),e.jsx(cn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:70",icon:Ve,label:"Pending (Vesting)",value:`$${(n.totalPendingCredit/100).toFixed(2)}`,color:"#0781fe"}),e.jsx(cn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:76",icon:He,label:"Active Referrers",value:n.activeReferrers,color:"#a78bfa"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:84",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:85",className:"text-white font-bold mb-3",children:"Liability Breakdown"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:86",className:"space-y-2 text-sm",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:87",className:"flex justify-between text-white/70",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:88",children:"Total credits ever issued"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:89",className:"text-white font-medium",children:["$",(n.totalLiability/100).toFixed(2)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:91",className:"flex justify-between text-white/70",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:92",children:"Total redeemed"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:93",className:"text-emerald-400 font-medium",children:["$",(n.totalRedeemed/100).toFixed(2)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:95",className:"flex justify-between text-white/70",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:96",children:"Total clawed back"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:97",className:"text-red-400 font-medium",children:["$",(n.totalClawedBack/100).toFixed(2)]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:99",className:"border-t border-white/10 pt-2 flex justify-between text-white font-bold",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:100",children:"Outstanding liability"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:101",className:"text-amber-400",children:["$",((n.totalAvailableCredit+n.totalPendingCredit)/100).toFixed(2)]})]})]})]}),e.jsx(uh,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:106"})]}):e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:53",className:"text-white/50",children:"No data available"})}function uh(){const t=j.useUtils(),n=j.referralWallet.adminVestPending.useMutation({onSuccess:a=>{R.success(`Vested ${a.vestedCount} credits successfully`),t.referralWallet.adminGetLiability.invalidate()},onError:a=>{R.error(a.message)}});return e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:124",onClick:()=>n.mutate(),disabled:n.isPending,className:"bg-emerald-500 hover:bg-emerald-400 text-black font-bold",children:[e.jsx(qe,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:129",className:`w-4 h-4 mr-2 ${n.isPending?"animate-spin":""}`}),"Vest All Pending Credits"]})}function ph(){const[t,n]=h.useState(1),a=j.referralWallet.adminListReferrers.useQuery({page:t,limit:20});if(a.isLoading)return e.jsx(Tn,{"data-loc":"client/src/components/
10admin/AdminReferralWallet.tsx:139"});const s=a.data;if(!s||s.items.length===0)return e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:143",className:"text-white/50",children:"No referrers yet"});const i=Math.ceil(s.total/20);return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:148",className:"space-y-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:149",className:"overflow-x-auto",children:e.jsxs("table",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:150",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:151",children:e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:152",className:"border-b border-white/10 text-white/50 text-xs uppercase",children:[e.jsx("th",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:153",className:"text-left py-3 px-2",children:"Affiliate"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:154",className:"text-left py-3 px-2",children:"Code"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:155",className:"text-right py-3 px-2",children:"Available"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:156",className:"text-right py-3 px-2",children:"Pending"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:157",className:"text-right py-3 px-2",children:"Volume"}),e.jsx("th",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:158",className:"text-center py-3 px-2",children:"Active"})]})}),e.jsx("tbody",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:161",children:s.items.map(o=>e.jsxs("tr",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:163",className:"border-b border-white/5 hover:bg-white/[0.02]",children:[e.jsx("td",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:164",className:"py-3 px-2",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:165",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:166",className:"text-white text-sm",children:o.displayName||o.username||`User #${o.id}`}),o.username&&e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:167",className:"text-white/40 text-xs",children:["@",o.username]})]})}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:170",className:"py-3 px-2 text-emerald-400 font-mono text-xs",children:o.referralCode}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:171",className:"py-3 px-2 text-right text-white",children:["$",(o.walletAvailable/100).toFixed(2)]}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:172",className:"py-3 px-2 text-right text-blue-400",children:["$",(o.walletPending/100).toFixed(2)]}),e.jsxs("td",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:173",className:"py-3 px-2 text-right text-white/70",children:["$",(o.currentMonthVolume/100).toFixed(2)]}),e.jsx("td",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:174",className:"py-3 px-2 text-center",children:e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:175",className:`px-2 py-0.5 rounded-full text-[10px] font-bold ${o.isActive?"bg-emerald-500/20 text-emerald-400":"bg-red-500/20 text-red-400"}`,children:o.isActive?"Active":"Inactive"})})]},o.id))})]})}),i>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:186",className:"flex items-center justify-center gap-2",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:187",variant:"outline",size:"sm",disabled:t<=1,onClick:()=>n(t-1),children:"Prev"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:190",className:"text-white/50 text-sm",children:["Page ",t," of ",i]}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:191",variant:"outline",size:"sm",disabled:t>=i,onClick:()=>n(t+1),children:"Next"})]})]})}function hh(){const[t,n]=h.useState("pending"),[a,s]=h.useState(1),i=j.useUtils(),o=j.referralWallet.adminListWithdrawals.useQuery({status:t,page:a,limit:20}),c=j.referralWallet.adminUpdateRedemption.useMutation({onSuccess:()=>{R.success("Withdrawal updated successfully"),i.referralWallet.adminListWithdrawals.invalidate(),i.referralWallet.adminGetLiability.invalidate()},onError:m=>{R.error(m.message)}}),d=m=>{confirm("Approve this withdrawal? The affiliate will expect payment.")&&c.mutate({redemptionId:m,status:"approved"})},l=m=>{confirm("Mark as fulfilled? This means payment has been sent.")&&c.mutate({redemptionId:m,status:"fulfilled",adminNotes:"Payment sent via PayPal"})},x=m=>{const b=prompt("Reason for rejection (optional):");c.mutate({redemptionId:m,status:"rejected",adminNotes:b||void 0})},r=Math.ceil((o.data?.total??0)/20);
10return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:243",className:"space-y-4",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:245",className:"flex gap-2 flex-wrap",children:["pending","approved","fulfilled","rejected"].map(m=>e.jsx("button",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:247",onClick:()=>{n(m),s(1)},className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors capitalize ${t===m?m==="pending"?"bg-amber-500/20 text-amber-400 border border-amber-500/30":m==="approved"?"bg-blue-500/20 text-blue-400 border border-blue-500/30":m==="fulfilled"?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"bg-red-500/20 text-red-400 border border-red-500/30":"bg-white/5 text-white/50 hover:text-white border border-transparent"}`,children:m},m))}),o.isLoading?e.jsx(Tn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:265"}):!o.data||o.data.items.length===0?e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:267",className:"bg-[#141414] border border-white/10 rounded-xl p-8 text-center",children:e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:268",className:"text-white/50",children:["No ",t," withdrawals"]})}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:271",className:"space-y-3",children:o.data.items.map(m=>e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:273",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:274",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:275",className:"flex-1",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:276",className:"flex items-center gap-2 mb-1",children:[e.jsx(Gt,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:277",className:"w-4 h-4 text-emerald-400"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:278",className:"text-white font-bold text-lg",children:["$",(m.faceValue/100).toFixed(2)]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:281",className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase ${m.type==="cash"?"bg-emerald-500/20 text-emerald-400":"bg-purple-500/20 text-purple-400"}`,children:m.type})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:287",className:"text-sm text-white/60 space-y-0.5",children:[e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:288",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:289",className:"text-white/40",children:"Affiliate:"})," ",e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:290",className:"text-white",children:m.affiliateDisplayName||m.affiliateUsername||`#${m.referrerId}`}),m.referralCode&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:291",className:"text-emerald-400/60 ml-2 font-mono text-xs",children:["(",m.referralCode,")"]})]}),m.paypalEmail&&e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:294",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:295",className:"text-white/40",children:"PayPal:"})," ",e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:296",className:"text-amber-400",children:m.paypalEmail})]}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:299",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:300",className:"text-white/40",children:"Requested:"})," ",new Date(m.createdAt).toLocaleString()]}),m.adminNotes&&e.jsxs("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:304",className:"text-white/40 italic",children:["Note: ",m.adminNotes]})]})]}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:310",className:"flex gap-2 shrink-0",children:[m.status==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:313",size:"sm",onClick:()=>d(m.id),disabled:c.isPending,className:"bg-emerald-500 hover:bg-emerald-400 text-black font-bold text-xs",children:[e.jsx(xn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:319",className:"w-3.5 h-3.5 mr-1"}),"Approve"]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:322",size:"sm",variant:"outline",onClick:()=>x(m.id),disabled:c.isPending,className:"border-red-500/30 text-red-400 hover:bg-red-500/10 text-xs",children:[e.jsx(vt,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:329",className:"w-3.5 h-3.5 mr-1"}),"Deny"]})]}),m.status==="approved"&&e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:335",size:"sm",onClick:()=>l(m.id),disabled:c.isPending,className:"bg-blue-500 hover:bg-blue-400 text-white font-bold text-xs",children:[e.jsx(xn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:341",className:"w-3.5 h-3.5 mr-1"}),"Mark Paid"]}),m.status==="fulfilled"&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:346",className:"px-3 py-1.5 bg-emerald-500/10 text-emerald-400 rounded-lg text-xs font-medium",children:"Paid"}),m.status==="rejected"&&e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:351",className:"px-3 py-1.5 bg-red-500/10 text-red-400 rounded-lg text-xs font-medium",children:"Denied"})]})]})},m.id))}),r>1&&e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:363",className:"flex items-center justify-center gap-2 mt-4",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:364",variant:"outline",size:"sm",disabled:a<=1,onClick:()=>s(a-1),children:"Prev"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:367",className:"text-white/50 text-sm",children:["Page ",a," of ",r]}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:368",variant:"outline",size:"sm",disabled:a>=r,onClick:()=>s(a+1),children:"Next"})]})]})}function fh(){const[t,n]=h.useState(""),[a,s]=h.useState(""),[i,o]=h.useState(""),[c,d]=h.useState(""),[l,x]=h.useState(""),[r,m]=h.useState(""),[b,f]=h.useState(!1),p=j.affiliateAuth.adminCreateAffiliate.useMutation({onSuccess:g=>{R.success(`Affiliate created! Username: ${g.username}, Code: ${g.referralCode}`),n(""),s(""),o(""),d(""),x(""),m("")},onError:g=>{R.error(g.message)}}),A=g=>{g.preventDefault(),p.mutate({username:t,password:a,displayName:i,email:c||void 0,paypalEmail:l||void 0,referralCode:r||void 0})};return e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:415",className:"max-w-lg",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:416",className:"bg-[#141414] border border-white/10 rounded-xl p-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:417",className:"flex items-center gap-3 mb-6",children:[e.jsx(Ls,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:418",className:"w-5 h-5 text-emerald-400"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:419",className:"text-white font-bold text-lg",children:"Create New Affiliate"})]}),e.jsxs("form",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:422",onSubmit:A,className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:423",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:424",className:"block text-xs text-white/60 uppercase tracking-wider mb-1",children:"Username *"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:425",type:"text",value:t,onChange:g=>n(g.target.value),className:"w-full px-3 py-2 bg-[#0a0a0a] border border-white/10 rounded-lg text-white text-sm focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500/50 outline-none",placeholder:"e.g. john_trader",required:!0,minLength:3})]}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:436",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:437",className:"block text-xs text-white/60 uppercase tracking-wider mb-1",children:"Password *"}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:438",className:"relative",children:[e.jsx("input",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:439",type:b?"text":"password",value:a,onChange:g=>s(g.target.value),className:"w-full px-3 py-2 pr-10 bg-[#0a0a0a] border border-white/10 rounded-lg text-white text-sm focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500/50 outline-none",placeholder:"Min 6 characters",required:!0,minLength:6}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:448",type:"button",onClick:()=>f(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/70",children:b?e.jsx(Gc,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:453",className:"w-4 h-4"}):e.jsx(ln,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:453",className:"w-4 h-4"})})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:458",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:459",className:"block text-xs text-white/60 uppercase tracking-wider mb-1",children:"Display Name *"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:460",type:"text",value:i,onChange:g=>o(g.target.value),className:"w-full px-3 py-2 bg-[#0a0a0a] border border-white/10 rounded-lg text-white text-sm focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500/50 outline-none",placeholder:"e.g. John Smith",required:!0})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:470",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:471",className:"block text-xs text-white/60 uppercase tracking-wider mb-1",children:"Email (optional)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:472",type:"email",value:c,onChange:g=>d(g.target.value),className:"w-full px-3 py-2 bg-[#0a0a0a] border border-white/10 rounded-lg text-white text-sm focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500/50 outline-none",placeholder:"[email protected]"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:481",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:482",className:"block text-xs text-white/60 uppercase tracking-wider mb-1",children:"PayPal Email (optional)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:483",type:"email",value:l,onChange:g=>x(g.target.value),className:"w-full px-3 py-2 bg-[#0a0a0a] border border-white/10 rounded-lg text-white text-sm focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500/50 outline-none",placeholder:"[email protected]"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:492",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:493",className:"block text-xs text-white/60 uppercase tracking-wider mb-1",children:"Referral Code (auto-generated if blank)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:494",type:"text",value:r,onChange:g=>m(g.target.value),className:"w-full px-3 py-2 bg-[#0a0a0a] border border-white/10 rounded-lg text-white text-sm focus:ring-2 focus:ring-emerald-500/50 focus:border-emerald-500/50 outline-none font-mono",placeholder:"e.g. AT-JOHN01"})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:503",type:"submit",disabled:p.isPending||!t||!a||!i,className:"w-full bg-emerald-500 hover:bg-emerald-400 text-black font-bold mt-2",children:[p.isPending?e.jsx(qe,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:509",className:"w-4 h-4 mr-2 animate-spin"}
10):e.jsx(Ls,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:511",className:"w-4 h-4 mr-2"}),"Create Affiliate Account"]})]})]})})}function bh(){const t=j.referralWallet.adminGetConfig.useQuery(),n=j.useUtils();if(j.referralWallet.adminUpdateConfig.useMutation({onSuccess:()=>{R.success("Config updated"),n.referralWallet.adminGetConfig.invalidate()},onError:s=>{R.error(s.message)}}),t.isLoading)return e.jsx(Tn,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:534"});const a=t.data;return!a||a.length===0?e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:537",className:"text-white/50",children:"No config found"}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:540",className:"space-y-4",children:e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:541",className:"bg-[#141414] border border-white/10 rounded-xl p-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:542",className:"flex items-center gap-2 mb-4",children:[e.jsx(Vc,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:543",className:"w-5 h-5 text-emerald-400"}),e.jsx("h3",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:544",className:"text-white font-bold",children:"Referral Wallet Configuration"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:546",className:"space-y-3",children:a.map(s=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:548",className:"flex items-center justify-between py-2 border-b border-white/5 last:border-0",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:549",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:550",className:"text-white text-sm font-medium",children:s.key}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:551",className:"text-white/40 text-xs",children:s.description||"No description"})]}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:553",className:"text-emerald-400 font-mono text-sm",children:s.value})]},s.key))})]})})}function cn({icon:t,label:n,value:a,color:s}){return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:564",className:"bg-[#141414] border border-white/10 rounded-xl p-3 md:p-4",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:565",className:"flex items-center justify-between mb-1.5 md:mb-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:566",className:"text-[10px] md:text-xs text-white/50 uppercase tracking-wider",children:n}),e.jsx(t,{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:567",className:"w-3.5 h-3.5 md:w-4 md:h-4",style:{color:s}})]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:569",className:"text-lg md:text-2xl font-bold text-white",children:a})]})}function Tn(){return e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:576",className:"space-y-4",children:e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:577",className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[...Array(4)].map((t,n)=>e.jsxs("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:579",className:"bg-[#141414] border border-white/10 rounded-xl p-4 animate-pulse",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:580",className:"h-3 bg-white/10 rounded w-20 mb-3"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminReferralWallet.tsx:581",className:"h-6 bg-white/10 rounded w-16"})]},n))})})}const gh=[{slug:"checkout",label:"Main Checkout (/checkout)"},{slug:"nmi",label:"Secondary Checkout (/nmi)"},{slug:"paypal",label:"PayPal / Apple Pay (/paypal)"},{slug:"5k-instant",label:"5K Instant (/5k-instant)"},{slug:"1k-instant",label:"1K Instant (/1k-instant)"},{slug:"paylater-checkout",label:"Pay Later (/paylater-checkout)"},{slug:"reset-checkout",label:"Reset Checkout (/reset-checkout)"},{slug:"unlocked-checkout",label:"Unlocked Checkout (/unlocked/checkout)"}];function Ah(){const t=j.useUtils(),[n,a]=h.useState(!1),[s,i]=h.useState(null),{data:o,isLoading:c}=j.paymentProcessors.list.useQuery(),d=j.paymentProcessors.toggleGlobal.useMutation({onSuccess:()=>
10{t.paymentProcessors.list.invalidate(),R.success("Processor status updated")},onError:m=>R.error(m.message)}),l=j.paymentProcessors.togglePage.useMutation({onSuccess:()=>{t.paymentProcessors.list.invalidate()},onError:m=>R.error(m.message)}),x=j.paymentProcessors.delete.useMutation({onSuccess:()=>{t.paymentProcessors.list.invalidate(),R.success("Processor deleted")},onError:m=>R.error(m.message)}),r=(m,b,f)=>{const p=f.find(A=>A.pageSlug===b);return p?p.isEnabled:!0};return c?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:56",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:57",className:"flex items-center gap-2 mb-6",children:[e.jsx(it,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:58",className:"w-6 h-6 text-blue-400"}),e.jsx("h1",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:59",className:"text-2xl font-bold text-white",children:"Payment Processors"})]}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:61",className:"animate-pulse space-y-4",children:[1,2,3].map(m=>e.jsx("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:63",className:"h-32 bg-white/5 rounded-xl"},m))})]}):e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:71",className:"w-full overflow-x-hidden",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:73",className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 md:mb-6",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:74",children:[e.jsxs("h1",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:75",className:"text-lg md:text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(it,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:76",className:"w-5 h-5 md:w-6 md:h-6 text-blue-400"}),"Payment Processors"]}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:79",className:"text-white/60 text-xs md:text-sm mt-1",children:"Manage payment gateways and toggle them on/off per checkout page."})]}),e.jsxs(L,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:83",onClick:()=>a(!0),className:"bg-blue-600 hover:bg-blue-700 text-white w-full sm:w-auto",size:"sm",children:[e.jsx(zt,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:88",className:"w-4 h-4 mr-1.5"})," Add Processor"]})]}),n&&e.jsx(wh,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:94",onClose:()=>a(!1)}),!o?.processors||o.processors.length===0?e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:99",className:"text-center py-12 text-white/40",children:[e.jsx(it,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:100",className:"w-12 h-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:101",className:"text-sm",children:"No payment processors configured yet."}),e.jsx("p",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:102",className:"text-xs mt-1",children:'Click "Add Processor" to get started.'})]}):e.jsx("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:105",className:"space-y-4",children:o.processors.map(m=>e.jsx(vh,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:107",processor:m,editingId:s,setEditingId:i,onToggleGlobal:b=>{d.mutate({id:m.id,isActive:b})},onTogglePage:(b,f)=>{l.mutate({processorId:m.id,pageSlug:b,isEnabled:f})},onDelete:()=>{confirm(`Delete "${m.name}"? This cannot be undone.`)&&x.mutate({id:m.id})},isPageEnabled:b=>r(m.id,b,m.pageAssignments)},m.id))}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:132",className:"mt-6 p-4 bg-white/5 rounded-xl border border-white/10",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:133",className:"text-sm font-medium text-white/80 mb-2",children:"How it works"}
10),e.jsxs("ul",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:134",className:"text-xs text-white/50 space-y-1.5",children:[e.jsxs("li",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:135",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:136",className:"w-2 h-2 rounded-full bg-emerald-400 inline-block"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:137",children:[e.jsx("strong",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:137",className:"text-white/70",children:"Global Toggle"})," â Turns the processor on/off across ALL checkout pages"]})]}),e.jsxs("li",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:139",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:140",className:"w-2 h-2 rounded-full bg-blue-400 inline-block"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:141",children:[e.jsx("strong",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:141",className:"text-white/70",children:"Per-Page Toggle"})," â Enable/disable the processor on individual checkout pages"]})]}),e.jsxs("li",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:143",className:"flex items-center gap-2",children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:144",className:"w-2 h-2 rounded-full bg-amber-400 inline-block"}),e.jsxs("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:145",children:[e.jsx("strong",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:145",className:"text-white/70",children:"Default"})," â If no per-page setting exists, the processor is enabled on that page (opt-out model)"]})]})]})]})]})}function vh({processor:t,editingId:n,setEditingId:a,onToggleGlobal:s,onTogglePage:i,onDelete:o,isPageEnabled:c}){const d=n===t.id;return e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:173",className:`rounded-xl border transition-all ${t.isActive?"bg-[#0d0d0d] border-white/10":"bg-[#0d0d0d]/50 border-red-500/20 opacity-75"}`,children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:179",className:"flex items-center justify-between p-4 border-b border-white/5",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:180",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:181",className:`w-3 h-3 rounded-full ${t.isActive?"bg-emerald-400":"bg-red-400"}`}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:182",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:183",className:"text-sm font-semibold text-white",children:t.name}),e.jsxs("p",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:184",className:"text-xs text-white/40 mt-0.5",children:["slug: ",e.jsx("code",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:185",className:"text-white/60",children:t.slug}),t.description&&e.jsxs("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:186",className:"ml-2",children:["â ",t.description]})]})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:190",className:"flex items-center gap-2",children:[e.jsx("button",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:192",onClick:()=>s(!t.isActive),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${t.isActive?"bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20":"bg-red-500/10 text-red-400 hover:bg-red-500/20"}`,title:t.isActive?"Click to disable globally":"Click to enable globally",children:t.isActive?e.jsxs(e.Fragment,{children:[e.jsx(_t,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:202",className:"w-4 h-4"})," Active"]}):e.jsxs(e.Fragment,{children:[e.jsx(Lt,{"data-loc":"client/src/components/
10admin/AdminPaymentProcessors.tsx:204",className:"w-4 h-4"})," Disabled"]})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:208",onClick:()=>a(d?null:t.id),className:"p-1.5 rounded-lg text-white/40 hover:text-white/80 hover:bg-white/5 transition-colors",title:"Edit page assignments",children:e.jsx(rt,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:213",className:"w-3.5 h-3.5"})}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:216",onClick:o,className:"p-1.5 rounded-lg text-white/40 hover:text-red-400 hover:bg-red-500/10 transition-colors",title:"Delete processor",children:e.jsx(me,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:221",className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:227",className:"p-4",children:[e.jsx("p",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:228",className:"text-xs text-white/50 mb-3 font-medium uppercase tracking-wide",children:"Checkout Page Assignments"}),e.jsx("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:231",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-2",children:gh.map(l=>{const x=c(l.slug),r=!t.isActive;return e.jsxs("button",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:236",onClick:()=>i(l.slug,!x),disabled:r,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium transition-all border ${r?"border-white/5 bg-white/[0.02] text-white/20 cursor-not-allowed":x?"border-emerald-500/20 bg-emerald-500/5 text-emerald-300 hover:bg-emerald-500/10":"border-red-500/20 bg-red-500/5 text-red-300 hover:bg-red-500/10"}`,children:[e.jsx("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:248",className:`w-2 h-2 rounded-full flex-shrink-0 ${r?"bg-white/20":x?"bg-emerald-400":"bg-red-400"}`}),e.jsx("span",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:251",className:"truncate",children:l.label})]},l.slug)})})]})]})}function wh({onClose:t}){const n=j.useUtils(),[a,s]=h.useState(""),[i,o]=h.useState(""),[c,d]=h.useState(""),l=j.paymentProcessors.create.useMutation({onSuccess:()=>{n.paymentProcessors.list.invalidate(),R.success("Payment processor added"),t()},onError:m=>R.error(m.message)}),x=m=>{if(m.preventDefault(),!a.trim()||!i.trim()){R.error("Name and slug are required");return}l.mutate({name:a.trim(),slug:i.trim().toLowerCase(),description:c.trim()||void 0})},r=m=>{s(m),(!i||i===ka(a))&&o(ka(m))};return e.jsxs("form",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:298",onSubmit:x,className:"mb-4 p-4 bg-[#0d0d0d] border border-white/10 rounded-xl space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:302",className:"flex items-center justify-between",children:[e.jsx("h3",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:303",className:"text-sm font-semibold text-white",children:"Add Payment Processor"}),e.jsx("button",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:304",type:"button",onClick:t,className:"text-white/40 hover:text-white/80",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:305",className:"w-4 h-4"})})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:308",className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:309",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:310",className:"text-xs text-white/60 mb-1 block",children:"Name *"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:311",type:"text",value:a,onChange:m=>r(m.target.value),placeholder:"e.g. TailoredPay NMI + Apple Pay",className:"w-full px-3 py-2 text-sm bg-black/50 border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-blue-500/50"})]}
10),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:319",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:320",className:"text-xs text-white/60 mb-1 block",children:"Slug * (machine key)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:321",type:"text",value:i,onChange:m=>o(m.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:"e.g. nmi",className:"w-full px-3 py-2 text-sm bg-black/50 border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-blue-500/50 font-mono"})]})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:330",children:[e.jsx("label",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:331",className:"text-xs text-white/60 mb-1 block",children:"Description (optional)"}),e.jsx("input",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:332",type:"text",value:c,onChange:m=>d(m.target.value),placeholder:"e.g. Card payments via NMI gateway with Apple Pay supp
10ort",className:"w-full px-3 py-2 text-sm bg-black/50 border border-white/10 rounded-lg text-white placeholder:text-white/30 focus:outline-none focus:border-blue-500/50"})]}),e.jsxs("div",{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:340",className:"flex justify-end gap-2 pt-1",children:[e.jsx(L,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:341",type:"button",variant:"outline",size:"sm",onClick:t,className:"text-white/60",children:"Cancel"}),e.jsx(L,{"data-loc":"client/src/components/admin/AdminPaymentProcessors.tsx:344",type:"submit",size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",disabled:l.isPending,children:l.isPending?"Adding...":"Add Processor"})]})]})}function ka(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim()}const Pa="pwa-install-dismissed";function yh(){const[t,n]=h.useState(null),[a,s]=h.useState(!1),[i,o]=h.useState(!1),[c,d]=h.useState(!1);Cs(),h.useEffect(()=>{const r=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;if(d(r),r)return;const m=localStorage.getItem(Pa);if(m&&(Date.now()-parseInt(m))/864e5<7)return;const b=navigator.userAgent,f=/iPad|iPhone|iPod/.test(b)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;if(o(f),f){s(!0);return}const p=A=>{A.preventDefault(),n(A),s(!0)};return window.addEventListener("beforeinstallprompt",p),()=>window.removeEventListener("beforeinstallprompt",p)},[]);const l=async()=>{if(!t)return;await t.prompt();const{outcome:r}=await t.userChoice;r==="accepted"&&s(!1),n(null)},x=()=>{s(!1),localStorage.setItem(Pa,Date.now().toString())};return!a||c?null:e.jsx("div",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:73",className:"fixed bottom-4 left-4 right-4 md:left-auto md:right-6 md:bottom-6 md:w-[360px] z-50 animate-in slide-in-from-bottom-4 duration-300",children:e.jsxs("div",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:74",className:"bg-[#1a1a1a] border border-white/10 rounded-xl p-4 shadow-2xl shadow-black/50",children:[e.jsxs("div",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:75",className:"flex items-start gap-3",children:[e.jsx("div",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:76",className:"h-10 w-10 rounded-lg bg-[#0b6fd9]/20 flex items-center justify-center shrink-0",children:e.jsx(Ua,{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:77",className:"h-5 w-5 text-[#0b6fd9]"})}),e.jsxs("div",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:79",className:"flex-1 min-w-0",children:[e.jsx("h4",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:80",className:"text-sm font-semibold text-white",children:"Install Admin App"}),i?e.jsxs("p",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:82",className:"text-xs text-white/50 mt-1 leading-relaxed",children:["Tap ",e.jsx(qc,{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:83",className:"inline h-3.5 w-3.5 text-[#0b6fd9] -mt-0.5"})," then ",e.jsx("span",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:83",className:"text-white/70 font-medium",children:'"Add to Home Screen"'})," for full-screen app experience."]}):e.jsx("p",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:86",className:"text-xs text-white/50 mt-1 leading-relaxed",children:"Add to your home screen for instant access â works offline, opens full screen."})]}),e.jsx("button",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:91",onClick:x,className:"h-6 w-6 flex items-center justify-center rounded hover:bg-white/10 transition-colors shrink-0","aria-label":"Dismiss",children:e.jsx(Ue,{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:96",className:"h-3.5 w-3.5 text-white/40"})})]}),!i&&t&&e.jsx("button",{"data-loc":"client/src/components/admin/PWAInstallPrompt.tsx:101",onClick:l,className:"mt-3 w-full h-9 bg-[#0b6fd9] hover:bg-[#0668d1] text-white text-sm font-medium rounded-lg transition-colors",children:"Install App"})]})})}const Sa=[{icon:Hc,label:"Overview",id:"overview"},{icon:Gt,label:"Revenue",id:"revenue"},{icon:un,label:"Orders",id:"orders"},{icon:hn,label:"Analytics",id:"analytics"},{icon:Qc,label:"Attribution",id:"attribution"},{icon:Kt,label:"Challenges",id:"challenges"},{icon:ls,label:"Promo Codes",id:"promo-codes"},{icon:He,label:"Leads",id:"leads"},{icon:Ea,label:"Blog Posts",id:"blog-posts"},{icon:Ia,label:"Affiliates",id:"affiliates"},{icon:za,label:"Referral Wallet",id:"referral-wallet"},{icon:Dt,label:"Lottery",id:"lottery"},{icon:ns,label:"Reviews",id:"reviews"},{icon:pn,label:"Blacklist",id:"blacklist"},{icon:It,label:"Web Analytics",id:"web-analytics"},{icon:it,label:"Payment Processors",id:"payment-processors"}],Oa="admin-sidebar-width",jh=260,Nh=200,Ch=400;function Eh(){const[t,n]=h.useState(()=>{const d=localStorage.getItem(Oa);return d?parseInt(d,10):jh}),{loading:a,user:s}=Da(),[i,o]=h.useState("revenue");if(h.useEffect(()=>{localStorage.setItem(Oa,t.toString())},[t]),h.useEffect(()=>{const d=window;
10return d.Intercom&&d.Intercom("update",{hide_default_launcher:!0}),()=>{d.Intercom&&d.Intercom("update",{hide_default_launcher:!1})}},[]),a)return e.jsx(fm,{"data-loc":"client/src/pages/AdminDashboard.tsx:98"});if(!s||s.role!=="admin")return e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:102",className:"flex items-center justify-center min-h-screen bg-[#0a0a0a]",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:103",className:"flex flex-col items-center gap-8 p-8 max-w-md w-full",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:104",className:"flex flex-col items-center gap-6",children:[e.jsx("h1",{"data-loc":"client/src/pages/AdminDashboard.tsx:105",className:"text-2xl font-semibold tracking-tight text-center text-white",children:s?"Access Denied":"Sign in to continue"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:108",className:"text-sm text-white/50 text-center max-w-sm",children:s?"You need admin privileges to access this dashboard.":"Access to the admin dashboard requires authentication."})]}),!s&&e.jsx(L,{"data-loc":"client/src/pages/AdminDashboard.tsx:115",onClick:()=>{window.location.href=Dc()},size:"lg",className:"w-full bg-[#0b6fd9] hover:bg-[#0668d1] text-white",children:"Sign in"}),e.jsxs("a",{"data-loc":"client/src/pages/AdminDashboard.tsx:123",href:"/",className:"text-sm text-[#0781fe] hover:underline flex items-center gap-1",children:[e.jsx(mn,{"data-loc":"client/src/pages/AdminDashboard.tsx:124",className:"w-4 h-4"})," Back to website"]})]})});const c=()=>{switch(i){case"revenue":return e.jsx(zp,{"data-loc":"client/src/pages/AdminDashboard.tsx:133"});case"orders":return e.jsx(ih,{"data-loc":"client/src/pages/AdminDashboard.tsx:134"});case"attribution":return e.jsx(Qp,{"data-loc":"client/src/pages/AdminDashboard.tsx:135"});case"challenges":return e.jsx(gm,{"data-loc":"client/src/pages/AdminDashboard.tsx:136"});case"promo-codes":return e.jsx(wm,{"data-loc":"client/src/pages/AdminDashboard.tsx:137"});case"leads":return e.jsx(jm,{"data-loc":"client/src/pages/AdminDashboard.tsx:138"});case"blog-posts":return e.jsx(Nm,{"data-loc":"client/src/pages/AdminDashboard.tsx:139"});case"affiliates":return e.jsx(km,{"data-loc":"client/src/pages/AdminDashboard.tsx:140"});case"referral-wallet":return e.jsx(mh,{"data-loc":"client/src/pages/AdminDashboard.tsx:141"});case"lottery":return e.jsx(Om,{"data-loc":"client/src/pages/AdminDashboard.tsx:142"});case"reviews":return e.jsx(Zp,{"data-loc":"client/src/pages/AdminDashboard.tsx:143"});case"blacklist":return e.jsx(Jp,{"data-loc":"client/src/pages/AdminDashboard.tsx:144"});case"analytics":return e.jsx(lh,{"data-loc":"client/src/pages/AdminDashboard.tsx:145"});case"web-analytics":return e.jsx(sh,{"data-loc":"client/src/pages/AdminDashboard.tsx:146"});case"payment-processors":return e.jsx(Ah,{"data-loc":"client/src/pages/AdminDashboard.tsx:147"});default:return e.jsx(bm,{"data-loc":"client/src/pages/AdminDashboard.tsx:148"})}};return e.jsxs(im,{"data-loc":"client/src/pages/AdminDashboard.tsx:153",style:{"--sidebar-width":`${t}px`},children:[e.jsx(kh,{"data-loc":"client/src/pages/AdminDashboard.tsx:156",setSidebarWidth:n,activeSection:i,setActiveSection:o,children:c()}),e.jsx(yh,{"data-loc":"client/src/pages/AdminDashboard.tsx:163"})]})}function kh({children:t,setSidebarWidth:n,activeSection:a,setActiveSection:s}){const{user:i,logout:o}=Da(),{state:c,toggleSidebar:d}=Rn(),l=c==="collapsed",[x,r]=h.useState(!1),m=h.useRef(null),b=Cs(),f=Sa.find(p=>p.id===a);return h.useEffect(()=>{l&&r(!1)},[l]),h.useEffect(()=>{const p=g=>{if(!x)return;const w=m.current?.getBoundingClientRect().left??0,C=g.clientX-w;C>=Nh&&C<=Ch&&n(C)},A=()=>r(!1);return x&&(document.addEventListener("mousemove",p),document.addEventListener("mouseup",A),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",A),document.body.style.cursor="",document.body.style.userSelect=""}},[x,n]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:215",className:"relative",ref:m,children:[e.jsxs(om,{"data-loc":"client/src/pages/AdminDashboard.tsx:216",collapsible:"icon",className:"border-r border-white/10 bg-[#111]",disableTransition:x,children:[e.jsx(dm,{"data-loc":"client/src/pages/AdminDashboard.tsx:217",className:"h-16 justify-center border-b border-white/10",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:218",className:"flex items-center gap-3 px-2 w-full",children:[e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:219",onClick:d,className:"h-8 w-8 flex items-center justify-center hover:bg-white/10 rounded-lg transition-colors shrink-0","aria-label":"Toggle navigation",children:e.jsx(La,{"data-loc":"client/src/pages/AdminDashboard.tsx:224",className:"h-4 w-4 text-white/60"})}),!l&&e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:227",className:"font-semibold tracking-tight truncate text-white text-sm",children:"Admin Dashboard"})]})}),e.jsxs(mm,{"data-loc":"client/src/pages/AdminDashboard.tsx:234",className:"gap-0",children:[e.jsx(xm,{"data-loc":"client/src/pages/AdminDashboard.tsx:235",className:"px-2 py-2",children:Sa.map(p=>{const A=a===p.id;return e.jsx(um,{"data-loc":"client/src/pages/AdminDashboard.tsx:239",children:e.jsxs(hm,{"data-loc":"client/src/pages/AdminDashboard.tsx:240",isActive:A,onClick:()=>s(p.id),tooltip:p.label,className:`h-10 transition-all font-normal ${A?"bg-[#0b6fd9]/15 text-[#0781fe]":"text-white/60 hover:text-white hover:bg-white/5"}`,children:[e.jsx(p.icon,{"data-loc":"client/src/pages/AdminDashboard.tsx:246",className:`h-4 w-4 ${A?"text-[#0781fe]":""}`}),e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:247",children:p.label})]})},p.id)})}),e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:254",className:"mt-auto px-3 py-3 border-t border-white/10",children:e.jsxs("a",{"data-loc":"client/src/pages/AdminDashboard.tsx:255",href:"/",className:"flex items-center gap-2 text-xs text-white/40 hover:text-white/70 transition-colors",children:[e.jsx(mn,{"data-loc":"client/src/pages/AdminDashboard.tsx:259",className:"w-3.5 h-3.5"}),!l&&e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:260",children:"Back to website"})]})})]}),e.jsx(lm,{"data-loc":"client/src/pages/AdminDashboard.tsx:265",className:"p-3 border-t border-white/10",children:e.jsxs(Ul,{"data-loc":"client/src/pages/AdminDashboard.tsx:266",children:[e.jsx(Yl,{"data-loc":"client/src/pages/AdminDashboard.tsx:267",asChild:!0,children:e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:268",className:"flex items-center gap-3 rounded-lg px-1 py-1 hover:bg-white/5 transition-colors w-full text-left group-data-[collapsible=icon]:justify-center",children:[e.jsx(ld,{"data-loc":"client/src/pages/AdminDashboard.tsx:269",className:"h-9 w-9 border border-white/10 shrink-0",children:e.jsx(md,{"data-loc":"client/src/pages/AdminDashboard.tsx:270",className:"text-xs font-medium bg-[#0b6fd9]/20 text-[#0781fe]",children:i?.name?.charAt(0).toUpperCase()||"A"})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:274",className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:275",className:"text-sm font-medium truncate leading-none text-white",children:i?.name||"-"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:276",className:"text-xs text-white/40 truncate mt-1.5",children:i?.email||"-"})]})]})}),e.jsx(Kl,{"data-loc":"client/src/pages/AdminDashboard.tsx:280",align:"end",className:"w-48",children:e.jsxs(zl,{"data-loc":"client/src/pages/AdminDashboard.tsx:281",onClick:o,className:"cursor-pointer text-red-400 focus:text-red-400",children:[e.jsx(Zc,{"data-loc":"client/src/pages/AdminDashboard.tsx:282",className:"mr-2 h-4 w-4"}),e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:283",children:"Sign out"})]})})]})})]}),e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:289",className:`absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-[#0b6fd9]/20 transition-colors ${l?"hidden":""}`,onMouseDown:()=>{l||r(!0)},style:{zIndex:50}})]}),e.jsxs(rm,{"data-loc":"client/src/pages/AdminDashboard.tsx:296",className:"bg-[#0a0a0a]",children:[b&&e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:298",className:"flex border-b border-white/10 items-center justify-between bg-[#111]/95 px-2 backdrop-blur sticky top-0 z-40",style:{paddingTop:"max(0.5rem, env(safe-area-inset-top, 0px))",minHeight:"calc(3.5rem + env(safe-area-inset-top, 0px))"},children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:299",className:"flex items-center gap-2",children:[e.jsx(cm,{"data-loc":"client/src/pages/AdminDashboard.tsx:300",className:"h-9 w-9 rounded-lg"}),e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:301",className:"text-white text-sm font-medium",children:f?.label??"Dashboard"})]})}),e.jsx("main",{"data-loc":"client/src/pages/AdminDashboard.tsx:305",className:"flex-1 p-4 md:p-6",children:t})]})]})}export{Eh as default};
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.