1var Tw=e=>{throw TypeError(e)};var Ow=(e,t,r)=>t.has(e)||Tw("Cannot "+r);var un=(e,t,r)=>(Ow(e,t,"read from private field"),r?r.call(e):t.get(e)),Ew=(e,t,r)=>t.has(e)?Tw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Um=(e,t,r,a)=>(Ow(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r);import{c as xe,r as y,j as n,b as Ae,d as Ic,e as Rc,L as ye,u as ai,O as Yr,N as Mt,t as W,f as ar,g as u9,h as Yh,i as q,k as h9,l as f9,s as p0,m as Wt,T as Dc,n as x0,o as $c,p as Cd,q as it,v as $e,R as m9,a as he}from"./index-C0fEOORV.js";import{m as zm,n as Wm,u as p9,o as x9,p as g9,q as et,r as tt,s as Hs,t as LC,X as Me,v as IC,w as b9,B as be,M as v9,x as Fc,I as Ee,y as Zh,z as ie,E as F,F as At,G as Be,U as en,H as ht,J as pn,L as ja,K as Rt,N as Pn,O as rs,Q as te,R as Vn,Y as Bc,Z as Ki,_ as Nv,$ as _v,a0 as y9,a1 as Yi,a2 as gt,a3 as j9,a4 as w9,W as N9,a5 as wt,a6 as Uc,a7 as _9,a8 as RC,a9 as g0,aa as DC,ab as Wn,ac as Vl,ad as S9,ae as we,af as zc,ag as xn,ah as Et,ai as b0,aj as gn,ak as nn,al as Sn,am as zo,an as Xh,ao as Dt,ap as iu,aq as Zr,ar as Sv,as as hu,at as $C,au as C9,a as A9,b as k9,e as P9,f as T9,g as O9,h as E9,i as M9,c as L9,d as I9,T as R9,P as D9,C as $9,A as F9,D as B9,S as U9,j as z9,k as W9,V as q9,l as V9}from"./LegalPage-BAL2n7dj.js";const H9=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Hl=xe("activity",H9);const G9=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],FC=xe("archive",G9);const K9=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],BC=xe("award",K9);const Y9=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2Z",key:"169p4p"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}]],Z9=xe("bookmark-check",Y9);const X9=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Jh=xe("bookmark",X9);const J9=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],Q9=xe("bug",J9);const eL=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Cr=xe("calendar",eL);const tL=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],UC=xe("camera",tL);const nL=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Fr=xe("chart-column",nL);const rL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ya=xe("chevron-right",rL);const aL=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],sL=xe("chevron-up",aL);const iL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],zC=xe("circle-alert",iL);const oL=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],v0=xe("circle-check-big",oL);const lL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],Qh=xe("circle-pause",lL);const cL=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ef=xe("circle-play",cL);const dL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Wc=xe("circle-user",dL);const uL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Wo=xe("circle-x",uL);const hL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fL=xe("circle",hL);const mL=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],It=xe("credit-card",mL);const pL=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Za=xe("crown",pL);const xL=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],WC=xe("file-pen",xL);const gL=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-
15-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],as=xe("flag",gL);const bL=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],y0=xe("funnel",bL);const vL=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],qC=xe("house",vL);const yL=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],VC=xe("inbox",yL);const jL=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],wL=xe("layers",jL);const NL=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],HC=xe("layout-dashboard",NL);const _L=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],SL=xe("link-2",_L);const CL=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],GC=xe("link",CL);const AL=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],KC=xe("list-checks",AL);const kL=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],qc=xe("lock",kL);const PL=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],tf=xe("log-out",PL);const TL=[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],OL=xe("mail-check",TL);const EL=[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]],ML=xe("mail-open",EL);const LL=[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]],qr=xe("medal",LL);const IL=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],tn=xe("message-square",IL);const RL=[["path",{d:"M5 12h14",key:"1ays0h"}]],DL=xe("minus",RL);const $L=[["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]],FL=xe("monitor-check",$L);const BL=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],UL=xe("moon",BL);const zL=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.
1074z",key:"s0h3yz"}]],YC=xe("mouse-pointer-click",zL);const WL=[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]],Vc=xe("mouse-pointer",WL);const qL=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],ZC=xe("octagon-alert",qL);const VL=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],fu=xe("paperclip",VL);const HL=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],GL=xe("party-popper",HL);const KL=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],qt=xe("pencil",KL);const YL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pt=xe("plus",YL);const ZL=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],XL=xe("radar",ZL);const JL=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],QL=xe("refresh-cw",JL);const eI=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]],XC=xe("reply",eI);const tI=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],nI=xe("rocket",tI);const rI=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Gs=xe("save",rI);const aI=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],sI=xe("scan-line",aI);const iI=[["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M18 5v16",key:"1ethyx"}],["path",{d:"m4 6 7.106-3.79a2 2 0 0 1 1.788 0L20 6",key:"zywc2d"}],["path",{d:"m6 11-3.52 2.147a1 1 0 0 0-.48.854V19a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5a1 1 0 0 0-.48-.853L18 11",key:"1d4ql0"}],["path",{d:"M6 5v16",key:"1sn0nx"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]],oI=xe("school",iI);const lI=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],si=xe("send",lI);const cI=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],qo=xe("settings",cI);const dI=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],uI=xe("share-2",dI);const hI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
1y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],fI=xe("shield-alert",hI);const mI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ln=xe("shield-check",mI);const pI=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],xI=xe("smartphone",pI);const gI=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Cv=xe("square-pen",gI);const bI=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Nn=xe("star",bI);const vI=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],yI=xe("sun",vI);const jI=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],wI=xe("tablet",jI);const NI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],_I=xe("target",NI);const SI=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],_n=xe("trash-2",SI);const CI=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],AI=xe("trending-down",CI);const kI=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ii=xe("trending-up",kI);const PI=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],JC=xe("user-cog",PI);const TI=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ze=xe("user",TI);const OI=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],EI=xe("wrench",OI);const MI=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Mw=xe("zap",MI),LI=(e,t,r)=>a=>{const s={...a.queries},i=a.nextPageKey,o=a.nextPageKey+1,c=a.nextPageKey+2;s[i]={query:a.query,args:{...a.args,paginationOpts:{...a.queries[e].args.paginationOpts,endCursor:t}}},s[o]={query:a.query,args:{...a.args,paginationOpts:{...a.queries[e].args.paginationOpts,cursor:t,endCursor:r}}};const d={...a.ongoingSplits};return d[e]=[i,o],{...a,nextPageKey:c,queries:s,ongoingSplits:d}},II=e=>t=>{const r=t.ongoingSplits[e];if(r===void 0)return t;const a={...t.queries};delete a[e];const s={...t.ongoingSplits};delete s[e];let i=t.pageKeys.slice();const o=t.pageKeys.findIndex(c=>c===e);return o>=0&&(i=[...t.pageKeys.slice(0,o),...r,...t.pageKeys.slice(o+1)]),{...t,queries:a,pageKeys:i,ongoingSplits:s}};function Xr(e,t,r){const{user:a}=$I(e,t,r,!0);return a}const RI=Symbol("includePageKeys"),DI=Symbol("page");function $I(e,t,r,a=!0){if(typeof r?.initialNumItems!="number"||r.initialNumItems<0)throw new Error(`\`options.initialNumItems\` must be a positive number. Received \`${r?.initialNumItems}\`.`);const s=t==="skip",i=s?{}:t,o=zm(e),c=y.useMemo(()=>()=>{const _=FI();return{query:e,args:i,id:_,nextPageKey:1,pageKeys:s?[]:[0],queries:s?{}:{0:{query:e,args:{...i,paginationOpts:{numItems:r.initialNumItems,cursor:null,id:_}}}},ongoingSplits:{},skip:s}},[JSON.stringify(Wm(i)),o,r.initialNumItems,s]),[d,u]=y.useState(c);let h=d;
1(zm(e)!==zm(d.query)||JSON.stringify(Wm(i))!==JSON.stringify(Wm(d.args))||s!==d.skip)&&(h=c(),u(h));const p=p9().logger,b=x9(h.queries),w=r[RI]??!1,[x,g,j]=y.useMemo(()=>{let _;const N=[];for(const C of h.pageKeys){if(_=b[C],_===void 0)break;if(_ instanceof Error){if(_.message.includes("InvalidCursor")||_ instanceof g9&&typeof _.data=="object"&&_.data?.isConvexSystemError===!0&&_.data?.paginationError==="InvalidCursor")return p.warn("usePaginatedQuery hit error, resetting pagination state: "+_.message),u(c),[[],void 0,void 0];if(a)throw _;return[N,void 0,_]}const A=h.ongoingSplits[C];if(A!==void 0?b[A[0]]!==void 0&&b[A[1]]!==void 0&&u(II(C)):_.splitCursor&&(_.pageStatus==="SplitRecommended"||_.pageStatus==="SplitRequired"||_.page.length>r.initialNumItems*2)&&u(LI(C,_.splitCursor,_.continueCursor)),_.pageStatus==="SplitRequired")return[N,void 0,void 0];N.push(...w?_.page.map(P=>({...P,[DI]:C.toString()})):_.page)}return[N,_,void 0]},[b,h.pageKeys,h.ongoingSplits,r.initialNumItems,c,p,w,a]),S=y.useMemo(()=>{if(j!==void 0)return{status:"Error",isLoading:!1,error:j,loadMore:()=>{}};if(g===void 0)return h.nextPageKey===1?{status:"LoadingFirstPage",isLoading:!0,loadMore:()=>{}}:{status:"LoadingMore",isLoading:!0,loadMore:C=>{}};if(g.isDone)return{status:"Exhausted",isLoading:!1,loadMore:C=>{}};const _=g.continueCursor;let N=!1;return{status:"CanLoadMore",isLoading:!1,loadMore:C=>{N||(N=!0,u(A=>{const P=[...A.pageKeys,A.nextPageKey],O={...A.queries};return O[A.nextPageKey]={query:A.query,args:{...A.args,paginationOpts:{numItems:C,cursor:_,id:A.id}}},{...A,nextPageKey:A.nextPageKey+1,pageKeys:P,queries:O}}))}}},[j,g,h.nextPageKey]);return{user:{results:x,...S},internal:{state:h}}}let Lw=0;function FI(){return Lw++,Lw}const j0="/auth/callback",QC="viktor_sign_in",BI="failed",UI="auto",Iw=`/login?${QC}=${BI}`,mu="viktor-spaces:viktor-signin-attempt",zI=300*1e3;function WI(e){return new URLSearchParams(e).has("code")}function qI(e){return new URLSearchParams(e).get(QC)===UI}function VI(){try{sessionStorage.setItem(mu,String(Date.now()))}catch{}}function eA(e){if(e===null)return!1;const t=Number(e);return Number.isFinite(t)&&Date.now()-t<zI}function HI(){try{return eA(sessionStorage.getItem(mu))}catch{return!1}}function GI(){try{const e=sessionStorage.getItem(mu);return e===null?!1:(sessionStorage.removeItem(mu),eA(e))}catch{return!1}}const KI=typeof window<"u"&&WI(window.location.search),YI=typeof window<"u"&&qI(window.location.search),ZI=typeof window<"u"&&window.location.pathname===j0&&GI();function XI(){return KI}function JI(){return ZI}function QI(){return YI}var eR=Object.defineProperty,Jn=(e,t)=>eR(e,"name",{value:t,configurable:!0});function tR(e,t){const r=y.createContext(t);r.displayName=e+"Context";const a=Jn(i=>{const{children:o,...c}=i,d=y.useMemo(()=>c,Object.values(c));return n.jsx(r.Provider,{value:d,children:o})},"Provider");a.displayName=e+"Provider";function s(i,o={}){const{optional:c=!1}=o,d=y.useContext(r);if(d)return d;if(t!==void 0)return t;if(!c)throw new Error(`\`${i}\` must be used within \`${e}\``)}return Jn(s,"useContext"),[a,s]}Jn(tR,"createContext");function sr(e,t=[]){let r=[];function a(i,o){const c=y.createContext(o);c.displayName=i+"Context";const d=r.length;r=[...r,o];const u=Jn(m=>{const{scope:p,children:b,...w}=m,x=p?.[e]?.[d]||c,g=y.useMemo(()=>w,Object.values(w));return n.jsx(x.Provider,{value:g,children:b})},"Provider");u.displayName=i+"Provider";function h(m,p,b={}){const{optional:w=!1}=b,x=p?.[e]?.[d]||c,g=y.useContext(x);if(g)return g;if(o!==void 0)return o;if(!w)throw new Error(`\`${m}\` must be used within \`${i}\``)}return Jn(h,"useContext"),[u,h]}Jn(a,"createContext");const s=Jn(()=>{const i=r.map(o=>y.createContext(o));return Jn(function(c){const d=c?.[e]||i;return y.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])},"useScope")},"createScope");return s.scopeName=e,[a,tA(s,...t)]}Jn(sr,"createContextScope");function tA(...e){const t=e[0];if(e.length===1)return t;const r=Jn(()=>{const a=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return Jn(function(i){const o=a.reduce((c,{useScope:d,scopeName:u})=>{const m=d(i)[`__scope${u}`];return{...c,...m}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=t.scopeName,r}Jn(tA,"composeContextScopes");var nR=Object.defineProperty,rR=(e,t)=>nR(e,"name",{value:t,configurable:!0});function qn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...r)=>t.current?.(...r)),[])}rR(qn,"useCallbackRef");var yt=globalThis?.document?y.useLayoutEffect:()=>{},aR=Object.defineProperty,wa=(e,t)=>aR(e,"name",{value:t,configurable:!0}),nA="Avatar",[sR,ode]=sr(nA),iR=[0,()=>{}],[oR,rA]=sR(nA),lR=y.forwardRef(wa(function(t,r){const{__scopeAvatar:a,...s}=t,[i,o]=y.useState("idle"),[c,d]=sA();return n.jsx(oR,{scope:a,imageLoadingStatus:i,setImageLoadingStatus:o,imageCount:c,setImageCount:d,children:n.jsx(et.span,{...s,ref:r})})},"Avatar")),cR="AvatarImage",dR=y.forwardRef(wa(function(t,r){const{__scopeAvatar:a,src:s,onLoadingStatusChange:i,...o}=t,c=rA(cR,a);c.setImageCount;const d=aA(s,{referrerPolicy:o.referrerPolicy,crossOrigin:o.crossOrigin,loadingStatus:c.imageLoadingStatus,set
1LoadingStatus:c.setImageLoadingStatus}),u=qn(m=>{i?.(m)}),h=y.useRef(d);return yt(()=>{const m=h.current;h.current=d,d!==m&&u(d)},[d,u]),d==="loaded"?n.jsx(et.img,{...o,ref:r,src:s}):null},"AvatarImage")),uR="AvatarFallback",hR=y.forwardRef(wa(function(t,r){const{__scopeAvatar:a,delayMs:s,...i}=t,o=rA(uR,a),[c,d]=y.useState(s===void 0);return y.useEffect(()=>{if(s!==void 0){const u=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(u)}},[s]),c&&o.imageLoadingStatus!=="loaded"?n.jsx(et.span,{...i,ref:r}):null},"AvatarFallback"));function aA(e,{loadingStatus:t,setLoadingStatus:r,referrerPolicy:a,crossOrigin:s}){return yt(()=>{if(!e){r("error");return}const i=new window.Image,o=wa(d=>{const u=d.currentTarget;r(Av(u))},"handleLoad"),c=wa(()=>r("error"),"handleError");return i.addEventListener("load",o),i.addEventListener("error",c),a&&(i.referrerPolicy=a),i.crossOrigin=s??null,i.src=e,r(Av(i)),()=>{i.removeEventListener("load",o),i.removeEventListener("error",c),r("idle")}},[e,s,a,r]),t}wa(aA,"useImageLoadingStatus");function Av(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}wa(Av,"getImageLoadingStatus");function sA(){return iR}wa(sA,"useImageCount");function fR(e){}wa(fR,"useUpdateImageCount");function w0({className:e,...t}){return n.jsx(lR,{"data-slot":"avatar",className:Ae("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function mR({className:e,...t}){return n.jsx(dR,{"data-slot":"avatar-image",className:Ae("aspect-square size-full object-cover",e),...t})}function N0({className:e,...t}){return n.jsx(hR,{"data-slot":"avatar-fallback",className:Ae("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full font-medium",e),...t})}const Zi=[{email:"[email protected]",name:"Kameron Elumbaugh",photo:"/kameron-settings.jpg"},{email:"[email protected]",name:"Astik Singh",photo:"/astik-settings.jpg"},{email:"[email protected]",name:"John Elumbaugh",photo:"/john-profile.jpg"},{email:"[email protected]",name:"Thomas VanSlambrouck",photo:"/thomas-settings.jpg"}];function _0(e){return e.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}function Hc(e){if(!e)return;const t=e.trim().toLowerCase();return Zi.find(r=>r.email===t)}var pR=Object.defineProperty,Vo=(e,t)=>pR(e,"name",{value:t,configurable:!0}),iA=!!(typeof window<"u"&&window.document&&window.document.createElement);function Se(e,t,{checkForDefaultPrevented:r=!0}={}){return Vo(function(s){if(e?.(s),r===!1||!s||!s.defaultPrevented)return t?.(s)},"handleEvent")}Vo(Se,"composeEventHandlers");function xR(e){if(!iA)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}Vo(xR,"getOwnerWindow");function kv(e){if(!iA)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}Vo(kv,"getOwnerDocument");function oA(e,t=!1){const{activeElement:r}=kv(e);if(!r?.nodeName)return null;if(lA(r)&&r.contentDocument)return oA(r.contentDocument.body,t);if(t){const a=r.getAttribute("aria-activedescendant");if(a){const s=kv(r).getElementById(a);if(s)return s}}return r}Vo(oA,"getActiveElement");function lA(e){return e.tagName==="IFRAME"}Vo(lA,"isFrame");var gR=Object.defineProperty,bR=(e,t)=>gR(e,"name",{value:t,configurable:!0}),Rw=Ic[" useEffectEvent ".trim().toString()],Dw=Ic[" useInsertionEffect ".trim().toString()];function cA(e){if(typeof Rw=="function")return Rw(e);const t=y.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Dw=="function"?Dw(()=>{t.current=e}):yt(()=>{t.current=e}),y.useMemo(()=>((...r)=>t.current?.(...r)),[])}bR(cA,"useEffectEvent");var vR=Object.defineProperty,Gc=(e,t)=>vR(e,"name",{value:t,configurable:!0}),yR=Ic[" useInsertionEffect ".trim().toString()]||yt;function Xa({prop:e,defaultProp:t,onChange:r=Gc(()=>{},"onChange"),caller:a}){const[s,i,o]=dA({defaultProp:t,onChange:r}),c=e!==void 0,d=c?e:s,u=y.useCallback(h=>{if(c){const m=uA(h)?h(e):h;m!==e&&o.current?.(m)}else i(h)},[c,e,i,o]);return[d,u]}Gc(Xa,"useControllableState");function dA({defaultProp:e,onChange:t}){const[r,a]=y.useState(e),s=y.useRef(r),i=y.useRef(t);return yR(()=>{i.current=t},[t]),y.useEffect(()=>{s.current!==r&&(i.current?.(r),s.current=r)},[r,s]),[r,a,i]}Gc(dA,"useUncontrolledState");function uA(e){return typeof e=="function"}Gc(uA,"isFunction");var $w=Symbol("RADIX:SYNC_STATE");function jR(e,t,r,a){const{prop:s,defaultProp:i,onChange:o,caller:c}=t,d=s!==void 0,u=cA(o),h=[{...r,state:i}];a&&h.push(a);const[m,p]=y.useReducer((g,j)=>{if(j.type===$w)return{...g,state:j.state};const S=e(g,j);return d&&!Object.is(S.state,g.state)&&u(S.state),S},...h),b=m.state,w=y.useRef(b);y.useEffect(()=>{w.current!==b&&(w.current=b,d||u(b))}
1,[b,w,d]);const x=y.useMemo(()=>s!==void 0?{...m,state:s}:m,[m,s]);return y.useEffect(()=>{d&&!Object.is(s,m.state)&&p({type:$w,state:s})},[s,m.state,d]),[x,p]}Gc(jR,"useControllableStateReducer");var wR=Object.defineProperty,Xt=(e,t)=>wR(e,"name",{value:t,configurable:!0});function nf(e){const t=e+"CollectionProvider",[r,a]=sr(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=Xt(x=>{const{scope:g,children:j}=x,S=y.useRef(null),_=y.useRef(new Map).current;return n.jsx(s,{scope:g,itemMap:_,collectionRef:S,children:j})},"CollectionProvider");o.displayName=t;const c=e+"CollectionSlot",d=Hs(c),u=y.forwardRef((x,g)=>{const{scope:j,children:S}=x,_=i(c,j),N=tt(g,_.collectionRef);return n.jsx(d,{ref:N,children:S})});u.displayName=c;const h=e+"CollectionItemSlot",m="data-radix-collection-item",p=Hs(h),b=y.forwardRef((x,g)=>{const{scope:j,children:S,..._}=x,N=y.useRef(null),C=tt(g,N),A=i(h,j);return y.useEffect(()=>(A.itemMap.set(N,{ref:N,..._}),()=>void A.itemMap.delete(N))),n.jsx(p,{[m]:"",ref:C,children:S})});b.displayName=h;function w(x){const g=i(e+"CollectionConsumer",x);return y.useCallback(()=>{const S=g.collectionRef.current;if(!S)return[];const _=Array.from(S.querySelectorAll(`[${m}]`));return Array.from(g.itemMap.values()).sort((A,P)=>_.indexOf(A.ref.current)-_.indexOf(P.ref.current))},[g.collectionRef,g.itemMap])}return Xt(w,"useCollection"),[{Provider:o,Slot:u,ItemSlot:b},w,a]}Xt(nf,"createCollection");var Fw=new WeakMap,Tt,Fn,qm=(Fn=class extends Map{constructor(r){super(r);Ew(this,Tt);Um(this,Tt,[...super.keys()]),Fw.set(this,!0)}set(r,a){return Fw.get(this)&&(this.has(r)?un(this,Tt)[un(this,Tt).indexOf(r)]=r:un(this,Tt).push(r)),super.set(r,a),this}insert(r,a,s){const i=this.has(a),o=un(this,Tt).length,c=S0(r);let d=c>=0?c:o+c;const u=d<0||d>=o?-1:d;if(u===this.size||i&&u===this.size-1||u===-1)return this.set(a,s),this;const h=this.size+(i?0:1);c<0&&d++;const m=[...un(this,Tt)];let p,b=!1;for(let w=d;w<h;w++)if(d===w){let x=m[w];m[w]===a&&(x=m[w+1]),i&&this.delete(a),p=this.get(x),this.set(a,s)}else{!b&&m[w-1]===a&&(b=!0);const x=m[b?w:w-1],g=p;p=this.get(x),this.delete(x),this.set(x,g)}return this}with(r,a,s){const i=new Fn(this);return i.insert(r,a,s),i}before(r){const a=un(this,Tt).indexOf(r)-1;if(!(a<0))return this.entryAt(a)}
1setBefore(r,a,s){const i=un(this,Tt).indexOf(r);return i===-1?this:this.insert(i,a,s)}after(r){let a=un(this,Tt).indexOf(r);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(r,a,s){const i=un(this,Tt).indexOf(r);return i===-1?this:this.insert(i+1,a,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return Um(this,Tt,[]),super.clear()}delete(r){const a=super.delete(r);return a&&un(this,Tt).splice(un(this,Tt).indexOf(r),1),a}deleteAt(r){const a=this.keyAt(r);return a!==void 0?this.delete(a):!1}at(r){const a=ou(un(this,Tt),r);if(a!==void 0)return this.get(a)}entryAt(r){const a=ou(un(this,Tt),r);if(a!==void 0)return[a,this.get(a)]}indexOf(r){return un(this,Tt).indexOf(r)}keyAt(r){return ou(un(this,Tt),r)}from(r,a){const s=this.indexOf(r);if(s===-1)return;let i=s+a;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(r,a){const s=this.indexOf(r);if(s===-1)return;let i=s+a;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(r,a){let s=0;for(const i of this){if(Reflect.apply(r,a,[i,s,this]))return i;s++}}findIndex(r,a){let s=0;for(const i of this){if(Reflect.apply(r,a,[i,s,this]))return s;s++}return-1}filter(r,a){const s=[];let i=0;for(const o of this)Reflect.apply(r,a,[o,i,this])&&s.push(o),i++;return new Fn(s)}map(r,a){const s=[];let i=0;for(const o of this)s.push([o[0],Reflect.apply(r,a,[o,i,this])]),i++;return new Fn(s)}reduce(...r){const[a,s]=r;let i=0,o=s??this.at(0);for(const c of this)i===0&&r.length===1?o=c:o=Reflect.apply(a,this,[o,c,i,this]),i++;return o}reduceRight(...r){const[a,s]=r;let i=s??this.at(-1);for(let o=this.size-1;o>=0;o--){const c=this.at(o);o===this.size-1&&r.length===1?i=c:i=Reflect.apply(a,this,[i,c,o,this])}return i}toSorted(r){const a=[...this.entries()].sort(r);return new Fn(a)}toReversed(){const r=new Fn;for(let a=this.size-1;a>=0;a--){const s=this.keyAt(a),i=this.get(s);r.set(s,i)}return r}toSpliced(...r){const a=[...this.entries()];return a.splice(...r),new Fn(a)}slice(r,a){const s=new Fn;let i=this.size-1;if(r===void 0)return s;r<0&&(r=r+this.size),a!==void 0&&a>0&&(i=a-1);for(let o=r;o<=i;o++){const c=this.keyAt(o),d=this.get(c);s.set(c,d)}return s}every(r,a){let s=0;for(const i of this){if(!Reflect.apply(r,a,[i,s,this]))return!1;s++}return!0}some(r,a){let s=0;for(const i of this){if(Reflect.apply(r,a,[i,s,this]))return!0;s++}return!1}},Tt=new WeakMap,Xt(Fn,"OrderedDict"),Fn);function ou(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const r=hA(e,t);return r===-1?void 0:e[r]}Xt(ou,"at");function hA(e,t){const r=e.length,a=S0(t),s=a>=0?a:r+a;return s<0||s>=r?-1:s}Xt(hA,"toSafeIndex");function S0(e){return e!==e||e===0?0:Math.trunc(e)}Xt(S0,"toSafeInteger");function NR(e){const t=e+"CollectionProvider",[r,a]=sr(t),[s,i]=r(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qm,setItemMap:Xt(()=>{},"setItemMap")}),o=Xt(({state:_,...N})=>_?n.jsx(d,{...N,state:_}):n.jsx(c,{...N}),"CollectionProvider");o.displayName=t;const c=Xt(_=>{const N=g();return n.jsx(d,{..._,state:N})},"CollectionInit");c.displayName=t+"Init";const d=Xt(_=>{const{scope:N,children:C,state:A}=_,P=y.useRef(null),[O,E]=y.useState(null),$=tt(P,E),[M,R]=A;return y.useEffect(()=>{if(!O)return;const B=pA(()=>{});return B.observe(O,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[O]),n.jsx(s,{scope:N,itemMap:M,setItemMap:R,collectionRef:$,collectionRefObject:P,collectionElement:O,children:C})},"CollectionProviderImpl");d.displayName=t+"Impl";const u=e+"CollectionSlot",h=Hs(u),m=y.forwardRef((_,N)=>{const{scope:C,children:A}=_,P=i(u,C),O=tt(N,P.collectionRef);return n.jsx(h,{ref:O,children:A})});m.displayName=u;const p=e+"CollectionItemSlot",b="data-radix-collection-item",w=Hs(p),x=y.forwardRef((_,N)=>{const{scope:C,children:A,...P}=_,O=y.useRef(null),[E,$]=y.useState(null),M=tt(N,O,$),R=i(p,C),{setItemMap:B}=R,D=y.useRef(P);fA(D.current,P)||(D.current=P);const U=D.current;return y.useEffect(()=>{const H=U;return B(K=>E?K.has(E)?K.set(E,{...H,element:E}).toSorted(Pv):(K.set(E,{...H,element:E}),K.toSorted(Pv)):K),()=>{B(K=>!E||!K.has(E)?K:(K.delete(E),new qm(K)))}},[E,U,B]),n.jsx(w,{[b]:"",ref:M,children:A})});x.displayName=p;function g(){return y.useState(new qm)}Xt(g,"useInitCollection");function j(_){const{itemMap:N}=i(e+"CollectionConsumer",_);return N}return Xt(j,"useCollection"),[{Provider:o,Slot:m,ItemSlot:x},{createCollectionScope:a,useCollection:j,useInitCollection:g}]}Xt(NR,"createCollection");function fA(e,t){if(e===t)return!0;
1if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(t,s)||e[s]!==t[s])return!1;return!0}Xt(fA,"shallowEqual");function mA(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Xt(mA,"isElementPreceding");function Pv(e,t){return!e[1].element||!t[1].element?0:mA(e[1].element,t[1].element)?-1:1}Xt(Pv,"sortByDocumentPosition");function pA(e){return new MutationObserver(r=>{for(const a of r)if(a.type==="childList"){e();return}})}Xt(pA,"getChildListObserver");var _R=Object.defineProperty,SR=(e,t)=>_R(e,"name",{value:t,configurable:!0}),CR=y.createContext(void 0);function rf(e){const t=y.useContext(CR);return e||t||"ltr"}SR(rf,"useDirection");var AR=Object.defineProperty,Zt=(e,t)=>AR(e,"name",{value:t,configurable:!0}),Tv="dismissableLayer.update",kR="dismissableLayer.pointerDownOutside",PR="dismissableLayer.focusOutside",Bw,xA=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),af=y.forwardRef(Zt(function(t,r){const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:d,onDismiss:u,...h}=t,m=y.useContext(xA),[p,b]=y.useState(null),w=p?.ownerDocument??globalThis?.document,[,x]=y.useState({}),g=tt(r,b),j=Array.from(m.layers),[S]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),_=S?j.indexOf(S):-1,N=p?j.indexOf(p):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,A=N>=_,P=y.useRef(!1),O=bA(R=>{o?.(R),d?.(R),R.defaultPrevented||u?.()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(R=>{if(!(R instanceof Node))return!1;const B=[...m.branches].some(D=>D.contains(R));return A&&!B},[m.branches,A])}),E=vA(R=>{if(s&&P.current)return;const B=R.target;[...m.branches].some(U=>U.contains(B))||(c?.(R),d?.(R),R.defaultPrevented||u?.())},w),$=p?N===j.length-1:!1,M=qn(R=>{R.key==="Escape"&&(i?.(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))});return y.useEffect(()=>{if($)return w.addEventListener("keydown",M,{capture:!0}),()=>w.removeEventListener("keydown",M,{capture:!0})},[w,$,M]),y.useEffect(()=>{if(p)return a&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Bw=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),Ov(),()=>{a&&(m.layersWithOutsidePointerEventsDisabled.delete(p),m.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=Bw))}},[p,w,a,m]),y.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),Ov())},[p,m]),y.useEffect(()=>{const R=Zt(()=>x({}),"handleUpdate");return document.addEventListener(Tv,R),()=>document.removeEventListener(Tv,R)},[]),n.jsx(et.div,{...h,ref:g,style:{pointerEvents:C?A?"auto":"none":void 0,...t.style},onFocusCapture:Se(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Se(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Se(t.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function gA(){const e=y.useContext(xA),[t,r]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}Zt(gA,"useDismissableLayerSurface");var TR=Zt(()=>!0,"IS_TRUE");function bA(e,t){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=TR}=t,c=qn(e),d=y.useRef(!1),u=y.useRef(!1),h=y.useRef(new Map),m=y.useRef(()=>{});return y.useEffect(()=>{function p(){u.current=!1,s.current=!1,h.current.clear()}Zt(p,"resetOutsideInteraction");function b(){return Array.from(h.current.values()).some(Boolean)}Zt(b,"isOutsideInteractionIntercepted");function w(_){if(!u.current)return;const N=_.target;N instanceof Node&&[...i].some(A=>A.contains(N))||h.current.set(_.type,!0),_.type==="click"&&window.setTimeout(()=>{u.current&&m.current()},0)}Zt(w,"handleInteractionCapture");function x(_){u.current&&h.current.set(_.type,!1)}Zt(x,"handleInteractionBubble");const g=Zt(_=>{if(_.target&&!d.current){let N=function(){r.removeEventListener("click",m.current);const A=b();p(),A||C0(kR,c,C,{discrete:!0})};if(Zt(N,"handleAndDispatchPointerDownOutsideEvent"),!o(_.target)){r.removeEventListener("click",m.current),p(),d.current=!1;return}const C={originalEvent:_};u.current=!0,s.current=a&&_.button===0,h.current.clear(),!a||_.button!==0?N():(r.removeEventListener("click",m.current),m.current=N,r.addEventListener("click",m.current,{once:!0}))}else r.removeEventListener("click",m.current),p();d.current=!1},"handlePointerDown"),j=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const _ of j)r.addEventListener(_,w,!0),r.addEventListener(_,x);const S=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(S),r.removeEventListener("pointerdown",g),r.removeEventListener("click",m.current);for(const _ of j)r.removeEventListener(_,w,!0),r.removeEventListener(_,x)}}
1,[r,c,a,s,i,o]),{onPointerDownCapture:Zt(()=>d.current=!0,"onPointerDownCapture")}}Zt(bA,"usePointerDownOutside");function vA(e,t=globalThis?.document){const r=qn(e),a=y.useRef(!1);return y.useEffect(()=>{const s=Zt(i=>{i.target&&!a.current&&C0(PR,r,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:Zt(()=>a.current=!0,"onFocusCapture"),onBlurCapture:Zt(()=>a.current=!1,"onBlurCapture")}}Zt(vA,"useFocusOutside");function Ov(){const e=new CustomEvent(Tv);document.dispatchEvent(e)}Zt(Ov,"dispatchUpdate");function C0(e,t,r,{discrete:a}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),a?LC(s,i):s.dispatchEvent(i)}Zt(C0,"handleAndDispatchCustomEvent");var OR=Object.defineProperty,A0=(e,t)=>OR(e,"name",{value:t,configurable:!0}),Ad=0,Mi=null;function ER(e){return Kc(),e.children}A0(ER,"FocusGuards");function Kc(){y.useEffect(()=>{Mi||(Mi={start:Ev(),end:Ev()});const{start:e,end:t}=Mi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ad++,()=>{Ad===1&&(Mi?.start.remove(),Mi?.end.remove(),Mi=null),Ad=Math.max(0,Ad-1)}},[])}A0(Kc,"useFocusGuards");function Ev(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}A0(Ev,"createFocusGuard");var MR=Object.defineProperty,vn=(e,t)=>MR(e,"name",{value:t,configurable:!0}),Vm="focusScope.autoFocusOnMount",Hm="focusScope.autoFocusOnUnmount",Uw={bubbles:!1,cancelable:!0},k0=y.forwardRef(vn(function(t,r){const{loop:a=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[d,u]=y.useState(null),h=qn(i),m=qn(o),p=y.useRef(null),b=tt(r,u),w=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(s){let g=function(N){if(w.paused||!d)return;const C=N.target;d.contains(C)?p.current=C:la(p.current,{select:!0})},j=function(N){if(w.paused||!d)return;const C=N.relatedTarget;C!==null&&(d.contains(C)||la(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&la(d)};vn(g,"handleFocusIn"),vn(j,"handleFocusOut"),vn(S,"handleMutations"),document.addEventListener("focusin",g),document.addEventListener("focusout",j);const _=new MutationObserver(S);return d&&_.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",j),_.disconnect()}}},[s,d,w.paused]),y.useEffect(()=>{if(d){zw.add(w);const g=document.activeElement;if(!d.contains(g)){const S=new CustomEvent(Vm,Uw);d.addEventListener(Vm,h),d.dispatchEvent(S),S.defaultPrevented||(yA(SA(P0(d)),{select:!0}),document.activeElement===g&&la(d))}return()=>{d.removeEventListener(Vm,h),setTimeout(()=>{const S=new CustomEvent(Hm,Uw);d.addEventListener(Hm,m),d.dispatchEvent(S),S.defaultPrevented||la(g??document.body,{select:!0}),d.removeEventListener(Hm,m),zw.remove(w)},0)}}},[d,h,m,w]);const x=y.useCallback(g=>{if(!a&&!s||w.paused)return;const j=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,S=document.activeElement;if(j&&S){const _=g.currentTarget,[N,C]=jA(_);N&&C?!g.shiftKey&&S===C?(g.preventDefault(),a&&la(N,{select:!0})):g.shiftKey&&S===N&&(g.preventDefault(),a&&la(C,{select:!0})):S===_&&g.preventDefault()}},[a,s,w.paused]);return n.jsx(et.div,{tabIndex:-1,...c,ref:b,onKeyDown:x})},"FocusScope"));function yA(e,{select:t=!1}={}){const r=document.activeElement;for(const a of e)if(la(a,{select:t}),document.activeElement!==r)return}vn(yA,"focusFirst");function jA(e){const t=P0(e),r=Mv(t,e),a=Mv(t.reverse(),e);return[r,a]}vn(jA,"getTabbableEdges");function P0(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vn(a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}vn(P0,"getTabbableCandidates");function Mv(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const a of e)if(!(r?!a.checkVisibility({checkVisibilityCSS:!0}):wA(a,{upTo:t})))return a}vn(Mv,"findVisible");function wA(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}vn(wA,"isHidden");function NA(e){return e instanceof HTMLInputElement&&"select"in e}vn(NA,"isSelectableInput");function la(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&NA(e)&&t&&e.select()}}vn(la,"focus");var zw=_A();function _A(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Lv(e,t),e.unshift(t)},remove(t){e=Lv(e,t),e[0]?.resume()}}}vn(_A,"createFocusScopesStack");function Lv(e,t){const r=[...e],a=r.indexOf(t);return a!==-1&&r.splice(a,1),r}vn(Lv,"arrayRemove");function SA(e){return e.filter(t=>t.tagName!=="A")}vn(SA,"removeLinks");var LR=Object.defineProperty,IR=(e,t)=>LR(e,"name",{value:t,configurable:!0}),RR=Ic[" useId ".trim().toString()]||(()=>{}),DR=0;function Br(e){const[t,r]=y.useState(RR());return yt(()=>{e||r(a=>a??String(DR++))},[e]),e||(t?`radix-${t}`:"")}IR(Br,"useId");const $R=["top","right","bottom","left"],Ja=Math.min,pa=Math.max,pu=Math.round,kd=Math.floor,xa=e=>({x:e,y:e}
1),FR={left:"right",right:"left",bottom:"top",top:"bottom"};function CA(e,t,r){return pa(e,Ja(t,r))}function Na(e,t){return typeof e=="function"?e(t):e}function Qa(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function T0(e){return e==="x"?"y":"x"}function O0(e){return e==="y"?"height":"width"}function Rr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function E0(e){return T0(Rr(e))}function BR(e,t,r){r===void 0&&(r=!1);const a=Ho(e),s=E0(e),i=O0(s);let o=s==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=xu(o)),[o,xu(o)]}function UR(e){const t=xu(e);return[Iv(e),t,Iv(t)]}function Iv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ww=["left","right"],qw=["right","left"],zR=["top","bottom"],WR=["bottom","top"];function qR(e,t,r){switch(e){case"top":case"bottom":return r?t?qw:Ww:t?Ww:qw;case"left":case"right":return t?zR:WR;default:return[]}}function VR(e,t,r,a){const s=Ho(e);let i=qR(Qa(e),r==="start",a);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(Iv)))),i}function xu(e){const t=Qa(e);return FR[t]+e.slice(t.length)}function HR(e){var t,r,a,s;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(a=e.bottom)!=null?a:0,left:(s=e.left)!=null?s:0}}function AA(e){return typeof e!="number"?HR(e):{top:e,right:e,bottom:e,left:e}}function gu(e){const{x:t,y:r,width:a,height:s}=e;return{width:a,height:s,top:r,left:t,right:t+a,bottom:r+s,x:t,y:r}}function Vw(e,t,r){let{reference:a,floating:s}=e;const i=Rr(t),o=E0(t),c=O0(o),d=Qa(t),u=i==="y",h=a.x+a.width/2-s.width/2,m=a.y+a.height/2-s.height/2,p=a[c]/2-s[c]/2;let b;switch(d){case"top":b={x:h,y:a.y-s.height};break;case"bottom":b={x:h,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:m};break;case"left":b={x:a.x-s.width,y:m};break;default:b={x:a.x,y:a.y}}const w=Ho(t);return w&&(b[o]+=p*(w==="end"?1:-1)*(r&&u?-1:1)),b}async function GR(e,t){var r;t===void 0&&(t={});const{x:a,y:s,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:p=!1,padding:b=0}=Na(t,e),w=AA(b),g=c[p?m==="floating"?"reference":"floating":m],j=gu(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(g)))==null||r?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:h,strategy:d})),S=m==="floating"?{x:a,y:s,width:o.floating.width,height:o.floating.height}:o.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),N=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},C=gu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:S,offsetParent:_,strategy:d}):S);return{top:(j.top-C.top+w.top)/N.y,bottom:(C.bottom-j.bottom+w.bottom)/N.y,left:(j.left-C.left+w.left)/N.x,right:(C.right-j.right+w.right)/N.x}}const KR=50,YR=async(e,t,r)=>{const{placement:a="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,c=o.detectOverflow?o:{...o,detectOverflow:GR},d=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:m}=Vw(u,a,d),p=a,b=0;const w={};for(let x=0;x<i.length;x++){const g=i[x];if(!g)continue;const{name:j,fn:S}=g,{x:_,y:N,data:C,reset:A}=await S({x:h,y:m,initialPlacement:a,placement:p,strategy:s,middlewareData:w,rects:u,platform:c,elements:{reference:e,floating:t}});h=_??h,m=N??m,w[j]={...w[j],...C},A&&b<KR&&(b++,typeof A=="object"&&(A.placement&&(p=A.placement),A.rects&&(u=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:h,y:m}=Vw(u,p,d)),x=-1)}return{x:h,y:m,placement:p,strategy:s,middlewareData:w}},ZR=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:a,placement:s,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:u,padding:h=0}=Na(e,t)||{};if(u==null)return{};const m=AA(h),p={x:r,y:a},b=E0(s),w=O0(b),x=await o.getDimensions(u),g=b==="y",j=g?"top":"left",S=g?"bottom":"right",_=g?"clientHeight":"clientWidth",N=i.reference[w]+i.reference[b]-p[b]-i.floating[w],C=p[b]-i.reference[b],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let P=A?A[_]:0;(!P||!await(o.isElement==null?void 0:o.isElement(A)))&&(P=c.floating[_]||i.floating[w]);const O=N/2-C/2,E=P/2-x[w]/2-1,$=Ja(m[j],E),M=Ja(m[S],E),R=P-x[w]-M,B=P/2-x[w]/2+O,D=CA($,B,R),U=!d.arrow&&Ho(s)!=null&&B!==D&&i.reference[w]/2-(B<$?$:M)-x[w]/2<0,H=U?B<$?B-$:B-R:0;return{[b]:p[b]+H,data:{[b]:D,centerOffset:B-D-H,...U&&{alignmentOffset:H}},reset:U}}}),XR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,a;const{placement:s,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:u}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...g}=Na(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const j=Qa(s),S=Rr(c),_=Qa(c)===c,N=await(d.isRTL==null?void 0:d.isRTL(u.floating)),C=p||(_||!x?[xu(c)]:UR(c)),A=w!=="none";!p&&A&&C.push(...VR(c,x,w,N));const P=[c,...C],O=await d.detectOverflow(t,g),E=[];let $=((a=i.flip)==null?void 0:a.overflows)||[];if(h&&E.push(O[j]),m){const D=BR(s,o,N);E.push(O[D[0]],O[D[1]])}if($=[...$,{placement:s,overflows:E}],!E.every(D=>D<=0)){var M,R;const D=(((M=i.flip)==null?void 0:M.index)||0)+1,U=P[D];
1if(U&&(!(m==="alignment"?S!==Rr(U):!1)||$.every(z=>Rr(z.placement)===S?z.overflows[0]>0:!0)))return{data:{index:D,overflows:$},reset:{placement:U}};let H=(R=$.filter(K=>K.overflows[0]<=0).sort((K,z)=>K.overflows[1]-z.overflows[1])[0])==null?void 0:R.placement;if(!H)switch(b){case"bestFit":{var B;const K=(B=$.filter(z=>{if(A){const X=Rr(z.placement);return X===S||X==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(X=>X>0).reduce((X,G)=>X+G,0)]).sort((z,X)=>z[1]-X[1])[0])==null?void 0:B[0];K&&(H=K);break}case"initialPlacement":H=c;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function Hw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gw(e){return $R.some(t=>e[t]>=0)}const JR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:a}=t,{strategy:s="referenceHidden",...i}=Na(e,t);switch(s){case"referenceHidden":{const o=await a.detectOverflow(t,{...i,elementContext:"reference"}),c=Hw(o,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Gw(c)}}}case"escaped":{const o=await a.detectOverflow(t,{...i,altBoundary:!0}),c=Hw(o,r.floating);return{data:{escapedOffsets:c,escaped:Gw(c)}}}default:return{}}}}},kA=new Set(["left","top"]);async function QR(e,t){const{placement:r,platform:a,elements:s}=e,i=await(a.isRTL==null?void 0:a.isRTL(s.floating)),o=Qa(r),c=Ho(r),d=Rr(r)==="y",u=kA.has(o)?-1:1,h=i&&d?-1:1,m=Na(t,e);let{mainAxis:p,crossAxis:b,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&typeof w=="number"&&(b=c==="end"?w*-1:w),d?{x:b*h,y:p*u}:{x:p*u,y:b*h}}const e6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,a;const{x:s,y:i,placement:o,middlewareData:c}=t,d=await QR(t,e);return o===((r=c.offset)==null?void 0:r.placement)&&(a=c.arrow)!=null&&a.alignmentOffset?{}:{x:s+d.x,y:i+d.y,data:{...d,placement:o}}}}},t6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:a,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:_,y:N}=S;return{x:_,y:N}}},...u}=Na(e,t),h={x:r,y:a},m=await i.detectOverflow(t,u),p=Rr(s),b=T0(p);let w=h[b],x=h[p];const g=(S,_)=>CA(_+m[S==="y"?"top":"left"],_,_-m[S==="y"?"bottom":"right"]);o&&(w=g(b,w)),c&&(x=g(p,x));const j=d.fn({...t,[b]:w,[p]:x});return{...j,data:{x:j.x-r,y:j.y-a,enabled:{[b]:o,[p]:c}}}}}},n6=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,a;const{x:s,y:i,placement:o,rects:c,middlewareData:d}=t,{offset:u=0,mainAxis:h=!0,crossAxis:m=!0}=Na(e,t),p={x:s,y:i},b=Rr(o),w=T0(b);let x=p[w],g=p[b];const j=Na(u,t),S=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:(r=j.mainAxis)!=null?r:0,crossAxis:(a=j.crossAxis)!=null?a:0};if(h){const C=w==="y"?"height":"width",A=c.reference[w]-c.floating[C]+S.mainAxis,P=c.reference[w]+c.reference[C]-S.mainAxis;x<A?x=A:x>P&&(x=P)}if(m){var _,N;const C=w==="y"?"width":"height",A=kA.has(Qa(o)),P=c.reference[b]-c.floating[C]+(A&&((_=d.offset)==null?void 0:_[b])||0)+(A?0:S.crossAxis),O=c.reference[b]+c.reference[C]+(A?0:((N=d.offset)==null?void 0:N[b])||0)-(A?S.crossAxis:0);g<P?g=P:g>O&&(g=O)}return{[w]:x,[b]:g}}}},r6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:a,platform:s,elements:i}=t,{apply:o=()=>{},...c}=Na(e,t),d=await s.detectOverflow(t,c),u=Qa(r),h=Ho(r),m=Rr(r)==="y",{width:p,height:b}=a.floating;let w,x;u==="top"||u==="bottom"?(w=u,x=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(x=u,w=h==="end"?"top":"bottom");const g=b-d.top-d.bottom,j=p-d.left-d.right,S=Ja(b-d[w],g),_=Ja(p-d[x],j),N=t.middlewareData.shift,C=!N;let A=S,P=_;N!=null&&N.enabled.x&&(P=j),N!=null&&N.enabled.y&&(A=g),C&&!h&&(m?P=p-2*pa(d.left,d.right):A=b-2*pa(d.top,d.bottom)),await o({...t,availableWidth:P,availableHeight:A});const O=await s.getDimensions(i.floating);return p!==O.width||b!==O.height?{reset:{rects:!0}}:{}}}};function sf(){return typeof window<"u"}function Go(e){return PA(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pa(e){var t;return(t=(PA(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function PA(e){return sf()?e instanceof Node||e instanceof Tn(e).Node:!1}function Vr(e){return sf()?e instanceof Element||e instanceof Tn(e).Element:!1}function ss(e){return sf()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function Kw(e){return!sf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function of(e){const{overflow:t,overflowX:r,overflowY:a,display:s}=Hr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&s!=="inline"&&s!=="contents"}function a6(e){return/^(table|td|th)$/.test(Go(e))}function lf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const s6=/transform|translate|scale|rotate|perspective|filter/,i6=/paint|layout|strict|content/,bs=e=>!!e&&e!=="none";let Gm;function M0(e){const t=Vr(e)?Hr(e):e;return bs(t.transform)||bs(t.translate)||bs(t.scale)||bs(t.rotate)||bs(t.perspective)||!L0()&&(bs(t.backdropFilter)||bs(t.filter))||s6.test(t.willChange||"")||i6.test(t.contain||"")}function o6(e){let t=Ks(e);for(;ss(t)&&!Gl(t);){if(M0(t))return t;if(lf(t))return null;t=Ks(t)}return null}function L0(){return Gm==null&&(Gm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gm}function Gl(e){return/^(html|body|#document)$/.test(Go(e))}function Hr(e){return Tn(e).getComputedStyle(e)}function cf(e){return Vr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ks(e){if(Go(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Kw(e)&&e.host||Pa(e);return Kw(t)?t.host:t}function TA(e){const t=Ks(e);
1return Gl(t)?(e.ownerDocument||e).body:ss(t)&&of(t)?t:TA(t)}function Kl(e,t,r){var a;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=TA(e),i=s===((a=e.ownerDocument)==null?void 0:a.body),o=Tn(s);if(i){const c=Rv(o);return t.concat(o,o.visualViewport||[],of(s)?s:[],c&&r?Kl(c):[])}else return t.concat(s,Kl(s,[],r))}function Rv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function OA(e){const t=Hr(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const s=ss(e),i=s?e.offsetWidth:r,o=s?e.offsetHeight:a,c=pu(r)!==i||pu(a)!==o;return c&&(r=i,a=o),{width:r,height:a,$:c}}function I0(e){return Vr(e)?e:e.contextElement}function Xi(e){const t=I0(e);if(!ss(t))return xa(1);const r=t.getBoundingClientRect(),{width:a,height:s,$:i}=OA(t);let o=(i?pu(r.width):r.width)/a,c=(i?pu(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const l6=xa(0);function EA(e){const t=Tn(e);return!L0()||!t.visualViewport?l6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function c6(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===Tn(e)}function Ys(e,t,r,a){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=I0(e);let o=xa(1);t&&(a?Vr(a)&&(o=Xi(a)):o=Xi(e));const c=c6(i,r,a)?EA(i):xa(0);let d=(s.left+c.x)/o.x,u=(s.top+c.y)/o.y,h=s.width/o.x,m=s.height/o.y;if(i&&a){const p=Tn(i),b=Vr(a)?Tn(a):a;let w=p,x=Rv(w);for(;x&&b!==w;){const g=Xi(x),j=x.getBoundingClientRect(),S=Hr(x),_=j.left+(x.clientLeft+parseFloat(S.paddingLeft))*g.x,N=j.top+(x.clientTop+parseFloat(S.paddingTop))*g.y;d*=g.x,u*=g.y,h*=g.x,m*=g.y,d+=_,u+=N,w=Tn(x),x=Rv(w)}}return gu({width:h,height:m,x:d,y:u})}function df(e,t){const r=cf(e).scrollLeft;return t?t.left+r:Ys(Pa(e)).left+r}function MA(e,t){const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-df(e,r),s=r.top+t.scrollTop;return{x:a,y:s}}function d6(e){let{elements:t,rect:r,offsetParent:a,strategy:s}=e;const i=s==="fixed",o=Pa(a),c=t?lf(t.floating):!1;if(a===o||c&&i)return r;let d={scrollLeft:0,scrollTop:0},u=xa(1);const h=xa(0),m=ss(a);if((m||!i)&&((Go(a)!=="body"||of(o))&&(d=cf(a)),m)){const b=Ys(a);u=Xi(a),h.x=b.x+a.clientLeft,h.y=b.y+a.clientTop}const p=o&&!m&&!i?MA(o,d):xa(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-d.scrollLeft*u.x+h.x+p.x,y:r.y*u.y-d.scrollTop*u.y+h.y+p.y}}function u6(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function h6(e){const t=cf(e),r=e.ownerDocument.body,a=pa(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=pa(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let i=-t.scrollLeft+df(e);const o=-t.scrollTop;return Hr(r).direction==="rtl"&&(i+=pa(e.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:o}}const f6=25;function m6(e,t,r){r===void 0&&(r="viewport");const a=r==="layoutViewport",s=Tn(e),i=Pa(e),o=s.visualViewport;let c=i.clientWidth,d=i.clientHeight,u=0,h=0;if(o){const p=!L0()||t==="fixed";a?p||(u=-o.offsetLeft,h=-o.offsetTop):(c=o.width,d=o.height,p&&(u=o.offsetLeft,h=o.offsetTop))}if(df(i)<=0){const p=i.ownerDocument,b=p.body,w=getComputedStyle(b),x=p.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,g=Math.abs(i.clientWidth-b.clientWidth-x),j=getComputedStyle(i).scrollbarGutter==="stable both-edges"?g/2:g;j<=f6&&(c-=j)}return{width:c,height:d,x:u,y:h}}function p6(e,t){const r=Ys(e,!0,t==="fixed"),a=r.top+e.clientTop,s=r.left+e.clientLeft,i=Xi(e),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=s*i.x,u=a*i.y;return{width:o,height:c,x:d,y:u}}function Yw(e,t,r){let a;if(t==="viewport"||t==="layoutViewport")a=m6(e,r,t);else if(t==="document")a=h6(Pa(e));else if(Vr(t))a=p6(t,r);else{const s=EA(e);a={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return gu(a)}function x6(e,t){const r=t.get(e);if(r)return r;let a=Kl(e,[],!1).filter(c=>Vr(c)&&Go(c)!=="body"),s=null;const i=Hr(e).position==="fixed";let o=i?Ks(e):e;for(;Vr(o)&&!Gl(o);){const c=Hr(o),d=M0(o),u=s?s.position:i?"fixed":"";!d&&(u==="fixed"||u==="absolute"&&c.position==="static")?a=a.filter(m=>m!==o):s=c,o=Ks(o)}return t.set(e,a),a}function g6(e){let{element:t,boundary:r,rootBoundary:a,strategy:s}=e;const o=[...r==="clippingAncestors"?lf(t)?[]:x6(t,this._c):[].concat(r),a],c=Yw(t,o[0],s);let d=c.top,u=c.right,h=c.bottom,m=c.left;for(let p=1;p<o.length;p++){const b=Yw(t,o[p],s);d=pa(b.top,d),u=Ja(b.right,u),h=Ja(b.bottom,h),m=pa(b.left,m)}
1return{width:u-m,height:h-d,x:m,y:d}}function b6(e){const{width:t,height:r}=OA(e);return{width:t,height:r}}function v6(e,t,r){const a=ss(t),s=Pa(t),i=r==="fixed",o=Ys(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=xa(0);if((a||!i)&&((Go(t)!=="body"||of(s))&&(c=cf(t)),a)){const p=Ys(t,!0,i,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}!a&&s&&(d.x=df(s));const u=s&&!a&&!i?MA(s,c):xa(0),h=o.left+c.scrollLeft-d.x-u.x,m=o.top+c.scrollTop-d.y-u.y;return{x:h,y:m,width:o.width,height:o.height}}function Km(e){return Hr(e).position==="static"}function Zw(e,t){if(!ss(e)||Hr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Pa(e)===r&&(r=r.ownerDocument.body),r}function LA(e,t){const r=Tn(e);if(lf(e))return r;if(!ss(e)){let s=Ks(e);for(;s&&!Gl(s);){if(Vr(s)&&!Km(s))return s;s=Ks(s)}return r}let a=Zw(e,t);for(;a&&a6(a)&&Km(a);)a=Zw(a,t);return a&&Gl(a)&&Km(a)&&!M0(a)?r:a||o6(e)||r}const y6=async function(e){const t=this.getOffsetParent||LA,r=this.getDimensions,a=await r(e.floating);return{reference:v6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function j6(e){return Hr(e).direction==="rtl"}const w6={convertOffsetParentRelativeRectToViewportRelativeRect:d6,getDocumentElement:Pa,getClippingRect:g6,getOffsetParent:LA,getElementRects:y6,getClientRects:u6,getDimensions:b6,getScale:Xi,isElement:Vr,isRTL:j6};function IA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function N6(e,t,r){let a=null,s;const i=Pa(e);function o(){var h;clearTimeout(s),(h=a)==null||h.disconnect(),a=null}function c(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),o();const p=e.getBoundingClientRect(),{left:b,top:w,width:x,height:g}=p;if(h||t(),!x||!g)return;const j=kd(w),S=kd(i.clientWidth-(b+x)),_=kd(i.clientHeight-(w+g)),N=kd(b),A={rootMargin:-j+"px "+-S+"px "+-_+"px "+-N+"px",threshold:pa(0,Ja(1,m))||1};let P=!0;function O(E){const $=E[0].intersectionRatio;if(!IA(p,e.getBoundingClientRect()))return c();if($!==m){if(!P)return c();$?c(!1,$):s=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{a=new IntersectionObserver(O,{...A,root:i.ownerDocument})}catch{a=new IntersectionObserver(O,A)}a.observe(e)}const d=Tn(e),u=()=>c(r);return d.addEventListener("resize",u),c(!0),()=>{d.removeEventListener("resize",u),o()}}function _6(e,t,r,a){a===void 0&&(a={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=a,u=I0(e),h=s||i?[...u?Kl(u):[],...t?Kl(t):[]]:[];h.forEach(j=>{s&&j.addEventListener("scroll",r),i&&j.addEventListener("resize",r)});const m=u&&c?N6(u,r,i):null;let p=-1,b=null;o&&(b=new ResizeObserver(j=>{let[S]=j;S&&S.target===u&&b&&t&&(b.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),r()}),u&&!d&&b.observe(u),t&&b.observe(t));let w,x=d?Ys(e):null;d&&g();function g(){const j=Ys(e);x&&!IA(x,j)&&r(),x=j,w=requestAnimationFrame(g)}return r(),()=>{var j;h.forEach(S=>{s&&S.removeEventListener("scroll",r),i&&S.removeEventListener("resize",r)}),m?.(),(j=b)==null||j.disconnect(),b=null,d&&cancelAnimationFrame(w)}}const S6=e6,C6=t6,A6=XR,k6=r6,P6=JR,Xw=ZR,T6=n6,O6=(e,t,r)=>{const a=new Map,s=r??{},i={...w6,...s.platform,_c:a};return YR(e,t,{...s,platform:i})};var E6=typeof document<"u",M6=function(){},lu=E6?y.useLayoutEffect:M6;function bu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,a,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;a--!==0;)if(!bu(e[a],t[a]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(t,s[a]))return!1;for(a=r;a--!==0;){const i=s[a];if(!(i==="_owner"&&e.$$typeof)&&!bu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function RA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jw(e,t){const r=RA(e);return Math.round(t*r)/r}function Ym(e){const t=y.useRef(e);return lu(()=>{t.current=e}),t}function L6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:s,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[h,m]=y.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,b]=y.useState(a);bu(p,a)||b(a);const[w,x]=y.useState(null),[g,j]=y.useState(null),S=y.useCallback(z=>{z!==A.current&&(A.current=z,x(z))},[]),_=y.useCallback(z=>{z!==P.current&&(P.current=z,j(z))},[]),N=i||w,C=o||g,A=y.useRef(null),P=y.useRef(null),O=y.useRef(h),E=d!=null,$=Ym(d),M=Ym(s),R=Ym(u),B=y.useCallback(()=>
1{if(!A.current||!P.current)return;const z={placement:t,strategy:r,middleware:p};M.current&&(z.platform=M.current),O6(A.current,P.current,z).then(X=>{const G={...X,isPositioned:R.current!==!1};D.current&&!bu(O.current,G)&&(O.current=G,Rc.flushSync(()=>{m(G)}))})},[p,t,r,M,R]);lu(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(z=>({...z,isPositioned:!1})))},[u]);const D=y.useRef(!1);lu(()=>(D.current=!0,()=>{D.current=!1}),[]),lu(()=>{if(N&&(A.current=N),C&&(P.current=C),N&&C){if($.current)return $.current(N,C,B);B()}},[N,C,B,$,E]);const U=y.useMemo(()=>({reference:A,floating:P,setReference:S,setFloating:_}),[S,_]),H=y.useMemo(()=>({reference:N,floating:C}),[N,C]),K=y.useMemo(()=>{const z={position:r,left:0,top:0};if(!H.floating)return z;const X=Jw(H.floating,h.x),G=Jw(H.floating,h.y);return c?{...z,transform:"translate("+X+"px, "+G+"px)",...RA(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:G}},[r,c,H.floating,h.x,h.y]);return y.useMemo(()=>({...h,update:B,refs:U,elements:H,floatingStyles:K}),[h,B,U,H,K])}const I6=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:a,padding:s}=typeof e=="function"?e(r):e;return a&&t(a)?a.current!=null?Xw({element:a.current,padding:s}).fn(r):{}:a?Xw({element:a,padding:s}).fn(r):{}}}},R6=(e,t)=>{const r=S6(e);return{name:r.name,fn:r.fn,options:[e,t]}},D6=(e,t)=>{const r=C6(e);return{name:r.name,fn:r.fn,options:[e,t]}},$6=(e,t)=>({fn:T6(e).fn,options:[e,t]}),F6=(e,t)=>{const r=A6(e);return{name:r.name,fn:r.fn,options:[e,t]}},B6=(e,t)=>{const r=k6(e);return{name:r.name,fn:r.fn,options:[e,t]}},U6=(e,t)=>{const r=P6(e);return{name:r.name,fn:r.fn,options:[e,t]}},z6=(e,t)=>{const r=I6(e);return{name:r.name,fn:r.fn,options:[e,t]}};var W6=Object.defineProperty,q6=(e,t)=>W6(e,"name",{value:t,configurable:!0});function R0(e){const[t,r]=y.useState(void 0);return yt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,c;if("borderBoxSize"in i){const d=i.borderBoxSize,u=Array.isArray(d)?d[0]:d;o=u.inlineSize,c=u.blockSize}else o=e.offsetWidth,c=e.offsetHeight;r({width:o,height:c})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else r(void 0)},[e]),t}q6(R0,"useSize");var V6=Object.defineProperty,Ha=(e,t)=>V6(e,"name",{value:t,configurable:!0}),DA="Popper",[$A,Ko]=sr(DA),[H6,FA]=$A(DA),G6=Ha(e=>{const{__scopePopper:t,children:r}=e,[a,s]=y.useState(null),[i,o]=y.useState(void 0);return n.jsx(H6,{scope:t,anchor:a,onAnchorChange:s,placementState:i,setPlacementState:o,children:r})},"Popper"),K6="PopperAnchor",Y6=y.forwardRef(Ha(function(t,r){const{__scopePopper:a,virtualRef:s,...i}=t,o=FA(K6,a),c=y.useRef(null),d=o.onAnchorChange,u=y.useCallback(x=>{c.current=x,x&&d(x)},[d]),h=tt(r,u),m=y.useRef(null);y.useEffect(()=>{if(!s)return;const x=m.current;m.current=s.current,x!==m.current&&d(m.current)});const p=o.placementState&&uf(o.placementState),b=p?.[0],w=p?.[1];return s?null:n.jsx(et.div,{"data-radix-popper-side":b,"data-radix-popper-align":w,...i,ref:h})},"PopperAnchor")),BA="PopperContent",[Z6,lde]=$A(BA),X6=y.forwardRef(Ha(function(t,r){const{__scopePopper:a,side:s="bottom",sideOffset:i=0,align:o="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:w="optimized",onPlaced:x,...g}=t,j=FA(BA,a),[S,_]=y.useState(null),N=tt(r,_),[C,A]=y.useState(null),P=R0(C),O=P?.width??0,E=P?.height??0,$=s+(o!=="center"?"-"+o:""),M=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},R=Array.isArray(h)?h:[h],B=R.length>0,D={padding:M,boundary:R.filter(UA),altBoundary:B},{refs:U,floatingStyles:H,placement:K,isPositioned:z,middlewareData:X}=L6({strategy:"fixed",placement:$,whileElementsMounted:Ha((...ae)=>_6(...ae,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:j.anchor},middleware:[R6({mainAxis:i+E,alignmentAxis:c}),u&&D6({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?$6():void 0,...D}),u&&F6({...D}),B6({...D,apply:Ha(({elements:ae,rects:ue,availableWidth:ee,availableHeight:Y})=>{const{width:je,height:ke}=ue.reference,Le=ae.floating.style;Le.setProperty("--radix-popper-available-width",`${ee}px`),Le.setProperty("--radix-popper-available-height",`${Y}px`),Le.setProperty("--radix-popper-anchor-width",`${je}px`),Le.setProperty("--radix-popper-anchor-height",`${ke}px`)},"apply")}),C&&z6({element:C,padding:d}),J6({arrowWidth:O,arrowHeight:E}),b&&U6({strategy:"referenceHidden",...D,boundary:B?D.boundary:void 0})]}),G=j.setPlacementState;yt(()=>(G(K),()=>{G(void 0)}),[K,G]);const[Q,re]=uf(K),ce=qn(x);yt(()=>{z&&ce?.()},[z,ce]);const fe=X.arrow?.x,me=X.arrow?.y,pe=X.arrow?.centerOffset!==0,[Re,J]=y.useState();return yt(()=>{S&&J(window.getComputedStyle(S).zIndex)},[S]),n.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:z?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[X.transformOrigin?.x,X.transformOrigin?.y].join(" "),...X.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:n.jsx(Z6,{scope:a,placedSide:Q,placedAlign:re,onArrowChange:A,arrowX:fe,arrowY:me,shouldHideArrow:pe,children:n.jsx(et.div,{"data-side":Q,"data-align":re,...g,ref:N,style:{...g.style,animation:z?g.style?.animation:"none"}})})})},"PopperContent"));function UA(e){return e!==null}Ha(UA,"isNotNull");var J6=Ha(e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:a,middlewareData:s}=t,o=s.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[u,h]=uf(r),m={start:"0%",center:"50%",end:"100%"}[h],p=(s.arrow?.x??0)+c/2,b=(s.arrow?.y??0)+d/2;let w="",x="";return u==="bottom"?(w=o?m:`${p}px`,x=`${-d}px`):u==="top"?(w=o?m:`${p}px`,x=`${a.floating.height+d}px`):u==="right"?(w=`${-d}px`,x=o?m:`${b}px`):u==="left"&&(w=`${a.floating.width+d}px`,x=o?m:`${b}px`),{data:{x:w,y:x}}}}),"transformOrigin");function uf(e){const[t,r="center"]=e.split("-");return[t,r]}Ha(uf,"getSideAndAlignFromPlacement");var D0=G6,$0=Y6,F0=X6,Q6=Object.defineProperty,eD=(e,t)=>Q6(e,"name",{value:t,configurable:!0}),hf=y.forwardRef(eD(function(t,r){const{container:a,...s}=t,[i,o]=y.useState(!1);yt(()=>o(!0),[]);const c=a||i&&globalThis?.document?.body;return c?Rc.createPortal(n.jsx(et.div,{...s,ref:r}),c):null},"Portal")),tD=Object.defineProperty,_a=(e,t)=>tD(e,"name",{value:t,configurable:!0});function zA(e,t){return y.useReducer((r,a)=>t[r][a]??r,e)}_a(zA,"useStateMachine");var is=_a(e=>{const{present:t,children:r}=e,a=WA(t),s=typeof r=="function"?r({present:a.isPresent}):y.Children.only(r),i=qA(a.ref,VA(s));return typeof r=="function"||a.isPresent?y.cloneElement(s,{ref:i}
1):null},"Presence");function WA(e){const[t,r]=y.useState(),a=y.useRef(null),s=y.useRef(e),i=y.useRef("none"),o=y.useRef(void 0),c=e?"mounted":"unmounted",[d,u]=zA(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{d==="mounted"?(i.current=o.current??zi(a.current),o.current=void 0):i.current="none"},[d]),yt(()=>{const h=a.current,m=s.current;if(m!==e){const b=i.current,w=zi(h);e?(o.current=w,u("MOUNT")):w==="none"||h?.display==="none"?u("UNMOUNT"):u(m&&b!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),yt(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,p=_a(w=>{const g=zi(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&g&&(u("ANIMATION_END"),!s.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},"handleAnimationEnd"),b=_a(w=>{w.target===t&&(i.current=zi(a.current))},"handleAnimationStart");return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:y.useCallback(h=>{if(h){const m=getComputedStyle(h);a.current=m,o.current=zi(m)}else a.current=null;r(h)},[])}}_a(WA,"usePresence");function Dv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}_a(Dv,"setRef");function qA(...e){const t=y.useRef(e);return t.current=e,y.useCallback(r=>{const a=t.current;let s=!1;const i=a.map(o=>{const c=Dv(o,r);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let o=0;o<i.length;o++){const c=i[o];typeof c=="function"?c():Dv(a[o],null)}}},[])}_a(qA,"useStableComposedRefs");function zi(e){return e?.animationName||"none"}_a(zi,"getAnimationName");function VA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}_a(VA,"getElementRef");var nD=Object.defineProperty,B0=(e,t)=>nD(e,"name",{value:t,configurable:!0}),Zm=!1;function HA(){const[e,t]=y.useState(Zm);return y.useEffect(()=>{Zm||(Zm=!0,t(!0))},[]),e}B0(HA,"useIsHydrated");var GA=Ic[" useSyncExternalStore ".trim().toString()];function KA(){return()=>{}}B0(KA,"subscribe");function YA(){return GA(KA,()=>!0,()=>!1)}B0(YA,"useIsHydratedModern");var rD=typeof GA=="function"?YA:HA,aD=Object.defineProperty,oi=(e,t)=>aD(e,"name",{value:t,configurable:!0}),Xm="rovingFocusGroup.onEntryFocus",sD={bubbles:!1,cancelable:!0},ff="RovingFocusGroup",[$v,ZA,iD]=nf(ff),[oD,XA]=sr(ff,[iD]),[lD,cD]=oD(ff),dD=y.forwardRef(oi(function(t,r){return n.jsx($v.Provider,{scope:t.__scopeRovingFocusGroup,children:n.jsx($v.Slot,{scope:t.__scopeRovingFocusGroup,children:n.jsx(uD,{...t,ref:r})})})},"RovingFocusGroup")),uD=y.forwardRef(oi(function(t,r){const{__scopeRovingFocusGroup:a,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:m=!1,...p}=t,b=y.useRef(null),w=tt(r,b),x=rf(o),[g,j]=Xa({prop:c,defaultProp:d??null,onChange:u,caller:ff}),[S,_]=y.useState(!1),N=qn(h),C=ZA(a),A=y.useRef(!1),[P,O]=y.useState(0);return y.useEffect(()=>{const E=b.current;if(E)return E.addEventListener(Xm,N),()=>E.removeEventListener(Xm,N)},[N]),n.jsx(lD,{scope:a,orientation:s,dir:x,loop:i,currentTabStopId:g,onItemFocus:y.useCallback(E=>j(E),[j]),onItemShiftTab:y.useCallback(()=>_(!0),[]),onFocusableItemAdd:y.useCallback(()=>O(E=>E+1),[]),onFocusableItemRemove:y.useCallback(()=>O(E=>E-1),[]),children:n.jsx(et.div,{tabIndex:S||P===0?-1:0,"data-orientation":s,...p,ref:w,style:{outline:"none",...t.style},onMouseDown:Se(t.onMouseDown,()=>{A.current=!0}),onFocus:Se(t.onFocus,E=>{const $=!A.current;if(E.target===E.currentTarget&&$&&!S){const M=new CustomEvent(Xm,sD
vendor: 9,280 bytes, lines 1-16
1);if(E.currentTarget.dispatchEvent(M),!M.defaultPrevented){const R=C().filter(K=>K.focusable),B=R.find(K=>K.active),D=R.find(K=>K.id===g),H=[B,D,...R].filter(Boolean).map(K=>K.ref.current);U0(H,m)}}A.current=!1}),onBlur:Se(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),hD="RovingFocusGroupItem",fD=y.forwardRef(oi(function(t,r){const{__scopeRovingFocusGroup:a,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...d}=t,u=Br(),h=o||u,m=cD(hD,a),p=m.currentTabStopId===h,b=ZA(a),{onFocusableItemAdd:w,onFocusableItemRemove:x,currentTabStopId:g}=m,j=rD();return yt(()=>{if(!(!j||!s))return w(),()=>x()},[j,s,w,x]),y.useEffect(()=>{if(!(j||!s))return w(),()=>x()},[j,s,w,x]),n.jsx($v.ItemSlot,{scope:a,id:h,focusable:s,active:i,children:n.jsx(et.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...d,ref:r,onMouseDown:Se(t.onMouseDown,S=>{s?m.onItemFocus(h):S.preventDefault()}),onFocus:Se(t.onFocus,()=>m.onItemFocus(h)),onKeyDown:Se(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){m.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const _=QA(S,m.orientation,m.dir);if(_!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let C=b().filter(A=>A.focusable).map(A=>A.ref.current);if(_==="last")C.reverse();else if(_==="prev"||_==="next"){_==="prev"&&C.reverse();const A=C.indexOf(S.currentTarget);C=m.loop?ek(C,A+1):C.slice(A+1)}setTimeout(()=>U0(C))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:g!=null}):c})})},"RovingFocusGroupItem")),mD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function JA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}oi(JA,"getDirectionAwareKey");function QA(e,t,r){const a=JA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return mD[a]}oi(QA,"getFocusIntent");function U0(e,t=!1){const r=document.activeElement;for(const a of e)if(a===r||(a.focus({preventScroll:t}),document.activeElement!==r))return}oi(U0,"focusFirst");function ek(e,t){return e.map((r,a)=>e[(t+a)%e.length])}oi(ek,"wrapArray");var pD=dD,xD=fD,gD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Li=new WeakMap,Pd=new WeakMap,Td={},Jm=0,tk=function(e){return e&&(e.host||tk(e.parentNode))},bD=function(e,t){return t.map(function(r){if(e.contains(r))return r;var a=tk(r);return a&&e.contains(a)?a:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},vD=function(e,t,r,a){var s=bD(t,Array.isArray(e)?e:[e]);Td[r]||(Td[r]=new WeakMap);var i=Td[r],o=[],c=new Set,d=new Set(s),u=function(m){!m||c.has(m)||(c.add(m),u(m.parentNode))};s.forEach(u);var h=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(p){if(c.has(p))h(p);else try{var b=p.getAttribute(a),w=b!==null&&b!=="false",x=(Li.get(p)||0)+1,g=(i.get(p)||0)+1;Li.set(p,x),i.set(p,g),o.push(p),x===1&&w&&Pd.set(p,!0),g===1&&p.setAttribute(r,"true"),w||p.setAttribute(a,"true")}catch(j){console.error("aria-hidden: cannot operate on ",p,j)}})};return h(t),c.clear(),Jm++,function(){o.forEach(function(m){var p=Li.get(m)-1,b=i.get(m)-1;Li.set(m,p),i.set(m,b),p||(Pd.has(m)||m.removeAttribute(a),Pd.delete(m)),b||m.removeAttribute(r)}),Jm--,Jm||(Li=new WeakMap,Li=new WeakMap,Pd=new WeakMap,Td={})}},z0=function(e,t,r){r===void 0&&(r="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),s=gD(e);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live], script"))),vD(a,s,r,"aria-hidden")):function(){return null}},Ir=function(){return Ir=Object.assign||function(t){for(var r,a=1,s=arguments.length;a<s;a++){r=arguments[a];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Ir.apply(this,arguments)};function nk(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r}function yD(e,t,r){if(r||arguments.length===2)for(var a=0,s=t.length,i;a<s;a++)(i||!(a in t))&&(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||Array.prototype.slice.call(t))}var cu="right-scroll-bar-position",du="width-before-scroll-bar",jD="with-scroll-bars-hidden",wD="--removed-body-scroll-bar-size";function Qm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ND(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(a){var s=r.value;s!==a&&(r.value=a,r.callback(a,s))}}}})[0];return r.callback=t,r.facade}var _D=typeof window<"u"?y.useLayoutEffect:y.useEffect,Qw=new WeakMap;function SD(e,t){var r=ND(null,function(a){return e.forEach(function(s){return Qm(s,a)})});return _D(function(){var a=Qw.get(r);if(a){var s=new Set(a),i=new Set(e),o=r.current;s.forEach(function(c){i.has(c)||Qm(c,null)}),i.forEach(function(c){s.has(c)||Qm(c,o)})}Qw.set(r,e)},[e]),r}function CD(e){return e}function AD(e,t){t===void 0&&(t=CD);var r=[],a=!1,s={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,a);return r.push(o),function(){r=r.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(a=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(c){return i(c)},filter:function(){return r}}},assignMedium:function(i){a=!0;var o=[];if(r.length){var c=r;r=[],c.forEach(i),o=r}var d=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(d)};u(),r={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),r}}}};return s}function kD(e){e===void 0&&(e={});var t=AD(null);return t.options=Ir({async:!0,ssr:!1},e),t}var rk=function(e){var t=e.sideCar,r=nk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return y.createElement(a,Ir({},r))};rk.isSideCarExport=!0;function PD(e,t){return e.useMedium(t),rk}var ak=kD(),ep=function(){},mf=y.forwardRef(function(e,t){var r=y.useRef(null),a=y.useState({onScrollCapture:ep,onWheelCapture:ep,onTouchMoveCapture:ep}),s=a[0],i=a[1],o=e.forwardProps,c=e.children,d=e.className,u=e.removeScrollBar,h=e.enabled,m=e.shards,p=e.sideCar,b=e.noRelative,w=e.noIsolation,x=e.inert,g=e.allowPinchZoom,j=e.as,S=j===void 0?"div":j,_=e.gapMode,N=nk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,A=SD([r,t]),P=Ir(Ir({},N),s);return y.createElement(y.Fragment,null,h&&y.createElement(C,{sideCar:ak,removeScrollBar:u,shards:m,noRelative:b,noIsolation:w,inert:x,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:_}),o?y.cloneElement(y.Children.only(c),Ir(Ir({},P),{ref:A})):y.createElement(S,Ir({},P,{className:d,ref:A}),c))});mf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mf.classNames={fullWidth:du,zeroRight:cu};var TD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function OD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=TD();return t&&e.setAttribute("nonce",t),e}function ED(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function MD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var LD=function(){var e=0,t=null;return{add:function(r){e==0&&(t=OD())&&(ED(t,r),MD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ID=function(){var e=LD();return function(t,r){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},sk=function(){var e=ID(),t=function(r){var a=r.styles,s=r.dynamic;return e(a,s),null};return t},RD={left:0,top:0,right:0,gap:0},tp=function(e){return parseInt(e||"",10)||0},DD=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[tp(r),tp(a),tp(s)]},$D=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RD;var t=DD(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-r+t[2]-t[0])}},FD=sk(),Ji="data-scroll-locked",BD=function(e,t,r,a){var s=e.left,i=e.top,o=e.right,c=e.gap;return r===void 0&&(r="margin"),` 2 .`.concat(jD,` { 3 overflow: hidden `).concat(a,`; 4 padding-right: `).concat(c,"px ").concat(a,`; 5 } 6 body[`).concat(Ji,`] { 7 overflow: hidden `).concat(a,`; 8 overscroll-behavior: contain; 9 `).concat([t&&"position: relative ".concat(a,";"),r==="margin"&&` 10 padding-left: `.concat(s,`px; 11 padding-top: `).concat(i,`px; 12 padding-right: `).concat(o,`px; 13 margin-left:0; 14 margin-top:0; 15 margin-right: `).concat(c,"px ").concat(a,`; 16 `),r==="padding"&&"padding-right: ".concat(c,"px ").concat(a,";
16")].filter(Boolean).join(""),` 17 } 18 19 .`).concat(cu,` { 20 right: `).concat(c,"px ").concat(a,`; 21 } 22 23 .`).concat(du,` { 24 margin-right: `).concat(c,"px ").concat(a,`; 25 } 26 27 .`).concat(cu," .").concat(cu,` { 28 right: 0 `).concat(a,`; 29 } 30 31 .`).concat(du," .").concat(du,` { 32 margin-right: 0 `).concat(a,`; 33 } 34 35 body[`).concat(Ji,`] { 36 `).concat(wD,": ").concat(c,`px; 37 } 38`)},eN=function(){var e=parseInt(document.body.getAttribute(Ji)||"0",10);return isFinite(e)?e:0},UD=function(){y.useEffect(function(){return document.body.setAttribute(Ji,(eN()+1).toString()),function(){var e=eN()-1;e<=0?document.body.removeAttribute(Ji):document.body.setAttribute(Ji,e.toString())}},[])},zD=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,s=a===void 0?"margin":a;UD();var i=y.useMemo(function(){return $D(s)},[s]);return y.createElement(FD,{styles:BD(i,!t,s,r?"":"!important")})},Fv=!1;if(typeof window<"u")try{var Od=Object.defineProperty({},"passive",{get:function(){return Fv=!0,!0}});window.addEventListener("test",Od,Od),window.removeEventListener("test",Od,Od)}catch{Fv=!1}var Ii=Fv?{passive:!1}:!1,WD=function(e){return e.tagName==="TEXTAREA"},ik=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!WD(e)&&r[t]==="visible")},qD=function(e){return ik(e,"overflowY")},VD=function(e){return ik(e,"overflowX")},tN=function(e,t){var r=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=ok(e,a);if(s){var i=lk(e,a),o=i[1],c=i[2];if(o>c)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},HD=function(e){var t=e.scrollTop,r=e.scrollHeight,a=e.clientHeight;return[t,r,a]},GD=function(e){var t=e.scrollLeft,r=e.scrollWidth,a=e.clientWidth;return[t,r,a]},ok=function(e,t){return e==="v"?qD(t):VD(t)},lk=function(e,t){return e==="v"?HD(t):GD(t)},KD=function(e,t){return e==="h"&&t==="rtl"?-1:1},YD=function(e,t,r,a,s){var i=KD(e,window.getComputedStyle(t).direction),o=i*a,c=r.target,d=t.contains(c),u=!1,h=o>0,m=0,p=0;do{if(!c)break;var b=lk(e,c),w=b[0],x=b[1],g=b[2],j=x-g-i*w;(w||j)&&ok(e,c)&&(m+=j,p+=w);var S=c.parentNode;c=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(m)<1||!h&&Math.abs(p)<1)&&(u=!0),u},Ed=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nN=function(e){return[e.deltaX,e.deltaY]},rN=function(e){return e&&"current"in e?e.current:e},ZD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XD=function(e){return` 39 .block-interactivity-`.concat(e,` {pointer-events: none;} 40 .allow-interactivity-`).concat(e,` {pointer-events: all;} 41`)},JD=0,Ri=[];function QD(e){var t=y.useRef([]),r=y.useRef([0,0]),a=y.useRef(),s=y.useState(JD++)[0],i=y.useState(sk)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var x=yD([e.lockRef.current],(e.shards||[]).map(rN),!0).filter(Boolean);return x.forEach(function(g){return g.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),x.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=y.useCallback(function(x,g){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var j=Ed(x),S=r.current,_="deltaX"in x?x.deltaX:S[0]-j[0],N="deltaY"in x?x.deltaY:S[1]-j[1],C,A=x.target,P=Math.abs(_)>Math.abs(N)?"h":"v";if("touches"in x&&P==="h"&&A.type==="range")return!1;var O=window.getSelection(),E=O&&O.anchorNode,$=E?E===A||E.contains(A):!1;if($)return!1;var M=tN(P,A);if(!M)return!0;if(M?C=P:(C=P==="v"?"h":"v",M=tN(P,A)),!M)return!1;if(!a.current&&"changedTouches"in x&&(_||N)&&(a.current=C),!C)return!0;var R=a.current||C;return YD(R,g,x,R==="h"?_:N)},[]),d=y.useCallback(function(x){var g=x;if(!(!Ri.length||Ri[Ri.length-1]!==i)){var j="deltaY"in g?nN(g):Ed(g),S=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&ZD(C.delta,j)})[0];if(S&&S.should){g.cancelable&&g.preventDefault();return}
41if(!S){var _=(o.current.shards||[]).map(rN).filter(Boolean).filter(function(C){return C.contains(g.target)}),N=_.length>0?c(g,_[0]):!o.current.noIsolation;N&&g.cancelable&&g.preventDefault()}}},[]),u=y.useCallback(function(x,g,j,S){var _={name:x,delta:g,target:j,should:S,shadowParent:e$(j)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(N){return N!==_})},1)},[]),h=y.useCallback(function(x){r.current=Ed(x),a.current=void 0},[]),m=y.useCallback(function(x){u(x.type,nN(x),x.target,c(x,e.lockRef.current))},[]),p=y.useCallback(function(x){u(x.type,Ed(x),x.target,c(x,e.lockRef.current))},[]);y.useEffect(function(){return Ri.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",d,Ii),document.addEventListener("touchmove",d,Ii),document.addEventListener("touchstart",h,Ii),function(){Ri=Ri.filter(function(x){return x!==i}),document.removeEventListener("wheel",d,Ii),document.removeEventListener("touchmove",d,Ii),document.removeEventListener("touchstart",h,Ii)}},[]);var b=e.removeScrollBar,w=e.inert;return y.createElement(y.Fragment,null,w?y.createElement(i,{styles:XD(s)}):null,b?y.createElement(zD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function e$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const t$=PD(ak,QD);var pf=y.forwardRef(function(e,t){return y.createElement(mf,Ir({},e,{ref:t,sideCar:t$}))});pf.classNames=mf.classNames;var n$=Object.defineProperty,ft=(e,t)=>n$(e,"name",{value:t,configurable:!0}),r$=["Enter"," "],a$=["ArrowDown","PageUp","Home"],ck=["ArrowUp","PageDown","End"],s$=[...a$,...ck],xf="Menu",[Bv,i$,o$]=nf(xf),[li,dk]=sr(xf,[o$,Ko,XA]),W0=Ko(),uk=XA(),[l$,Yc]=li(xf),[c$,q0]=li(xf),d$=ft(e=>{const{__scopeMenu:t,open:r=!1,children:a,dir:s,onOpenChange:i,modal:o=!0}=e,c=W0(t),[d,u]=y.useState(null),h=y.useRef(!1),m=qn(i),p=rf(s);return y.useEffect(()=>{const b=ft(()=>{h.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},"handleKeyDown"),w=ft(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),y.useEffect(()=>{if(!r)return;const b=ft(()=>m(!1),"handleBlur");return window.addEventListener("blur",b),()=>window.removeEventListener("blur",b)},[r,m]),n.jsx(D0,{...c,children:n.jsx(l$,{scope:t,open:r,onOpenChange:m,content:d,onContentChange:u,children:n.jsx(c$,{scope:t,onClose:y.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:p,modal:o,children:a})})})},"Menu"),u$=y.forwardRef(ft(function(t,r){const{__scopeMenu:a,...s}=t,i=W0(a);return n.jsx($0,{...i,...s,ref:r})},"MenuAnchor")),hk="MenuPortal",[h$,f$]=li(hk,{forceMount:void 0}),m$=ft(e=>{const{__scopeMenu:t,forceMount:r,children:a,container:s}=e,i=Yc(hk,t);return n.jsx(h$,{scope:t,forceMount:r,children:n.jsx(is,{present:r||i.open,children:n.jsx(hf,{asChild:!0,container:s,children:a})})})},"MenuPortal"),Ga="MenuContent",[p$,fk]=li(Ga),x$=y.forwardRef(ft(function(t,r){const a=f$(Ga,t.__scopeMenu),{forceMount:s=a.forceMount,...i}=t,o=Yc(Ga,t.__scopeMenu),c=q0(Ga,t.__scopeMenu);return n.jsx(Bv.Provider,{scope:t.__scopeMenu,children:n.jsx(is,{present:s||o.open,children:n.jsx(Bv.Slot,{scope:t.__scopeMenu,children:c.modal?n.jsx(g$,{...i,ref:r}):n.jsx(b$,{...i,ref:r})})})})},"MenuContent")),g$=y.forwardRef(ft(function(t,r){const a=Yc(Ga,t.__scopeMenu),s=y.useRef(null),i=tt(r,s);return y.useEffect(()=>{const o=s.current;if(o)return z0(o)},[]),n.jsx(mk,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:Se(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentModal")),b$=y.forwardRef(ft(function(t,r){const a=Yc(Ga,t.__scopeMenu);return n.jsx(mk,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})},"MenuRootContentNonModal")),v$=Hs("MenuContent.ScrollLock"),mk=y.forwardRef(ft(function(t,r){const{__scopeMenu:a,loop:s=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:u,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:b,onDismiss:w,disableOutsideScroll:x,...g}=t,j=Yc(Ga,a),S=q0(Ga,a),_=W0(a),N=uk(a),C=i$(a),[A,P]=y.useState(null),O=y.useRef(null),E=tt(r,O,j.onContentChange),$=y.useRef(0),M=y.useRef(""),R=y.useRef(0),B=y.useRef(null),D=y.useRef("right"),U=y.useRef(0),H=x?pf:y.Fragment,K=x?{as:v$,allowPinchZoom:!0}:void 0,z=ft(G=>{const Q=M.current+G,re=C().filter(J=>!J.disabled),ce=document.activeElement,fe=re.find(J=>J.ref.current===ce)?.textValue,me=re.map(J=>J.textValue),pe=vk(me,Q,fe),Re=re.find(J=>J.textValue===pe)?.ref.current;ft((function J(ae){M.current=ae,window.clearTimeout($.current),ae!==""&&($.current=window.setTimeout(()=>J(""),1e3))}),"updateSearch")(Q),Re&&setTimeout(()=>Re.focus())},"handleTypeaheadSearch");y.useEffect(()=>()=>window.clearTimeout($.current),[]),Kc();const X=y.useCallback(G=>
41D.current===B.current?.side&&jk(G,B.current?.area),[]);return n.jsx(p$,{scope:a,searchRef:M,onItemEnter:y.useCallback(G=>{X(G)&&G.preventDefault()},[X]),onItemLeave:y.useCallback(G=>{X(G)||(O.current?.focus(),P(null))},[X]),onTriggerLeave:y.useCallback(G=>{X(G)&&G.preventDefault()},[X]),pointerGraceTimerRef:R,onPointerGraceIntentChange:y.useCallback(G=>{B.current=G},[]),children:n.jsx(H,{...K,children:n.jsx(k0,{asChild:!0,trapped:i,onMountAutoFocus:Se(o,G=>{G.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:n.jsx(af,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:b,onDismiss:w,children:n.jsx(pD,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:s,currentTabStopId:A,onCurrentTabStopIdChange:P,onEntryFocus:Se(u,G=>{S.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(F0,{role:"menu","aria-orientation":"vertical","data-state":pk(j.open),"data-radix-menu-content":"",dir:S.dir,..._,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:Se(g.onKeyDown,G=>{const re=G.target.closest("[data-radix-menu-content]")===G.currentTarget,ce=G.ctrlKey||G.altKey||G.metaKey,fe=G.key.length===1;re&&(G.key==="Tab"&&G.preventDefault(),!ce&&fe&&z(G.key));const me=O.current;if(G.target!==me||!s$.includes(G.key))return;G.preventDefault();const Re=C().filter(J=>!J.disabled).map(J=>J.ref.current);ck.includes(G.key)&&Re.reverse(),gk(Re)}),onBlur:Se(t.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout($.current),M.current="")}),onPointerMove:Se(t.onPointerMove,vu(G=>{const Q=G.target,re=U.current!==G.clientX;if(G.currentTarget.contains(Q)&&re){const ce=G.clientX>U.current?"right":"left";D.current=ce,U.current=G.clientX}}))})})})})})})},"MenuContentImpl")),Uv="MenuItem",aN="menu.itemSelect",y$=y.forwardRef(ft(function(t,r){const{disabled:a=!1,onSelect:s,...i}=t,o=y.useRef(null),c=q0(Uv,t.__scopeMenu),d=fk(Uv,t.__scopeMenu),u=tt(r,o),h=y.useRef(!1),m=ft(()=>{const p=o.current;if(!a&&p){const b=new CustomEvent(aN,{bubbles:!0,cancelable:!0});p.addEventListener(aN,w=>s?.(w),{once:!0}),LC(p,b),b.defaultPrevented?h.current=!1:c.onClose()}},"handleSelect");return n.jsx(j$,{...i,ref:u,disabled:a,onClick:Se(t.onClick,m),onPointerDown:p=>{t.onPointerDown?.(p),h.current=!0},onPointerUp:Se(t.onPointerUp,p=>{h.current||p.currentTarget?.click()}),onKeyDown:Se(t.onKeyDown,p=>{a||p.target!==p.currentTarget||d.searchRef.current!==""&&p.key===" "||r$.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})},"MenuItem")),j$=y.forwardRef(ft(function(t,r){const{__scopeMenu:a,disabled:s=!1,textValue:i,...o}=t,c=fk(Uv,a),d=uk(a),u=y.useRef(null),h=tt(r,u),[m,p]=y.useState(!1),[b,w]=y.useState("");return y.useEffect(()=>{const x=u.current;x&&w((x.textContent??"").trim())},[o.children]),n.jsx(Bv.ItemSlot,{scope:a,disabled:s,textValue:i??b,children:n.jsx(xD,{asChild:!0,...d,focusable:!s,children:n.jsx(et.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...o,ref:h,onPointerMove:Se(t.onPointerMove,vu(x=>{s?c.onItemLeave(x):(c.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(t.onPointerLeave,vu(x=>c.onItemLeave(x))),onFocus:Se(t.onFocus,()=>p(!0)),onBlur:Se(t.onBlur,()=>p(!1))})})})},"MenuItemImpl")),w$="MenuRadioGroup",[cde,dde]=li(w$,{value:void 0,onValueChange:ft(()=>{},"onValueChange")}),N$="MenuItemIndicator",[ude,hde]=li(N$,{checked:!1}),_$=y.forwardRef(ft(function(t,r){const{__scopeMenu:a,...s}=t;return n.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...s,ref:r})},"MenuSeparator")),S$="MenuSub",[fde,mde]=li(S$);function pk(e){return e?"open":"closed"}ft(pk,"getOpenState");function xk(e){return e==="indeterminate"}ft(xk,"isIndeterminate");function C$(e){return xk(e)?"indeterminate":e?"checked":"unchecked"}ft(C$,"getCheckedState");function gk(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}ft(gk,"focusFirst");function bk(e,t){return e.map((r,a)=>e[(t+a)%e.length])}ft(bk,"wrapArray");function vk(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=bk(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const d=o.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return d!==r?d:void 0}ft(vk,"getNextMatch");function yk(e,t){const{x:r,y:a}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],u=c.x,h=c.y,m=d.x,p=d.y;h>a!=p>a&&r<(m-u)*(a-h)/(p-h)+u&&(s=!s)}return s}ft(yk,"isPointInPolygon");function jk(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return yk(r,t)}ft(jk,"isPointerInGraceArea");function vu(e){return t=>t.pointerType==="mouse"?e(t):void 0}ft(vu,"whenMouse");var A$=d$,k$=u$,P$=m$,T$=x$,O$=y$,E$=_$,M$=Object.defineProperty,Yo=(e,t)=>M$(e,"name",{value:t,configurable:!0}),V0="DropdownMenu",[L$,pde]=sr(V0,[dk]),Zo=dk(),[I$,wk]=L$(V0),R$=Yo(e=>{const{__scopeDropdownMenu:t,children:r,dir:a,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Zo(t),u=y.useRef(null),[h,m]=Xa({prop:s,defaultProp:i??!1,onChange:o,caller:V0});return n.jsx(I$,{scope:t,triggerId:Br(),triggerRef:u,contentId:Br(),open:h,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(p=>!p),[m]),modal:c,children:n.jsx(A$,{...d,open:h,onOpenChange:m,dir:a,modal:c,children:r})})},"DropdownMenu"),D$="DropdownMenuTrigger",$$=y.forwardRef(Yo(function(t,r){const{__scopeDropdownMenu:a,disabled:s=!1,...i}=t,o=wk(D$,a),c=Zo(a),d=tt(r,o.triggerRef);return n.jsx(k$,{asChild:!0,...c,children:n.jsx(et.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:d,onPointerDown:Se(t.onPointerDown,u=>{!s&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Se(t.onKeyDown,u=>{s||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),F$=Yo(e=>{const{__scopeDropdownMenu:t,...r}=e,a=Zo(t);return n.jsx(P$,{...a,...r})},"DropdownMenuPortal"),B$="DropdownMenuContent",U$=y.forwardRef(Yo(function(t,r){const{__scopeDropdownMenu:a,...s}=t,i=wk(B$,a),o=Zo(a),c=y.useRef(!1);return n.jsx(T$,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...s,ref:r,onCloseAutoFocus:Se(t.onCloseAutoFocus,d=>{c.current||i.triggerRef.current?.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Se(t.onInteractOutside,d=>{const u=d.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,m=u.button===2||h;(!i.modal||m)&&(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)"}})}
41,"DropdownMenuContent")),z$=y.forwardRef(Yo(function(t,r){const{__scopeDropdownMenu:a,...s}=t,i=Zo(a);return n.jsx(O$,{...i,...s,ref:r})},"DropdownMenuItem")),W$=y.forwardRef(Yo(function(t,r){const{__scopeDropdownMenu:a,...s}=t,i=Zo(a);return n.jsx(E$,{...i,...s,ref:r})},"DropdownMenuSeparator")),q$=R$,V$=$$,H$=F$,G$=U$,K$=z$,Y$=W$;function Nk({...e}){return n.jsx(q$,{"data-slot":"dropdown-menu",...e})}function _k({...e}){return n.jsx(V$,{"data-slot":"dropdown-menu-trigger",...e})}function Sk({className:e,sideOffset:t=4,...r}){return n.jsx(H$,{children:n.jsx(G$,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Ae("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-lg border p-1 shadow-lg",e),...r})})}function yu({className:e,inset:t,variant:r="default",...a}){return n.jsx(K$,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:Ae("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-md px-2 py-2 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 transition-colors",e),...a})}function Ck({className:e,...t}){return n.jsx(Y$,{"data-slot":"dropdown-menu-separator",className:Ae("bg-border -mx-1 my-1 h-px",e),...t})}var Z$=Object.defineProperty,ir=(e,t)=>Z$(e,"name",{value:t,configurable:!0}),H0="Dialog",[Ak,xde]=sr(H0),[X$,Jr]=Ak(H0),kk=ir(e=>{const{__scopeDialog:t,children:r,open:a,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,c=y.useRef(null),d=y.useRef(null),[u,h]=Xa({prop:a,defaultProp:s??!1,onChange:i,caller:H0}),[m,p]=y.useState(0),[b,w]=y.useState(0);return n.jsx(X$,{scope:t,triggerRef:c,contentRef:d,contentId:Br(),titleId:Br(),descriptionId:Br(),titlePresent:m>0,descriptionPresent:b>0,setTitleCount:p,setDescriptionCount:w,open:u,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(x=>!x),[h]),modal:o,children:r})},"Dialog"),Pk="DialogPortal",[J$,Tk]=Ak(Pk,{forceMount:void 0}),Ok=ir(e=>{const{__scopeDialog:t,forceMount:r,children:a,container:s}=e,i=Jr(Pk,t);return n.jsx(J$,{scope:t,forceMount:r,children:y.Children.map(a,o=>n.jsx(is,{present:r||i.open,children:n.jsx(hf,{asChild:!0,container:s,children:o})}))})},"DialogPortal"),zv="DialogOverlay",G0=y.forwardRef(ir(function(t,r){const a=Tk(zv,t.__scopeDialog),{forceMount:s=a.forceMount,...i}=t,o=Jr(zv,t.__scopeDialog);return o.modal?n.jsx(is,{present:s||o.open,children:n.jsx(e7,{...i,ref:r})}):null},"DialogOverlay")),Q$=Hs("DialogOverlay.RemoveScroll"),e7=y.forwardRef(ir(function(t,r){const{__scopeDialog:a,...s}=t,i=Jr(zv,a),o=gA(),c=tt(r,o);return n.jsx(pf,{as:Q$,allowPinchZoom:!0,shards:[i.contentRef],children:n.jsx(et.div,{"data-state":X0(i.open),...s,ref:c,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),Yl="DialogContent",K0=y.forwardRef(ir(function(t,r){const a=Tk(Yl,t.__scopeDialog),{forceMount:s=a.forceMount,...i}=t,o=Jr(Yl,t.__scopeDialog);return n.jsx(is,{present:s||o.open,children:o.modal?n.jsx(t7,{...i,ref:r}):n.jsx(n7,{...i,ref:r})})},"DialogContent")),t7=y.forwardRef(ir(function(t,r){const a=Jr(Yl,t.__scopeDialog),s=y.useRef(null),i=tt(r,a.contentRef,s);return y.useEffect(()=>{const o=s.current;if(o)return z0(o)},[]),n.jsx(Ek,{...t,ref:i,trapFocus:a.open,disableOutsidePointerEvents:a.open,onCloseAutoFocus:Se(t.onCloseAutoFocus,o=>{o.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:Se(t.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&o.preventDefault()}),onFocusOutside:Se(t.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),n7=y.forwardRef(ir(function(t,r){const a=Jr(Yl,t.__scopeDialog),s=y.useRef(!1),i=y.useRef(!1);return n.jsx(Ek,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(s.current||a.triggerRef.current?.focus(),o.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;a.triggerRef.current?.contains(c)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})},"DialogContentNonModal")),Ek=y.forwardRef(ir(function(t,r){const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,d=Jr(Yl,a);return Kc(),n.jsx(n.Fragment,{children:n.jsx(k0,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:n.jsx(af,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionPresent?d.descriptionId:void 0,"aria-labelledby":d.titlePresent?d.titleId:void 0,"data-state":X0(d.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})},"DialogContentImpl")),r7="DialogTitle",Y0=y.forwardRef(ir(function(t,r){const{__scopeDialog:a,...s}=t,i=Jr(r7,a),{setTitleCount:o}=i;return yt(()=>(o(c=>c+1),()=>o(c=>c-1)),[o]),n.jsx(et.h2,{id:i.titleId,...s,ref:r})},"DialogTitle")),a7="DialogDescription",Z0=y.forwardRef(ir(function(t,r){const{__scopeDialog:a,...s}=t,i=Jr(a7,a),{setDescriptionCount:o}=i;return yt(()=>(o(c=>c+1),()=>o(c=>c-1)),[o]),n.jsx(et.p,{id:i.descriptionId,...s,ref:r})},"DialogDescription")),s7="DialogClose",Mk=y.forwardRef(ir(function(t,r){const{__scopeDialog:a,...s}=t,i=Jr(s7,a);return n.jsx(et.button,{type:"button",...s,ref:r,onClick:Se(t.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function X0(e){return e?"open":"closed"}ir(X0,"getState");const i7=kk,o7=Ok,Lk=y.forwardRef(({className:e,...t},r)=>n.jsx(G0,{className:Ae("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Lk.displayName=G0.displayName;const l7=IC("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ik=y.forwardRef(({side:e="right",className:t,children:r,...a},s)=>n.jsxs(o7,{children:[n.jsx(Lk,{}),n.jsxs(K0,{ref:s,className:Ae(l7({side:e}),t),...a,children:[n.jsxs(Mk,{className:"absolute right-4 top-4 roun
41ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[n.jsx(Me,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));Ik.displayName=K0.displayName;const Rk=({className:e,...t})=>n.jsx("div",{className:Ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});Rk.displayName="SheetHeader";const Dk=y.forwardRef(({className:e,...t},r)=>n.jsx(Y0,{ref:r,className:Ae("text-lg font-semibold text-foreground",e),...t}));Dk.displayName=Y0.displayName;const $k=y.forwardRef(({className:e,...t},r)=>n.jsx(Z0,{ref:r,className:Ae("text-sm text-muted-foreground",e),...t}));$k.displayName=Z0.displayName;function Je({className:e,...t}){return n.jsx("div",{className:Ae("animate-pulse rounded-md bg-primary/10",e),...t})}var c7=Object.defineProperty,d7=(e,t)=>c7(e,"name",{value:t,configurable:!0}),Fk=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),u7=y.forwardRef(d7(function(t,r){return n.jsx(et.span,{...t,ref:r,style:{...Fk,...t.style}})},"VisuallyHidden")),h7=u7,f7=Object.defineProperty,Qt=(e,t)=>f7(e,"name",{value:t,configurable:!0}),[J0,gde]=sr("Tooltip",[Ko]),Q0=Ko(),m7="TooltipProvider",p7=700,Wv="tooltip.open",[x7,e1]=J0(m7),g7=Qt(e=>{const{__scopeTooltip:t,delayDuration:r=p7,skipDelayDuration:a=300,disableHoverableContent:s=!1,children:i}=e,o=y.useRef(!0),c=y.useRef(!1),d=y.useRef(0);return y.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),n.jsx(x7,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:y.useCallback(()=>{a<=0||(window.clearTimeout(d.current),o.current=!1)},[a]),onClose:y.useCallback(()=>{a<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,a))},[a]),isPointerInTransitRef:c,onPointerInTransitChange:y.useCallback(u=>{c.current=u},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),qv="Tooltip",[b7,Zc]=J0(qv),v7=Qt(e=>{const{__scopeTooltip:t,children:r,open:a,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=e1(qv,e.__scopeTooltip),u=Q0(t),[h,m]=y.useState(null),[p,b]=y.useState(void 0),w=Br(),x=y.useRef(0),g=o??d.disableHoverableContent,j=c??d.delayDuration,S=y.useRef(!1),[_,N]=Xa({prop:a,defaultProp:s??!1,onChange:Qt($=>{$?(d.onOpen(),document.dispatchEvent(new CustomEvent(Wv))):d.onClose(),i?.($)},"onChange"),caller:qv}),C=y.useMemo(()=>_?S.current?"delayed-open":"instant-open":"closed",[_]),A=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,N(!0)},[N]),P=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),O=y.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,N(!0),x.current=0},j)},[j,N]);y.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]);const E=p??w;return n.jsx(D0,{...u,children:n.jsx(b7,{scope:t,contentId:E,setContentId:b,open:_,stateAttribute:C,trigger:h,onTriggerChange:m,onTriggerEnter:y.useCallback(()=>{d.isOpenDelayedRef.current?O():A()},[d.isOpenDelayedRef,O,A]),onTriggerLeave:y.useCallback(()=>{g?P():(window.clearTimeout(x.current),x.current=0)},[P,g]),onOpen:A,onClose:P,disableHoverableContent:g,children:r})})},"Tooltip"),sN="TooltipTrigger",y7=y.forwardRef(Qt(function(t,r){const{__scopeTooltip:a,...s}=t,i=Zc(sN,a),o=e1(sN,a),c=Q0(a),d=y.useRef(null),u=tt(r,d,i.onTriggerChange),h=y.useRef(!1),m=y.useRef(!1),p=y.useCallback(()=>h.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),n.jsx($0,{asChild:!0,...c,children:n.jsx(et.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:u,onPointerMove:Se(t.onPointerMove,b=>{b.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),m.current=!0)}),onPointerLeave:Se(t.onPointerLeave,()=>{i.onTriggerLeave(),m.current=!1}),onPointerDown:Se(t.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Se(t.onFocus,()=>{h.current||i.onOpen()}),onBlur:Se(t.onBlur,i.onClose),onClick:Se(t.onClick,i.onClose)})})},"TooltipTrigger")),Bk="TooltipPortal",[j7,w7]=J0(Bk,{forceMount:void 0}),N7=Qt(e=>{const{__scopeTooltip:t,forceMount:r,children:a,container:s}=e,i=Zc(Bk,t);return n.jsx(j7,{scope:t,forceMount:r,children:n.jsx(is,{present:r||i.open,children:n.jsx(hf,{asChild:!0,container:s,children:a})})})},"TooltipPortal"),Zl="TooltipContent",_7=y.forwardRef(Qt(function(t,r){const a=w7(Zl,t.__scopeTooltip),{forceMount:s=a.forceMount,side:i="top",...o}=t,c=Zc(Zl,t.__scopeTooltip);return n.jsx(is,{present:s||c.open,children:c.disableHoverableContent?n.jsx(Uk,{side:i,...o,ref:r}):n.jsx(S7,{side:i,...o,ref:r})})},"TooltipContent")),S7=y.forwardRef(Qt(function(t,r){const a=Zc(Zl,t.__scopeTooltip),s=e1(Zl,t.__scopeTooltip),i=y.useRef(null),o=tt(r,i),[c,d]=y.useState(null),{trigger:u,onClose:h}=a,m=i.current,{onPointerInTransitChange:p}=s,b=y.useCallback(()=>{d(null),p(!1)},[p]),w=y.useCallback((x,g)=>{const j=x.currentTarget,S={x:x.clientX,y:x.clientY},_=zk(S,j.getBoundingClientRect()),N=Wk(S,_),C=qk(g.getBoundingClientRect()),A=Hk([...N,...C]);d(A),p(!0)},[p]);return y.useEffect(()=>()=>b(),[b]),y.useEffect(()=>{if(u&&m){const x=Qt(j=>w(j,m),"handleTriggerLeave"),g=Qt(j=>w(j,u),"handleContentLeave");return u.addEventListener("pointerleave",x),m.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",g)}}},[u,m,w,b]),y.useEffect(()=>{if(c){const x=Qt(g=>{const j=g.target,S={x:g.clientX,y:g.clientY},_=u?.contains(j)||m?.contains(j),N=!Vk(S,c);_?b():N&&(b(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,m,c,h,b]),n.jsx(Uk,{...t,ref:o})},"TooltipContentHoverable")),C7=b9("TooltipContent"),Uk=y.forwardRef(Qt(function(t,r){const{__scopeTooltip:a,children:s,"aria-label":i,id:o,onEscapeKeyDown:c,onPointerDownOutside:d,...u}=t,h=Zc(Zl,a),m=Q0(a),{onClose:p}=h;y.useEffect(()=>(document.addEventListener(Wv,p),()=>document.removeEventListener(Wv,p)),[p]),y.useEffect(()=>{if(h.trigger){const w=Qt(x=>{x.target instanceof Node&&x.target.contains(h.trigger)&&p()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[h.trigger,p]);const{setContentId:b}=h;return yt(()=>(b(o),()=>{b(void 0)}),[o,b]),n.jsx(af,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:w=>w.preventDefault(),onDismiss:p,children:n.jsxs(F0,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...m,...u,ref:r,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[n.jsx(C7,{children:s}),i?n.jsx(h7,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function zk(e,t){const r=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,a,s,i)){case i:return"left";case s:return"right";case r:return"top";case a:return"bottom";default:throw new Error("unreachable")}}Qt(zk,"getExitSideFromRect");function Wk(e,t,r=5){const a=[];switch(t){case"top":a.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":a.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":a.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":a.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return a}Qt(Wk,"getPaddedExitPoints");
41function qk(e){const{top:t,right:r,bottom:a,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:a},{x:s,y:a}]}Qt(qk,"getPointsFromRect");function Vk(e,t){const{x:r,y:a}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],u=c.x,h=c.y,m=d.x,p=d.y;h>a!=p>a&&r<(m-u)*(a-h)/(p-h)+u&&(s=!s)}return s}Qt(Vk,"isPointInPolygon");function Hk(e){const t=e.slice();return t.sort((r,a)=>r.x<a.x?-1:r.x>a.x?1:r.y<a.y?-1:r.y>a.y?1:0),Gk(t)}Qt(Hk,"getHull");function Gk(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const s=e[a];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let a=e.length-1;a>=0;a--){const s=e[a];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}Qt(Gk,"getHullPresorted");var A7=g7,k7=v7,P7=y7,T7=N7,Kk=_7;const O7=A7,E7=k7,M7=P7,Yk=y.forwardRef(({className:e,sideOffset:t=4,...r},a)=>n.jsx(T7,{children:n.jsx(Kk,{ref:a,sideOffset:t,className:Ae("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));Yk.displayName=Kk.displayName;const np=768;function L7(){const[e,t]=y.useState(void 0);return y.useEffect(()=>{const r=window.matchMedia(`(max-width: ${np-1}px)`),a=()=>{t(window.innerWidth<np)};return r.addEventListener("change",a),t(window.innerWidth<np),()=>r.removeEventListener("change",a)},[]),!!e}const I7="sidebar_state",R7=3600*24*7,D7="16rem",$7="100vw",F7="3rem",B7="b",Zk=y.createContext(null);function Qr(){const e=y.useContext(Zk);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const ci=y.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:a,style:s,children:i,...o},c)=>{const d=L7(),[u,h]=y.useState(!1),[m,p]=y.useState(e),b=t??m,w=y.useCallback(S=>{const _=typeof S=="function"?S(b):S;r?r(_):p(_),document.cookie=`${I7}=${_}; path=/; max-age=${R7}`},[r,b]),x=y.useCallback(()=>d?h(S=>!S):w(S=>!S),[d,w]);y.useEffect(()=>{const S=_=>{_.key===B7&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),x())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[x]);const g=b?"expanded":"collapsed",j=y.useMemo(()=>({state:g,open:b,setOpen:w,isMobile:d,openMobile:u,setOpenMobile:h,toggleSidebar:x}),[g,b,w,d,u,x]);return n.jsx(Zk.Provider,{value:j,children:n.jsx(O7,{delayDuration:0,children:n.jsx("div",{style:{"--sidebar-width":D7,"--sidebar-width-icon":F7,...s},className:Ae("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",a),ref:c,...o,children:i})})})});ci.displayName="SidebarProvider";const di=y.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:a,children:s,...i},o)=>{const{isMobile:c,state:d,openMobile:u,setOpenMobile:h}=Qr();return r==="none"?n.jsx("div",{className:Ae("flex h-full flex-col bg-sidebar text-sidebar-foreground",a),style:{width:"var(--sidebar-width)"},ref:o,...i,children:s}):c?n.jsx(i7,{open:u,onOpenChange:h,...i,children:n.jsxs(Ik,{"data-sidebar":"sidebar","data-mobile":"true",className:"bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":$7,width:"var(--sidebar-width)"},side:e,children:[n.jsxs(Rk,{className:"sr-only",children:[n.jsx(Dk,{children:"Sidebar"}),n.jsx($k,{children:"Displays the mobile sidebar."})]}),n.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):n.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":t,"data-side":e,children:[n.jsx("div",{className:Ae("relative bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)"),style:{width:"var(--sidebar-width)"}}),n.jsx("div",{className:Ae("fixed inset-y-0 z-10 hidden h-svh transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),style:{width:"var(--sidebar-width)"},...i,children:n.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});di.displayName="Sidebar";const Xc=y.forwardRef(({className:e,onClick:t,...r},a)=>{const{toggleSidebar:s}=Qr();return n.jsxs(be,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Ae("h-7 w-7",e),onClick:i=>{t?.(i),s()},...r,children:[n.jsx(v9,{}),n.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Xc.displayName="SidebarTrigger";const U7=y.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:a}=Qr();return n.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:Ae("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});U7.displayName="SidebarRail";const ui=y.forwardRef(({className:e,...t},r)=>n.jsx("main",{ref:r,className:Ae("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ui.displayName="SidebarInset";const z7=y.forwardRef(({className:e,...t},r)=>n.jsx(Ee,{ref:r,"data-sidebar":"input",className:Ae("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));z7.displayName="SidebarInput";const hi=y.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,"data-sidebar":"header",className:Ae("flex flex-col gap-2 p-2",e),...t}));hi.displayName="SidebarHeader";const fi=y.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,"data-sidebar":"footer",className:Ae("flex flex-col gap-2 p-2",e),...t}));fi.displayName="SidebarFooter";const W7=y.forwardRef(({className:e,...t},r)=>n.jsx(Zh,{ref:r,"data-sidebar":"separator",className:Ae("mx-2 w-auto bg-sidebar-border",e),...t}));W7.displayName="SidebarSeparator";const mi=y.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,"data-sidebar":"content",className:Ae("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));mi.displayName="SidebarContent";const es=y.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,"data-sidebar":"group",className:Ae("relative flex w-full min-w-0 flex-col p-2",e),...t}));es.displayName="SidebarGroup";const Zs=y.forwardRef(({className:e,asChild:t=!1,...r},a)=>{const s=t?Fc:"div";return n.jsx(s,{ref:a,"data-sidebar":"group-label",className:Ae("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground
41/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Zs.displayName="SidebarGroupLabel";const q7=y.forwardRef(({className:e,asChild:t=!1,...r},a)=>{const s=t?Fc:"button";return n.jsx(s,{ref:a,"data-sidebar":"group-action",className:Ae("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});q7.displayName="SidebarGroupAction";const ts=y.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,"data-sidebar":"group-content",className:Ae("w-full text-sm",e),...t}));ts.displayName="SidebarGroupContent";const On=y.forwardRef(({className:e,...t},r)=>n.jsx("ul",{ref:r,"data-sidebar":"menu",className:Ae("flex w-full min-w-0 flex-col gap-1",e),...t}));On.displayName="SidebarMenu";const ln=y.forwardRef(({className:e,...t},r)=>n.jsx("li",{ref:r,"data-sidebar":"menu-item",className:Ae("group/menu-item relative",e),...t}));ln.displayName="SidebarMenuItem";const V7=IC("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none 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"}}),Un=y.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:a="default",tooltip:s,className:i,...o},c)=>{const d=e?Fc:"button",{isMobile:u,state:h}=Qr(),m=n.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":a,"data-active":t,className:Ae(V7({variant:r,size:a}),i),...o});return s?(typeof s=="string"&&(s={children:s}),n.jsxs(E7,{children:[n.jsx(M7,{asChild:!0,children:m}),n.jsx(Yk,{side:"right",align:"center",hidden:h!=="collapsed"||u,...s})]})):m});Un.displayName="SidebarMenuButton";const H7=y.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...a},s)=>{const i=t?Fc:"button";return n.jsx(i,{ref:s,"data-sidebar":"menu-action",className:Ae("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...a})});H7.displayName="SidebarMenuAction";const Xk=y.forwardRef(({className:e,...t},r)=>n.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:Ae("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Xk.displayName="SidebarMenuBadge";const ju=y.forwardRef(({className:e,showIcon:t=!1,...r},a)=>{const s=y.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return n.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:Ae("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&n.jsx(Je,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n.jsx(Je,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});ju.displayName="SidebarMenuSkeleton";const G7=y.forwardRef(({className:e,...t},r)=>n.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:Ae("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));G7.displayName="SidebarMenuSub";const K7=y.forwardRef(({...e},t)=>n.jsx("li",{ref:t,...e}));K7.displayName="SidebarMenuSubItem";const Y7=y.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:a,...s},i)=>{const o=e?Fc:"a";return n.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:Ae("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",a),...s})});Y7.displayName="SidebarMenuSubButton";const Z7=[{href:"/admin",label:"Overview",icon:Ln},{href:"/admin/pending",label:"Pending Approvals",icon:At}
41,{href:"/admin/members",label:"Agency Members",icon:Za},{href:"/admin/participating",label:"Participating",icon:Be},{href:"/admin/platinum",label:"State-Level Featured",icon:Nn},{href:"/admin/all-agencies",label:"All Agencies",icon:en},{href:"/admin/jobs",label:"Job Board",icon:ht}],X7=[{href:"/admin/veterans/pending",label:"Pending Veterans",icon:At},{href:"/admin/veterans",label:"All Veterans",icon:qr}],J7=[{href:"/admin/colleges",label:"Colleges & Universities",icon:pn},{href:"/admin/academies",label:"LE Academies",icon:ja},{href:"/admin/business",label:"Business Contributors",icon:Rt}],Q7=[{href:"/admin/billing",label:"Billing Activity",icon:It},{href:"/admin/site-analytics",label:"Site Analytics",icon:Hl},{href:"/admin/messages",label:"Messages",icon:tn},{href:"/admin/carousel",label:"Logo Carousel",icon:ef},{href:"/admin/calendar",label:"Calendar",icon:Cr},{href:"/admin/settings",label:"Settings",icon:qo},{href:"/admin/activity",label:"Activity Log",icon:Pn},{href:"/admin/system-updates",label:"System Updates",icon:FL}];function Md({href:e,label:t,icon:r,isActive:a,badge:s}){const{setOpenMobile:i}=Qr();return n.jsx(ln,{children:n.jsx(Un,{asChild:!0,isActive:a,children:n.jsxs(ye,{to:e,onClick:()=>i(!1),className:"flex items-center justify-between w-full",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(r,{}),n.jsx("span",{children:t})]}),s!==void 0&&s>0&&n.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[#f59e0b]/20 text-[#f59e0b] min-w-[20px] text-center",children:s})]})})})}function Ld({color:e,children:t}){return n.jsx("li",{className:"px-2 pt-4 pb-1",children:n.jsx("span",{className:"text-xs uppercase tracking-wider font-semibold",style:{color:e},children:t})})}function eF(){const e=ai(),t=ie(F.admin.getAdminStats),r=ie(F.veterans.getVeteranStats),a=ie(F.adminMessaging.getTeamUnreadCount)??0;return n.jsx(mi,{children:n.jsx(es,{children:n.jsx(ts,{children:n.jsxs(On,{children:[n.jsx(Ld,{color:"#d4a843",children:"Agencies"}),Z7.map(s=>n.jsx(Md,{href:s.href,label:s.label,icon:s.icon,isActive:e.pathname===s.href,badge:s.href==="/admin/pending"?t?.pendingCount??0:void 0},s.href)),n.jsx("li",{className:"border-t border-sidebar-border my-1"}),n.jsx(Ld,{color:"#00b4ff",children:"Veterans"}),X7.map(s=>n.jsx(Md,{href:s.href,label:s.label,icon:s.icon,isActive:e.pathname===s.href,badge:s.href==="/admin/veterans/pending"?r?.pendingCount??0:void 0},s.href)),n.jsx("li",{className:"border-t border-sidebar-border my-1"}),n.jsx(Ld,{color:"#22c55e",children:"Partners"}),J7.map(s=>n.jsx(Md,{href:s.href,label:s.label,icon:s.icon,isActive:e.pathname===s.href},s.href)),n.jsx("li",{className:"border-t border-sidebar-border my-1"}),n.jsx(Ld,{color:"#475569",children:"System"}),Q7.map(s=>n.jsx(Md,{href:s.href,label:s.label,icon:s.icon,isActive:e.pathname===s.href,badge:s.href==="/admin/messages"?a:void 0},s.href))]})})})})}function tF(){const e=ie(F.auth.currentUser),t=Hc(e?.email),r=t?.name||e?.name||"Admin",{signOut:a}=rs(),{setOpenMobile:s}=Qr();return n.jsx(fi,{className:"border-t border-sidebar-border",children:n.jsx(On,{children:n.jsx(ln,{children:n.jsxs(Nk,{children:[n.jsx(_k,{asChild:!0,children:n.jsxs(Un,{size:"lg",children:[n.jsxs(w0,{className:"size-8",children:[t?.photo&&n.jsx(mR,{src:t.photo,alt:r,className:"object-cover"}),n.jsx(N0,{className:"bg-[#d4a843] text-black text-sm font-bold",children:r.charAt(0).toUpperCase()})]}),n.jsxs("div",{className:"flex flex-col items-start text-left",children:[n.jsx("span",{className:"text-sm font-medium truncate text-white",children:r}),n.jsx("span",{className:"text-xs text-[#94a3b8] truncate",children:e?.email})]})]})}),n.jsxs(Sk,{side:"top",align:"start",className:"w-[--radix-dropdown-menu-trigger-width] bg-[#111827] border-[#1e293b]",children:[n.jsx(yu,{asChild:!0,className:"text-white hover:bg-[#1e293b]",children:n.jsxs(ye,{to:"/admin/settings",onClick:()=>s(!1),children:[n.jsx(qo,{className:"size-4"}),"Settings"]})}),n.jsx(Ck,{className:"bg-[#1e293b]"}),n.jsxs(yu,{onClick:()=>a(),className:"text-[#ef4444] focus:text-[#ef4444] focus:bg-[#ef4444]/10",children:[n.jsx(tf,{className:"size-4"}),"Sign out"]})]})]})})})})}function nF(){const{setOpenMobile:e}=Qr();return n.jsx(hi,{className:"border-b border-sidebar-border",children:n.jsxs(ye,{to:"/admin",onClick:()=>e(!1),className:"flex flex-col items-center gap-2 px-4 py-5",children:[n.jsx("img",{src:"/vettoleo-logo.png",alt:"
41VET-TO-LEO",className:"w-full h-auto drop-shadow-[0_0_12px_rgba(212,168,67,0.3)]"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ln,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] text-xs font-bold uppercase tracking-widest",children:"Admin Console"})]})]})})}function rF(){return n.jsxs(di,{children:[n.jsx(nF,{}),n.jsx(eF,{}),n.jsx(tF,{})]})}const aF=2.5*60*1e3,sF=60*1e3;function gf(){const e=te(F.presence.heartbeat);y.useEffect(()=>{const t=()=>{document.visibilityState==="visible"&&e().catch(()=>{})};t();const r=window.setInterval(t,sF);return document.addEventListener("visibilitychange",t),window.addEventListener("focus",t),()=>{window.clearInterval(r),document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}},[e])}function pi(e=3e4){const[t,r]=y.useState(()=>Date.now());return y.useEffect(()=>{const a=window.setInterval(()=>r(Date.now()),e);return()=>window.clearInterval(a)},[e]),t}function Jk(e,t){return!!e&&t-e<aF}function rp(e,t){const r=Math.max(0,t-e),a=Math.floor(r/6e4);if(a<1)return"just now";if(a<60)return`${a} min ago`;const s=Math.floor(a/60);if(s<24)return`${s} hr${s===1?"":"s"} ago`;const i=Math.floor(s/24);return i<30?`${i} day${i===1?"":"s"} ago`:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function ap(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",timeZone:"America/Denver",timeZoneName:"short"})}function xi({status:e,now:t,showLogin:r=!1}){if(e===void 0)return null;const a=e?.lastSeenAt??null,s=e?.lastLoginAt??null;return Jk(a,t)?n.jsxs("span",{className:"inline-flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-semibold text-[#22c55e]",children:[n.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-[#22c55e] shadow-[0_0_6px_#22c55e]"}),"Online"]}),r&&s&&n.jsxs("span",{className:"text-xs text-[#64748b]",title:ap(s),children:["Logged in ",rp(s,t)]})]}):a?n.jsxs("span",{className:"inline-flex flex-wrap items-center gap-x-3 gap-y-0.5",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[#94a3b8]",title:ap(a),children:[n.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-[#475569]"}),"Last active ",rp(a,t)]}),r&&s&&n.jsxs("span",{className:"text-xs text-[#64748b]",title:ap(s),children:["Logged in ",rp(s,t)]})]}):n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[#64748b]",children:[n.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-[#334155]"}),"Never logged in"]})}function iF(){return n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-[#0a0e17]",children:n.jsxs("div",{className:"text-center space-y-4 max-w-md px-6",children:[n.jsx("div",{className:"w-16 h-16 rounded-full bg-[#ef4444]/10 border border-[#ef4444]/30 flex items-center justify-center mx-auto",children:n.jsx(zC,{className:"w-8 h-8 text-[#ef4444]"})}),n.jsx("h2",{className:"text-2xl font-bold text-white",children:"Access Denied"}),n.jsx("p",{className:"text-[#94a3b8]",children:"This dashboard is restricted to VET-TO-LEO super administrators. If you believe this is an error, contact your system administrator."}),n.jsx("a",{href:"/dashboard",className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#1e293b] text-[#94a3b8] hover:text-white hover:bg-[#2a3a50] transition-colors text-sm",children:"Return to Agency Dashboard"})]})})}function oF(){return gf(),null}function lF(){return n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-[#0a0e17]",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-2 border-[#d4a843] border-t-transparent rounded-full animate-spin"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ln,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] text-sm font-medium",children:"Verifying admin access..."})]})]})})}function cF(){const e=ie(F.admin.isAdmin);return e===void 0?n.jsx(lF,{}):e===!1?n.jsx(iF,{}):n.jsxs(ci,{children:[n.jsx(oF,{}),n.jsx(rF,{}),n.jsxs(ui,{children:[n.jsx("header",{className:"flex h-12 items-center px-4 md:hidden",children:n.jsx(Xc,{})}),n.jsx("main",{className:"flex-1 p-4 lg:p-6",children:n.jsx(Yr,{})})]})]})}function dF(){return n.jsx("div",{className:"flex items-center justify-center min-h-screen bg-[#0a0e17]",children:n.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-2 border-[#d4a843] border-t-transparent roun
41ded-full animate-spin"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ln,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] text-sm font-medium",children:"Loading..."})]})]})})}function uF(){const{isAuthenticated:e,isLoading:t}=Vn(),r=ie(F.admin.isAdmin);return t||r===void 0?n.jsx(dF,{}):e?r?n.jsx(Yr,{}):n.jsx(Mt,{to:"/",replace:!0}):n.jsx(Mt,{to:"/admin/login",replace:!0})}const hF=[{href:"/dashboard",label:"Dashboard",icon:HC},{href:"/profile",label:"Agency Profile",icon:Rt},{href:"/jobs",label:"Job Postings",icon:ht},{href:"/recruiters",label:"Recruiters",icon:Wc},{href:"/analytics",label:"Analytics",icon:Fr},{href:"/leads",label:"Veteran Leads",icon:en},{href:"/messages",label:"Messages",icon:tn}],fF=[{href:"/subscription",label:"Subscription",icon:It},{href:"/settings",label:"Settings",icon:qo}];function iN({href:e,label:t,icon:r,isActive:a}){const{setOpenMobile:s}=Qr();return n.jsx(ln,{children:n.jsx(Un,{asChild:!0,isActive:a,children:n.jsxs(ye,{to:e,onClick:()=>s(!1),children:[n.jsx(r,{}),n.jsx("span",{children:t})]})})})}function mF(){const e=ai();return n.jsxs(mi,{children:[n.jsxs(es,{children:[n.jsx(Zs,{className:"text-[#475569] text-xs uppercase tracking-wider",children:"Agency"}),n.jsx(ts,{children:n.jsx(On,{children:hF.map(t=>n.jsx(iN,{href:t.href,label:t.label,icon:t.icon,isActive:e.pathname===t.href},t.href))})})]}),n.jsxs(es,{children:[n.jsx(Zs,{className:"text-[#475569] text-xs uppercase tracking-wider",children:"Account"}),n.jsx(ts,{children:n.jsx(On,{children:fF.map(t=>n.jsx(iN,{href:t.href,label:t.label,icon:t.icon,isActive:e.pathname===t.href},t.href))})})]})]})}function pF(){const e=ie(F.auth.currentUser),{signOut:t}=rs(),{setOpenMobile:r}=Qr();return n.jsx(fi,{className:"border-t border-sidebar-border",children:n.jsx(On,{children:n.jsx(ln,{children:n.jsxs(Nk,{children:[n.jsx(_k,{asChild:!0,children:n.jsxs(Un,{size:"lg",children:[n.jsx(w0,{className:"size-8",children:n.jsx(N0,{className:"bg-[#00b4ff] text-black text-sm font-bold",children:e?.name?.charAt(0).toUpperCase()||"U"})}),n.jsxs("div",{className:"flex flex-col items-start text-left",children:[n.jsx("span",{className:"text-sm font-medium truncate text-white",children:e?.name||"User"}),n.jsx("span",{className:"text-xs text-[#94a3b8] truncate",children:e?.email})]})]})}),n.jsxs(Sk,{side:"top",align:"start",className:"w-[--radix-dropdown-menu-trigger-width] bg-[#111827] border-[#1e293b]",children:[n.jsx(yu,{asChild:!0,className:"text-white hover:bg-[#1e293b]",children:n.jsxs(ye,{to:"/settings",onClick:()=>r(!1),children:[n.jsx(qo,{className:"size-4"}),"Settings"]})}),n.jsx(Ck,{className:"bg-[#1e293b]"}),n.jsxs(yu,{onClick:()=>t(),className:"text-[#ef4444] focus:text-[#ef4444] focus:bg-[#ef4444]/10",children:[n.jsx(tf,{className:"size-4"}),"Sign out"]})]})]})})})})}function xF(){const{setOpenMobile:e}=Qr();return n.jsx(hi,{className:"border-b border-sidebar-border",children:n.jsx(ye,{to:"/",onClick:()=>e(!1),className:"flex items-center justify-center px-2 py-5",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"w-full h-auto drop-shadow-[0_0_12px_rgba(212,168,67,0.3)]"})})})}function gF(){return n.jsxs(di,{children:[n.jsx(xF,{}),n.jsx(mF,{}),n.jsx(pF,{})]})}function bF(){const t=new URLSearchParams(window.location.search).get("dev")==="1",r=ie(F.agencies.getMyAgency),a=te(F.agencies.devSetTier),[s,i]=y.useState(!1);if(!t||!r)return null;const o=[{value:"participating",label:"Participating Agency",color:"#00b4ff"},{value:"member",label:"Agency Member",color:"#d4a843"},{value:"platinum",label:"State-Level Featured",color:"#f5c842"}],c=async d=>{try{await a({tier:d}),W.success(`Switched to ${d} tier`),i(!1)}catch{W.error("Failed to change tier")}};return n.jsxs("div",{className:"fixed bottom-4 right-4 z-50",children:[s&&n.jsxs("div",{className:"mb-2 bg-[#111827] border border-[#1e293b] rounded-lg p-3 shadow-xl min-w-[200px]",children:[n.jsx("div",{className:"text-xs text-[#94a3b8] uppercase tracking-wider mb-2 font-semibold",children:"Dev: Switch Tier"}),o.map(d=>n.jsxs("button",{onClick:()=>
41c(d.value),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 ${r.tier===d.value?"bg-[#1e293b] text-white font-semibold":"text-[#94a3b8] hover:bg-[#1e293b]/50 hover:text-white"}`,children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:d.color}}),d.label,r.tier===d.value&&n.jsx("span",{className:"ml-auto text-xs text-[#00b4ff]",children:"Active"})]},d.value))]}),n.jsx("button",{onClick:()=>i(!s),className:"w-10 h-10 rounded-full bg-[#111827] border border-[#1e293b] flex items-center justify-center text-[#94a3b8] hover:text-[#00b4ff] hover:border-[#00b4ff]/30 transition-colors shadow-lg",title:"Dev: Toggle Tier",children:n.jsx(Q9,{className:"w-4 h-4"})})]})}function vF(){return gf(),n.jsxs(ci,{children:[n.jsx(gF,{}),n.jsxs(ui,{children:[n.jsx("header",{className:"flex h-12 items-center px-4 md:hidden",children:n.jsx(Xc,{})}),n.jsx("main",{className:"flex-1 p-4 lg:p-6",children:n.jsx(Yr,{})})]}),n.jsx(bF,{})]})}function yF(){return n.jsxs(ci,{children:[n.jsxs(di,{children:[n.jsx(hi,{className:"border-b border-sidebar-border",children:n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Je,{className:"size-8 rounded-lg"}),n.jsx(Je,{className:"h-5 w-16"})]})}),n.jsx(mi,{children:n.jsx("div",{className:"p-2",children:n.jsxs(On,{children:[n.jsx(ln,{children:n.jsx(ju,{showIcon:!0})}),n.jsx(ln,{children:n.jsx(ju,{showIcon:!0})})]})})}),n.jsx(fi,{className:"border-t border-sidebar-border",children:n.jsxs("div",{className:"flex items-center gap-3 p-2",children:[n.jsx(Je,{className:"size-8 rounded-full"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(Je,{className:"h-3.5 w-24"}),n.jsx(Je,{className:"h-3 w-32"})]})]})})]}),n.jsxs(ui,{children:[n.jsxs("header",{className:"flex h-14 items-center gap-2 border-b px-4",children:[n.jsx(Je,{className:"size-7 rounded-md"}),n.jsx("div",{className:"flex-1"})]}),n.jsxs("main",{className:"flex-1 p-4 lg:p-6 space-y-6",children:[n.jsx(Je,{className:"h-8 w-48"}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[n.jsx(Je,{className:"h-32 rounded-lg"}),n.jsx(Je,{className:"h-32 rounded-lg"}),n.jsx(Je,{className:"h-32 rounded-lg"})]})]})]})]})}function jF(){const{isAuthenticated:e,isLoading:t}=Vn();return t?n.jsx(yF,{}):e?n.jsx(Yr,{}):n.jsx(Mt,{to:"/login",replace:!0})}function wF({isAuthenticated:e,isLoading:t,showAuthActions:r}){const a=ai(),s=a.pathname==="/login"||a.pathname==="/signup";return a.pathname==="/"?null:n.jsx("header",{className:"sticky top-0 z-50 border-b border-[#1e293b] bg-[#0a0e17]/90 backdrop-blur-md",children:n.jsx("div",{className:"container",children:n.jsxs("div",{className:"flex h-16 items-center justify-between",children:[n.jsx(ye,{to:"/",className:"flex items-center gap-2.5 hover:opacity-80 transition-opacity",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"h-8 w-auto"})}),n.jsx("nav",{className:"flex items-center gap-2",children:!r||t?null:e?n.jsx(be,{size:"sm",asChild:!0,className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:n.jsxs(ye,{to:"/dashboard",children:["Dashboard",n.jsx(Bc,{className:"size-4"})]})}):!s&&n.jsxs(n.Fragment,{children:[n.jsx(be,{variant:"ghost",size:"sm",asChild:!0,className:"text-[#94a3b8] hover:text-white",children:n.jsx(ye,{to:"/login",children:"Sign In"})}),n.jsx(be,{size:"sm",asChild:!0,className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:n.jsx(ye,{to:"/signup",children:"Register Agency"})})]})})]})})})}function NF(){const{isAuthenticated:e,isLoading:t}=Vn();return n.jsx(wF,{isAuthenticated:e,isLoading:t,showAuthActions:!0})}function _F(){return n.jsxs("div",{className:"min-h-screen flex flex-col",children:[n.jsx(NF,{}),n.jsx("main",{className:"flex-1 flex flex-col",children:n.jsx(Yr,{})})]})}function SF(){return n.jsx("div",{className:"min-h-screen flex flex-col items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md",children:[n.jsx(Je,{className:"h-9 w-32 mx-auto mb-8"}),n.jsxs(Ki,{children:[n.jsxs(Nv,{children:[n.jsx(_v,{children:n.jsx(Je,{className:"h-6 w-32"})}),n.jsx(y9,{children:n.jsx(Je,{className:"h-4 w-48"})})]}),n.jsxs(Yi,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Je,{className:"h-4 w-12"}),n.jsx(Je,{className:"h-10 w-full"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Je,{className:"h-4 w-16"}),n.jsx(Je,{className:"h-10 w-full"})]}),n.jsx(Je,{className:"h-10 w-full"})]})]}),n.jsx(Je,{className:"h-4 w-48 mx-auto mt-4"})]})})}function CF(){const{isAuthenticated:e,isLoading:t}=Vn();return t?n.jsx(SF,{}):e?n.jsx(Mt,{to:"/dashboard",replace:!0}):n.jsx(Yr,{})}function AF(e){return!e.requestedAutoSignIn||e.isLoading?"none":e.isAuthenticated?"enter_app":!e.signInAvailable||e.hasRecentAttempt?"none":"start_sign_in"}function kF({requestedAutoSignIn:e=QI()}){const{signIn:t}=rs(),{isAuthenticated:r,isLoading:a}=Vn(),s=ar(),i=y.useRef(!1),[o,c]=y.useState(!1);return y.useEffect(()=>{const d=u=>{u.persisted&&(i.current=!1,c(!1))};return window.addEventListener("pageshow",d),()=>window.removeEventListener("pageshow",d)},[]),y.useEffect(()=>{if(i.current)return;const d=AF({requestedAutoSignIn:e,signInAvailable:u9(),isAuthenticated:r,isLoading:a,hasRecentAttempt:HI()});if(d!=="none"){if(i.current=!0,d==="enter_app"){s("/dashboard",{replace:!0});return}c(!0),VI(),t("viktor",{redirectTo:j0}).catch(()=>{c(!1)})}},[e,r,a,s,t]),o?n.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center gap-3 bg-background",children:[n.jsx(gt,{className:"size-6 animate-spin text-muted-foreground"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Signing you in..."})]}):null}const PF=new j9("https://benevolent-capybara-189.convex.cloud");function TF({children:e,enabled:t}){return t?n.jsx(w9,{client:PF,children:e}):n.jsx(n.Fragment,{children:e})}function OF(){const e=window.location.hostname;if(e.startsWith("veterans.")||e.startsWith("testveteran."))return"veteran";if(e.startsWith("agencies.")||e.startsWith("testagency."))return"agency";if(e.startsWith("admin."))return"admin";if(e.startsWith("academies."))return"academy";if(e.startsWith("education."))return"college";if(e.startsWith("business."))return"business";
41const r=new URLSearchParams(window.location.search).get("portal");return r&&EF(r)?r:"website"}function EF(e){return["website","veteran","agency","admin","academy","college","business"].includes(e)}function MF(){const e=OF(),{isAuthenticated:t,isLoading:r}=Vn();return e==="agency"?r?null:t?n.jsx(Mt,{to:"/dashboard",replace:!0}):n.jsx(Mt,{to:"/login",replace:!0}):e==="veteran"?r?null:t?n.jsx(Mt,{to:"/vet/dashboard",replace:!0}):n.jsx(Mt,{to:"/vet/login",replace:!0}):e==="admin"?r?null:t?n.jsx(Mt,{to:"/admin",replace:!0}):n.jsx(Mt,{to:"/admin/login",replace:!0}):n.jsx(N9,{})}function LF(){return n.jsxs("section",{className:"relative overflow-hidden min-h-[90vh] flex items-center",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#0a0e17] via-[#0d1a2e] to-[#0a0e17]"}),n.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"linear-gradient(#00b4ff 1px, transparent 1px), linear-gradient(90deg, #00b4ff 1px, transparent 1px)",backgroundSize:"60px 60px"}}),n.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#00b4ff] rounded-full opacity-[0.06] blur-[120px]"}),n.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-80 h-80 bg-[#00b4ff] rounded-full opacity-[0.04] blur-[100px]"}),n.jsx("div",{className:"relative container mx-auto px-4 py-20",children:n.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[n.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full border border-[#00b4ff30] bg-[#00b4ff08] mb-8",children:[n.jsx(Be,{className:"w-4 h-4 text-[#00b4ff]"}),n.jsx("span",{className:"text-sm text-[#00b4ff] font-medium tracking-wide",children:"AGENCY DASHBOARD"})]}),n.jsx("div",{className:"mb-8",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"h-16 mx-auto"})}),n.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-bold mb-6 leading-tight",children:[n.jsx("span",{className:"text-white",children:"Your Agency."})," ",n.jsx("span",{className:"neon-text",children:"Connected."})]}),n.jsx("p",{className:"text-lg sm:text-xl text-[#94a3b8] max-w-2xl mx-auto mb-10 leading-relaxed",children:"Manage your agency profile, post career opportunities, and connect with qualified veterans seeking law enforcement careers across the nation."}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[n.jsx(ye,{to:"/signup",children:n.jsxs(be,{size:"lg",className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold px-8 py-6 text-lg neon-glow-md transition-all duration-300 hover:shadow-[0_0_30px_#00b4ff40]",children:["Register Your Agency",n.jsx(Bc,{className:"ml-2 w-5 h-5"})]})}),n.jsx(ye,{to:"/login",children:n.jsxs(be,{variant:"outline",size:"lg",className:"border-[#00b4ff40] text-[#00b4ff] hover:bg-[#00b4ff10] px-8 py-6 text-lg",children:["Sign In",n.jsx(Ya,{className:"ml-2 w-5 h-5"})]})})]})]})})]})}function IF(){const e=ie(F.agencies.getStats);return n.jsx("section",{className:"border-y border-[#1e293b] bg-[#0d1117]",children:n.jsx("div",{className:"container mx-auto px-4 py-10",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-8 text-center",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-3xl sm:text-4xl font-bold neon-text mb-1",children:e?.totalAgencies??"..."}),n.jsx("div",{className:"text-[#94a3b8] text-sm tracking-wider uppercase",children:"Participating Agencies"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-3xl sm:text-4xl font-bold text-[#d4a843] mb-1",style:{textShadow:"0 0 10px #d4a84340"},children:e?.stateCount??"..."}),n.jsx("div",{className:"text-[#94a3b8] text-sm tracking-wider uppercase",children:"States Represented"})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-3xl sm:text-4xl font-bold neon-text mb-1",children:"18,000+"}),n.jsx("div",{className:"text-[#94a3b8] text-sm tracking-wider uppercase",children:"US Law Enforcement Agencies"})]})]})})})}const RF=[{name:"Participating Agency",price:"Free",period:"",description:"Get your agency featured on VET-TO-LEO and connect with veteran candidates at no cost.",features:["Agency logo on national directory","Agency logo on state directory","Basic agency profile","Analytics dashboard","Veteran visibility"],cta:"Get Started Free",highlight:!1,icon:Rt}
41,{name:"Agency Member",price:"$299",originalPrice:"$598",period:"/year",badge:"50% OFF",description:"Full agency profile, job postings, and direct access to veteran candidates.",features:["Everything in Participating","Up to 3 active job postings","Veteran lead pipeline","Enhanced agency profile","Priority directory listing","Campaign analytics"],cta:"Become a Member",highlight:!0,icon:Nn},{name:"Annual Job Posting",price:"$129",period:"/year per listing",description:"Individual 12-month job listing for non-members or additional posts beyond the 3 included.",features:["12-month active listing","Direct veteran visibility","Job description integration","Application link support","Social media promotion"],cta:"Post a Job",highlight:!1,icon:ht}];function DF(){return n.jsx("section",{className:"py-20 bg-[#0a0e17]",children:n.jsxs("div",{className:"container mx-auto px-4",children:[n.jsxs("div",{className:"text-center mb-14",children:[n.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-white mb-4",children:"Choose Your Plan"}),n.jsx("p",{className:"text-[#94a3b8] max-w-xl mx-auto",children:"From free participation to full agency membership, find the right fit for your recruiting needs."}),n.jsx("div",{className:"mt-4 inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-[#d4a843]/10 border border-[#d4a843]/30",children:n.jsx("span",{className:"text-[#d4a843] text-sm font-medium",children:"Use code AGENCY50 for 50% off Agency Membership"})})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 max-w-5xl mx-auto",children:RF.map(e=>n.jsxs("div",{className:`relative rounded-xl p-6 flex flex-col ${e.highlight?"neon-border-bright bg-[#0d1a2e]":"border border-[#1e293b] bg-[#111827]"}`,children:[e.badge&&n.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-[#d4a843] text-black text-xs font-bold",children:e.badge}),n.jsxs("div",{className:"mb-4",children:[n.jsx(e.icon,{className:`w-8 h-8 mb-3 ${e.highlight?"text-[#00b4ff]":"text-[#94a3b8]"}`}),n.jsx("h3",{className:"text-xl font-bold text-white",children:e.name})]}),n.jsx("div",{className:"mb-4",children:n.jsxs("div",{className:"flex items-baseline gap-2",children:[e.originalPrice&&n.jsx("span",{className:"text-lg text-[#94a3b8] line-through",children:e.originalPrice}),n.jsx("span",{className:`text-4xl font-bold ${e.highlight?"neon-text":"text-white"}`,children:e.price}),e.period&&n.jsx("span",{className:"text-[#94a3b8] text-sm",children:e.period})]})}),n.jsx("p",{className:"text-[#94a3b8] text-sm mb-6",children:e.description}),n.jsx("ul",{className:"space-y-3 mb-8 flex-1",children:e.features.map(t=>n.jsxs("li",{className:"flex items-start gap-2.5",children:[n.jsx(Uc,{className:`w-4 h-4 mt-0.5 shrink-0 ${e.highlight?"text-[#00b4ff]":"text-[#22c55e]"}`}),n.jsx("span",{className:"text-sm text-[#cbd5e1]",children:t})]},t))}),n.jsx(ye,{to:"/signup",children:n.jsx(be,{className:`w-full ${e.highlight?"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold neon-glow-sm":"bg-[#1e293b] hover:bg-[#2d3a4d] text-white border border-[#2d3a4d]"}`,children:e.cta})})]},e.name))})]})})}const $F=[{icon:Rt,title:"Agency Profile",desc:"Showcase your agency with a professional profile visible to veterans nationwide."},{icon:ht,title:"Job Postings",desc:"Post and manage career opportunities directly from your dashboard."},{icon:Fr,title:"Analytics",desc:"Track profile views, job clicks, and veteran engagement in real time."},{icon:en,title:"Veteran Leads",desc:"Receive qualified veteran candidates who are interested in your agency."},{icon:wt,title:"Military Base Map",desc:"Interactive map to target recruitment campaigns at military installations."},{icon:Pn,title:"Nationwide Reach",desc:"Your agency is visible to veterans stationed around the world."}];function FF(){return n.jsx("section",{className:"py-20 bg-[#0d1117] border-t border-[#1e293b]",children:n.jsxs("div",{className:"container mx-auto px-4",children:[n.jsxs("div",{className:"text-center mb-14",children:[n.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-white mb-4",children:"Built for Law Enforcement Recruiting"}),n.jsx("p",{className:"text-[#94a3b8] max-w-xl mx-auto",children:"Everything your agency needs to attract, connect with, and hire qualified veterans."})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-5xl mx-auto",children:$F.map(e=>n.jsxs("div",{className:"group p-6 rounded-xl bg-[#111827] border border-[#1e293b] hover:border-[#00b4ff30] transition-all duration-300 hover:shadow-[0_0_20px_#00b4ff10]",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#00b4ff10] flex items-center justify-center mb-4 group-hover:bg-[#00b4ff15] transition-colors",children:n.jsx(e.icon,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:e.title}),n.jsx("p",{className:"text-[#94a3b8] text-sm leading-relaxed",children:e.desc})]},e.title))})]})})}function BF(){return n.jsx("section",{className:"py-20 bg-[#0a0e17] border-t border-[#1e293b]",children:n.jsx("div",{className:"container mx-auto px-4",children:n.jsx("div",{className:"max-w-3xl mx-auto text-center",children:n.jsxs("div",{className:"p-10 rounded-2xl neon-border bg-gradient-to-br from-[#111827] to-[#0d1a2e] animate-pulse-neon",children:[n.jsx("h2",{className:"text-3xl sm:text-4xl font-bold text-white mb-4",children:"Ready to Connect With Veterans?"}
41),n.jsx("p",{className:"text-[#94a3b8] mb-8 max-w-lg mx-auto",children:"Join the nation's leading veteran-to-law-enforcement platform. Registration is free and takes less than 5 minutes."}),n.jsx(ye,{to:"/signup",children:n.jsxs(be,{size:"lg",className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold px-10 py-6 text-lg neon-glow-md",children:["Register Your Agency",n.jsx(Bc,{className:"ml-2 w-5 h-5"})]})})]})})})})}function UF(){return n.jsx("footer",{className:"border-t border-[#1e293b] bg-[#0d1117] py-10",children:n.jsx("div",{className:"container mx-auto px-4",children:n.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"h-8"})}),n.jsxs("div",{className:"text-[#94a3b8] text-sm",children:["VET-TO-LEO © ",new Date().getFullYear()," All Rights Reserved.",n.jsx("span",{className:"mx-2",children:"|"}),"372 South Eagle Road #219, Eagle, ID 83616"]})]})})})}function zF(){return n.jsxs("div",{className:"min-h-screen bg-[#0a0e17]",children:[n.jsx(LF,{}),n.jsx(IF,{}),n.jsx(FF,{}),n.jsx(DF,{}),n.jsx(BF,{}),n.jsx(UF,{})]})}const sp={email:"[email protected]",password:"Ymo4rfZ_7rracUFruKR9lS5U_FpkHXBD",name:"Test Agent"};function Qk(){const{signIn:e}=rs(),t=te(F.agencies.setupTestAgency),r=ar(),[a,s]=y.useState(!1),[i,o]=y.useState("");if(!(window.location.hostname.startsWith("preview-")||window.location.hostname.startsWith("testagency.")))return null;const d=async()=>{o(""),s(!0);const u=new FormData;u.set("email",sp.email),u.set("password",sp.password),u.set("flow","signIn");try{await e("test",u)}catch{u.set("flow","signUp"),u.set("name",sp.name);try{await e("test",u)}catch{o("Failed to sign in as test user. Please try again."),s(!1);return}}try{await t({})}catch{}r("/"),s(!1)};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rounded-xl border-2 border-dashed border-warning/30 bg-warning/5 p-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"size-9 rounded-lg bg-warning flex items-center justify-center shrink-0",children:n.jsx(_9,{className:"size-4 text-warning-foreground"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"font-medium text-sm",children:"Preview Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Sign in instantly to explore the agency dashboard"})]})]}),n.jsxs(be,{onClick:d,disabled:a,className:"w-full mt-3 bg-warning text-warning-foreground hover:bg-warning/90",children:[a&&n.jsx(gt,{className:"size-4 animate-spin"}),a?"Signing in...":"Continue as Demo Agency"]}),i&&n.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-lg px-3 py-2 mt-3",children:i})]}),n.jsxs("div",{className:"relative py-4",children:[n.jsx(Zh,{}),n.jsx("span",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-background px-3 text-xs text-muted-foreground",children:"or continue with email"})]})]})}const on="#00b4ff",WF=[{name:"Jonathan",photo:"/referrals/jonathan.jpg",credentials:"Doctorate Degree, Purple Heart Recipient, POST Certified",tag:"Referred to:",agency:"Ada County Sheriffâs Office",agencyLogo:"/referrals/acso-icon.png"},{name:"Garrett",photo:"/referrals/garrett.jpg",credentials:"Certified Drug Recognition Expert",tag:"Referred to:",agency:"Ada County Sheriffâs Office",agencyLogo:"/referrals/acso-icon.png"},{name:"Jorge",photo:"/referrals/jorge.jpg",credentials:"POST Certified, SWAT",tag:"",agency:"Resume Assistance",agencyLogo:"/referrals/vtl-badge.png"}],qF=[{value:"18K+",label:"Agencies in the US"},{value:"200K+",label:"Veterans Transitioning"},{value:"19%",label:"Of LEOs Are Veterans"}],VF=[{icon:en,title:"Pre-Screened Candidates:",desc:"Veterans with military discipline, leadership skills, and a service mindset ready for law enforcement careers."},{icon:RC,title:"Agency Dashboard:",desc:"Post jobs, manage applications, track recruiter performance, and communicate directly with candidates."},{icon:wL,title:"Free Tier Available:",desc:"Get started at no cost. Post jobs and connect with veterans immediately. Upgrade when you're ready to scale."}];function HF(){return n.jsxs("div",{className:"rounded-2xl p-6 relative overflow-hidden",style:{background:"linear-gradient(135deg, #0a1e3d, #051530)",border:`1px solid ${on}20`},children:[n.jsx("div",{className:"absolute pointer-events-none",style:{to
41p:-1,left:"50%",transform:"translateX(-50%)",width:"40%",height:2,background:`linear-gradient(90deg, transparent, ${on}, transparent)`,borderRadius:2}}),n.jsx("div",{className:"absolute pointer-events-none",style:{bottom:-1,left:"50%",transform:"translateX(-50%)",width:"40%",height:2,background:`linear-gradient(90deg, transparent, ${on}, transparent)`,borderRadius:2}}),n.jsx("div",{className:"absolute pointer-events-none",style:{inset:0,borderRadius:"inherit",overflow:"hidden",zIndex:0},children:n.jsx("div",{className:"absolute",style:{inset:0,backgroundImage:"radial-gradient(circle, rgba(0,180,255,0.35) 1px, transparent 1px)",backgroundSize:"24px 24px",maskImage:"radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%)",WebkitMaskImage:"radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 70%)"}})}),n.jsxs("div",{className:"relative",style:{zIndex:1},children:[n.jsx("h3",{className:"text-lg font-bold mb-1",style:{color:on},children:"Successful Veteran Referrals"}),n.jsx("p",{className:"text-xs text-gray-500 mb-5",children:"Veterans connected through VET-TO-LEO"}),n.jsx("div",{className:"flex flex-col gap-3",children:WF.map((e,t)=>n.jsxs("div",{className:"rounded-xl px-4 py-4",style:{background:"rgba(17,24,39,0.7)",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("img",{src:e.photo,alt:e.name,className:"w-[52px] h-[52px] rounded-full flex-shrink-0 object-cover",style:{border:`2px solid ${on}30`}}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-semibold",children:e.name}),n.jsx("div",{className:"text-[11px] text-gray-400 leading-tight mt-0.5",children:e.credentials})]})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-3 pt-3",style:{borderTop:"1px solid rgba(30,41,59,0.8)"},children:[n.jsx("img",{src:e.agencyLogo,alt:e.agency,className:"w-8 h-8 rounded-full object-cover flex-shrink-0"}),n.jsxs("div",{children:[e.tag&&n.jsx("div",{className:"text-[10px] font-medium",style:{color:"#64748b"},children:e.tag}),n.jsx("div",{className:"text-[12px] font-semibold",style:{color:"#94a3b8"},children:e.agency})]})]})]},t))})]})]})}function GF(){const e=Yh(),{isAuthenticated:t,isLoading:r}=Vn(),a=ar();if(!r&&t)return a("/",{replace:!0}),null;const s=()=>{a("/",{replace:!0})};return n.jsx("div",{className:"flex flex-col overflow-x-hidden",style:{background:"#060a13",minHeight:"100vh"},children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2",style:{minHeight:"100vh"},children:[n.jsxs("div",{className:"relative px-8 py-12 lg:px-16 lg:py-16 flex flex-col justify-center items-center overflow-hidden",style:{background:"linear-gradient(135deg, #0a0e17 0%, #0f1729 50%, #0a1628 100%)"},children:[n.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 pointer-events-none",style:{background:"radial-gradient(circle, rgba(0,180,255,0.05) 0%, transparent 70%)"}}),n.jsx("div",{className:"absolute bottom-0 left-0 w-72 h-72 pointer-events-none",style:{background:"radial-gradient(circle, rgba(0,180,255,0.03) 0%, transparent 70%)"}}),n.jsxs("div",{className:"relative w-full max-w-lg mx-auto",children:[n.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full px-4 py-1.5 mb-5",style:{background:`${on}0a`,border:`1px solid ${on}25`},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:on}}),n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-[1.5px]",style:{color:on},children:"For Law Enforcement Agencies"})]}),n.jsxs("h1",{className:"text-3xl lg:text-[36px] font-extrabold leading-[1.2] mb-4",children:["Recruit"," ",n.jsx("span",{style:{color:on},children:"Military Veterans"})," ","Ready to Serve"]}),n.jsx("p",{className:"text-base leading-relaxed mb-8",style:{color:"#94a3b8"},children:"VET-TO-LEO connects your agency directly with disciplined, trained veterans transitioning into law enforcement. Fill your ranks with candidates who already understand service."}),n.jsx("div",{className:"rounded-2xl overflow-hidden mb-8 aspect-video",style:{border:`1px solid ${on}18`},children:n.jsx("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/WejgtihItKQ?rel=0&modestbranding=1",title:"VET-TO-LEO for Agencies",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full"})}),n.jsx("div",{className:"grid grid-cols-3 gap-3 mb-8",children:qF.map(i=>n.jsxs("div",{className:"text-center rounded-xl py-4 px-3",style:{background:"rgba(17,24,39,0.6)",border:"1px solid #1e293b"},children:[n.jsx("div",{className:"text-2xl font-extrabold mb-1",style:{color:on},children:i.value}),n.jsx("div",{className:"text-[11px] text-gray-500 uppercase tracking-[0.5px]",children:i.label})]},i.label))}),n.jsx("div",{className:"flex flex-col gap-4 mb-8",children:VF.map(i=>n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex-shrink-0 flex items-center justify-center mt-0.5",style:{background:`${on}10`,border:`1px solid ${on}18`},children:n.jsx(i.icon,{className:"w-3.5 h-3.5",style:{color:on}})}),n.jsxs("p",{className:"text-sm text-gray-300 leading-relaxed",children:[n.jsx("strong",{className:"text-white font-semibold",children:i.title})," ",i.desc]})]},i.title))}),n.jsx(HF,{})]})]}),n.jsxs("div",{className:"flex items-center justify-center px-8 py-12 lg:px-12 relative",style:{background:"#0a0e17",borderLeft:"1px solid #1e293b"},children:[n.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(0,180,255,0.03) 0%, transparent 70%)"}}),n.jsxs("div",{className:"w-full max-w-sm relative z-10 space-y-6",children:[n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("img",{src:"/vettoleo-logo.png",alt:"
41VET-TO-LEO",className:"mx-auto h-14 w-auto mb-4"}),n.jsx("h2",{className:"text-2xl font-bold tracking-tight text-white",children:"Agency Sign In"}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:"Access your recruiting dashboard"})]}),n.jsx(Qk,{}),e&&n.jsx(g0,{onAuthenticated:s}),e&&n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsx("span",{className:"text-[11px] uppercase tracking-wider",style:{color:"#475569"},children:"New to VET-TO-LEO?"}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}})]}),e&&n.jsx(be,{variant:"outline",className:"w-full h-11",style:{border:`1px solid ${on}30`,color:on,background:"transparent",borderRadius:"10px",fontSize:"13px",fontWeight:600},asChild:!0,children:n.jsx(ye,{to:"/signup",children:"Register Your Agency â"})}),n.jsx("div",{className:"flex justify-center gap-5 pt-2",children:[{label:"Web Application Firewall Enabled"},{label:"256 Bit Encryption"},{label:"Cloudflare Security"}].map(i=>n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",style:{color:"#64748b"},children:[n.jsx(Be,{className:"w-3 h-3",style:{color:"#22c55e"}}),i.label]},i.label))}),n.jsx("div",{className:"flex justify-center pt-1",children:n.jsx("img",{src:"/cloudflare-badge.png",alt:"Protected by Cloudflare",className:"h-8 w-auto opacity-70"})})]})]})]})})}function KF(){const e=Yh();return n.jsxs("div",{className:"flex-1 flex items-center justify-center p-4 relative",children:[n.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden",children:[n.jsx("div",{className:"absolute top-0 right-1/4 size-96 rounded-full bg-[#00b4ff]/5 blur-[120px]"}),n.jsx("div",{className:"absolute bottom-0 left-1/4 size-96 rounded-full bg-[#00b4ff]/3 blur-[100px]"})]}),n.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[n.jsxs("div",{className:"text-center space-y-2",children:[n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"mx-auto h-12 w-auto mb-4"}),n.jsx("h1",{className:"text-2xl font-bold tracking-tight text-white",children:"Register Your Agency"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Create your agency account on VET-TO-LEO"})]}),n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-lg bg-[#00b4ff]/5 border border-[#00b4ff]/15",children:[n.jsx(zC,{className:"w-4 h-4 text-[#00b4ff] mt-0.5 shrink-0"}),n.jsx("p",{className:"text-xs text-[#94a3b8]",children:"Agency accounts require an official agency email address. Personal emails (Gmail, Yahoo, Outlook, etc.) are not accepted."})]}),n.jsx(Qk,{}),e&&n.jsx(DC,{}),e&&n.jsxs("p",{className:"text-center text-sm text-[#94a3b8]",children:["Already have an account?"," ",n.jsx(be,{variant:"link",className:"p-0 h-auto font-medium text-[#00b4ff]",asChild:!0,children:n.jsx(ye,{to:"/login",children:"Sign in"})})]})]})]})}function bf({feature:e,description:t}){return n.jsx("div",{className:"dot-grid-backdrop",children:n.jsxs("div",{className:"relative rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center space-y-5 overflow-hidden",children:[n.jsx("div",{className:"dot-grid-layer"}),n.jsxs("div",{className:"relative z-10 space-y-5",children:[n.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-[#d4a843]/10 flex items-center justify-center",children:n.jsx(qc,{className:"w-8 h-8 text-[#d4a843]"})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:e}),n.jsx("p",{className:"text-[#94a3b8] max-w-md mx-auto",children:t})]}),n.jsxs("div",{className:"gold-glow-card p-4 max-w-sm mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[n.jsx(It,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] font-semibold text-sm",children:"LIMITED TIME OFFER"})]}),n.jsxs("p",{className:"text-white font-bold text-lg",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-sm mr-1",children:"$598"}),"$299/year"]}),n.jsx("p",{className:"text-[#94a3b8] text-xs mt-1",children:"Use code AGENCY50 at checkout for 50% off"})]}),n.jsx(ye,{to:"/subscription",children:n.jsxs("button",{className:"btn-gold-outline-pill inline-flex items-center gap-2",children:[n.jsx(It,{className:"w-4 h-4"}),"Become an Agency Member"]})})]})]})})}function eP(e,t){const r=y.useRef(t);y.useEffect(function(){t!==r.current&&e.attributionControl!=null&&(r.current!=null&&e.attributionControl.removeAttribution(r.current),t!=null&&e.attributionControl.addAttribution(t)),r.current=t},[e,t])}function YF(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radiu
41s!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const ZF=1;function XF(e){return Object.freeze({__version:ZF,map:e})}function JF(e,t){return Object.freeze({...e,...t})}const t1=y.createContext(null);function vf(){const e=y.use(t1);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function QF(e){function t(r,a){const{instance:s,context:i}=e(r).current;y.useImperativeHandle(a,()=>s);const{children:o}=r;return o==null?null:q.createElement(t1,{value:i},o)}return y.forwardRef(t)}function eB(e){function t(r,a){const[s,i]=y.useState(!1),{instance:o}=e(r,i).current;y.useImperativeHandle(a,()=>o),y.useEffect(function(){s&&o.update()},[o,s,r.children]);const c=o._contentNode;return c?Rc.createPortal(r.children,c):null}return y.forwardRef(t)}function tB(e){function t(r,a){const{instance:s}=e(r).current;return y.useImperativeHandle(a,()=>s),null}return y.forwardRef(t)}function n1(e,t){const r=y.useRef(void 0);y.useEffect(function(){return t!=null&&e.instance.on(t),r.current=t,function(){r.current!=null&&e.instance.off(r.current),r.current=null}},[e,t])}function yf(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function nB(e,t){return function(a,s){const i=vf(),o=e(yf(a,i),i);return eP(i.map,a.attribution),n1(o.current,a.eventHandlers),t(o.current,i,a,s),o}}var Ml={exports:{}};var rB=Ml.exports,oN;function aB(){return oN||(oN=1,(function(e,t){(function(r,a){a(t)})(rB,(function(r){var a="1.9.4";function s(l){var f,v,k,T;for(v=1,k=arguments.length;v<k;v++){T=arguments[v];for(f in T)l[f]=T[f]}return l}var i=Object.create||(function(){function l(){}return function(f){return l.prototype=f,new l}})();function o(l,f){var v=Array.prototype.slice;if(l.bind)return l.bind.apply(l,v.call(arguments,1));var k=v.call(arguments,2);return function(){return l.apply(f,k.length?k.concat(v.call(arguments)):arguments)}}var c=0;function d(l){return"_leaflet_id"in l||(l._leaflet_id=++c),l._leaflet_id}function u(l,f,v){var k,T,I,V;return V=function(){k=!1,T&&(I.apply(v,T),T=!1)},I=function(){k?T=arguments:(l.apply(v,arguments),setTimeout(V,f),k=!0)},I}function h(l,f,v){var k=f[1],T=f[0],I=k-T;return l===k&&v?l:((l-T)%I+I)%I+T}function m(){return!1}function p(l,f){if(f===!1)return l;var v=Math.pow(10,f===void 0?6:f);return Math.round(l*v)/v}function b(l){return l.trim?l.trim():l.replace(/^\s+|\s+$/g,"")}function w(l){return b(l).split(/\s+/)}function x(l,f){Object.prototype.hasOwnProperty.call(l,"options")||(l.options=l.options?i(l.options):{});for(var v in f)l.options[v]=f[v];return l.options}function g(l,f,v){var k=[];for(var T in l)k.push(encodeURIComponent(v?T.toUpperCase():T)+"="+encodeURIComponent(l[T]));return(!f||f.indexOf("?")===-1?"?":"&")+k.join("&")}var j=/\{ *([\w_ -]+) *\}/g;function S(l,f){return l.replace(j,function(v,k){var T=f[k];if(T===void 0)throw new Error("No value provided for variable "+v);return typeof T=="function"&&(T=T(f)),T})}var _=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"};function N(l,f){for(var v=0;v<l.length;v++)if(l[v]===f)return v;return-1}var C="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function A(l){return window["webkit"+l]||window["moz"+l]||window["ms"+l]}var P=0;function O(l){var f=+new Date,v=Math.max(0,16-(f-P));return P=f+v,window.setTimeout(l,v)}var E=window.requestAnimationFrame||A("RequestAnimationFrame")||O,$=window.cancelAnimationFrame||A("CancelAnimationFrame")||A("CancelRequestAnimationFrame")||function(l){window.clearTimeout(l)};function M(l,f,v){if(v&&E===O)l.call(f);else return E.call(window,o(l,f))}function R(l){l&&$.call(window,l)}var B={__proto__:null,extend:s,create:i,bind:o,get lastId(){return c},stamp:d,throttle:u,wrapNum:h,falseFn:m,formatNum:p,trim:b,splitWords:w,setOptions:x,getParamString:g,template:S,isArray:_,indexOf:N,emptyImageUrl:C,requestFn:E,cancelFn:$,requestAnimFrame:M,cancelAnimFrame:R};function D(){}D.extend=function(l){var f=function(){x(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},v=f.__super__=this.prototype,k=i(v);k.constructor=f,f.prototype=k;for(var T in this)Object.prototype.hasOwnProperty.call(this,T)&&T!=="prototype"&&T!=="__super__"&&(f[T]=this[T]);return l.statics&&s(f,l.statics),l.includes&&(U(l.includes),s.apply(null,[k].concat(l.includes))),s(k,l),delete k.statics,delete k.includes,k.options&&(k.options=v.options?i(v.options):{},s(k.options,l.options)),k._initHooks=[],k.callInitHooks=function(){if(!this._initHooksCalled){v.callInitHooks&&v.callInitHooks.call(this),this._initHooksCalled=!0;for(var I=0,V=k._initHooks.length;I<V;I++)k._initHooks[I].call(this)}},f},D.include=function(l){var f=this.prototype.options;return s(this.prototype,l),l.options&&(this.prototype.options=f,this.mergeOptions(l.options)),this},D.mergeOptions=function(l){return s(this.prototype.options,l),this},D.addInitHook=function(l){var f=Array.prototype.slice.call(arguments,1
41),v=typeof l=="function"?l:function(){this[l].apply(this,f)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(v),this};function U(l){if(!(typeof L>"u"||!L||!L.Mixin)){l=_(l)?l:[l];for(var f=0;f<l.length;f++)l[f]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var H={on:function(l,f,v){if(typeof l=="object")for(var k in l)this._on(k,l[k],f);else{l=w(l);for(var T=0,I=l.length;T<I;T++)this._on(l[T],f,v)}return this},off:function(l,f,v){if(!arguments.length)delete this._events;else if(typeof l=="object")for(var k in l)this._off(k,l[k],f);else{l=w(l);for(var T=arguments.length===1,I=0,V=l.length;I<V;I++)T?this._off(l[I]):this._off(l[I],f,v)}return this},_on:function(l,f,v,k){if(typeof f!="function"){console.warn("wrong listener type: "+typeof f);return}if(this._listens(l,f,v)===!1){v===this&&(v=void 0);var T={fn:f,ctx:v};k&&(T.once=!0),this._events=this._events||{},this._events[l]=this._events[l]||[],this._events[l].push(T)}},_off:function(l,f,v){var k,T,I;if(this._events&&(k=this._events[l],!!k)){if(arguments.length===1){if(this._firingCount)for(T=0,I=k.length;T<I;T++)k[T].fn=m;delete this._events[l];return}if(typeof f!="function"){console.warn("wrong listener type: "+typeof f);return}var V=this._listens(l,f,v);if(V!==!1){var Z=k[V];this._firingCount&&(Z.fn=m,this._events[l]=k=k.slice()),k.splice(V,1)}}},fire:function(l,f,v){if(!this.listens(l,v))return this;var k=s({},f,{type:l,target:this,sourceTarget:f&&f.sourceTarget||this});if(this._events){var T=this._events[l];if(T){this._firingCount=this._firingCount+1||1;for(var I=0,V=T.length;I<V;I++){var Z=T[I],ne=Z.fn;Z.once&&this.off(l,ne,Z.ctx),ne.call(Z.ctx||this,k)}this._firingCount--}}return v&&this._propagateEvent(k),this},listens:function(l,f,v,k){typeof l!="string"&&console.warn('"string" type argument expected');var T=f;typeof f!="function"&&(k=!!f,T=void 0,v=void 0);var I=this._events&&this._events[l];if(I&&I.length&&this._listens(l,T,v)!==!1)return!0;if(k){for(var V in this._eventParents)if(this._eventParents[V].listens(l,f,v,k))return!0}return!1},_listens:function(l,f,v){if(!this._events)return!1;var k=this._events[l]||[];if(!f)return!!k.length;v===this&&(v=void 0);for(var T=0,I=k.length;T<I;T++)if(k[T].fn===f&&k[T].ctx===v)return T;return!1},once:function(l,f,v){if(typeof l=="object")for(var k in l)this._on(k,l[k],f,!0);else{l=w(l);for(var T=0,I=l.length;T<I;T++)this._on(l[T],f,v,!0)}return this},addEventParent:function(l){return this._eventParents=this._eventParents||{},this._eventParents[d(l)]=l,this},removeEventParent:function(l){return this._eventParents&&delete this._eventParents[d(l)],this},_propagateEvent:function(l){for(var f in this._eventParents)this._eventParents[f].fire(l.type,s({layer:l.target,propagatedFrom:l.target},l),!0)}};H.addEventListener=H.on,H.removeEventListener=H.clearAllEventListeners=H.off,H.addOneTimeEventListener=H.once,H.fireEvent=H.fire,H.hasEventListeners=H.listens;var K=D.extend(H);function z(l,f,v){this.x=v?Math.round(l):l,this.y=v?Math.round(f):f}var X=Math.trunc||function(l){return l>0?Math.floor(l):Math.ceil(l)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(l){return this.clone()._add(G(l))},_add:function(l){return this.x+=l.x,this.y+=l.y,this},subtract:function(l){return this.clone()._subtract(G(l))},_subtract:function(l){return this.x-=l.x,this.y-=l.y,this},divideBy:function(l){return this.clone()._divideBy(l)},_divideBy:function(l){return this.x/=l,this.y/=l,this},multiplyBy:function(l){return this.clone()._multiplyBy(l)},_multiplyBy:function(l){return this.x*=l,this.y*=l,this},scaleBy:function(l){return new z(this.x*l.x,this.y*l.y)},unscaleBy:function(l){return new z(this.x/l.x,this.y/l.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=X(this.x),this.y=X(this.y),this},distanceTo:function(l){l=G(l);var f=l.x-this.x,v=l.y-this.y;return Math.sqrt(f*f+v*v)},equals:function(l){return l=G(l),l.x===this.x&&l.y===this.y},contains:function(l){return l=G(l),Math.abs(l.x)<=Math.abs(this.x)&&Math.abs(l.
41y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function G(l,f,v){return l instanceof z?l:_(l)?new z(l[0],l[1]):l==null?l:typeof l=="object"&&"x"in l&&"y"in l?new z(l.x,l.y):new z(l,f,v)}function Q(l,f){if(l)for(var v=f?[l,f]:l,k=0,T=v.length;k<T;k++)this.extend(v[k])}Q.prototype={extend:function(l){var f,v;if(!l)return this;if(l instanceof z||typeof l[0]=="number"||"x"in l)f=v=G(l);else if(l=re(l),f=l.min,v=l.max,!f||!v)return this;return!this.min&&!this.max?(this.min=f.clone(),this.max=v.clone()):(this.min.x=Math.min(f.x,this.min.x),this.max.x=Math.max(v.x,this.max.x),this.min.y=Math.min(f.y,this.min.y),this.max.y=Math.max(v.y,this.max.y)),this},getCenter:function(l){return G((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,l)},getBottomLeft:function(){return G(this.min.x,this.max.y)},getTopRight:function(){return G(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(l){var f,v;return typeof l[0]=="number"||l instanceof z?l=G(l):l=re(l),l instanceof Q?(f=l.min,v=l.max):f=v=l,f.x>=this.min.x&&v.x<=this.max.x&&f.y>=this.min.y&&v.y<=this.max.y},intersects:function(l){l=re(l);var f=this.min,v=this.max,k=l.min,T=l.max,I=T.x>=f.x&&k.x<=v.x,V=T.y>=f.y&&k.y<=v.y;return I&&V},overlaps:function(l){l=re(l);var f=this.min,v=this.max,k=l.min,T=l.max,I=T.x>f.x&&k.x<v.x,V=T.y>f.y&&k.y<v.y;return I&&V},isValid:function(){return!!(this.min&&this.max)},pad:function(l){var f=this.min,v=this.max,k=Math.abs(f.x-v.x)*l,T=Math.abs(f.y-v.y)*l;return re(G(f.x-k,f.y-T),G(v.x+k,v.y+T))},equals:function(l){return l?(l=re(l),this.min.equals(l.getTopLeft())&&this.max.equals(l.getBottomRight())):!1}};function re(l,f){return!l||l instanceof Q?l:new Q(l,f)}function ce(l,f){if(l)for(var v=f?[l,f]:l,k=0,T=v.length;k<T;k++)this.extend(v[k])}ce.prototype={extend:function(l){var f=this._southWest,v=this._northEast,k,T;if(l instanceof me)k=l,T=l;else if(l instanceof ce){if(k=l._southWest,T=l._northEast,!k||!T)return this}else return l?this.extend(pe(l)||fe(l)):this;return!f&&!v?(this._southWest=new me(k.lat,k.lng),this._northEast=new me(T.lat,T.lng)):(f.lat=Math.min(k.lat,f.lat),f.lng=Math.min(k.lng,f.lng),v.lat=Math.max(T.lat,v.lat),v.lng=Math.max(T.lng,v.lng)),this},pad:function(l){var f=this._southWest,v=this._northEast,k=Math.abs(f.lat-v.lat)*l,T=Math.abs(f.lng-v.lng)*l;return new ce(new me(f.lat-k,f.lng-T),new me(v.lat+k,v.lng+T))},getCenter:function(){return new me((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new me(this.getNorth(),this.getWest())},getSouthEast:function(){return new me(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(l){typeof l[0]=="number"||l instanceof me||"lat"in l?l=pe(l):l=fe(l);var f=this._southWest,v=this._northEast,k,T;
41return l instanceof ce?(k=l.getSouthWest(),T=l.getNorthEast()):k=T=l,k.lat>=f.lat&&T.lat<=v.lat&&k.lng>=f.lng&&T.lng<=v.lng},intersects:function(l){l=fe(l);var f=this._southWest,v=this._northEast,k=l.getSouthWest(),T=l.getNorthEast(),I=T.lat>=f.lat&&k.lat<=v.lat,V=T.lng>=f.lng&&k.lng<=v.lng;return I&&V},overlaps:function(l){l=fe(l);var f=this._southWest,v=this._northEast,k=l.getSouthWest(),T=l.getNorthEast(),I=T.lat>f.lat&&k.lat<v.lat,V=T.lng>f.lng&&k.lng<v.lng;return I&&V},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(l,f){return l?(l=fe(l),this._southWest.equals(l.getSouthWest(),f)&&this._northEast.equals(l.getNorthEast(),f)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function fe(l,f){return l instanceof ce?l:new ce(l,f)}function me(l,f,v){if(isNaN(l)||isNaN(f))throw new Error("Invalid LatLng object: ("+l+", "+f+")");this.lat=+l,this.lng=+f,v!==void 0&&(this.alt=+v)}me.prototype={equals:function(l,f){if(!l)return!1;l=pe(l);var v=Math.max(Math.abs(this.lat-l.lat),Math.abs(this.lng-l.lng));return v<=(f===void 0?1e-9:f)},toString:function(l){return"LatLng("+p(this.lat,l)+", "+p(this.lng,l)+")"},distanceTo:function(l){return J.distance(this,pe(l))},wrap:function(){return J.wrapLatLng(this)},toBounds:function(l){var f=180*l/40075017,v=f/Math.cos(Math.PI/180*this.lat);return fe([this.lat-f,this.lng-v],[this.lat+f,this.lng+v])},clone:function(){return new me(this.lat,this.lng,this.alt)}};function pe(l,f,v){return l instanceof me?l:_(l)&&typeof l[0]!="object"?l.length===3?new me(l[0],l[1],l[2]):l.length===2?new me(l[0],l[1]):null:l==null?l:typeof l=="object"&&"lat"in l?new me(l.lat,"lng"in l?l.lng:l.lon,l.alt):f===void 0?null:new me(l,f,v)}var Re={latLngToPoint:function(l,f){var v=this.projection.project(l),k=this.scale(f);return this.transformation._transform(v,k)},pointToLatLng:function(l,f){var v=this.scale(f),k=this.transformation.untransform(l,v);return this.projection.unproject(k)},project:function(l){return this.projection.project(l)},unproject:function(l){return this.projection.unproject(l)},scale:function(l){return 256*Math.pow(2,l)},zoom:function(l){return Math.log(l/256)/Math.LN2},getProjectedBounds:function(l){if(this.infinite)return null;var f=this.projection.bounds,v=this.scale(l),k=this.transformation.transform(f.min,v),T=this.transformation.transform(f.max,v);return new Q(k,T)},infinite:!1,wrapLatLng:function(l){var f=this.wrapLng?h(l.lng,this.wrapLng,!0):l.lng,v=this.wrapLat?h(l.lat,this.wrapLat,!0):l.lat,k=l.alt;return new me(v,f,k)},wrapLatLngBounds:function(l){var f=l.getCenter(),v=this.wrapLatLng(f),k=f.lat-v.lat,T=f.lng-v.lng;if(k===0&&T===0)return l;
41var I=l.getSouthWest(),V=l.getNorthEast(),Z=new me(I.lat-k,I.lng-T),ne=new me(V.lat-k,V.lng-T);return new ce(Z,ne)}},J=s({},Re,{wrapLng:[-180,180],R:6371e3,distance:function(l,f){var v=Math.PI/180,k=l.lat*v,T=f.lat*v,I=Math.sin((f.lat-l.lat)*v/2),V=Math.sin((f.lng-l.lng)*v/2),Z=I*I+Math.cos(k)*Math.cos(T)*V*V,ne=2*Math.atan2(Math.sqrt(Z),Math.sqrt(1-Z));return this.R*ne}}),ae=6378137,ue={R:ae,MAX_LATITUDE:85.0511287798,project:function(l){var f=Math.PI/180,v=this.MAX_LATITUDE,k=Math.max(Math.min(v,l.lat),-v),T=Math.sin(k*f);return new z(this.R*l.lng*f,this.R*Math.log((1+T)/(1-T))/2)},unproject:function(l){var f=180/Math.PI;return new me((2*Math.atan(Math.exp(l.y/this.R))-Math.PI/2)*f,l.x*f/this.R)},bounds:(function(){var l=ae*Math.PI;return new Q([-l,-l],[l,l])})()};function ee(l,f,v,k){if(_(l)){this._a=l[0],this._b=l[1],this._c=l[2],this._d=l[3];return}this._a=l,this._b=f,this._c=v,this._d=k}ee.prototype={transform:function(l,f){return this._transform(l.clone(),f)},_transform:function(l,f){return f=f||1,l.x=f*(this._a*l.x+this._b),l.y=f*(this._c*l.y+this._d),l},untransform:function(l,f){return f=f||1,new z((l.x/f-this._b)/this._a,(l.y/f-this._d)/this._c)}};function Y(l,f,v,k){return new ee(l,f,v,k)}var je=s({},J,{code:"EPSG:3857",projection:ue,transformation:(function(){var l=.5/(Math.PI*ue.R);return Y(l,.5,-l,.5)})()}),ke=s({},je,{code:"EPSG:900913"});function Le(l){return document.createElementNS("http://www.w3.org/2000/svg",l)}function Ge(l,f){var v="",k,T,I,V,Z,ne;for(k=0,I=l.length;k<I;k++){for(Z=l[k],T=0,V=Z.length;T<V;T++)ne=Z[T],v+=(T?"L":"M")+ne.x+" "+ne.y;v+=f?_e.svg?"z":"x":""}return v||"M0 0"}var at=document.documentElement.style,ot="ActiveXObject"in window,le=ot&&!document.addEventListener,Ne="msLaunchUri"in navigator&&!("documentMode"in document),qe=Pr("webkit"),dn=Pr("android"),kr=Pr("android 2")||Pr("android 3"),id=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),od=dn&&Pr("Google")&&id<537&&!("AudioNode"in window),hm=!!window.opera,Cj=!Ne&&Pr("chrome"),Aj=Pr("gecko")&&!qe&&!hm&&!ot,VM=!Cj&&Pr("safari"),kj=Pr("phantom"),Pj="OTransition"in at,HM=navigator.platform.indexOf("Win")===0,Tj=ot&&"transition"in at,fm="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!kr,Oj="MozPerspective"in at,GM=!window.L_DISABLE_3D&&(Tj||fm||Oj)&&!Pj&&!kj,ol=typeof orientation<"u"||Pr("mobile"),KM=ol&&qe,YM=ol&&fm,Ej=!window.PointerEvent&&window.MSPointerEvent,Mj=!!(window.PointerEvent||Ej),Lj="ontouchstart"in window||!!window.TouchEvent,ZM=!window.L_NO_TOUCH&&(Lj||Mj),XM=ol&&hm,JM=ol&&Aj,QM=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,e8=(function(){var l=!1;try{var f=Object.defineProperty({},"passive",{get:function(){l=!0}});window.addEventListener("testPassiveEventSupport",m,f),window.removeEventListener("testPassiveEventSupport",m,f)}catch{}return l})(),t8=(function(){return!!document.createElement("canvas").getContext})(),mm=!!(document.createElementNS&&Le("svg").createSVGRect),n8=!!mm&&(function(){var l=document.createElement("div");return l.innerHTML="<svg/>",(l.firstChild&&l.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),r8=!mm&&(function(){try{var l=document.createElement("div");l.innerHTML='<v:shape adj="1"/>';var f=l.firstChild;return f.style.behavior="url(#default#VML)",f&&typeof f.adj=="object"}catch{return!1}})(),a8=navigator.platform.indexOf("Mac")===0,s8=navigator.platform.indexOf("Linux")===0;function Pr(l){return navigator.userAgent.toLowerCase().indexOf(l)>=0}var _e={ie:ot,ielt9:le,edge:Ne,webkit:qe,android:dn,android23:kr,androidStock:od,opera:hm,chrome:Cj,gecko:Aj,safari:VM,phantom:kj,opera12:Pj,win:HM,ie3d:Tj,webkit3d:fm,gecko3d:Oj,any3d:GM,mobile:ol,mobileWebkit:KM,mobileWebkit3d:YM,msPointer:Ej,pointer:Mj,touch:ZM,touchNative:Lj,mobileOpera:XM,mobileGecko:JM,retina:QM,passiveEvents:e8,canvas:t8,svg:mm,vml:r8,inlineSvg:n8,mac:a8,linux:s8},Ij=_e.msPointer?"MSPointerDown":"pointerdown",Rj=_e.msPointer?"MSPointerMove":"pointermove",Dj=_e.msPointer?"MSPointerUp":"pointerup",$j=_e.msPointer?"MSPointerCancel":"pointercancel",pm={touchstart:Ij,touchmove:Rj,touchend:Dj,touchcancel:$j},Fj={touchstart:u8,touchmove:ld,touchend:ld,touchcancel:ld},_i={},Bj=!1;function i8(l,f,v){return f==="touchstart"&&d8(),Fj[f]?(v=Fj[f].bind(this,v),l.addEventListener(pm[f],v,!1),v):(console.warn("wrong event specified:",f),m)}function o8(l,f,v){if(!pm[f]){console.warn("wrong event specified:",f);return}l.removeEventListener(pm[f],v,!1)}function l8(l){_i[l.pointerId]=l}function c8(l){_i[l.pointerId]&&(_i[l.pointerId]=l)}function Uj(l){delete _i[l.pointerId]}function d8(){Bj||(document.addEventListener(Ij,l8,!0),document.addEventListener(Rj,c8,!0),document.addEventListener(
41Dj,Uj,!0),document.addEventListener($j,Uj,!0),Bj=!0)}function ld(l,f){if(f.pointerType!==(f.MSPOINTER_TYPE_MOUSE||"mouse")){f.touches=[];for(var v in _i)f.touches.push(_i[v]);f.changedTouches=[f],l(f)}}function u8(l,f){f.MSPOINTER_TYPE_TOUCH&&f.pointerType===f.MSPOINTER_TYPE_TOUCH&&an(f),ld(l,f)}function h8(l){var f={},v,k;for(k in l)v=l[k],f[k]=v&&v.bind?v.bind(l):v;return l=f,f.type="dblclick",f.detail=2,f.isTrusted=!1,f._simulated=!0,f}var f8=200;function m8(l,f){l.addEventListener("dblclick",f);var v=0,k;function T(I){if(I.detail!==1){k=I.detail;return}if(!(I.pointerType==="mouse"||I.sourceCapabilities&&!I.sourceCapabilities.firesTouchEvents)){var V=Hj(I);if(!(V.some(function(ne){return ne instanceof HTMLLabelElement&&ne.attributes.for})&&!V.some(function(ne){return ne instanceof HTMLInputElement||ne instanceof HTMLSelectElement}))){var Z=Date.now();Z-v<=f8?(k++,k===2&&f(h8(I))):k=1,v=Z}}}return l.addEventListener("click",T),{dblclick:f,simDblclick:T}}function p8(l,f){l.removeEventListener("dblclick",f.dblclick),l.removeEventListener("click",f.simDblclick)}var xm=ud(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ll=ud(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),zj=ll==="webkitTransition"||ll==="OTransition"?ll+"End":"transitionend";function Wj(l){return typeof l=="string"?document.getElementById(l):l}function cl(l,f){var v=l.style[f]||l.currentStyle&&l.currentStyle[f];if((!v||v==="auto")&&document.defaultView){var k=document.defaultView.getComputedStyle(l,null);v=k?k[f]:null}return v==="auto"?null:v}function Xe(l,f,v){var k=document.createElement(l);return k.className=f||"",v&&v.appendChild(k),k}function jt(l){var f=l.parentNode;f&&f.removeChild(l)}function cd(l){for(;l.firstChild;)l.removeChild(l.firstChild)}function Si(l){var f=l.parentNode;f&&f.lastChild!==l&&f.appendChild(l)}function Ci(l){var f=l.parentNode;f&&f.firstChild!==l&&f.insertBefore(l,f.firstChild)}function gm(l,f){if(l.classList!==void 0)return l.classList.contains(f);var v=dd(l);return v.length>0&&new RegExp("(^|\\s)"+f+"(\\s|$)").test(v)}function Fe(l,f){if(l.classList!==void 0)for(var v=w(f),k=0,T=v.length;k<T;k++)l.classList.add(v[k]);else if(!gm(l,f)){var I=dd(l);bm(l,(I?I+" ":"")+f)}}function _t(l,f){l.classList!==void 0?l.classList.remove(f):bm(l,b((" "+dd(l)+" ").replace(" "+f+" "," ")))}function bm(l,f){l.className.baseVal===void 0?l.className=f:l.className.baseVal=f}function dd(l){return l.correspondingElement&&(l=l.correspondingElement),l.className.baseVal===void 0?l.className:l.className.baseVal}function Hn(l,f){"opacity"in l.style?l.style.opacity=f:"filter"in l.style&&x8(l,f)}function x8(l,f){var v=!1,k="DXImageTransform.Microsoft.Alpha";try{v=l.filters.item(k)}catch{if(f===1)return}f=Math.round(f*100),v?(v.Enabled=f!==100,v.Opacity=f):l.style.filter+=" progid:"+k+"(opacity="+f+")"}function ud(l){for(var f=document.documentElement.style,v=0;v<l.length;v++)if(l[v]in f)return l[v];return!1}function fs(l,f,v){var k=f||new z(0,0);l.style[xm]=(_e.ie3d?"translate("+k.x+"px,"+k.y+"px)":"translate3d("+k.x+"px,"+k.y+"px,0)")+(v?" scale("+v+")":"")}function kt(l,f){l._leaflet_pos=f,_e.any3d?fs(l,f):(l.style.left=f.x+"px",l.style.top=f.y+"px")}function ms(l){return l._leaflet_pos||new z(0,0)}var dl,ul,vm;if("onselectstart"in document)dl=function(){De(window,"selectstart",an)},ul=function(){ct(window,"selectstart",an)};else{var hl=ud(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);dl=function(){if(hl){var l=document.documentElement.style;vm=l[hl],l[hl]="none"}},ul=function(){hl&&(document.documentElement.style[hl]=vm,vm=void 0)}}function ym(){De(window,"dragstart",an)}function jm(){ct(window,"dragstart",an)}var hd,wm;function Nm(l){for(;l.tabIndex===-1;)l=l.parentNode;l.style&&(fd(),hd=l,wm=l.style.outlineStyle,l.style.outlineStyle="none",De(window,"keydown",fd))}function fd(){hd&&(hd.style.outlineStyle=wm,hd=void 0,wm=void 0,ct(window,"keydown",fd))}function qj(l){do l=l.parentNode;while((!l.offsetWidth||!l.offsetHeight)&&l!==document.body);return l}function _m(l){var f=l.getBoundingClientRect();return{x:f.width/l.offsetWidth||1,y:f.height/l.offsetHeight||1,boundingClientRect:f}}var g8={__proto__:null,TRANSFORM:xm,TRANSITION:ll,TRANSITION_END:zj,get:Wj,getStyle:cl,create:Xe,remove:jt,empty:cd,toFront:Si,toBack:Ci,hasClass:gm,addClass:Fe,removeClass:_t,setClass:bm,getClass:dd,setOpacity:Hn,testProp:ud,setTransform:fs,setPosition:kt,getPosition:ms,get disableTextSelection(){return dl},get enableTextSelection(){return ul},disableImageDrag:ym,enableImageDrag:jm,preventOutline:Nm,restoreOutline:fd,get
41SizedParentNode:qj,getScale:_m};function De(l,f,v,k){if(f&&typeof f=="object")for(var T in f)Cm(l,T,f[T],v);else{f=w(f);for(var I=0,V=f.length;I<V;I++)Cm(l,f[I],v,k)}return this}var Tr="_leaflet_events";function ct(l,f,v,k){if(arguments.length===1)Vj(l),delete l[Tr];else if(f&&typeof f=="object")for(var T in f)Am(l,T,f[T],v);else if(f=w(f),arguments.length===2)Vj(l,function(Z){return N(f,Z)!==-1});else for(var I=0,V=f.length;I<V;I++)Am(l,f[I],v,k);return this}function Vj(l,f){for(var v in l[Tr]){var k=v.split(/\d/)[0];(!f||f(k))&&Am(l,k,null,null,v)}}var Sm={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Cm(l,f,v,k){var T=f+d(v)+(k?"_"+d(k):"");if(l[Tr]&&l[Tr][T])return this;var I=function(Z){return v.call(k||l,Z||window.event)},V=I;!_e.touchNative&&_e.pointer&&f.indexOf("touch")===0?I=i8(l,f,I):_e.touch&&f==="dblclick"?I=m8(l,I):"addEventListener"in l?f==="touchstart"||f==="touchmove"||f==="wheel"||f==="mousewheel"?l.addEventListener(Sm[f]||f,I,_e.passiveEvents?{passive:!1}:!1):f==="mouseenter"||f==="mouseleave"?(I=function(Z){Z=Z||window.event,Pm(l,Z)&&V(Z)},l.addEventListener(Sm[f],I,!1)):l.addEventListener(f,V,!1):l.attachEvent("on"+f,I),l[Tr]=l[Tr]||{},l[Tr][T]=I}function Am(l,f,v,k,T){T=T||f+d(v)+(k?"_"+d(k):"");var I=l[Tr]&&l[Tr][T];if(!I)return this;!_e.touchNative&&_e.pointer&&f.indexOf("touch")===0?o8(l,f,I):_e.touch&&f==="dblclick"?p8(l,I):"removeEventListener"in l?l.removeEventListener(Sm[f]||f,I,!1):l.detachEvent("on"+f,I),l[Tr][T]=null}function ps(l){return l.stopPropagation?l.stopPropagation():l.originalEvent?l.originalEvent._stopped=!0:l.cancelBubble=!0,this}function km(l){return Cm(l,"wheel",ps),this}function fl(l){return De(l,"mousedown touchstart dblclick contextmenu",ps),l._leaflet_disable_click=!0,this}function an(l){return l.preventDefault?l.preventDefault():l.returnValue=!1,this}function xs(l){return an(l),ps(l),this}function Hj(l){if(l.composedPath)return l.composedPath();for(var f=[],v=l.target;v;)f.push(v),v=v.parentNode;return f}function Gj(l,f){if(!f)return new z(l.clientX,l.clientY);var v=_m(f),k=v.boundingClientRect;return new z((l.clientX-k.left)/v.x-f.clientLeft,(l.clientY-k.top)/v.y-f.clientTop)}var b8=_e.linux&&_e.chrome?window.devicePixelRatio:_e.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Kj(l){return _e.edge?l.wheelDeltaY/2:l.deltaY&&l.deltaMode===0?-l.deltaY/b8:l.deltaY&&l.deltaMode===1?-l.deltaY*20:l.deltaY&&l.deltaMode===2?-l.deltaY*60:l.deltaX||l.deltaZ?0:l.wheelDelta?(l.wheelDeltaY||l.wheelDelta)/2:l.detail&&Math.abs(l.detail)<32765?-l.detail*20:l.detail?l.detail/-32765*60:0}function Pm(l,f){var v=f.relatedTarget;if(!v)return!0;try{for(;v&&v!==l;)v=v.parentNode}catch{return!1}return v!==l}var v8={__proto__:null,on:De,off:ct,stopPropagation:ps,disableScrollPropagation:km,disableClickPropagation:fl,preventDefault:an,stop:xs,getPropagationPath:Hj,getMousePosition:Gj,getWheelDelta:Kj,isExternalTarget:Pm,addListener:De,removeListener:ct},Yj=K.extend({run:function(l,f,v,k){this.stop(),this._el=l,this._inProgress=!0,this._duration=v||.25,this._easeOutPower=1/Math.max(k||.5,.2),this._startPos=ms(l),this._offset=f.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(l){var f=+new Date-this._startTime,v=this._duration*1e3;f<v?this._runFrame(this._easeOut(f/v),l):(this._runFrame(1),this._complete())},_runFrame:function(l,f){var v=this._startPos.add(this._offset.multiplyBy(l));f&&v._round(),kt(this._el,v),this.fire("step")},_complete:function(){R(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(l){return 1-Math.pow(1-l,this._easeOutPower)}}),Ve=K.extend({options:{crs:je,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(l,f){f=x(this,f),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(l),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),f.maxBounds&&this.setMaxBounds(f.maxBounds),f.zoom!==void 0&&(this._zoom=this._limitZoom(f.zoom)),f.center&&f.zoom!==void 0&&this.setView(pe(f.center),f.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ll&&_e.any3d&&!_e.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),De(this._proxy,zj,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
41,setView:function(l,f,v){if(f=f===void 0?this._zoom:this._limitZoom(f),l=this._limitCenter(pe(l),f,this.options.maxBounds),v=v||{},this._stop(),this._loaded&&!v.reset&&v!==!0){v.animate!==void 0&&(v.zoom=s({animate:v.animate},v.zoom),v.pan=s({animate:v.animate,duration:v.duration},v.pan));var k=this._zoom!==f?this._tryAnimatedZoom&&this._tryAnimatedZoom(l,f,v.zoom):this._tryAnimatedPan(l,v.pan);if(k)return clearTimeout(this._sizeTimer),this}return this._resetView(l,f,v.pan&&v.pan.noMoveStart),this},setZoom:function(l,f){return this._loaded?this.setView(this.getCenter(),l,{zoom:f}):(this._zoom=l,this)},zoomIn:function(l,f){return l=l||(_e.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+l,f)},zoomOut:function(l,f){return l=l||(_e.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-l,f)},setZoomAround:function(l,f,v){var k=this.getZoomScale(f),T=this.getSize().divideBy(2),I=l instanceof z?l:this.latLngToContainerPoint(l),V=I.subtract(T).multiplyBy(1-1/k),Z=this.containerPointToLatLng(T.add(V));return this.setView(Z,f,{zoom:v})},_getBoundsCenterZoom:function(l,f){f=f||{},l=l.getBounds?l.getBounds():fe(l);var v=G(f.paddingTopLeft||f.padding||[0,0]),k=G(f.paddingBottomRight||f.padding||[0,0]),T=this.getBoundsZoom(l,!1,v.add(k));if(T=typeof f.maxZoom=="number"?Math.min(f.maxZoom,T):T,T===1/0)return{center:l.getCenter(),zoom:T};
41var I=k.subtract(v).divideBy(2),V=this.project(l.getSouthWest(),T),Z=this.project(l.getNorthEast(),T),ne=this.unproject(V.add(Z).divideBy(2).add(I),T);return{center:ne,zoom:T}},fitBounds:function(l,f){if(l=fe(l),!l.isValid())throw new Error("Bounds are not valid.");var v=this._getBoundsCenterZoom(l,f);return this.setView(v.center,v.zoom,f)},fitWorld:function(l){return this.fitBounds([[-90,-180],[90,180]],l)},panTo:function(l,f){return this.setView(l,this._zoom,{pan:f})},panBy:function(l,f){if(l=G(l).round(),f=f||{},!l.x&&!l.y)return this.fire("moveend");if(f.animate!==!0&&!this.getSize().contains(l))return this._resetView(this.unproject(this.project(this.getCenter()).add(l)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Yj,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),f.noMoveStart||this.fire("movestart"),f.animate!==!1){Fe(this._mapPane,"leaflet-pan-anim");var v=this._getMapPanePos().subtract(l).round();this._panAnim.run(this._mapPane,v,f.duration||.25,f.easeLinearity)}else this._rawPanBy(l),this.fire("move").fire("moveend");return this},flyTo:function(l,f,v){if(v=v||{},v.animate===!1||!_e.any3d)return this.setView(l,f,v);this._stop();var k=this.project(this.getCenter()),T=this.project(l),I=this.getSize(),V=this._zoom;l=pe(l),f=f===void 0?V:f;var Z=Math.max(I.x,I.y),ne=Z*this.getZoomScale(V,f),oe=T.distanceTo(k)||1,ge=1.42,Te=ge*ge;function Ue(Pt){var Sd=Pt?-1:1,o9=Pt?ne:Z,l9=ne*ne-Z*Z+Sd*Te*Te*oe*oe,c9=2*o9*Te*oe,Bm=l9/c9,Pw=Math.sqrt(Bm*Bm+1)-Bm,d9=Pw<1e-9?-18:Math.log(Pw);return d9}function bn(Pt){return(Math.exp(Pt)-Math.exp(-Pt))/2}function Ht(Pt){return(Math.exp(Pt)+Math.exp(-Pt))/2}function Kn(Pt){return bn(Pt)/Ht(Pt)}var Cn=Ue(0);function Ei(Pt){return Z*(Ht(Cn)/Ht(Cn+ge*Pt))}function r9(Pt){return Z*(Ht(Cn)*Kn(Cn+ge*Pt)-bn(Cn))/Te}function a9(Pt){return 1-Math.pow(1-Pt,1.5)}var s9=Date.now(),Aw=(Ue(1)-Cn)/ge,i9=v.duration?1e3*v.duration:1e3*Aw*.8;function kw(){var Pt=(Date.now()-s9)/i9,Sd=a9(Pt)*Aw;Pt<=1?(this._flyToFrame=M(kw,this),this._move(this.unproject(k.add(T.subtract(k).multiplyBy(r9(Sd)/oe)),V),this.getScaleZoom(Z/Ei(Sd),V),{flyTo:!0})):this._move(l,f)._moveEnd(!0)}return this._moveStart(!0,v.noMoveStart),kw.call(this),this},flyToBounds:function(l,f){var v=this._getBoundsCenterZoom(l,f);return this.flyTo(v.center,v.zoom,f)},setMaxBounds:function(l){return l=fe(l),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),l.isValid()?(this.options.maxBounds=l,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(l){var f=this.options.minZoom;return this.options.minZoom=l,this._loaded&&f!==l&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(l):this},setMaxZoom:function(l){var f=this.options.maxZoom;return this.options.maxZoom=l,this._loaded&&f!==l&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(l):this},panInsideBounds:function(l,f){this._enforcingBounds=!0;var v=this.getCenter(),k=this._limitCenter(v,this._zoom,fe(l));return v.equals(k)||this.panTo(k,f),this._enforcingBounds=!1,this},panInside:function(l,f){f=f||{};var v=G(f.paddingTopLeft||f.padding||[0,0]),k=G(f.paddingBottomRight||f.padding||[0,0]),T=this.project(this.getCenter()),I=this.project(l),V=this.getPixelBounds(),Z=re([V.min.add(v),V.max.subtract(k)]),ne=Z.getSize();if(!Z.contains(I)){this._enforcingBounds=!0;var oe=I.subtract(Z.getCenter()),ge=Z.extend(I).getSize().subtract(ne);T.x+=oe.x<0?-ge.x:ge.x,T.y+=oe.y<0?-ge.y:ge.y,this.panTo(this.unproject(T),f),this._enforcingBounds=!1}return this},invalidateSize:function(l){if(!this._loaded)return this;l=s({animate:!1,pan:!0},l===!0?{animate:!0}:l);var f=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var v=this.getSize(),k=f.divideBy(2).round(),T=v.divideBy(2).round(),I=k.subtract(T);return!I.x&&!I.y?this:(l.animate&&l.pan?this.panBy(I):(l.pan&&this._rawPanBy(I),this.fire("move"),l.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:f,newSize:v}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(l){if(l=this._locateOptions=s({timeout:1e4,watch:!1},l),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var f=o(this._handleGeolocationResponse,this),v=o(this._handleGeolocationError,this);return l.watch?this._locationWatchId=navigator.geolocation.watchPosition(f,v,l):navigator.geolocation.getCurrentPosition(f,v,l),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(l){if(this._container._leaflet_id){var f=l.code,v=l.message||(f===1?"permission denied":f===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:f,message:"Geolocation error: "+v+"."})}},_handleGeolocationResponse:function(l){if(this._container._leaflet_id){var f=l.coords.latitude,v=l.coords.longitude,k=new me(f,v),T=k.toBounds(l.coords.accuracy*2),I=this._locateOptions;
41if(I.setView){var V=this.getBoundsZoom(T);this.setView(k,I.maxZoom?Math.min(V,I.maxZoom):V)}var Z={latlng:k,bounds:T,timestamp:l.timestamp};for(var ne in l.coords)typeof l.coords[ne]=="number"&&(Z[ne]=l.coords[ne]);this.fire("locationfound",Z)}},addHandler:function(l,f){if(!f)return this;var v=this[l]=new f(this);return this._handlers.push(v),this.options[l]&&v.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),jt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(R(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var l;for(l in this._layers)this._layers[l].remove();for(l in this._panes)jt(this._panes[l]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(l,f){var v="leaflet-pane"+(l?" leaflet-"+l.replace("Pane","")+"-pane":""),k=Xe("div",v,f||this._mapPane);return l&&(this._panes[l]=k),k},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var l=this.getPixelBounds(),f=this.unproject(l.getBottomLeft()),v=this.unproject(l.getTopRight());return new ce(f,v)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(l,f,v){l=fe(l),v=G(v||[0,0]);var k=this.getZoom()||0,T=this.getMinZoom(),I=this.getMaxZoom(),V=l.getNorthWest(),Z=l.getSouthEast(),ne=this.getSize().subtract(v),oe=re(this.project(Z,k),this.project(V,k)).getSize(),ge=_e.any3d?this.options.zoomSnap:1,Te=ne.x/oe.x,Ue=ne.y/oe.y,bn=f?Math.max(Te,Ue):Math.min(Te,Ue);return k=this.getScaleZoom(bn,k),ge&&(k=Math.round(k/(ge/100))*(ge/100),k=f?Math.ceil(k/ge)*ge:Math.floor(k/ge)*ge),Math.max(T,Math.min(I,k))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(l,f){var v=this._getTopLeftPoint(l,f);return new Q(v,v.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(l){return this.options.crs.getProjectedBounds(l===void 0?this.getZoom():l)},getPane:function(l){return typeof l=="string"?this._panes[l]:l},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(l,f){var v=this.options.crs;return f=f===void 0?this._zoom:f,v.scale(l)/v.scale(f)},getScaleZoom:function(l,f){var v=this.options.crs;f=f===void 0?this._zoom:f;var k=v.zoom(l*v.scale(f));return isNaN(k)?1/0:k},project:function(l,f){return f=f===void 0?this._zoom:f,this.options.crs.latLngToPoint(pe(l),f)},unproject:function(l,f){return f=f===void 0?this._zoom:f,this.options.crs.pointToLatLng(G(l),f)},layerPointToLatLng:function(l){var f=G(l).add(this.getPixelOrigin());return this.unproject(f)},latLngToLayerPoint:function(l){var f=this.project(pe(l))._round();return f._subtract(this.getPixelOrigin())},wrapLatLng:function(l){return this.options.crs.wrapLatLng(pe(l))},wrapLatLngBounds:function(l){return this.options.crs.wrapLatLngBounds(fe(l))},distance:function(l,f){return this.options.crs.distance(pe(l),pe(f))},containerPointToLayerPoint:function(l){return G(l).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(l){return G(l).add(this._getMapPanePos())},containerPointToLatLng:function(l){var f=this.containerPointToLayerPoint(G(l));return this.layerPointToLatLng(f)},latLngToContainerPoint:function(l){return this.layerPointToContainerPoint(this.latLngToLayerPoint(pe(l)))},mouseEventToContainerPoint:function(l){return Gj(l,this._container)},mouseEventToLayerPoint:function(l){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(l))},mouseEventToLatLng:function(l){return this.layerPointToLatLng(this.mouseEventToLayerPoint(l))},_initContainer:function(l){var f=this._container=Wj(l);if(f){if(f._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");De(f,"scroll",this._onScroll,this),this._containerId=d(f)},_initLayout:function(){var l=this._container;this._fadeAnimated=this.options.fadeAnimation&&_e.any3d,Fe(l,"leaflet-container"+(_e.touch?" leaflet-touch":"")+(_e.retina?" leaflet-retina":"")+(_e.ielt9?" leaflet-oldie":"")+(_e.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var f=cl(l,"position");f!=="absolute"&&f!=="relative"&&f!=="fixed"&&f!=="sticky"&&(l.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var l=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),kt(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Fe(l.markerPane,"leaflet-zoom-hide"),Fe(l.shadowPane,"leaflet-zoom-hide"))},_resetView:function(l,f,v){kt(this._mapPane,new z(0,0));var k=!this._loaded;this._loaded=!0,f=this._limitZoom(f),this.fire("viewprereset");var T=this._zoom!==f;this._moveStart(T,v)._move(l,f)._moveEnd(T),this.fire("viewreset"),k&&this.fire("load")},_moveStart:function(l,f){return l&&this.fire("zoomstart"),f||this.fire("movestart"),this}
41,_move:function(l,f,v,k){f===void 0&&(f=this._zoom);var T=this._zoom!==f;return this._zoom=f,this._lastCenter=l,this._pixelOrigin=this._getNewPixelOrigin(l),k?v&&v.pinch&&this.fire("zoom",v):((T||v&&v.pinch)&&this.fire("zoom",v),this.fire("move",v)),this},_moveEnd:function(l){return l&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return R(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(l){kt(this._mapPane,this._getMapPanePos().subtract(l))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(l){this._targets={},this._targets[d(this._container)]=this;var f=l?ct:De;f(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&f(window,"resize",this._onResize,this),_e.any3d&&this.options.transform3DLimit&&(l?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){R(this._resizeRequest),this._resizeRequest=M(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var l=this._getMapPanePos();Math.max(Math.abs(l.x),Math.abs(l.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(l,f){for(var v=[],k,T=f==="mouseout"||f==="mouseover",I=l.target||l.srcElement,V=!1;I;){if(k=this._targets[d(I)],k&&(f==="click"||f==="preclick")&&this._draggableMoved(k)){V=!0;break}if(k&&k.listens(f,!0)&&(T&&!Pm(I,l)||(v.push(k),T))||I===this._container)break;I=I.parentNode}return!v.length&&!V&&!T&&this.listens(f,!0)&&(v=[this]),v},_isClickDisabled:function(l){for(;l&&l!==this._container;){if(l._leaflet_disable_click)return!0;l=l.parentNode}},_handleDOMEvent:function(l){var f=l.target||l.srcElement;if(!(!this._loaded||f._leaflet_disable_events||l.type==="click"&&this._isClickDisabled(f))){var v=l.type;v==="mousedown"&&Nm(f),this._fireDOMEvent(l,v)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(l,f,v){if(l.type==="click"){var k=s({},l);k.type="preclick",this._fireDOMEvent(k,k.type,v)}var T=this._findEventTargets(l,f);if(v){for(var I=[],V=0;V<v.length;V++)v[V].listens(f,!0)&&I.push(v[V]);T=I.concat(T)}if(T.length){f==="contextmenu"&&an(l);var Z=T[0],ne={originalEvent:l};if(l.type!=="keypress"&&l.type!=="keydown"&&l.type!=="keyup"){var oe=Z.getLatLng&&(!Z._radius||Z._radius<=10);ne.containerPoint=oe?this.latLngToContainerPoint(Z.getLatLng()):this.mouseEventToContainerPoint(l),ne.layerPoint=this.containerPointToLayerPoint(ne.containerPoint),ne.latlng=oe?Z.getLatLng():this.layerPointToLatLng(ne.layerPoint)}for(V=0;V<T.length;V++)if(T[V].fire(f,ne,!0),ne.originalEvent._stopped||T[V].options.bubblingMouseEvents===!1&&N(this._mouseEvents,f)!==-1)return}},_draggableMoved:function(l){return l=l.dragging&&l.dragging.enabled()?l:this,l.dragging&&l.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var l=0,f=this._handlers.length;l<f;l++)this._handlers[l].disable()},whenReady:function(l,f){return this._loaded?l.call(f||this,{target:this}):this.on("load",l,f),this},_getMapPanePos:function(){return ms(this._mapPane)||new z(0,0)},_moved:function(){var l=this._getMapPanePos();return l&&!l.equals([0,0])},_getTopLeftPoint:function(l,f){var v=l&&f!==void 0?this._getNewPixelOrigin(l,f):this.getPixelOrigin();return v.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(l,f){var v=this.getSize()._divideBy(2);return this.project(l,f)._subtract(v)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(l,f,v){var k=this._getNewPixelOrigin(v,f);return this.project(l,f)._subtract(k)},_latLngBoundsToNewLayerBounds:function(l,f,v){var k=this._getNewPixelOrigin(v,f);
41return re([this.project(l.getSouthWest(),f)._subtract(k),this.project(l.getNorthWest(),f)._subtract(k),this.project(l.getSouthEast(),f)._subtract(k),this.project(l.getNorthEast(),f)._subtract(k)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(l){return this.latLngToLayerPoint(l).subtract(this._getCenterLayerPoint())},_limitCenter:function(l,f,v){if(!v)return l;var k=this.project(l,f),T=this.getSize().divideBy(2),I=new Q(k.subtract(T),k.add(T)),V=this._getBoundsOffset(I,v,f);return Math.abs(V.x)<=1&&Math.abs(V.y)<=1?l:this.unproject(k.add(V),f)},_limitOffset:function(l,f){if(!f)return l;var v=this.getPixelBounds(),k=new Q(v.min.add(l),v.max.add(l));return l.add(this._getBoundsOffset(k,f))},_getBoundsOffset:function(l,f,v){var k=re(this.project(f.getNorthEast(),v),this.project(f.getSouthWest(),v)),T=k.min.subtract(l.min),I=k.max.subtract(l.max),V=this._rebound(T.x,-I.x),Z=this._rebound(T.y,-I.y);return new z(V,Z)},_rebound:function(l,f){return l+f>0?Math.round(l-f)/2:Math.max(0,Math.ceil(l))-Math.max(0,Math.floor(f))},_limitZoom:function(l){var f=this.getMinZoom(),v=this.getMaxZoom(),k=_e.any3d?this.options.zoomSnap:1;
41return k&&(l=Math.round(l/k)*k),Math.max(f,Math.min(v,l))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){_t(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(l,f){var v=this._getCenterOffset(l)._trunc();return(f&&f.animate)!==!0&&!this.getSize().contains(v)?!1:(this.panBy(v,f),!0)},_createAnimProxy:function(){var l=this._proxy=Xe("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(l),this.on("zoomanim",function(f){var v=xm,k=this._proxy.style[v];fs(this._proxy,this.project(f.center,f.zoom),this.getZoomScale(f.zoom,1)),k===this._proxy.style[v]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){jt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var l=this.getCenter(),f=this.getZoom();fs(this._proxy,this.project(l,f),this.getZoomScale(f,1))},_catchTransitionEnd:function(l){this._animatingZoom&&l.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(l,f,v){if(this._animatingZoom)return!0;if(v=v||{},!this._zoomAnimated||v.animate===!1||this._nothingToAnimate()||Math.abs(f-this._zoom)>this.options.zoomAnimationThreshold)return!1;var k=this.getZoomScale(f),T=this._getCenterOffset(l)._divideBy(1-1/k);return v.animate!==!0&&!this.getSize().contains(T)?!1:(M(function(){this._moveStart(!0,v.noMoveStart||!1)._animateZoom(l,f,!0)},this),!0)},_animateZoom:function(l,f,v,k){this._mapPane&&(v&&(this._animatingZoom=!0,this._animateToCenter=l,this._animateToZoom=f,Fe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:l,zoom:f,noUpdate:k}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_t(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function y8(l,f){return new Ve(l,f)}var lr=D.extend({options:{position:"topright"},initialize:function(l){x(this,l)},getPosition:function(){return this.options.position},setPosition:function(l){var f=this._map;return f&&f.removeControl(this),this.options.position=l,f&&f.addControl(this),this},getContainer:function(){return this._container},addTo:function(l){this.remove(),this._map=l;var f=this._container=this.onAdd(l),v=this.getPosition(),k=l._controlCorners[v];return Fe(f,"leaflet-control"),v.indexOf("bottom")!==-1?k.insertBefore(f,k.firstChild):k.appendChild(f),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(jt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(l){this._map&&l&&l.screenX>0&&l.screenY>0&&this._map.getContainer().focus()}}),ml=function(l){return new lr(l)};Ve.include({addControl:function(l){return l.addTo(this),this},removeControl:function(l){return l.remove(),this},_initControlPos:function(){var l=this._controlCorners={},f="leaflet-",v=this._controlContainer=Xe("div",f+"control-container",this._container);function k(T,I){var V=f+T+" "+f+I;l[T+I]=Xe("div",V,v)}k("top","left"),k("top","right"),k("bottom","left"),k("bottom","right")},_clearControlPos:function(){for(var l in this._controlCorners)jt(this._controlCorners[l]);jt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Zj=lr.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(l,f,v,k){return v<k?-1:k<v?1:0}},initialize:function(l,f,v){x(this,v),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var k in l)this._addLayer(l[k],k);for(k in f)this._addLayer(f[k],k,!0)},onAdd:function(l){this._initLayout(),this._update(),this._map=l,l.on("zoomend",this._checkDisabledLayers,this);for(var f=0;f<this._layers.length;f++)this._layers[f].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(l){return lr.prototype.addTo.call(this,l),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var l=0;l<this._layers.length;l++)this._layers[l].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(l,f){return this._addLayer(l,f),this._map?this._update():this},addOverlay:function(l,f){return this._addLayer(l,f,!0),this._map?this._update():this},removeLayer:function(l){l.off("add remove",this._onLayerChange,this);var f=this._getLayer(d(l));return f&&this._layers.splice(this._layers.indexOf(f),1),this._map?this._update():this},expand:function(){Fe(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var l=this._map.getSize().y-(this._container.offsetTop+50);return l<this._section.clientHeight?(Fe(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=l+"px"):_t(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return _t(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var l="leaflet-control-layers",f=this._container=Xe("div",l),v=this.options.collapsed;f.setAttribute("aria-haspopup",!0),fl(f),km(f);var k=this._section=Xe("section",l+"-list");v&&(this._map.on("click",this.collapse,this),De(f,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var T=this._layersLink=Xe("a",l+"-toggle",f);T.href="#",T.title="Layers",T.setAttribute("role","button"),De(T,{keydown:function(I){I.keyCode===13&&this._expandSafely()},click:function(I){an(I),this._expandSafely()}},this),v||this.expand(),this._baseLayersList=Xe("div",l+"-base",k),this._separator=Xe("div",l+"-separator",k),this._overlaysList=Xe("div",l+"-overlays",k),f.appendChild(k)},_getLayer:function(l){for(var f=0;f<this._layers.length;f++)if(this._layers[f]&&d(this._layers[f].layer)===l)return this._layers[f]},_addLayer:function(l,f,v){this._map&&l.on("add remove",this._onLayerChange,this),this._layers.push({layer:l,name:f,overlay:v}),this.options.sortLayers&&this._layers.sort(o(function(k,T){return this.options.sortFunction(k.layer,T.layer,k.name,T.name)}
41,this)),this.options.autoZIndex&&l.setZIndex&&(this._lastZIndex++,l.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;cd(this._baseLayersList),cd(this._overlaysList),this._layerControlInputs=[];var l,f,v,k,T=0;for(v=0;v<this._layers.length;v++)k=this._layers[v],this._addItem(k),f=f||k.overlay,l=l||!k.overlay,T+=k.overlay?0:1;return this.options.hideSingleBase&&(l=l&&T>1,this._baseLayersList.style.display=l?"":"none"),this._separator.style.display=f&&l?"":"none",this},_onLayerChange:function(l){this._handlingClick||this._update();var f=this._getLayer(d(l.target)),v=f.overlay?l.type==="add"?"overlayadd":"overlayremove":l.type==="add"?"baselayerchange":null;v&&this._map.fire(v,f)},_createRadioElement:function(l,f){var v='<input type="radio" class="leaflet-control-layers-selector" name="'+l+'"'+(f?' checked="checked"':"")+"/>",k=document.createElement("div");return k.innerHTML=v,k.firstChild},_addItem:function(l){var f=document.createElement("label"),v=this._map.hasLayer(l.layer),k;l.overlay?(k=document.createElement("input"),k.type="checkbox",k.className="leaflet-control-layers-selector",k.defaultChecked=v):k=this._createRadioElement("leaflet-base-layers_"+d(this),v),this._layerControlInputs.push(k),k.layerId=d(l.layer),De(k,"click",this._onInputClick,this);var T=document.createElement("span");T.innerHTML=" "+l.name;var I=document.createElement("span");f.appendChild(I),I.appendChild(k),I.appendChild(T);var V=l.overlay?this._overlaysList:this._baseLayersList;return V.appendChild(f),this._checkDisabledLayers(),f},_onInputClick:function(){if(!this._preventClick){var l=this._layerControlInputs,f,v,k=[],T=[];this._handlingClick=!0;for(var I=l.length-1;I>=0;I--)f=l[I],v=this._getLayer(f.layerId).layer,f.checked?k.push(v):f.checked||T.push(v);for(I=0;I<T.length;I++)this._map.hasLayer(T[I])&&this._map.removeLayer(T[I]);for(I=0;I<k.length;I++)this._map.hasLayer(k[I])||this._map.addLayer(k[I]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var l=this._layerControlInputs,f,v,k=this._map.getZoom(),T=l.length-1;T>=0;T--)f=l[T],v=this._getLayer(f.layerId).layer,f.disabled=v.options.minZoom!==void 0&&k<v.options.minZoom||v.options.maxZoom!==void 0&&k>v.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var l=this._section;this._preventClick=!0,De(l,"click",an),this.expand();var f=this;setTimeout(function(){ct(l,"click",an),f._preventClick=!1})}}),j8=function(l,f,v){return new Zj(l,f,v)},Tm=lr.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(l){var f="leaflet-control-zoom",v=Xe("div",f+" leaflet-bar"),k=this.options;return this._zoomInButton=this._createButton(k.zoomInText,k.zoomInTitle,f+"-in",v,this._zoomIn),this._zoomOutButton=this._createButton(k.zoomOutText,k.zoomOutTitle,f+"-out",v,this._zoomOut),this._updateDisabled(),l.on("zoomend zoomlevelschange",this._updateDisabled,this),v},onRemove:function(l){l.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(l){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(l.shiftKey?3:1))},_zoomOut:function(l){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(l.shiftKey?3:1))},_createButton:function(l,f,v,k,T){var I=Xe("a",v,k);return I.innerHTML=l,I.href="#",I.title=f,I.setAttribute("role","button"),I.setAttribute("aria-label",f),fl(I),De(I,"click",xs),De(I,"click",T,this),De(I,"click",this._refocusOnMap,this),I},_updateDisabled:function(){var l=this._map,f="leaflet-disabled";_t(this._zoomInButton,f),_t(this._zoomOutButton,f),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||l._zoom===l.getMin
41Zoom())&&(Fe(this._zoomOutButton,f),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||l._zoom===l.getMaxZoom())&&(Fe(this._zoomInButton,f),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ve.mergeOptions({zoomControl:!0}),Ve.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Tm,this.addControl(this.zoomControl))});var w8=function(l){return new Tm(l)},Xj=lr.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(l){var f="leaflet-control-scale",v=Xe("div",f),k=this.options;return this._addScales(k,f+"-line",v),l.on(k.updateWhenIdle?"moveend":"move",this._update,this),l.whenReady(this._update,this),v},onRemove:function(l){l.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(l,f,v){l.metric&&(this._mScale=Xe("div",f,v)),l.imperial&&(this._iScale=Xe("div",f,v))},_update:function(){var l=this._map,f=l.getSize().y/2,v=l.distance(l.containerPointToLatLng([0,f]),l.containerPointToLatLng([this.options.maxWidth,f]));this._updateScales(v)},_updateScales:function(l){this.options.metric&&l&&this._updateMetric(l),this.options.imperial&&l&&this._updateImperial(l)},_updateMetric:function(l){var f=this._getRoundNum(l),v=f<1e3?f+" m":f/1e3+" km";this._updateScale(this._mScale,v,f/l)},_updateImperial:function(l){var f=l*3.2808399,v,k,T;f>5280?(v=f/5280,k=this._getRoundNum(v),this._updateScale(this._iScale,k+" mi",k/v)):(T=this._getRoundNum(f),this._updateScale(this._iScale,T+" ft",T/f))},_updateScale:function(l,f,v){l.style.width=Math.round(this.options.maxWidth*v)+"px",l.innerHTML=f},_getRoundNum:function(l){var f=Math.pow(10,(Math.floor(l)+"").length-1),v=l/f;return v=v>=10?10:v>=5?5:v>=3?3:v>=2?2:1,f*v}}),N8=function(l){return new Xj(l)},_8='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Om=lr.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(_e.inlineSvg?_8+" ":"")+"Leaflet</a>"},initialize:function(l){x(this,l),this._attributions={}},onAdd:function(l){l.attributionControl=this,this._container=Xe("div","leaflet-control-attribution"),fl(this._container);for(var f in l._layers)l._layers[f].getAttribution&&this.addAttribution(l._layers[f].getAttribution());return this._update(),l.on("layeradd",this._addAttribution,this),this._container},onRemove:function(l){l.off("layeradd",this._addAttribution,this)},_addAttribution:function(l){l.layer.getAttribution&&(this.addAttribution(l.layer.getAttribution()),l.layer.once("remove",function(){this.removeAttribution(l.layer.getAttribution())},this))},setPrefix:function(l){return this.options.prefix=l,this._update(),this},addAttribution:function(l){return l?(this._attributions[l]||(this._attributions[l]=0),this._attributions[l]++,this._update(),this):this},removeAttribution:function(l){return l?(this._attributions[l]&&(this._attributions[l]--,this._update()),this):this},_update:function(){if(this._map){var l=[];for(var f in this._attributions)this._attributions[f]&&l.push(f);var v=[];this.options.prefix&&v.push(this.options.prefix),l.length&&v.push(l.join(", ")),this._container.innerHTML=v.join(' <span aria-hidden="true">|</span> ')}}});Ve.mergeOptions({attributionControl:!0}),Ve.addInitHook(function(){this.options.attributionControl&&new Om().addTo(this)});var S8=function(l){return new Om(l)};lr.Layers=Zj,lr.Zoom=Tm,lr.Scale=Xj,lr.Attribution=Om,ml.layers=j8,ml.zoom=w8,ml.scale=N8,ml.attribution=S8;var Or=D.extend({initialize:function(l){this._map=l},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Or.addTo=function(l,f){return l.addHandler(f,this),this};var C8={Events:H},Jj=_e.touch?"touchstart mousedown":"mousedown",La=K.extend({options:{clickTolerance:3},initialize:function(l,f,v,k){x(this,k),this._element=l,this._dragStartTarget=f||l,this._preventOutline=v},enable:function(){this._enabled||(De(this._dragStartTarget,Jj,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(La._dragging===this&&this.finishDrag(!0),ct(this._dragStartTarget,Jj,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(l){if(this._enabled&&(this._moved=!1,!gm(this._element,"leaflet-zoom-anim"))){if(l.touches&&l.touches.length!==1){La._dragging===this&&this.finishDrag();return}if(!(La._dragging||l.shiftKey||l.which!==1&&l.button!==1&&!l.touches)&&(La._dragging=this,this._preventOutline&&Nm(this._element),ym(),dl(),!this._moving)){this.fire("down");var f=l.touches?l.touches[0]:l,v=qj(this._element);this._startPoint=new z(f.clientX,f.clientY),this._startPos=ms(this._element),this._parentScale=_m(v);var k=l.type==="mousedown";De(document,k?"mousemove":"touchmove",this._onMove,this),De(document,k?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(l){if(this._enabled){if(l.touches&&l.touches.length>1){this._moved=!0;return}var f=l.touches&&l.touches.length===1?l.touches[0]:l,v=new z(f.clientX,f.clientY)._subtract(this._startPoint);!v.x&&!v.y||Math.abs(v.x)+Math.abs(v.y)<this.options.clickTolerance||(v.x/=this._parentScale.x,v.y/=this._parentScale.y,an(l),this._moved||(this.fire("dragstart"),this._moved=!0,Fe(document.body,"leaflet-dragging"),this._lastTarget=l.target||l.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Fe(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(v),this._moving=!0,this._lastEvent=l,this._updatePosition())}},_updatePosition:function(){var l={originalEvent:this._lastEvent};this.fire("predrag",l),kt(this._element,this._newPos),this.fire("drag",l)}
41,_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(l){_t(document.body,"leaflet-dragging"),this._lastTarget&&(_t(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ct(document,"mousemove touchmove",this._onMove,this),ct(document,"mouseup touchend touchcancel",this._onUp,this),jm(),ul();var f=this._moved&&this._moving;this._moving=!1,La._dragging=!1,f&&this.fire("dragend",{noInertia:l,distance:this._newPos.distanceTo(this._startPos)})}});function Qj(l,f,v){var k,T=[1,4,2,8],I,V,Z,ne,oe,ge,Te,Ue;for(I=0,ge=l.length;I<ge;I++)l[I]._code=gs(l[I],f);for(Z=0;Z<4;Z++){for(Te=T[Z],k=[],I=0,ge=l.length,V=ge-1;I<ge;V=I++)ne=l[I],oe=l[V],ne._code&Te?oe._code&Te||(Ue=md(oe,ne,Te,f,v),Ue._code=gs(Ue,f),k.push(Ue)):(oe._code&Te&&(Ue=md(oe,ne,Te,f,v),Ue._code=gs(Ue,f),k.push(Ue)),k.push(ne));l=k}return l}function ew(l,f){var v,k,T,I,V,Z,ne,oe,ge;if(!l||l.length===0)throw new Error("latlngs not passed");Gn(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var Te=pe([0,0]),Ue=fe(l),bn=Ue.getNorthWest().distanceTo(Ue.getSouthWest
41())*Ue.getNorthEast().distanceTo(Ue.getNorthWest());bn<1700&&(Te=Em(l));var Ht=l.length,Kn=[];for(v=0;v<Ht;v++){var Cn=pe(l[v]);Kn.push(f.project(pe([Cn.lat-Te.lat,Cn.lng-Te.lng])))}for(Z=ne=oe=0,v=0,k=Ht-1;v<Ht;k=v++)T=Kn[v],I=Kn[k],V=T.y*I.x-I.y*T.x,ne+=(T.x+I.x)*V,oe+=(T.y+I.y)*V,Z+=V*3;Z===0?ge=Kn[0]:ge=[ne/Z,oe/Z];var Ei=f.unproject(G(ge));return pe([Ei.lat+Te.lat,Ei.lng+Te.lng])}function Em(l){for(var f=0,v=0,k=0,T=0;T<l.length;T++){var I=pe(l[T]);f+=I.lat,v+=I.lng,k++}return pe([f/k,v/k])}var A8={__proto__:null,clipPolygon:Qj,polygonCenter:ew,centroid:Em};function tw(l,f){if(!f||!l.length)return l.slice();var v=f*f;return l=T8(l,v),l=P8(l,v),l}function nw(l,f,v){return Math.sqrt(pl(l,f,v,!0))}function k8(l,f,v){return pl(l,f,v)}function P8(l,f){var v=l.length,k=typeof Uint8Array<"u"?Uint8Array:Array,T=new k(v);T[0]=T[v-1]=1,Mm(l,T,f,0,v-1);var I,V=[];for(I=0;I<v;I++)T[I]&&V.push(l[I]);return V}function Mm(l,f,v,k,T){var I=0,V,Z,ne;for(Z=k+1;Z<=T-1;Z++)ne=pl(l[Z],l[k],l[T],!0),ne>I&&(V=Z,I=ne);I>v&&(f[V]=1,Mm(l,f,v,k,V),Mm(l,f,v,V,T))}function T8(l,f){for(var v=[l[0]],k=1,T=0,I=l.length;k<I;k++)O8(l[k],l[T])>f&&(v.push(l[k]),T=k);return T<I-1&&v.push(l[I-1]),v}var rw;function aw(l,f,v,k,T){var I=k?rw:gs(l,v),V=gs(f,v),Z,ne,oe;for(rw=V;;){if(!(I|V))return[l,f];if(I&V)return!1;Z=I||V,ne=md(l,f,Z,v,T),oe=gs(ne,v),Z===I?(l=ne,I=oe):(f=ne,V=oe)}}function md(l,f,v,k,T){var I=f.x-l.x,V=f.y-l.y,Z=k.min,ne=k.max,oe,ge;return v&8?(oe=l.x+I*(ne.y-l.y)/V,ge=ne.y):v&4?(oe=l.x+I*(Z.y-l.y)/V,ge=Z.y):v&2?(oe=ne.x,ge=l.y+V*(ne.x-l.x)/I):v&1&&(oe=Z.x,ge=l.y+V*(Z.x-l.x)/I),new z(oe,ge,T)}function gs(l,f){var v=0;return l.x<f.min.x?v|=1:l.x>f.max.x&&(v|=2),l.y<f.min.y?v|=4:l.y>f.max.y&&(v|=8),v}function O8(l,f){var v=f.x-l.x,k=f.y-l.y;return v*v+k*k}function pl(l,f,v,k){var T=f.x,I=f.y,V=v.x-T,Z=v.y-I,ne=V*V+Z*Z,oe;return ne>0&&(oe=((l.x-T)*V+(l.y-I)*Z)/ne,oe>1?(T=v.x,I=v.y):oe>0&&(T+=V*oe,I+=Z*oe)),V=l.x-T,Z=l.y-I,k?V*V+Z*Z:new z(T,I)}function Gn(l){return!_(l[0])||typeof l[0][0]!="object"&&typeof l[0][0]<"u"}function sw(l){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Gn(l)}function iw(l,f){var v,k,T,I,V,Z,ne,oe;if(!l||l.length===0)throw new Error("latlngs not passed");Gn(l)||(console.warn("latlngs are not flat! Only the first ring will be used"),l=l[0]);var ge=pe([0,0]),Te=fe(l),Ue=Te.getNorthWest().distanceTo(Te.getSouthWest
41())*Te.getNorthEast().distanceTo(Te.getNorthWest());Ue<1700&&(ge=Em(l));var bn=l.length,Ht=[];for(v=0;v<bn;v++){var Kn=pe(l[v]);Ht.push(f.project(pe([Kn.lat-ge.lat,Kn.lng-ge.lng])))}for(v=0,k=0;v<bn-1;v++)k+=Ht[v].distanceTo(Ht[v+1])/2;if(k===0)oe=Ht[0];else for(v=0,I=0;v<bn-1;v++)if(V=Ht[v],Z=Ht[v+1],T=V.distanceTo(Z),I+=T,I>k){ne=(I-k)/T,oe=[Z.x-ne*(Z.x-V.x),Z.y-ne*(Z.y-V.y)];break}var Cn=f.unproject(G(oe));return pe([Cn.lat+ge.lat,Cn.lng+ge.lng])}var E8={__proto__:null,simplify:tw,pointToSegmentDistance:nw,closestPointOnSegment:k8,clipSegment:aw,_getEdgeIntersection:md,_getBitCode:gs,_sqClosestPointOnSegment:pl,isFlat:Gn,_flat:sw,polylineCenter:iw},Lm={project:function(l){return new z(l.lng,l.lat)},unproject:function(l){return new me(l.y,l.x)},bounds:new Q([-180,-90],[180,90])},Im={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Q([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(l){var f=Math.PI/180,v=this.R,k=l.lat*f,T=this.R_MINOR/v,I=Math.sqrt(1-T*T),V=I*Math.sin(k),Z=Math.tan(Math.PI/4-k/2)/Math.pow((1-V)/(1+V),I/2);return k=-v*Math.log(Math.max(Z,1e-10)),new z(l.lng*f*v,k)},unproject:function(l){for(var f=180/Math.PI,v=this.R,k=this.R_MINOR/v,T=Math.sqrt(1-k*k),I=Math.exp(-l.y/v),V=Math.PI/2-2*Math.atan(I),Z=0,ne=.1,oe;Z<15&&Math.abs(ne)>1e-7;Z++)oe=T*Math.sin(V),oe=Math.pow((1-oe)/(1+oe),T/2),ne=Math.PI/2-2*Math.atan(I*oe)-V,V+=ne;return new me(V*f,l.x*f/v)}},M8={__proto__:null,LonLat:Lm,Mercator:Im,SphericalMercator:ue},L8=s({},J,{code:"EPSG:3395",projection:Im,transformation:(function(){var l=.5/(Math.PI*Im.R);return Y(l,.5,-l,.5)})()}),ow=s({},J,{code:"EPSG:4326",projection:Lm,transformation:Y(1/180,1,-1/180,.5)}),I8=s({},Re,{projection:Lm,transformation:Y(1,0,-1,0),scale:function(l){return Math.pow(2,l)},zoom:function(l){return Math.log(l)/Math.LN2},distance:function(l,f){var v=f.lng-l.lng,k=f.lat-l.lat;return Math.sqrt(v*v+k*k)},infinite:!0});Re.Earth=J,Re.EPSG3395=L8,Re.EPSG3857=je,Re.EPSG900913=ke,Re.EPSG4326=ow,Re.Simple=I8;var cr=K.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(l){return l.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(l){return l&&l.removeLayer(this),this},getPane:function(l){return this._map.getPane(l?this.options[l]||l:this.options.pane)},addInteractiveTarget:function(l){return this._map._targets[d(l)]=this,this},removeInteractiveTarget:function(l){return delete this._map._targets[d(l)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(l){var f=l.target;if(f.hasLayer(this)){if(this._map=f,this._zoomAnimated=f._zoomAnimated,this.getEvents){var v=this.getEvents();f.on(v,this),this.once("remove",function(){f.off(v,this)},this)}this.onAdd(f),this.fire("add"),f.fire("layeradd",{layer:this})}}});Ve.include({addLayer:function(l){if(!l._layerAdd)throw new Error("The provided object is not a Layer.");var f=d(l);return this._layers[f]?this:(this._layers[f]=l,l._mapToAdd=this,l.beforeAdd&&l.beforeAdd(this),this.whenReady(l._layerAdd,l),this)},removeLayer:function(l){var f=d(l);return this._layers[f]?(this._loaded&&l.onRemove(this),delete this._layers[f],this._loaded&&(this.fire("layerremove",{layer:l}),l.fire("remove")),l._map=l._mapToAdd=null,this):this},hasLayer:function(l){return d(l)in this._layers},eachLayer:function(l,f){for(var v in this._layers)l.call(f,this._layers[v]);return this},_addLayers:function(l){l=l?_(l)?l:[l]:[];for(var f=0,v=l.length;f<v;f++)this.addLayer(l[f])},_addZoomLimit:function(l){(!isNaN(l.options.maxZoom)||!isNaN(l.options.minZoom))&&(this._zoomBoundLayers[d(l)]=l,this._updateZoomLevels())},_removeZoomLimit:function(l){var f=d(l);this._zoomBoundLayers[f]&&(delete this._zoomBoundLayers[f],this._updateZoomLevels())},_updateZoomLevels:function(){var l=1/0,f=-1/0,v=this._getZoomSpan();for(var k in this._zoomBoundLayers){var T=this._zoomBoundLayers[k].options;l=T.minZoom===void 0?l:Math.min(l,T.minZoom),f=T.maxZoom===void 0?f:Math.max(f,T.maxZoom)}this._layersMaxZoom=f===-1/0?void 0:f,this._layersMinZoom=l===1/0?void 0:l,v!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZo
41om&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Ai=cr.extend({initialize:function(l,f){x(this,f),this._layers={};var v,k;if(l)for(v=0,k=l.length;v<k;v++)this.addLayer(l[v])},addLayer:function(l){var f=this.getLayerId(l);return this._layers[f]=l,this._map&&this._map.addLayer(l),this},removeLayer:function(l){var f=l in this._layers?l:this.getLayerId(l);return this._map&&this._layers[f]&&this._map.removeLayer(this._layers[f]),delete this._layers[f],this},hasLayer:function(l){var f=typeof l=="number"?l:this.getLayerId(l);return f in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(l){var f=Array.prototype.slice.call(arguments,1),v,k;for(v in this._layers)k=this._layers[v],k[l]&&k[l].apply(k,f);return this},onAdd:function(l){this.eachLayer(l.addLayer,l)},onRemove:function(l){this.eachLayer(l.removeLayer,l)},eachLayer:function(l,f){for(var v in this._layers)l.call(f,this._layers[v]);return this},getLayer:function(l){return this._layers[l]},getLayers:function(){var l=[];return this.eachLayer(l.push,l),l},setZIndex:function(l){return this.invoke("setZIndex",l)},getLayerId:function(l){return d(l)}}),R8=function(l,f){return new Ai(l,f)},na=Ai.extend({addLayer:function(l){return this.hasLayer(l)?this:(l.addEventParent(this),Ai.prototype.addLayer.call(this,l),this.fire("layeradd",{layer:l}))},removeLayer:function(l){return this.hasLayer(l)?(l in this._layers&&(l=this._layers[l]),l.removeEventParent(this),Ai.prototype.removeLayer.call(this,l),this.fire("layerremove",{layer:l})):this},setStyle:function(l){return this.invoke("setStyle",l)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var l=new ce;for(var f in this._layers){var v=this._layers[f];l.extend(v.getBounds?v.getBounds():v.getLatLng())}return l}}),D8=function(l,f){return new na(l,f)},ki=D.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(l){x(this,l)},createIcon:function(l){return this._createIcon("icon",l)},createShadow:function(l){return this._createIcon("shadow",l)},_createIcon:function(l,f){var v=this._getIconUrl(l);if(!v){if(l==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var k=this._createImg(v,f&&f.tagName==="IMG"?f:null);return this._setIconStyles(k,l),(this.options.crossOrigin||this.options.crossOrigin==="")&&(k.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),k},_setIconStyles:function(l,f){var v=this.options,k=v[f+"Size"];typeof k=="number"&&(k=[k,k]);var T=G(k),I=G(f==="shadow"&&v.shadowAnchor||v.iconAnchor||T&&T.divideBy(2,!0));l.className="leaflet-marker-"+f+" "+(v.className||""),I&&(l.style.marginLeft=-I.x+"px",l.style.marginTop=-I.y+"px"),T&&(l.style.width=T.x+"px",l.style.height=T.y+"px")},_createImg:function(l,f){return f=f||document.createElement("img"),f.src=l,f},_getIconUrl:function(l){return _e.retina&&this.options[l+"RetinaUrl"]||this.options[l+"Url"]}});function $8(l){return new ki(l)}var xl=ki.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(l){return typeof xl.imagePath!="string"&&(xl.imagePath=this._detectIconPath()),(this.options.imagePath||xl.imagePath)+ki.prototype._getIconUrl.call(this,l)},_stripUrl:function(l){var f=function(v,k,T){var I=k.exec(v);return I&&I[T]};return l=f(l,/^url\((['"])?(.+)\1\)$/,2),l&&f(l,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var l=Xe("div","leaflet-default-icon-path",document.body),f=cl(l,"background-image")||cl(l,"backgroundImage");if(document.body.removeChild(l),f=this._stripUrl(f),f)return f;var v=document.querySelector('link[href$="leaflet.css"]');return v?v.href.substring(0,v.href.length-11-1):""}}),lw=Or.extend({initialize:function(l){this._marker=l},addHooks:function(){var l=this._marker._icon;this._draggable||(this._draggable=new La(l,l,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Fe(l,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&_t(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(l){var f=this._marker,v=f._map,k=this._marker.options.autoPanSpeed,T=this._marker.options.autoPanPadding,I=ms(f._icon),V=v.getPixelBounds(),Z=v.getPixelOrigin(),ne=re(V.min._subtract(Z).add(T),V.max._subtract(Z).subtract(T));if(!ne.contains(I)){var oe=G((Math.max(ne.max.x,I.x)-ne.max.x)/(V.max.x-ne.max.x)-(Math.min(ne.min.x,I.x)-ne.min.x)/(V.min.x-ne.min.x),(Math.max(ne.max.y,I.y)-ne.max.y)/(V.max.y-ne.max.y)-(Math.min(ne.min.y,I.y)-ne.min.y)/(V.min.y-ne.min.y)).multiplyBy(k);v.panBy(oe,{animate:!1}),this._draggable._newPos._add(oe),this._draggable._startPos._add(oe),kt(f._icon,this._draggable._newPos),this._onDrag(l),this._panRequest=M(this._adjustPan.bind(this,l))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(l){this._marker.options.autoPan&&(R(this._panRequest),this._panRequest=M(this._adjustPan.bind(this,l)))},_onDrag:function(l){var f=this._marker,v=f._shadow,k=ms(f._icon),T=f._map.layerPointToLatLng(k);v&&kt(v,k),f._latlng=T,l.latlng=T,l.oldLatLng=this._oldLatLng,f.fire("move",l).fire("drag",l)}
vendor: 8,113 bytes, line 41
41,_onDragEnd:function(l){R(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",l)}}),pd=cr.extend({options:{icon:new xl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(l,f){x(this,f),this._latlng=pe(l)},onAdd:function(l){this._zoomAnimated=this._zoomAnimated&&l.options.markerZoomAnimation,this._zoomAnimated&&l.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(l){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&l.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(l){var f=this._latlng;return this._latlng=pe(l),this.update(),this.fire("move",{oldLatLng:f,latlng:this._latlng})},setZIndexOffset:function(l){return this.options.zIndexOffset=l,this.update()},getIcon:function(){return this.options.icon},setIcon:function(l){return this.options.icon=l,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var l=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(l)}return this},_initIcon:function(){var l=this.options,f="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),v=l.icon.createIcon(this._icon),k=!1;v!==this._icon&&(this._icon&&this._removeIcon(),k=!0,l.title&&(v.title=l.title),v.tagName==="IMG"&&(v.alt=l.alt||"")),Fe(v,f),l.keyboard&&(v.tabIndex="0",v.setAttribute("role","button")),this._icon=v,l.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&De(v,"focus",this._panOnFocus,this);var T=l.icon.createShadow(this._shadow),I=!1;T!==this._shadow&&(this._removeShadow(),I=!0),T&&(Fe(T,f),T.alt=""),this._shadow=T,l.opacity<1&&this._updateOpacity(),k&&this.getPane().appendChild(this._icon),this._initInteraction(),T&&I&&this.getPane(l.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ct(this._icon,"focus",this._panOnFocus,this),jt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&jt(this._shadow),this._shadow=null},_setPos:function(l){this._icon&&kt(this._icon,l),this._shadow&&kt(this._shadow,l),this._zIndex=l.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(l){this._icon&&(this._icon.style.zIndex=this._zIndex+l)},_animateZoom:function(l){var f=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center).round();this._setPos(f)},_initInteraction:function(){if(this.options.interactive&&(Fe(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),lw)){var l=this.options.draggable;this.dragging&&(l=this.dragging.enabled(),this.dragging.disable()),this.dragging=new lw(this),l&&this.dragging.enable()}},setOpacity:function(l){return this.options.opacity=l,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var l=this.options.opacity;this._icon&&Hn(this._icon,l),this._shadow&&Hn(this._shadow,l)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var l=this._map;if(l){var f=this.options.icon.options,v=f.iconSize?G(f.iconSize):G(0,0),k=f.iconAnchor?G(f.iconAnchor):G(0,0);l.panInside(this._latlng,{paddingTopLeft:k,paddingBottomRight:v.subtract(k)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function F8(l,f){return new pd(l,f)}var Ia=cr.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(l){this._renderer=l.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(l){return x(this,l),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&l&&Object.prototype.hasOwnProperty.call(l,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),xd=Ia.extend({options:{fill:!0,radius:10},initialize:function(l,f){x(this,f),this._latlng=pe(l),this._radius=this.options.radius},setLatLng:function(l){var f=this._latlng;return this._latlng=pe(l),this.redraw(),this.fire("move",{oldLatLng:f,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(l){return this.options.radius=this._radius=l,this.redraw()},getRadius:function(){return this._radius},setStyle:function(l){var f=l&&l.radius||this._radius;return Ia.prototype.setStyle.call(this,l),this.setRadius(f),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var l=this._radius,f=this._radiusY||l,v=this._clickTolerance(),k=[l+v,f+v];this._pxBounds=new Q(this._point.subtract(k),this._point.add(k))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(l){return l.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function B8(l,f){return new xd(l,f)}var Rm=xd.extend({initialize:function(l,f,v){if(typeof f=="number"&&(f=s({},v,{radius:f})),x(this,f),this._latlng=pe(l),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(l){return this._mRadius=l,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var l=[this._radius,this._radiusY||this._radius];return new ce(this._map.layerPointToLatLng(this._point.subtract(l)),this._map.layerPointToLatLng(this._point.add(l)))},setStyle:Ia.prototype.setStyle,_project:function(){var l=this._latlng.lng,f=this._latlng.lat,v=this._map,k=v.options.crs;if(k.distance===J.distance){var T=Math.PI/180,I=this._mRadius/J.R/T,V=v.project([f+I,l]),Z=v.project([f-I,l]),ne=V.add(Z).divideBy(2),oe=v.unproject(ne).lat,ge=Math.acos((Math.cos(I*T)-Math.sin(f*T)*Math.sin(oe*T))/(Math.cos(f*T)*Math.cos(oe*T)))/T;(isNaN(ge)||ge===0)&&(ge=I/Math.cos(Math.PI/180*f)),this._point=ne.subtract(v.getPixelOrigin()),this._radius=isNaN(ge)?0:ne.x-v.project([oe,l-ge]).x,this._radiusY=ne.y-V.y}else{var Te=k.unproject(k.project(this._latlng).subtract([this._mRadius,0]));this._point=v.latLngToLayerPoint(this._latlng),this._radius=this._point.x-v.latLngToLayerPoint(Te).x}this._updateBounds()}});function U8(l,f,v){return new Rm(l,f,v)}var ra=Ia.extend({options:{smoothFactor:1,noClip:!1},initialize:function(l,f){x(this,f),this._setLatLngs(l)},getLatLngs:function(){return this._latlngs},setLatLngs:function(l){return this._setLatLngs(l),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(l){for(var f=1/0,v=null,k=pl,T,I,V=0,Z=this._parts.length;V<Z;V++)for(var ne=this._parts[V],oe=1,ge=ne.length;oe<ge;oe++){T=ne[oe-1],I=ne[oe];var Te=k(l,T,I,!0);Te<f&&(f=Te,v=k(l,T,I))}return v&&(v.distance=Math.sqrt(f)),v}
41,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return iw(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(l,f){return f=f||this._defaultShape(),l=pe(l),f.push(l),this._bounds.extend(l),this.redraw()},_setLatLngs:function(l){this._bounds=new ce,this._latlngs=this._convertLatLngs(l)},_defaultShape:function(){return Gn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(l){for(var f=[],v=Gn(l),k=0,T=l.length;k<T;k++)v?(f[k]=pe(l[k]),this._bounds.extend(f[k])):f[k]=this._convertLatLngs(l[k]);return f},_project:function(){var l=new Q;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,l),this._bounds.isValid()&&l.isValid()&&(this._rawPxBounds=l,this._updateBounds())},_updateBounds:function(){var l=this._clickTolerance(),f=new z(l,l);this._rawPxBounds&&(this._pxBounds=new Q([this._rawPxBounds.min.subtract(f),this._rawPxBounds.max.add(f)]))},_projectLatlngs:function(l,f,v){var k=l[0]instanceof me,T=l.length,I,V;if(k){for(V=[],I=0;I<T;I++)V[I]=this._map.latLngToLayerPoint(l[I]),v.extend(V[I]);f.push(V)}else for(I=0;I<T;I++)this._projectLatlngs(l[I],f,v)},_clipPoints:function(){var l=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}var f=this._parts,v,k,T,I,V,Z,ne;for(v=0,T=0,I=this._rings.length;v<I;v++)for(ne=this._rings[v],k=0,V=ne.length;k<V-1;k++)Z=aw(ne[k],ne[k+1],l,k,!0),Z&&(f[T]=f[T]||[],f[T].push(Z[0]),(Z[1]!==ne[k+1]||k===V-2)&&(f[T].push(Z[1]),T++))}},_simplifyPoints:function(){for(var l=this._parts,f=this.options.smoothFactor,v=0,k=l.length;v<k;v++)l[v]=tw(l[v],f)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(l,f){var v,k,T,I,V,Z,ne=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(v=0,I=this._parts.length;v<I;v++)for(Z=this._parts[v],k=0,V=Z.length,T=V-1;k<V;T=k++)if(!(!f&&k===0)&&nw(l,Z[T],Z[k])<=ne)return!0;return!1}});function z8(l,f){return new ra(l,f)}ra._flat=sw;var Pi=ra.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
41,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return ew(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(l){var f=ra.prototype._convertLatLngs.call(this,l),v=f.length;return v>=2&&f[0]instanceof me&&f[0].equals(f[v-1])&&f.pop(),f},_setLatLngs:function(l){ra.prototype._setLatLngs.call(this,l),Gn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Gn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var l=this._renderer._bounds,f=this.options.weight,v=new z(f,f);if(l=new Q(l.min.subtract(v),l.max.add(v)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(l))){if(this.options.noClip){this._parts=this._rings;return}for(var k=0,T=this._rings.length,I;k<T;k++)I=Qj(this._rings[k],l,!0),I.length&&this._parts.push(I)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(l){var f=!1,v,k,T,I,V,Z,ne,oe;if(!this._pxBounds||!this._pxBounds.contains(l))return!1;for(I=0,ne=this._parts.length;I<ne;I++)for(v=this._parts[I],V=0,oe=v.length,Z=oe-1;V<oe;Z=V++)k=v[V],T=v[Z],k.y>l.y!=T.y>l.y&&l.x<(T.x-k.x)*(l.y-k.y)/(T.y-k.y)+k.x&&(f=!f);return f||ra.prototype._containsPoint.call(this,l,!0)}});function W8(l,f){return new Pi(l,f)}var aa=na.extend({initialize:function(l,f){x(this,f),this._layers={},l&&this.addData(l)},addData:function(l){var f=_(l)?l:l.features,v,k,T;if(f){for(v=0,k=f.length;v<k;v++)T=f[v],(T.geometries||T.geometry||T.features||T.coordinates)&&this.addData(T);return this}var I=this.options;if(I.filter&&!I.filter(l))return this;var V=gd(l,I);return V?(V.feature=yd(l),V.defaultOptions=V.options,this.resetStyle(V),I.onEachFeature&&I.onEachFeature(l,V),this.addLayer(V)):this},resetStyle:function(l){return l===void 0?this.eachLayer(this.resetStyle,this):(l.options=s({},l.defaultOptions),this._setLayerStyle(l,this.options.style),this)},setStyle:function(l){return this.eachLayer(function(f){this._setLayerStyle(f,l)},this)},_setLayerStyle:function(l,f){l.setStyle&&(typeof f=="function"&&(f=f(l.feature)),l.setStyle(f))}});function gd(l,f){var v=l.type==="Feature"?l.geometry:l,k=v?v.coordinates:null,T=[],I=f&&f.pointToLayer,V=f&&f.coordsToLatLng||Dm,Z,ne,oe,ge;if(!k&&!v)return null;switch(v.type){case"Point":return Z=V(k),cw(I,l,Z,f);case"MultiPoint":for(oe=0,ge=k.length;oe<ge;oe++)Z=V(k[oe]),T.push(cw(I,l,Z,f));return new na(T);case"LineString":case"MultiLineString":return ne=bd(k,v.type==="LineString"?0:1,V),new ra(ne,f);case"Polygon":case"MultiPolygon":return ne=bd(k,v.type==="Polygon"?1:2,V),new Pi(ne,f);case"GeometryCollection":for(oe=0,ge=v.geometries.length;oe<ge;oe++){var Te=gd({geometry:v.geometries[oe],type:"Feature",properties:l.properties},f);Te&&T.push(Te)}return new na(T);case"FeatureCollection":for(oe=0,ge=v.features.length;oe<ge;oe++){var Ue=gd(v.features[oe],f);Ue&&T.push(Ue)}return new na(T);default:throw new Error("Invalid GeoJSON object.")}}function cw(l,f,v,k){return l?l(f,v):new pd(v,k&&k.markersInheritOptions&&k)}function Dm(l){return new me(l[1],l[0],l[2])}function bd(l,f,v){for(var k=[],T=0,I=l.length,V;T<I;T++)V=f?bd(l[T],f-1,v):(v||Dm)(l[T]),k.push(V);return k}function $m(l,f){return l=pe(l),l.alt!==void 0?[p(l.lng,f),p(l.lat,f),p(l.alt,f)]:[p(l.lng,f),p(l.lat,f)]}function vd(l,f,v,k){for(var T=[],I=0,V=l.length;I<V;I++)T.push(f?vd(l[I],Gn(l[I])?0:f-1,v,k):$m(l[I],k));return!f&&v&&T.length>0&&T.push(T[0].slice()),T}function Ti(l,f){return l.feature?s({},l.feature,{geometry:f}):yd(f)}function yd(l){return l.type==="Feature"||l.type==="FeatureCollection"?l:{type:"Feature",properties:{},geometry:l}}var Fm={toGeoJSON:function(l){return Ti(this,{type:"Point",coordinates:$m(this.getLatLng(),l)})}};pd.include(Fm),Rm.include(Fm),xd.include(Fm),ra.include({toGeoJSON:function(l){var f=!Gn(this._latlngs),v=vd(this._latlngs,f?1:0,!1,l);return Ti(this,{type:(f?"Multi":"")+"LineString",coordinates:v})}}),Pi.include({toGeoJSON:function(l){var f=!Gn(this._latlngs),v=f&&!Gn(this._latlngs[0]),k=vd(this._latlngs,v?2:f?1:0,!0,l);return f||(k=[k]),Ti(this,{type:(v?"Multi":"")+"Polygon",coordinates:k})}}),Ai.include({toMultiPoint:function(l){var f=[];return this.eachLayer(function(v){f.push(v.toGeoJSON(l).geometry.coordinates)}),Ti(this,{type:"MultiPoint",coordinates:f})},toGeoJSON:function(l){var f=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(f==="MultiPoint")return this.toMultiPoint(l);var v=f==="GeometryCollection",k=[];return this.eachLayer(function(T){if(T.toGeoJSON){var I=T.toGeoJSON(l);if(v)k.push(I.geometry);else{var V=yd(I);V.type==="FeatureCollection"?k.push.apply(k,V.features):k.push(V)}}}),v?Ti(this,{geometries:k,type:"GeometryCollection"}):{type:"FeatureCollection",features:k}}});function dw(l,f){return new aa(l,f)}var q8=dw,jd=cr.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(l,f,v){this._url=l,this._bounds=fe(f),x(this,v)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Fe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){jt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(l){return this.options.opacity=l,this._image&&this._updateOpacity(),this},setStyle:function(l){return l.opacity&&this.setOpacity(l.opacity),this},bringToFront:function(){return this._map&&Si(this._image),this},bringToBack:function(){return this._map&&Ci(this._image),this},setUrl:function(l){return this._url=l,this._image&&(this._image.src=l),this},setBounds:function(l){return this._bounds=fe(l),this._map&&this._reset(),this},getEvents:function(){var l={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var l=this._url.tagName==="IMG",f=this._image=l?this._url:Xe("img");if(Fe(f,"leaflet-image-layer"),this._zoomAnimated&&Fe(f,"leaflet-zoom-animated"),this.options.className&&Fe(f,this.options.className),f.onselectstart=m,f.onmousemove=m,f.onload=o(this.fire,this,"load"),f.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),l){this._url=f.src;return}f.src=this._url,f.alt=this.options.alt},_animateZoom:function(l){var f=this._map.getZoomScale(l.zoom),v=this._map._latLngBoundsToNewLayerBounds(this._bounds,l.zoom,l.center).min;fs(this._image,v,f)},_reset:function(){var l=this._image,f=new Q(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),v=f.getSize();kt(l,f.min),l.style.width=v.x+"px",l.style.height=v.y+"px"},_updateOpacity:function(){Hn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var l=this.options.errorOverlayUrl;l&&this._url!==l&&(this._url=l,this._image.src=l)},getCenter:function(){return this._bounds.getCenter()}}),V8=function(l,f,v){return new jd(l,f,v)},uw=jd.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
41ine:!0},_initImage:function(){var l=this._url.tagName==="VIDEO",f=this._image=l?this._url:Xe("video");if(Fe(f,"leaflet-image-layer"),this._zoomAnimated&&Fe(f,"leaflet-zoom-animated"),this.options.className&&Fe(f,this.options.className),f.onselectstart=m,f.onmousemove=m,f.onloadeddata=o(this.fire,this,"load"),l){for(var v=f.getElementsByTagName("source"),k=[],T=0;T<v.length;T++)k.push(v[T].src);this._url=v.length>0?k:[f.src];return}_(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(f.style,"objectFit")&&(f.style.objectFit="fill"),f.autoplay=!!this.options.autoplay,f.loop=!!this.options.loop,f.muted=!!this.options.muted,f.playsInline=!!this.options.playsInline;for(var I=0;I<this._url.length;I++){var V=Xe("source");V.src=this._url[I],f.appendChild(V)}}});function H8(l,f,v){return new uw(l,f,v)}var hw=jd.extend({_initImage:function(){var l=this._image=this._url;Fe(l,"leaflet-image-layer"),this._zoomAnimated&&Fe(l,"leaflet-zoom-animated"),this.options.className&&Fe(l,this.options.className),l.onselectstart=m,l.onmousemove=m}});function G8(l,f,v){return new hw(l,f,v)}var Er=cr.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(l,f){l&&(l instanceof me||_(l))?(this._latlng=pe(l),x(this,f)):(x(this,l),this._source=f),this.options.content&&(this._content=this.options.content)},openOn:function(l){return l=arguments.length?l:this._source._map,l.hasLayer(this)||l.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(l){return this._map?this.close():(arguments.length?this._source=l:l=this._source,this._prepareOpen(),this.openOn(l._map)),this},onAdd:function(l){this._zoomAnimated=l._zoomAnimated,this._container||this._initLayout(),l._fadeAnimated&&Hn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),l._fadeAnimated&&Hn(this._container,1),this.bringToFront(),this.options.interactive&&(Fe(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(l){l._fadeAnimated?(Hn(this._container,0),this._removeTimeout=setTimeout(o(jt,void 0,this._container),200)):jt(this._container),this.options.interactive&&(_t(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(l){return this._latlng=pe(l),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(l){return this._content=l,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var l={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Si(this._container),this},bringToBack:function(){return this._map&&Ci(this._container),this},_prepareOpen:function(l){var f=this._source;if(!f._map)return!1;if(f instanceof na){f=null;var v=this._source._layers;for(var k in v)if(v[k]._map){f=v[k];break}if(!f)return!1;this._source=f}if(!l)if(f.getCenter)l=f.getCenter();else if(f.getLatLng)l=f.getLatLng();else if(f.getBounds)l=f.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(l),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var l=this._contentNode,f=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof f=="string")l.innerHTML=f;else{for(;l.hasChildNodes();)l.removeChild(l.firstChild);l.appendChild(f)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var l=this._map.latLngToLayerPoint(this._latlng),f=G(this.options.offset),v=this._getAnchor();this._zoomAnimated?kt(this._container,l.add(v)):f=f.add(l).add(v);var k=this._containerBottom=-f.y,T=this._containerLeft=-Math.round(this._containerWidth/2)+f.x;this._container.style.bottom=k+"px",this._container.style.left=T+"px"}},_getAnchor:function(){return[0,0]}});Ve.include({_initOverlay:function(l,f,v,k){var T=f;return T instanceof l||(T=new l(k).setContent(f)),v&&T.setLatLng(v),T}}
41),cr.include({_initOverlay:function(l,f,v,k){var T=v;return T instanceof l?(x(T,k),T._source=this):(T=f&&!k?f:new l(k,this),T.setContent(v)),T}});var wd=Er.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(l){return l=arguments.length?l:this._source._map,!l.hasLayer(this)&&l._popup&&l._popup.options.autoClose&&l.removeLayer(l._popup),l._popup=this,Er.prototype.openOn.call(this,l)},onAdd:function(l){Er.prototype.onAdd.call(this,l),l.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Ia||this._source.on("preclick",ps))},onRemove:function(l){Er.prototype.onRemove.call(this,l),l.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Ia||this._source.off("preclick",ps))},getEvents:function(){var l=Er.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(l.preclick=this.close),this.options.keepInView&&(l.moveend=this._adjustPan),l},_initLayout:function(){var l="leaflet-popup",f=this._container=Xe("div",l+" "+(this.options.className||"")+" leaflet-zoom-animated"),v=this._wrapper=Xe("div",l+"-content-wrapper",f);if(this._contentNode=Xe("div",l+"-content",v),fl(f),km(this._contentNode),De(f,"contextmenu",ps),this._tipContainer=Xe("div",l+"-tip-container",f),this._tip=Xe("div",l+"-tip",this._tipContainer),this.options.closeButton){var k=this._closeButton=Xe("a",l+"-close-button",f);k.setAttribute("role","button"),k.setAttribute("aria-label","Close popup"),k.href="#close",k.innerHTML='<span aria-hidden="true">×</span>',De(k,"click",function(T){an(T),this.close()},this)}},_updateLayout:function(){var l=this._contentNode,f=l.style;f.width="",f.whiteSpace="nowrap";var v=l.offsetWidth;v=Math.min(v,this.options.maxWidth),v=Math.max(v,this.options.minWidth),f.width=v+1+"px",f.whiteSpace="",f.height="";var k=l.offsetHeight,T=this.options.maxHeight,I="leaflet-popup-scrolled";T&&k>T?(f.height=T+"px",Fe(l,I)):_t(l,I),this._containerWidth=this._container.offsetWidth},_animateZoom:function(l){var f=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center),v=this._getAnchor();kt(this._container,f.add(v))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var l=this._map,f=parseInt(cl(this._container,"marginBottom"),10)||0,v=this._container.offsetHeight+f,k=this._containerWidth,T=new z(this._containerLeft,-v-this._containerBottom);T._add(ms(this._container));var I=l.layerPointToContainerPoint(T),V=G(this.options.autoPanPadding),Z=G(this.options.autoPanPaddingTopLeft||V),ne=G(this.options.autoPanPaddingBottomRight||V),oe=l.getSize(),ge=0,Te=0;I.x+k+ne.x>oe.x&&(ge=I.x+k-oe.x+ne.x),I.x-ge-Z.x<0&&(ge=I.x-Z.x),I.y+v+ne.y>oe.y&&(Te=I.y+v-oe.y+ne.y),I.y-Te-Z.y<0&&(Te=I.y-Z.y),(ge||Te)&&(this.options.keepInView&&(this._autopanning=!0),l.fire("autopanstart").panBy([ge,Te]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),K8=function(l,f){return new wd(l,f)};Ve.mergeOptions({closePopupOnClick:!0}),Ve.include({openPopup:function(l,f,v){return this._initOverlay(wd,l,f,v).openOn(this),this},closePopup:function(l){return l=arguments.length?l:this._popup,l&&l.close(),this}}),cr.include({bindPopup:function(l,f){return this._popup=this._initOverlay(wd,this._popup,l,f),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(l){return this._popup&&(this instanceof na||(this._popup._source=this),this._popup._prepareOpen(l||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1}
41,setPopupContent:function(l){return this._popup&&this._popup.setContent(l),this},getPopup:function(){return this._popup},_openPopup:function(l){if(!(!this._popup||!this._map)){xs(l);var f=l.layer||l.target;if(this._popup._source===f&&!(f instanceof Ia)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(l.latlng);return}this._popup._source=f,this.openPopup(l.latlng)}},_movePopup:function(l){this._popup.setLatLng(l.latlng)},_onKeyPress:function(l){l.originalEvent.keyCode===13&&this._openPopup(l)}});var Nd=Er.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(l){Er.prototype.onAdd.call(this,l),this.setOpacity(this.options.opacity),l.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(l){Er.prototype.onRemove.call(this,l),l.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var l=Er.prototype.getEvents.call(this);return this.options.permanent||(l.preclick=this.close),l},_initLayout:function(){var l="leaflet-tooltip",f=l+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Xe("div",f),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+d(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(l){var f,v,k=this._map,T=this._container,I=k.latLngToContainerPoint(k.getCenter()),V=k.layerPointToContainerPoint(l),Z=this.options.direction,ne=T.offsetWidth,oe=T.offsetHeight,ge=G(this.options.offset),Te=this._getAnchor();Z==="top"?(f=ne/2,v=oe):Z==="bottom"?(f=ne/2,v=0):Z==="center"?(f=ne/2,v=oe/2):Z==="right"?(f=0,v=oe/2):Z==="left"?(f=ne,v=oe/2):V.x<I.x?(Z="right",f=0,v=oe/2):(Z="left",f=ne+(ge.x+Te.x)*2,v=oe/2),l=l.subtract(G(f,v,!0)).add(ge).add(Te),_t(T,"leaflet-tooltip-right"),_t(T,"leaflet-tooltip-left"),_t(T,"leaflet-tooltip-top"),_t(T,"leaflet-tooltip-bottom"),Fe(T,"leaflet-tooltip-"+Z),kt(T,l)},_updatePosition:function(){var l=this._map.latLngToLayerPoint(this._latlng);this._setPosition(l)},setOpacity:function(l){this.options.opacity=l,this._container&&Hn(this._container,l)},_animateZoom:function(l){var f=this._map._latLngToNewLayerPoint(this._latlng,l.zoom,l.center);this._setPosition(f)},_getAnchor:function(){return G(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Y8=function(l,f){return new Nd(l,f)};Ve.include({openTooltip:function(l,f,v){return this._initOverlay(Nd,l,f,v).openOn(this),this},closeTooltip:function(l){return l.close(),this}}),cr.include({bindTooltip:function(l,f){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Nd,this._tooltip,l,f),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(l){if(!(!l&&this._tooltipHandlersAdded)){var f=l?"off":"on",v={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?v.add=this._openTooltip:(v.mouseover=this._openTooltip,v.mouseout=this.closeTooltip,v.click=this._openTooltip,this._map?this._addFocusListeners():v.add=this._addFocusListeners),this._tooltip.options.sticky&&(v.mousemove=this._moveTooltip),this[f](v),this._tooltipHandlersAdded=!l}},openTooltip:function(l){return this._tooltip&&(this instanceof na||(this._tooltip._source=this),this._tooltip._prepareOpen(l)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(l){return this._tooltip&&this._tooltip.setContent(l),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(l){var f=typeof l.getElement=="function"&&l.getElement();f&&(De(f,"focus",function(){this._tooltip._source=l,this.openTooltip()},this),De(f,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(l){var f=typeof l.getElement=="function"&&l.getElement();f&&f.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(l){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var f=this;this._map.once("moveend",function(){f._openOnceFlag=!1,f._openTooltip(l)});return}this._tooltip._source=l.layer||l.target,this.openTooltip(this._tooltip.options.sticky?l.latlng:void 0)}},_moveTooltip:function(l){var f=l.latlng,v,k;this._tooltip.options.sticky&&l.originalEvent&&(v=this._map.mouseEventToContainerPoint(l.originalEvent),k=this._map.containerPointToLayerPoint(v),f=this._map.layerPointToLatLng(k)),this._tooltip.setLatLng(f)}});var fw=ki.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(l){var f=l&&l.tagName==="DIV"?l:document.createElement("div"),v=this.options;if(v.html instanceof Element?(cd(f),f.appendChild(v.html)):f.innerHTML=v.html!==!1?v.html:"",v.bgPos){var k=G(v.bgPos);f.style.backgroundPosition=-k.x+"px "+-k.y+"px"}return this._setIconStyles(f,"icon"),f},createShadow:function(){return null}});function Z8(l){return new fw(l)}ki.Default=xl;var gl=cr.extend({options:{tileSize:256,opacity:1,updateWhenIdle:_e.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(l){x(this,l)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(l){l._addZoomLimit(this)},onRemove:function(l){this._removeAllTiles(),jt(this._container),l._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Si(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ci(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(l){return this.options.opacity=l,this._updateOpacity(),this},setZIndex:function(l){return this.options.zIndex=l,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var l=this._clampZoom(this._map.getZoom());l!==this._tileZoom&&(this._tileZoom=l,this._updateLevels()),this._update()}return this},getEvents:function(){var l={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=u(this._onMoveEnd,this.options.updateInterval,this)),l.move=this._onMove),this._zoomAnimated&&(l.zoomanim=this._animateZoom),l},createTile:function(){return document.createElement("div")},getTileSize:function(){var l=this.options.tileSize;return l instanceof z?l:new z(l,l)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(l){for(var f=this.getPane().children,v=-l(-1/0,1/0),k=0,T=f.length,I;k<T;k++)I=f[k].style.zIndex,f[k]!==this._container&&I&&(v=l(v,+I));isFinite(v)&&(this.options.zIndex=v+l(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!_e.ielt9){Hn(this._container,this.options.opacity);var l=+new Date,f=!1,v=!1;for(var k in this._tiles){var T=this._tiles[k];if(!(!T.current||!T.loaded)){var I=Math.min(1,(l-T.loaded)/200);Hn(T.el,I),I<1?f=!0:(T.active?v=!0:this._onOpaqueTile(T),T.active=!0)}}v&&!this._noPrune&&this._pruneTiles(),f&&(R(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=Xe("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var l=this._tileZoom,f=this.options.maxZoom;if(l!==void 0){for(var v in this._levels)v=Number(v),this._levels[v].el.children.length||v===l?(this._levels[v].el.style.zIndex=f-Math.abs(l-v),this._onUpdateLevel(v)):(jt(this._levels[v].el),this._removeTilesAtZoom(v),this._onRemoveLevel(v),delete this._levels[v]);var k=this._levels[l],T=this._map;return k||(k=this._levels[l]={},k.el=Xe("div","leaflet-tile-container leaflet-zoom-animated",this._container),k.el.style.zIndex=f,k.origin=T.project(T.unproject(T.getPixelOrigin()),l).round(),k.zoom=l,this._setZoomTransform(k,T.getCenter(),T.getZoom()),m(k.el.offsetWidth),this._onCreateLevel(k)),this._level=k,k}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var l,f,v=this._map.getZoom();if(v>this.options.maxZoom||v<this.options.minZoom){this._removeAllTiles();return}for(l in this._tiles)f=this._tiles[l],f.retain=f.current;for(l in this._tiles)if(f=this._tiles[l],f.current&&!f.active){var k=f.coords;this._retainParent(k.x,k.y,k.z,k.z-5)||this._retainChildren(k.x,k.y,k.z,k.z+2)}for(l in this._tiles)this._tiles[l].retain||this._removeTile(l)}},_removeTilesAtZoom:function(l){for(var f in this._tiles)this._tiles[f].coords.z===l&&this._removeTile(f)},_removeAllTiles:function(){for(var l in this._tiles)this._removeTile(l)},_invalidateAll:function(){for(var l in this._levels)jt(this._levels[l].el),this._onRemoveLevel(Number(l)),delete this._levels[l];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(l,f,v,k){var T=Math.floor(l/2),I=Math.floor(f/2),V=v-1,Z=new z(+T,+I);Z.z=+V;var ne=this._tileCoordsToKey(Z),oe=this._tiles[ne];return oe&&oe.active?(oe.retain=!0,!0):(oe&&oe.loaded&&(oe.retain=!0),V>k?this._retainParent(T,I,V,k):!1)},_retainChildren:function(l,f,v,k){for(var T=2*l;T<2*l+2;T++)for(var I=2*f;I<2*f+2;I++){var V=new z(T,I);V.z=v+1;var Z=this._tileCoordsToKey(V),ne=this._tiles[Z];if(ne&&ne.active){ne.retain=!0;continue}else ne&&ne.loaded&&(ne.retain=!0);v+1<k&&this._retainChildren(T,I,v+1,k)}},_resetView:function(l){var f=l&&(l.pinch||l.flyTo);
41this._setView(this._map.getCenter(),this._map.getZoom(),f,f)},_animateZoom:function(l){this._setView(l.center,l.zoom,!0,l.noUpdate)},_clampZoom:function(l){var f=this.options;return f.minNativeZoom!==void 0&&l<f.minNativeZoom?f.minNativeZoom:f.maxNativeZoom!==void 0&&f.maxNativeZoom<l?f.maxNativeZoom:l},_setView:function(l,f,v,k){var T=Math.round(f);this.options.maxZoom!==void 0&&T>this.options.maxZoom||this.options.minZoom!==void 0&&T<this.options.minZoom?T=void 0:T=this._clampZoom(T);var I=this.options.updateWhenZooming&&T!==this._tileZoom;(!k||I)&&(this._tileZoom=T,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),T!==void 0&&this._update(l),v||this._pruneTiles(),this._noPrune=!!v),this._setZoomTransforms(l,f)},_setZoomTransforms:function(l,f){for(var v in this._levels)this._setZoomTransform(this._levels[v],l,f)},_setZoomTransform:function(l,f,v){var k=this._map.getZoomScale(v,l.zoom),T=l.origin.multiplyBy(k).subtract(this._map._getNewPixelOrigin(f,v)).round();_e.any3d?fs(l.el,T,k):kt(l.el,T)},_resetGrid:function(){var l=this._map,f=l.options.crs,v=this._tileSize=this.getTileSize(),k=this._tileZoom,T=this._map.getPixelWorldBounds(this._tileZoom);T&&(this._globalTileRange=this._pxBoundsToTileRange(T)),this._wrapX=f.wrapLng&&!this.options.noWrap&&[Math.floor(l.project([0,f.wrapLng[0]],k).x/v.x),Math.ceil(l.project([0,f.wrapLng[1]],k).x/v.y)],this._wrapY=f.wrapLat&&!this.options.noWrap&&[Math.floor(l.project([f.wrapLat[0],0],k).y/v.x),Math.ceil(l.project([f.wrapLat[1],0],k).y/v.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(l){var f=this._map,v=f._animatingZoom?Math.max(f._animateToZoom,f.getZoom()):f.getZoom(),k=f.getZoomScale(v,this._tileZoom),T=f.project(l,this._tileZoom).floor(),I=f.getSize().divideBy(k*2);return new Q(T.subtract(I),T.add(I))},_update:function(l){var f=this._map;if(f){var v=this._clampZoom(f.getZoom());if(l===void 0&&(l=f.getCenter()),this._tileZoom!==void 0){var k=this._getTiledPixelBounds(l),T=this._pxBoundsToTileRange(k),I=T.getCenter(),V=[],Z=this.options.keepBuffer,ne=new Q(T.getBottomLeft().subtract([Z,-Z]),T.getTopRight().add([Z,-Z]));if(!(isFinite(T.min.x)&&isFinite(T.min.y)&&isFinite(T.max.x)&&isFinite(T.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var oe in this._tiles){var ge=this._tiles[oe].coords;(ge.z!==this._tileZoom||!ne.contains(new z(ge.x,ge.y)))&&(this._tiles[oe].current=!1)}if(Math.abs(v-this._tileZoom)>1){this._setView(l,v);return}for(var Te=T.min.y;Te<=T.max.y;Te++)for(var Ue=T.min.x;Ue<=T.max.x;Ue++){var bn=new z(Ue,Te);if(bn.z=this._tileZoom,!!this._isValidTile(bn)){var Ht=this._tiles[this._tileCoordsToKey(bn)];Ht?Ht.current=!0:V.push(bn)}}if(V.sort(function(Cn,Ei){return Cn.distanceTo(I)-Ei.distanceTo(I)}),V.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Kn=document.createDocumentFragment();for(Ue=0;Ue<V.length;Ue++)this._addTile(V[Ue],Kn);this._level.el.appendChild(Kn)}}}},_isValidTile:function(l){var f=this._map.options.crs;if(!f.infinite){var v=this._globalTileRange;if(!f.wrapLng&&(l.x<v.min.x||l.x>v.max.x)||!f.wrapLat&&(l.y<v.min.y||l.y>v.max.y))return!1}if(!this.options.bounds)return!0;var k=this._tileCoordsToBounds(l);return fe(this.options.bounds).overlaps(k)},_keyToBounds:function(l){return this._tileCoordsToBounds(this._keyToTileCoords(l))},_tileCoordsToNwSe:function(l){var f=this._map,v=this.getTileSize(),k=l.scaleBy(v),T=k.add(v),I=f.unproject(k,l.z),V=f.unproject(T,l.z);return[I,V]},_tileCoordsToBounds:function(l){var f=this._tileCoordsToNwSe(l),v=new ce(f[0],f[1]);return this.options.noWrap||(v=this._map.wrapLatLngBounds(v)),v},_tileCoordsToKey:function(l){return l.x+":"+l.y+":"+l.z},_keyToTileCoords:function(l){var f=l.split(":"),v=new z(+f[0],+f[1]);return v.z=+f[2],v},_removeTile:function(l){var f=this._tiles[l];f&&(jt(f.el),delete this._tiles[l],this.fire("tileunload",{tile:f.el,coords:this._keyToTileCoords(l)}))},_initTile:function(l){Fe(l,"leaflet-tile");var f=this.getTileSize();l.style.width=f.x+"px",l.style.height=f.y+"px",l.onselectstart=m,l.onmousemove=m,_e.ielt9&&this.options.opacity<1&&Hn(l,this.options.opacity)},_addTile:function(l,f){var v=this._getTilePos(l),k=this._tileCoordsToKey(l),T=this.createTile(this._wrapCoords(l),o(this._tileReady,this,l));this._initTile(T),this.createTile.length<2&&M(o(this._tileReady,this,l,null,T)),kt(T,v),this._tiles[k]={el:T,coords:l,current:!0},f.appendChild(T),this.fire("tileloadstart",{tile:T,coords:l})},_tileReady:function(l,f,v){f&&this.fire("tileerror",{error:f,tile:v,coords:l});var k=this._tileCoordsToKey(l);v=this._tiles[k],v&&(v.loaded=+new Date,this._map._fadeAnimated?(Hn(v.el,0),R(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(v.active=!0,this._pruneTiles()),f||(Fe(v.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:v.el,coords:l})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_e.ielt9||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(l){return l.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(l){var f=new z(this._wrapX?h(l.x,this._wrapX):l.x,this._wrapY?h(l.y,this._wrapY):l.y);return f.z=l.z,f},_pxBoundsToTileRange:function(l){var f=this.getTileSize();return new Q(l.min.unscaleBy(f).floor(),l.max.unscaleBy(f).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var l in this._tiles)if(!this._tiles[l].loaded)return!1;return!0}});function X8(l){return new gl(l)}var Oi=gl.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(l,f){this._url=l,f=x(this,f),f.detectRetina&&_e.retina&&f.maxZoom>0?(f.tileSize=Math.floor(f.tileSize/2),f.zoomReverse?(f.zoomOffset--,f.minZoom=Math.min(f.maxZoom,f.minZoom+1)):(f.zoomOffset++,f.maxZoom=Math.max(f.minZoom,f.maxZoom-1)),f.minZoom=Math.max(0,f.minZoom)):f.zoomReverse?f.minZoom=Math.min(f.maxZoom,f.minZoom):f.maxZoom=Math.max(f.minZoom,f.maxZoom),typeof f.subdomains=="string"&&(f.subdomains=f.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(l,f){return this._url===l&&f===void 0&&(f=!0),this._url=l,f||this.redraw(),this},createTile:function(l,f){var v=document.createElement("img");return De(v,"load",o(this._tileOnLoad,this,f,v)),De(v,"error",o(this._tileOnError,this,f,v)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(v.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(v.referrerPolicy=this.options.referrerPolicy),v.alt="",v.src=this.getTileUrl(l),v},getTileUrl:function(l){var f={r:_e.retina?"@2x":"",s:this._getSubdomain(l),x:l.x,y:l.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var v=this._globalTileRange.max.y-l.y;this.options.tms&&(f.y=v),f["-y"]=v}return S(this._url,s(f,this.options))},_tileOnLoad:function(l,f){_e.ielt9?setTimeout(o(l,this,null,f),0):l(null,f)},_tileOnError:function(l,f,v){var k=this.options.errorTileUrl;k&&f.getAttribute("src")!==k&&(f.src=k),l(v,f)},_onTileRemove:function(l){l.tile.onload=null},_getZoomForUrl:function(){var l=this._tileZoom,f=this.options.maxZoom,v=this.options.zoomReverse,k=this.options.zoomOffset;return v&&(l=f-l),l+k},_getSubdomain:function(l){var f=Math.abs(l.x+l.y)%this.options.subdomains.length;return this.options.subdomains[f]},_abortLoading:function(){var l,f;for(l in this._tiles)if(this._tiles[l].coords.z!==this._tileZoom&&(f=this._tiles[l].el,f.onload=m,f.onerror=m,!f.complete)){f.src=C;var v=this._tiles[l].coords;jt(f),delete this._tiles[l],this.fire("tileabort",{tile:f,coords:v})}},_removeTile:function(l){var f=this._tiles[l];if(f)return f.el.setAttribute("src",C),gl.prototype._removeTile.call(this,l)},_tileReady:function(l,f,v){if(!(!this._map||v&&v.getAttribute("src")===C))return gl.prototype._tileReady.call(this,l,f,v)}});function mw(l,f){return new Oi(l,f)}var pw=Oi.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(l,f){this._url=l;var v=s({},this.defaultWmsParams);for(var k in f)k in this.options||(v[k]=f[k]);f=x(this,f);var T=f.detectRetina&&_e.retina?2:1,I=this.getTileSize();v.width=I.x*T,v.height=I.y*T,this.wmsParams=v},onAdd:function(l){this._crs=this.options.crs||l.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var f=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[f]=this._crs.code,Oi.prototype.onAdd.call(this,l)},getTileUrl:function(l){var f=this._tileCoordsToNwSe(l),v=this._crs,k=re(v.project(f[0]),v.project(f[1])),T=k.min,I=k.max,V=(this._wmsVersion>=1.3&&this._crs===ow?[T.y,T.x,I.y,I.x]:[T.x,T.y,I.x,I.y]).join(","),Z=Oi.prototype.getTileUrl.call(this,l);return Z+g(this.wmsParams,Z,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+V},setParams:function(l,f){return s(this.wmsParams,l),f||this.redraw(),this}});function J8(l,f){return new pw(l,f)}Oi.WMS=pw,mw.wms=J8;var sa=cr.extend({options:{padding:.1},initialize:function(l){x(this,l),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Fe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var l={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(l.zoomanim=this._onAnimZoom),l},_onAnimZoom:function(l){this._updateTransform(l.center,l.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(l,f){var v=this._map.getZoomScale(f,this._zoom),k=this._map.getSize().multiplyBy(.5+this.options.padding),T=this._map.project(this._center,f),I=k.multiplyBy(-v).add(T).subtract(this._map._getNewPixelOrigin(l,f));_e.any3d?fs(this._container,I,v):kt(this._container,I)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var l in this._layers)this._layers[l]._reset()},_onZoomEnd:function(){for(var l in this._layers)this._layers[l]._project()},_updatePaths:function(){for(var l in this._layers)this._layers[l]._update()}
41,_update:function(){var l=this.options.padding,f=this._map.getSize(),v=this._map.containerPointToLayerPoint(f.multiplyBy(-l)).round();this._bounds=new Q(v,v.add(f.multiplyBy(1+l*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),xw=sa.extend({options:{tolerance:0},getEvents:function(){var l=sa.prototype.getEvents.call(this);return l.viewprereset=this._onViewPreReset,l},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){sa.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var l=this._container=document.createElement("canvas");De(l,"mousemove",this._onMouseMove,this),De(l,"click dblclick mousedown mouseup contextmenu",this._onClick,this),De(l,"mouseout",this._handleMouseOut,this),l._leaflet_disable_events=!0,this._ctx=l.getContext("2d")},_destroyContainer:function(){R(this._redrawRequest),delete this._ctx,jt(this._container),ct(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var l;this._redrawBounds=null;for(var f in this._layers)l=this._layers[f],l._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){sa.prototype._update.call(this);var l=this._bounds,f=this._container,v=l.getSize(),k=_e.retina?2:1;kt(f,l.min),f.width=k*v.x,f.height=k*v.y,f.style.width=v.x+"px",f.style.height=v.y+"px",_e.retina&&this._ctx.scale(2,2),this._ctx.translate(-l.min.x,-l.min.y),this.fire("update")}},_reset:function(){sa.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(l){this._updateDashArray(l),this._layers[d(l)]=l;var f=l._order={layer:l,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=f),this._drawLast=f,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(l){this._requestRedraw(l)},_removePath:function(l){var f=l._order,v=f.next,k=f.prev;v?v.prev=k:this._drawLast=k,k?k.next=v:this._drawFirst=v,delete l._order,delete this._layers[d(l)],this._requestRedraw(l)},_updatePath:function(l){this._extendRedrawBounds(l),l._project(),l._update(),this._requestRedraw(l)},_updateStyle:function(l){this._updateDashArray(l),this._requestRedraw(l)},_updateDashArray:function(l){if(typeof l.options.dashArray=="string"){var f=l.options.dashArray.split(/[, ]+/),v=[],k,T;for(T=0;T<f.length;T++){if(k=Number(f[T]),isNaN(k))return;v.push(k)}l.options._dashArray=v}else l.options._dashArray=l.options.dashArray},_requestRedraw:function(l){this._map&&(this._extendRedrawBounds(l),this._redrawRequest=this._redrawRequest||M(this._redraw,this))},_extendRedrawBounds:function(l){if(l._pxBounds){var f=(l.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Q,this._redrawBounds.extend(l._pxBounds.min.subtract([f,f])),this._redrawBounds.extend(l._pxBounds.max.add([f,f]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var l=this._redrawBounds;if(l){var f=l.getSize();this._ctx.clearRect(l.min.x,l.min.y,f.x,f.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var l,f=this._redrawBounds;if(this._ctx.save(),f){var v=f.getSize();this._ctx.beginPath(),this._ctx.rect(f.min.x,f.min.y,v.x,v.y),this._ctx.clip()}this._drawing=!0;for(var k=this._drawFirst;k;k=k.next)l=k.layer,(!f||l._pxBounds&&l._pxBounds.intersects(f))&&l._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(l,f){if(this._drawing){var v,k,T,I,V=l._parts,Z=V.length,ne=this._ctx;if(Z){for(ne.beginPath(),v=0;v<Z;v++){for(k=0,T=V[v].length;k<T;k++)I=V[v][k],ne[k?"lineTo":"moveTo"](I.x,I.y);f&&ne.closePath()}this._fillStroke(ne,l)}}},_updateCircle:function(l){if(!(!this._drawing||l._empty())){var f=l._point,v=this._ctx,k=Math.max(Math.round(l._radius),1),T=(Math.max(Math.round(l._radiusY),1)||k)/k;T!==1&&(v.save(),v.scale(1,T)),v.beginPath(),v.arc(f.x,f.y/T,k,0,Math.PI*2,!1),T!==1&&v.restore(
41),this._fillStroke(v,l)}},_fillStroke:function(l,f){var v=f.options;v.fill&&(l.globalAlpha=v.fillOpacity,l.fillStyle=v.fillColor||v.color,l.fill(v.fillRule||"evenodd")),v.stroke&&v.weight!==0&&(l.setLineDash&&l.setLineDash(f.options&&f.options._dashArray||[]),l.globalAlpha=v.opacity,l.lineWidth=v.weight,l.strokeStyle=v.color,l.lineCap=v.lineCap,l.lineJoin=v.lineJoin,l.stroke())},_onClick:function(l){for(var f=this._map.mouseEventToLayerPoint(l),v,k,T=this._drawFirst;T;T=T.next)v=T.layer,v.options.interactive&&v._containsPoint(f)&&(!(l.type==="click"||l.type==="preclick")||!this._map._draggableMoved(v))&&(k=v);this._fireEvent(k?[k]:!1,l)},_onMouseMove:function(l){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var f=this._map.mouseEventToLayerPoint(l);this._handleMouseHover(l,f)}},_handleMouseOut:function(l){var f=this._hoveredLayer;f&&(_t(this._container,"leaflet-interactive"),this._fireEvent([f],l,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(l,f){if(!this._mouseHoverThrottled){for(var v,k,T=this._drawFirst;T;T=T.next)v=T.layer,v.options.interactive&&v._containsPoint(f)&&(k=v);k!==this._hoveredLayer&&(this._handleMouseOut(l),k&&(Fe(this._container,"leaflet-interactive"),this._fireEvent([k],l,"mouseover"),this._hoveredLayer=k)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,l),this._mouseHoverThrottled=!0,setTimeout(o(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(l,f,v){this._map._fireDOMEvent(f,v||f.type,l)},_bringToFront:function(l){var f=l._order;if(f){var v=f.next,k=f.prev;if(v)v.prev=k;else return;k?k.next=v:v&&(this._drawFirst=v),f.prev=this._drawLast,this._drawLast.next=f,f.next=null,this._drawLast=f,this._requestRedraw(l)}},_bringToBack:function(l){var f=l._order;if(f){var v=f.next,k=f.prev;if(k)k.next=v;else return;v?v.prev=k:k&&(this._drawLast=k),f.prev=null,f.next=this._drawFirst,this._drawFirst.prev=f,this._drawFirst=f,this._requestRedraw(l)}}});function gw(l){return _e.canvas?new xw(l):null}var bl=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(l){return document.createElement("<lvml:"+l+' class="lvml">')}}catch{}return function(l){return document.createElement("<"+l+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Q8={_initContainer:function(){this._container=Xe("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(sa.prototype._update.call(this),this.fire("update"))},_initPath:function(l){var f=l._container=bl("shape");
41Fe(f,"leaflet-vml-shape "+(this.options.className||"")),f.coordsize="1 1",l._path=bl("path"),f.appendChild(l._path),this._updateStyle(l),this._layers[d(l)]=l},_addPath:function(l){var f=l._container;this._container.appendChild(f),l.options.interactive&&l.addInteractiveTarget(f)},_removePath:function(l){var f=l._container;jt(f),l.removeInteractiveTarget(f),delete this._layers[d(l)]},_updateStyle:function(l){var f=l._stroke,v=l._fill,k=l.options,T=l._container;T.stroked=!!k.stroke,T.filled=!!k.fill,k.stroke?(f||(f=l._stroke=bl("stroke")),T.appendChild(f),f.weight=k.weight+"px",f.color=k.color,f.opacity=k.opacity,k.dashArray?f.dashStyle=_(k.dashArray)?k.dashArray.join(" "):k.dashArray.replace(/( *, *)/g," "):f.dashStyle="",f.endcap=k.lineCap.replace("butt","flat"),f.joinstyle=k.lineJoin):f&&(T.removeChild(f),l._stroke=null),k.fill?(v||(v=l._fill=bl("fill")),T.appendChild(v),v.color=k.fillColor||k.color,v.opacity=k.fillOpacity):v&&(T.removeChild(v),l._fill=null)},_updateCircle:function(l){var f=l._point.round(),v=Math.round(l._radius),k=Math.round(l._radiusY||v);this._setPath(l,l._empty()?"M0 0":"AL "+f.x+","+f.y+" "+v+","+k+" 0,"+65535*360)},_setPath:function(l,f){l._path.v=f},_bringToFront:function(l){Si(l._container)},_bringToBack:function(l){Ci(l._container)}},_d=_e.vml?bl:Le,vl=sa.extend({_initContainer:function(){this._container=_d("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=_d("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){jt(this._container),ct(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){sa.prototype._update.call(this);var l=this._bounds,f=l.getSize(),v=this._container;(!this._svgSize||!this._svgSize.equals(f))&&(this._svgSize=f,v.setAttribute("width",f.x),v.setAttribute("height",f.y)),kt(v,l.min),v.setAttribute("viewBox",[l.min.x,l.min.y,f.x,f.y].join(" ")),this.fire("update")}},_initPath:function(l){var f=l._path=_d("path");l.options.className&&Fe(f,l.options.className),l.options.interactive&&Fe(f,"leaflet-interactive"),this._updateStyle(l),this._layers[d(l)]=l},_addPath:function(l){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(l._path),l.addInteractiveTarget(l._path)},_removePath:function(l){jt(l._path),l.removeInteractiveTarget(l._path),delete this._layers[d(l)]},_updatePath:function(l){l._project(),l._update()},_updateStyle:function(l){var f=l._path,v=l.options;f&&(v.stroke?(f.setAttribute("stroke",v.color),f.setAttribute("stroke-opacity",v.opacity),f.setAttribute("stroke-width",v.weight),f.setAttribute("stroke-linecap",v.lineCap),f.setAttribute("stroke-linejoin",v.lineJoin),v.dashArray?f.setAttribute("stroke-dasharray",v.dashArray):f.removeAttribute("stroke-dasharray"),v.dashOffset?f.setAttribute("stroke-dashoffset",v.dashOffset):f.removeAttribute("stroke-dashoffset")):f.setAttribute("stroke","none"),v.fill?(f.setAttribute("fill",v.fillColor||v.color),f.setAttribute("fill-opacity",v.fillOpacity),f.setAttribute("fill-rule",v.fillRule||"evenodd")):f.setAttribute("fill","none"))},_updatePoly:function(l,f){this._setPath(l,Ge(l._parts,f))},_updateCircle:function(l){var f=l._point,v=Math.max(Math.round(l._radius),1),k=Math.max(Math.round(l._radiusY),1)||v,T="a"+v+","+k+" 0 1,0 ",I=l._empty()?"M0 0":"M"+(f.x-v)+","+f.y+T+v*2+",0 "+T+-v*2+",0 ";this._setPath(l,I)},_setPath:function(l,f){l._path.setAttribute("d",f)},_bringToFront:function(l){Si(l._path)},_bringToBack:function(l){Ci(l._path)}});_e.vml&&vl.include(Q8);function bw(l){return _e.svg||_e.vml?new vl(l):null}Ve.include({getRenderer:function(l){var f=l.options.renderer||this._getPaneRenderer(l.options.pane)||this.options.renderer||this._renderer;return f||(f=this._renderer=this._createRenderer()),this.hasLayer(f)||this.addLayer(f),f},_getPaneRenderer:function(l){if(l==="overlayPane"||l===void 0)return!1;var f=this._paneRenderers[l];return f===void 0&&(f=this._createRenderer({pane:l}),this._paneRenderers[l]=f),f},_createRenderer:function(l){return this.options.preferCanvas&&gw(l)||bw(l)}});var vw=Pi.extend({initialize:function(l,f){Pi.prototype.initialize.call(this,this._boundsToLatLngs(l),f)},setBounds:function(l){return this.setLatLngs(this._boundsToLatLngs(l))}
41,_boundsToLatLngs:function(l){return l=fe(l),[l.getSouthWest(),l.getNorthWest(),l.getNorthEast(),l.getSouthEast()]}});function e9(l,f){return new vw(l,f)}vl.create=_d,vl.pointsToPath=Ge,aa.geometryToLayer=gd,aa.coordsToLatLng=Dm,aa.coordsToLatLngs=bd,aa.latLngToCoords=$m,aa.latLngsToCoords=vd,aa.getFeature=Ti,aa.asFeature=yd,Ve.mergeOptions({boxZoom:!0});var yw=Or.extend({initialize:function(l){this._map=l,this._container=l._container,this._pane=l._panes.overlayPane,this._resetStateTimeout=0,l.on("unload",this._destroy,this)},addHooks:function(){De(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ct(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){jt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(l){if(!l.shiftKey||l.which!==1&&l.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),dl(),ym(),this._startPoint=this._map.mouseEventToContainerPoint(l),De(document,{contextmenu:xs,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(l){this._moved||(this._moved=!0,this._box=Xe("div","leaflet-zoom-box",this._container),Fe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(l);var f=new Q(this._point,this._startPoint),v=f.getSize();kt(this._box,f.min),this._box.style.width=v.x+"px",this._box.style.height=v.y+"px"},_finish:function(){this._moved&&(jt(this._box),_t(this._container,"leaflet-crosshair")),ul(),jm(),ct(document,{contextmenu:xs,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(l){if(!(l.which!==1&&l.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var f=new ce(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(f).fire("boxzoomend",{boxZoomBounds:f})}},_onKeyDown:function(l){l.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ve.addInitHook("addHandler","boxZoom",yw),Ve.mergeOptions({doubleClickZoom:!0});var jw=Or.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(l){var f=this._map,v=f.getZoom(),k=f.options.zoomDelta,T=l.originalEvent.shiftKey?v-k:v+k;f.options.doubleClickZoom==="center"?f.setZoom(T):f.setZoomAround(l.containerPoint,T)}});Ve.addInitHook("addHandler","doubleClickZoom",jw),Ve.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ww=Or.extend({addHooks:function(){if(!this._draggable){var l=this._map;this._draggable=new La(l._mapPane,l._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),l.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),l.on("zoomend",this._onZoomEnd,this),l.whenReady(this._onZoomEnd,this))}Fe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_t(this._map._container,"leaflet-grab"),_t(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var l=this._map;if(l._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var f=fe(this._map.options.maxBounds);this._offsetLimit=re(this._map.latLngToContainerPoint(f.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(f.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;l.fire("movestart").fire("dragstart"),l.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(l){if(this._map.options.inertia){var f=this._lastTime=+new Date,v=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(v),this._times.push(f),this._prunePositions(f)}this._map.fire("move",l).fire("drag",l)}
41,_prunePositions:function(l){for(;this._positions.length>1&&l-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var l=this._map.getSize().divideBy(2),f=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=f.subtract(l).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(l,f){return l-(l-f)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var l=this._draggable._newPos.subtract(this._draggable._startPos),f=this._offsetLimit;l.x<f.min.x&&(l.x=this._viscousLimit(l.x,f.min.x)),l.y<f.min.y&&(l.y=this._viscousLimit(l.y,f.min.y)),l.x>f.max.x&&(l.x=this._viscousLimit(l.x,f.max.x)),l.y>f.max.y&&(l.y=this._viscousLimit(l.y,f.max.y)),this._draggable._newPos=this._draggable._startPos.add(l)}},_onPreDragWrap:function(){var l=this._worldWidth,f=Math.round(l/2),v=this._initialWorldOffset,k=this._draggable._newPos.x,T=(k-f+v)%l+f-v,I=(k+f+v)%l-f-v,V=Math.abs(T+v)<Math.abs(I+v)?T:I;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=V},_onDragEnd:function(l){var f=this._map,v=f.options,k=!v.inertia||l.noInertia||this._times.length<2;if(f.fire("dragend",l),k)f.fire("moveend");else{this._prunePositions(+new Date);var T=this._lastPos.subtract(this._positions[0]),I=(this._lastTime-this._times[0])/1e3,V=v.easeLinearity,Z=T.multiplyBy(V/I),ne=Z.distanceTo([0,0]),oe=Math.min(v.inertiaMaxSpeed,ne),ge=Z.multiplyBy(oe/ne),Te=oe/(v.inertiaDeceleration*V),Ue=ge.multiplyBy(-Te/2).round();!Ue.x&&!Ue.y?f.fire("moveend"):(Ue=f._limitOffset(Ue,f.options.maxBounds),M(function(){f.panBy(Ue,{duration:Te,easeLinearity:V,noMoveStart:!0,animate:!0})}))}}});Ve.addInitHook("addHandler","dragging",ww),Ve.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Nw=Or.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(l){this._map=l,this._setPanDelta(l.options.keyboardPanDelta),this._setZoomDelta(l.options.zoomDelta)},addHooks:function(){var l=this._map._container;l.tabIndex<=0&&(l.tabIndex="0"),De(l,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),ct(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var l=document.body,f=document.documentElement,v=l.scrollTop||f.scrollTop,k=l.scrollLeft||f.scrollLeft;this._map._container.focus(),window.scrollTo(k,v)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(l){var f=this._panKeys={},v=this.keyCodes,k,T;for(k=0,T=v.left.length;k<T;k++)f[v.left[k]]=[-1*l,0];for(k=0,T=v.right.length;k<T;k++)f[v.right[k]]=[l,0];for(k=0,T=v.down.length;k<T;k++)f[v.down[k]]=[0,l];for(k=0,T=v.up.length;k<T;k++)f[v.up[k]]=[0,-1*l]},_setZoomDelta:function(l){var f=this._zoomKeys={},v=this.keyCodes,k,T;for(k=0,T=v.zoomIn.length;k<T;k++)f[v.zoomIn[k]]=l;for(k=0,T=v.zoomOut.length;k<T;k++)f[v.zoomOut[k]]=-l},_addHooks:function(){De(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){ct(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(l){if(!(l.altKey||l.ctrlKey||l.metaKey)){var f=l.keyCode,v=this._map,k;if(f in this._panKeys){if(!v._panAnim||!v._panAnim._inProgress)if(k=this._panKeys[f],l.shiftKey&&(k=G(k).multiplyBy(3)),v.options.maxBounds&&(k=v._limitOffset(G(k),v.options.maxBounds)),v.options.worldCopyJump){var T=v.wrapLatLng(v.unproject(v.project(v.getCenter()).add(k)));v.panTo(T)}else v.panBy(k)}else if(f in this._zoomKeys)v.setZoom(v.getZoom()+(l.shiftKey?3:1)*this._zoomKeys[f]);else if(f===27&&v._popup&&v._popup.options.closeOnEscapeKey)v.closePopup();else return;xs(l)}}});Ve.addInitHook("addHandler","keyboard",Nw),Ve.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var _w=Or.extend({addHooks:function(){De(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){ct(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(l){var f=Kj(l),v=this._map.options.wheelDebounceTime;this._delta+=f,this._lastMousePos=this._map.mouseEventToContainerPoint(l),this._startTime||(this._startTime=+new Date);var k=Math.max(v-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),k),xs(l)},_performZoom:function(){var l=this._map,f=l.getZoom(),v=this._map.options.zoomSnap||0;l._stop();var k=this._delta/(this._map.options.wheelPxPerZoomLevel*4),T=4*Math.log(2/(1+Math.exp(-Math.abs(k))))/M
41ath.LN2,I=v?Math.ceil(T/v)*v:T,V=l._limitZoom(f+(this._delta>0?I:-I))-f;this._delta=0,this._startTime=null,V&&(l.options.scrollWheelZoom==="center"?l.setZoom(f+V):l.setZoomAround(this._lastMousePos,f+V))}});Ve.addInitHook("addHandler","scrollWheelZoom",_w);var t9=600;Ve.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var Sw=Or.extend({addHooks:function(){De(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ct(this._map._container,"touchstart",this._onDown,this)},_onDown:function(l){if(clearTimeout(this._holdTimeout),l.touches.length===1){var f=l.touches[0];this._startPos=this._newPos=new z(f.clientX,f.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(De(document,"touchend",an),De(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",f))},this),t9),De(document,"touchend touchcancel contextmenu",this._cancel,this),De(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function l(){ct(document,"touchend",an),ct(document,"touchend touchcancel",l)},_cancel:function(){clearTimeout(this._holdTimeout),ct(document,"touchend touchcancel contextmenu",this._cancel,this),ct(document,"touchmove",this._onMove,this)},_onMove:function(l){var f=l.touches[0];this._newPos=new z(f.clientX,f.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(l,f){var v=new MouseEvent(l,{bubbles:!0,cancelable:!0,view:window,screenX:f.screenX,screenY:f.screenY,clientX:f.clientX,clientY:f.clientY});v._simulated=!0,f.target.dispatchEvent(v)}});Ve.addInitHook("addHandler","tapHold",Sw),Ve.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var Cw=Or.extend({addHooks:function(){Fe(this._map._container,"leaflet-touch-zoom"),De(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){_t(this._map._container,"leaflet-touch-zoom"),ct(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(l){var f=this._map;if(!(!l.touches||l.touches.length!==2||f._animatingZoom||this._zooming)){var v=f.mouseEventToContainerPoint(l.touches[0]),k=f.mouseEventToContainerPoint(l.touches[1]);this._centerPoint=f.getSize()._divideBy(2),this._startLatLng=f.containerPointToLatLng(this._centerPoint),f.options.touchZoom!=="center"&&(this._pinchStartLatLng=f.containerPointToLatLng(v.add(k)._divideBy(2))),this._startDist=v.distanceTo(k),this._startZoom=f.getZoom(),this._moved=!1,this._zooming=!0,f._stop(),De(document,"touchmove",this._onTouchMove,this),De(document,"touchend touchcancel",this._onTouchEnd,this),an(l)}},_onTouchMove:function(l){if(!(!l.touches||l.touches.length!==2||!this._zooming)){var f=this._map,v=f.mouseEventToContainerPoint(l.touches[0]),k=f.mouseEventToContainerPoint(l.touches[1]),T=v.distanceTo(k)/this._startDist;if(this._zoom=f.getScaleZoom(T,this._startZoom),!f.options.bounceAtZoomLimits&&(this._zoom<f.getMinZoom()&&T<1||this._zoom>f.getMaxZoom()&&T>1)&&(this._zoom=f._limitZoom(this._zoom)),f.options.touchZoom==="center"){if(this._center=this._startLatLng,T===1)return}else{var I=v._add(k)._divideBy(2)._subtract(this._centerPoint);if(T===1&&I.x===0&&I.y===0)return;this._center=f.unproject(f.project(this._pinchStartLatLng,this._zoom).subtract(I),this._zoom)}this._moved||(f._moveStart(!0,!1),this._moved=!0),R(this._animRequest);var V=o(f._move,f,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=M(V,this,!0),an(l)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,R(this._animRequest),ct(document,"touchmove",this._onTouchMove,this),ct(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ve.addInitHook("addHandler","touchZoom",Cw),Ve.BoxZoom=yw,Ve.DoubleClickZoom=jw,Ve.Drag=ww,Ve.Keyboard=Nw,Ve.ScrollWheelZoom=_w,Ve.TapHold=Sw,Ve.TouchZoom=Cw,r.Bounds=Q,r.Browser=_e,r.CRS=Re,r.Canvas=xw,r.Circle=Rm,r.CircleMarker=xd,r.Class=D,r.Control=lr,r.DivIcon=fw,r.DivOverlay=Er,r.DomEvent=v8,r.DomUtil=g8,r.Draggable=La,r.Evented=K,r.FeatureGroup=na,r.GeoJSON=aa,r.GridLayer=gl,r.Handler=Or,r.Icon=ki,r.ImageOverlay=jd,r.LatLng=me,r.LatLngBounds=ce,r.L
41ayer=cr,r.LayerGroup=Ai,r.LineUtil=E8,r.Map=Ve,r.Marker=pd,r.Mixin=C8,r.Path=Ia,r.Point=z,r.PolyUtil=A8,r.Polygon=Pi,r.Polyline=ra,r.Popup=wd,r.PosAnimation=Yj,r.Projection=M8,r.Rectangle=vw,r.Renderer=sa,r.SVG=vl,r.SVGOverlay=hw,r.TileLayer=Oi,r.Tooltip=Nd,r.Transformation=ee,r.Util=B,r.VideoOverlay=uw,r.bind=o,r.bounds=re,r.canvas=gw,r.circle=U8,r.circleMarker=B8,r.control=ml,r.divIcon=Z8,r.extend=s,r.featureGroup=D8,r.geoJSON=dw,r.geoJson=q8,r.gridLayer=X8,r.icon=$8,r.imageOverlay=V8,r.latLng=pe,r.latLngBounds=fe,r.layerGroup=R8,r.map=y8,r.marker=F8,r.point=G,r.polygon=W8,r.polyline=z8,r.popup=K8,r.rectangle=e9,r.setOptions=x,r.stamp=d,r.svg=bw,r.svgOverlay=G8,r.tileLayer=mw,r.tooltip=Y8,r.transformation=Y,r.version=a,r.videoOverlay=H8;var n9=window.L;r.noConflict=function(){return window.L=n9,this},window.L=r}))})(Ml,Ml.exports)),Ml.exports}var jf=aB();function r1(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function a1(e,t){return t==null?function(a,s){const i=y.useRef(void 0);return i.current||(i.current=e(a,s)),i}:function(a,s){const i=y.useRef(void 0);i.current||(i.current=e(a,s));const o=y.useRef(a),{instance:c}=i.current;return y.useEffect(function(){o.current!==a&&(t(c,a,o.current),o.current=a)},[c,a,t]),i}}function tP(e,t){y.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){t.layerContainer?.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function sB(e){return function(r){const a=vf(),s=e(yf(r,a),a);return eP(a.map,r.attribution),n1(s.current,r.eventHandlers),tP(s.current,a),s}}function iB(e,t){const r=y.useRef(void 0);y.useEffect(function(){if(t.pathOptions!==r.current){const s=t.pathOptions??{};e.instance.setStyle(s),r.current=s}},[e,t])}function oB(e){return function(r){const a=vf(),s=e(yf(r,a),a);return n1(s.current,r.eventHandlers),tP(s.current,a),iB(s.current,r),s}}function lB(e,t){const r=a1(e),a=nB(r,t);return eB(a)}function cB(e,t){const r=a1(e,t),a=oB(r);return QF(a)}function dB(e,t){const r=a1(e,t),a=sB(r);return tB(a)}function uB(e,t,r){const{opacity:a,zIndex:s}=t;a!=null&&a!==r.opacity&&e.setOpacity(a),s!=null&&s!==r.zIndex&&e.setZIndex(s)}function nP(){return vf().map}const rP=cB(function({center:t,children:r,...a},s){const i=new jf.CircleMarker(t,a);return r1(i,JF(s,{overlayContainer:i}))},YF);function hB({bounds:e,boundsOptions:t,center:r,children:a,className:s,id:i,placeholder:o,style:c,whenReady:d,zoom:u,...h},m){const[p]=y.useState({className:s,id:i,style:c}),[b,w]=y.useState(null),x=y.useRef(void 0);y.useImperativeHandle(m,()=>b?.map??null,[b]);const g=y.useCallback(S=>{if(S!==null&&!x.current){const _=new jf.Map(S,h);x.current=_,r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),d!=null&&_.whenReady(d),w(XF(_))}},[]);y.useEffect(()=>()=>{b?.map.remove()},[b]);const j=b?q.createElement(t1,{value:b},a):o??null;return q.createElement("div",{...p,ref:g},j)}const aP=y.forwardRef(hB),sP=lB(function(t,r){const a=new jf.Popup(t,r.overlayContainer);return r1(a,r)},function(t,r,{position:a},s){y.useEffect(function(){const{instance:o}=t;function c(u){u.popup===o&&(o.update(),s(!0))}function d(u){u.popup===o&&s(!1)}return r.map.on({popupopen:c,popupclose:d}),r.overlayContainer==null?(a!=null&&o.setLatLng(a),o.openOn(r.map)):r.overlayContainer.bindPopup(o),function(){r.map.off({popupopen:c,popupclose:d}),r.overlayContainer?.unbindPopup(),r.map.removeLayer(o)}},[t,r,s,a])}),iP=dB(function({url:t,...r},a){const s=new jf.TileLayer(t,yf(r,a));return r1(s,a)},function(t,r,a){uB(t,r,a);const{url:s}=r;s!=null&&s!==a.url&&t.setUrl(s)}),oP=[39.5,-98.35],lP=4;function fB(){const e=nP();return n.jsxs("button",{onClick:()=>e.setView(oP,lP),className:"absolute top-3 right-3 z-[1000] flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-[#111827]/90 border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#00b4ff40] text-xs font-medium transition-all backdrop-blur-sm",title:"Reset map view",children:[n.jsx(h9,{className:"w-3.5 h-3.5"}),"Reset View"]})}const lN={Army:"#4ade80",Navy:"#60a5fa","Air Force":"#818cf8",Marines:"#f87171","Coast Guard":"#fb923c","Space Force":"#c084fc","Joint Base":"#fbbf24"},Id=[{name:"Fort Liberty",branch:"Army",state:"NC",lat:35.14,lng:-79,personnel:"~68,000"},{name:"Fort Cavazos",branch:"Army",state:"TX",lat:31.13,lng:-97.78,personnel:"~59,700"},{name:"Fort Moore",branch:"Army",state:"GA",lat:32.36,lng:-84.95,personnel:"~42,000"},{name:"Fort Campbell",branch:"Army",state:"KY",lat:36.66,lng:-87.47,personnel:"~36,000"},{name:"Fort Stewart",branch:"Army",state:"GA",lat:31.87,lng:-81.61,personnel:"~24,000"},{name:"Fort Drum",branch:"Army",state:"NY",lat:44.05,lng:-75.76,personnel:"~17,000"},{name:"Fort Riley",branch:"Army",state:"KS",lat:39.06,lng:-96.83,personnel:"~15,000"},{name:"Fort Carson",branch:"Army",state:"CO",lat:38.74,lng:-104.79,personnel:"~32,400"},{name:"Fort Bliss",branch:"Army",state:"TX",lat:31.81,lng:-106.42,personnel:"~48,500"},{name:"Fort Eisenhower",branch:"Army",state:"GA",lat:33.42,lng:-82.13,personnel:"~27,000"},{name:"Fort Huachuca",branch:"Army",state:"AZ",lat:31.55,lng:-110.35,personnel:"~12,000"},{name:"Fort Irwin",branch:"Army",state:"CA",lat:35.26,lng:-116.68,personnel:"~7,500"},{name:"Fort Johnson",branch:"Army",state:"LA",lat:31.13,lng:-93.2,personnel:"~13,000"},{name:"Fort Knox",branch:"Army",state:"KY",lat:37.9,lng:-85.96,personnel:"~12,000"},{name:"Fort Leonard Wood",branch:"Army",state:"MO",lat:37.74,lng:-92.15,personnel:"~18,000"},{name:"Fort Leavenworth",branch:"Army",state:"KS",lat:39.35,lng:-94.92,personnel:"~5,500"},{name:"Fort Sill",branch:"Army",state:"OK",lat:34.65,lng:-98.4,personnel:"~16,000"},{name:"Fort Wainwright",branch:"Army",state:"AK",lat:64.83,lng:-147.64,personnel:"~7,000"},{name:"Schofield Barracks",branch:"Army",state:"HI",lat:21.49,lng:-158.07,personnel:"~32,200"},{name:"Fort Novosel",branch:"Army",state:"AL",lat:31.34,lng:-85.73,personnel:"~9,000"},{name:"Redstone Arsenal",branch:"Army",state:"AL",lat:34.68,lng:-86.65,personnel:"~46,000"},{name:"Fort Greely",branch:"Army",state:"AK",lat:63.88,lng:-145.74,personnel:"~1,500"},{name:"Fort Meade",branch:"Army",state:"MD",lat:39.1,lng:-76.74,personnel:"~56,000"},{name:"Fort Belvoir",branch:"Army",state:"VA",lat:38.72,lng:-77.15,personnel:"~50,000"},{name:"Fort Gregg-Adams",branch:"Army",state:"VA",lat:37.24,lng:-77.34,personnel:"~22,000"},{name:"Fort Detrick",branch:"Army",state:"MD",lat:39.44,lng:-77.44,personnel:"~10,000"},{name:"Fort Hamilton",branch:"Army",state:"NY",lat:40.61,lng:-74.03,personnel:"~4,000"},{name:"Fort McCoy",branch:"Army",state:"WI",lat:43.97,lng:-90.69,personnel:"~3,500"},{name:"Fort Shafter",branch:"Army",state:"HI",lat:21.35,lng:-157.9,personnel:"~3,000"},{name:"Fort Buchanan",branch:"Army",state:"PR",lat:18.41,lng:-66.11,personnel:"~4,000"},{name:"Fort Hunter Liggett",branch:"Army",state:"CA",lat:36,lng:-121.23,personnel:"~2,500"},{name:"United States Military Academy",branch:"Army",state:"NY",lat:41.39,lng:-73.96,personnel:"~13,000"},{name:"Aberdeen Proving Ground",branch:"Army",state:"MD",lat:39.47,lng:-76.13,personnel:"~21,000"},{name:"White Sands Missile Range",branch:"Army",state:"NM",lat:32.38,lng:-106.48,personnel:"~5,500"},{name:"Yuma Proving Ground",branch:"Army",state:"AZ",lat:32.84,lng:-114.39,personnel:"~3,000"},{name:"Dugway Proving Ground",branch:"Army",state:"UT",lat:40.19,lng:-112.94,personnel:"~1,500"},{name:"Carlisle Barracks",branch:"Army",state:"PA",lat:40.21,lng:-77.17,personnel:"~5,000"},{name:"Picatinny Arsenal",branch:"Army",state:"NJ",lat:40.96,lng:-74.55,personnel:"~6,500"},{name:"Rock Island Arsenal",branch:"Army",state:"IL",lat:41.52,lng:-90.55,personnel:"~6,000"},{name:"Tobyhanna Army Depot",branch:"Army",state:"PA",lat:41.19,lng:-75.44,personnel:"~5,000"},{name:"Letterkenny Army Depot",branch:"Army",state:"PA",lat:39.97,lng:-77.69,personnel:"~3,500"},{name:"Anniston Army Depot",branch:"Army",state:"AL",lat:33.72,lng:-85.88,personnel:"~4,500"},{name:"Red River Army Depot",branch:"Army",state:"TX",lat:33.44,lng:-94.3,personnel:"~3,500"},{name:"Pine Bluff Arsenal",branch:"Army",state:"AR",lat:34.25,lng:-92.01,personnel:"~1,500"},{name:"Sierra Army Depot",branch:"Army",state:"CA",lat:40.19,lng:-120.1,personnel:"~1,200"},{name:"Tooele Army Depot",branch:"Army",state:"UT",lat:40.52,lng:-112.38,personnel:"~1,200"},{name:"Watervliet Arsenal",branch:"Army",state:"NY",lat:42.72,lng:-73.7,personnel:"~1,500"},{name:"Naval Station Norfolk",branch:"Navy",state:"VA",lat:36.95,lng:-76.3,personnel:"~71,300"},{name:"Naval Base San Diego",branch:"Navy",state:"CA",lat:32.68,lng:-117.13,personnel:"~48,000"},{name:"Naval Station Mayport",branch:"Navy",state:"FL",lat:30.39,lng:-81.4,personnel:"~14,000"},{name:"Naval Air Station Jacksonville",branch:"Navy",state:"FL",lat:30.24,lng:-81.68,personnel:"~17,000"},{name:"Naval Base Kitsap",branch:"Navy",state:"WA",lat:47.56,lng:-122.65,personnel:"~16,000"},{name:"Naval Station Great Lakes",branch:"Navy",state:"IL",lat:42.3,lng:-87.85,personnel:"~20,000"},{name:"Naval Air Station Pensacola",branch:"Navy",state:"FL",lat:30.35,lng:-87.32,personnel:"~23,000"},{name:"Naval Station Pearl Harbor",branch:"Navy",state:"HI",lat:21.35,lng:-157.97,personnel:"~15,000"},{name:"Naval Air Station Corpus Christi",branch:"Navy",state:"TX",lat:27.69,lng:-97.29,personnel:"~5,000"},{name:"Naval Air Station Whidbey Island",branch:"Navy",state:"WA",lat:48.35,lng:-122.66,personnel:"~10,000"},{name:"Naval Air Station Oceana",branch:"Navy",state:"VA",lat:36.82,lng:-76.03,personnel:"~11,000"},{name:"Naval Submarine Base New London",branch:"Navy",state:"CT",lat:41.39,lng:-72.09,personnel:"~10,000"},{name:"Naval Air Station Fallon",branch:"Navy",state:"NV",lat:39.42,lng:-118.7,personnel:"~5,000"},{name:"Naval Air Station Lemoore",branch:"Navy",state:"CA",lat:36.33,lng:-119.95,personnel:"~8,000"},{name:"Naval Station Newport",branch:"Navy",state:"RI",lat:41.51,lng:-71.33,personnel:"~8,500"},{name:"Naval Station Everett",branch:"Navy",state:"WA",lat:48,lng:-122.23,personnel:"~6,000"},{name:"Naval Submarine Base Kings Bay",branch:"Navy",state:"GA",lat:30.8,lng:-81.56,personnel:"~10,000"},{name:"Naval Air Station Patuxent River",branch:"Navy",state:"MD",lat:38.29,lng:-76.41,personnel:"~10,500"},{name:"Naval Base Ventura County",branch:"Navy",state:"CA",lat:34.15,lng:-119.12,personnel:"~18,000"},{name:"Naval Air Station Kingsville",branch:"Navy",state:"TX",lat:27.51,lng:-97.81,personnel:"~2,000"},{name:"Naval Air Station Meridian",branch:"Navy",state:"MS",lat:32.55,lng:-88.56,personnel:"~1,800"},{name:"Naval Air Station Joint Reserve Base Fort Worth",branch:"Navy",state:"TX",lat:32.77,lng:-97.44,personnel:"~12,000"},{name:"Naval Air Station Joint Reserve Base New Orleans",branch:"Navy",state:"LA",lat:29.83,lng:-90.02,personnel:"~5,000"},{name:"Naval Support Activity Bethesda",branch:"Navy",state:"MD",lat:38.98,lng:-77.1,personnel:"~7,500"},{name:"Naval Support Activity Mid-South",branch:"Navy",state:"TN",lat:35.35,lng:-89.87,personnel:"~7,000"},{name:"Naval Support Activity Crane",branch:"Navy",state:"IN",lat:38.87,lng:-86.81,personnel:"~6,000"},{name:"Naval Support Activity Panama City",branch:"Navy",state:"FL",lat:30.19,lng:-85.81,personnel:"~4,500"},{name:"Naval Surface Warfare Center Dahlgren",branch:"Navy",state:"VA",lat:38.35,lng:-77.04,personnel:"~5,500"},{name:"Naval Weapons Station Earle",branch:"Navy",state:"NJ",lat:40.28,lng:-74.17,personnel:"~2,500"},{name:"Naval Construction Battalion Center Gulfport",branch:"Navy",state:"MS",lat:30.39,lng:-89.09,personnel:"~6,000"},{name:"Portsmouth Naval Shipyard",branch:"Navy",state:"ME",lat:43.08,lng:-70.74,personnel:"~6,500"},{name:"Norfolk Naval Shipyard",branch:"Navy",state:"VA",lat:36.82,lng:-76.3,personnel:"~10,000"},{name:"Puget Sound Naval Shipyard",branch:"Navy",state:"WA",lat:47.55,lng:-122.65,personnel:"~14,000"},{name:"Eglin Air Force Base",branch:"Air Force",state:"FL",lat:30.46,lng:-86.53,personnel:"~13,000"},{name:"Nellis Air Force Base",branch:"Air Force",state:"NV",lat:36.24,lng:-115.03,personnel:"~12,000"},{name:"Travis Air Force Base",branch:"Air Force",state:"CA",lat:38.26,lng:-121.93,personnel:"~8,000"},{name:"Hill Air Force Base",branch:"Air Force",state:"UT",lat:41.12,lng:-111.97,personnel:"~6,000"},{name:"Tinker Air Force Base",branch:"Air Force",state:"OK",lat:35.42,lng:-97.39,personnel:"~30,700"},{name:"Wright-Patterson Air Force Base",branch:"Air Force",state:"OH",lat:39.83,lng:-84.05,personnel:"~38,000"},{name:"Offutt Air Force Base",branch:"Air Force",state:"NE",lat:41.12,lng:-95.91,personnel:"~10,000"},{name:"Robins Air Force Base",branch:"Air Force",state:"GA",lat:32.64,lng:-83.59,personnel:"~22,000"},{name:"Luke Air Force Base",branch:"Air Force",state:"AZ",lat:33.54,lng:-112.38,personnel:"~7,000"},{name:"Davis-Monthan Air Force Base",branch:"Air Force",state:"AZ",lat:32.17,lng:-110.88,personnel:"~7,000"},{name:"Dyess Air Force Base",branch:"Air Force",state:"TX",lat:32.42,lng:-99.85,personnel:"~5,000"},{name:"Barksdale Air Force Base",branch:"Air Force",state:"LA",lat:32.5,lng:-93.66,personnel:"~8,000"},{name:"Ellsworth Air Force Base",branch:"Air Force",state:"SD",lat:44.15,lng:-103.1,personnel:"~4,000"},{name:"Minot Air Force Base",branch:"Air Force",state:"ND",lat:48.42,lng:-101.36,personnel:"~5,500"},{name:"Malmstrom Air Force Base",branch:"Air Force",state:"MT",lat:47.51,lng:-111.19,personnel:"~3,500"},{name:"Whiteman Air Force Base",branch:"Air Force",state:"MO",lat:38.73,lng:-93.55,personnel:"~4,000"},{name:"F.E. Warren Air Force Base",branch:"Air Force",state:"WY",lat:41.15,lng:-104.86,personnel:"~4,000"},{name:"Mountain Home Air Force Base",branch:"Air Force",state:"ID",lat:43.04,lng:-115.87,personnel:"~4,000"},{name:"Fairchild Air Force Base",branch:"Air Force",state:"WA",lat:47.62,lng:-117.66,personnel:"~6,000"},{name:"MacDill Air Force Base",branch:"Air Force",state:"FL",lat:27.85,lng:-82.52,personnel:"~15,000"},{name:"Patrick Space Force Base",branch:"Space Force",state:"FL",lat:28.23,lng:-80.61,personnel:"~10,000"},{name:"Tyndall Air Force Base",branch:"Air Force",state:"FL",lat:30.07,lng:-85.58,personnel:"~3,500"},{name:"Moody Air Force Base",branch:"Air Force",state:"GA",lat:30.97,lng:-83.19,personnel:"~4,000"},{name:"Shaw Air Force Base",branch:"Air Force",state:"SC",lat:33.97,lng:-80.47,personnel:"~6,000"},{name:"Seymour Johnson Air Force Base",branch:"Air Force",state:"NC",lat:35.34,lng:-77.9
416,personnel:"~4,500"},{name:"Langley Air Force Base",branch:"Air Force",state:"VA",lat:37.08,lng:-76.36,personnel:"~10,000"},{name:"Dover Air Force Base",branch:"Air Force",state:"DE",lat:39.13,lng:-75.47,personnel:"~6,000"},{name:"Hanscom Air Force Base",branch:"Air Force",state:"MA",lat:42.47,lng:-71.29,personnel:"~6,000"},{name:"Scott Air Force Base",branch:"Air Force",state:"IL",lat:38.54,lng:-89.85,personnel:"~8,000"},{name:"Maxwell Air Force Base",branch:"Air Force",state:"AL",lat:32.38,lng:-86.36,personnel:"~6,000"},{name:"Keesler Air Force Base",branch:"Air Force",state:"MS",lat:30.41,lng:-88.92,personnel:"~6,000"},{name:"Sheppard Air Force Base",branch:"Air Force",state:"TX",lat:33.99,lng:-98.49,personnel:"~5,700"},{name:"Goodfellow Air Force Base",branch:"Air Force",state:"TX",lat:31.43,lng:-100.41,personnel:"~4,500"},{name:"Peterson Space Force Base",branch:"Space Force",state:"CO",lat:38.8,lng:-104.7,personnel:"~7,000"},{name:"Buckley Space Force Base",branch:"Space Force",state:"CO",lat:39.72,lng:-104.75,personnel:"~5,000"},{name:"U.S. Air Force Academy",branch:"Air Force",state:"CO",lat:38.99,lng:-104.86,personnel:"~7,000"},{name:"Eielson Air Force Base",branch:"Air Force",state:"AK",lat:64.66,lng:-147.1,personnel:"~3,500"},{name:"Beale Air Force Base",branch:"Air Force",state:"CA",lat:39.13,lng:-121.44,personnel:"~4,000"},{name:"Cannon Air Force Base",branch:"Air Force",state:"NM",lat:34.38,lng:-103.32,personnel:"~5,500"},{name:"Columbus Air Force Base",branch:"Air Force",state:"MS",lat:33.64,lng:-88.44,personnel:"~3,000"},{name:"Creech Air Force Base",branch:"Air Force",state:"NV",lat:36.58,lng:-115.67,personnel:"~5,000"},{name:"Edwards Air Force Base",branch:"Air Force",state:"CA",lat:34.91,lng:-117.88,personnel:"~10,000"},{name:"Grand Forks Air Force Base",branch:"Air Force",state:"ND",lat:47.97,lng:-97.4,personnel:"~3,000"},{name:"Holloman Air Force Base",branch:"Air Force",state:"NM",lat:32.85,lng:-106.1,personnel:"~5,000"},{name:"Hurlburt Field",branch:"Air Force",state:"FL",lat:30.43,lng:-86.69,personnel:"~8,000"},{name:"Kirtland Air Force Base",branch:"Air Force",state:"NM",lat:35.05,lng:-106.57,personnel:"~6,000"},{name:"Laughlin Air Force Base",branch:"Air Force",state:"TX",lat:29.36,lng:-100.78,personnel:"~3,500"},{name:"Little Rock Air Force Base",branch:"Air Force",state:"AR",lat:34.92,lng:-92.15,personnel:"~7,000"},{name:"McConnell Air Force Base",branch:"Air Force",state:"KS",lat:37.62,lng:-97.27,personnel:"~4,500"},{name:"Arnold Air Force Base",branch:"Air Force",state:"TN",lat:35.39,lng:-86.09,personnel:"~3,000"},{name:"Altus Air Force Base",branch:"Air Force",state:"OK",lat:34.67,lng:-99.27,personnel:"~3,000"},{name:"Vance Air Force Base",branch:"Air Force",state:"OK",lat:36.34,lng:-97.92,personnel:"~2,500"},{name:"Los Angeles Air Force Base",branch:"Air Force",state:"CA",lat:33.92,lng:-118.38,personnel:"~6,000"},{name:"Joint Base McGuire-Dix-Lakehurst",branch:"Joint Base",state:"NJ",lat:40.02,lng:-74.59,personnel:"~44,000"},{name:"Joint Base Anacostia-Bolling",branch:"Joint Base",state:"DC",lat:38.84,lng:-77.01,personnel:"~17,000"},{name:"Joint Base Myer-Henderson Hall",branch:"Joint Base",state:"VA",lat:38.88,lng:-77.08,personnel:"~6,000"},{name:"Camp Pendleton",branch:"Marines",state:"CA",lat:33.3,lng:-117.35,personnel:"~49,000"},{name:"Camp Lejeune",branch:"Marines",state:"NC",lat:34.73,lng:-77.38,personnel:"~47,000"},{name:"Marine Corps Air Station Miramar",branch:"Marines",state:"CA",lat:32.87,lng:-117.14,personnel:"~12,000"},{name:"Marine Corps Base Quantico",branch:"Marines",state:"VA",lat:38.52,lng:-77.32,personnel:"~12,000"},{name:"Marine Corps Air Station Cherry Point",branch:"Marines",state:"NC",lat:34.9,lng:-76.88,personnel:"~9,000"},{name:"Marine Corps Air Station Beaufort",branch:"Marines",state:"SC",lat:32.48,lng:-80.72,personnel:"~5,000"},{name:"Marine Corps Air Station Yuma",branch:"Marines",state:"AZ",lat:32.66,lng:-114.61,personnel:"~5,000"},{name:"Marine Corps Recruit Depot San Diego",branch:"Marines",state:"CA",lat:32.74,lng:-117.2,personnel:"~7,000"},{name:"Marine Corps Recruit Depot Parris Island",branch:"Marines",state:"SC",lat:32.34,lng:-80.68,personnel:"~8,000"},{name:"Twentynine Palms",branch:"Marines",state:"CA",lat:34.22,lng:-116.06,personnel:"~12,000"},{name:"Marine Corps Logistics Base Albany",branch:"Marines",state:"GA",lat:31.58,lng:-84.07,personnel:"~6,000"},{name:"Marine Corps Logistics Base Barstow",branch:"Marines",state:"CA",lat:34.88,lng:-116.97,personnel:"~2,500"},{name:"Marine Corps Mountain Warfare Training Center",branch:"Marines",state:"CA",lat:38.51,lng:-119.53,personnel:"~1,500"},{name:"Marine Barracks Washington",branch:"Marines",state:"DC",lat:38.88,lng:-76.99,personnel:"~1,200"},{name:"Camp Smith",branch:"Marines",state:"HI",lat:21.41,lng:-157.9,personnel:"~2,000"},{name:"Vandenberg Space Force Base",branch:"Space Force",state:"CA",lat:34.73,lng:-120.57,personnel:"~10,000"},{name:"Schriever Space Force Base",branch:"Space Force",state:"CO",lat:38.8,lng:-104.53,personnel:"~8,000"},{name:"Cape Canaveral Space Force Station",branch:"Space Force",state:"FL",lat:28.49,lng:-80.58,personnel:"~10,000"},{name:"Los Angeles Space Force Base",branch:"Space Force",state:"CA",lat:33.92,lng:-118.38,personnel:"~6,500"},{name:"U.S. Coast Guard Base Alameda",branch:"Coast Guard",state:"CA",lat:37.77,lng:-122.3,personnel:"~1,500"},{name:"U.S. Coast Guard Base Boston",branch:"Coast Guard",state:"MA",lat:42.35,lng:-71.05,personnel:"~1,200"},{name:"U.S. Coast Guard Base Cape Cod",branch:"Coast Guard",state:"MA",lat:41.76,lng:-70.06,personnel:"~600"},{name:"U.S. Coast Guard Base Cleveland",branch:"Coast Guard",state:"OH",lat:41.51,lng:-81.7,personnel:"~500"},{name:"U.S. Coast Guard Base Elizabeth City",branch:"Coast Guard",state:"NC",lat:36.26,lng:-76.18,personnel:"~3,000"},{name:"U.S. Coast Guard Base Honolulu",branch:"Coast Guard",state:"HI",lat:21.31,lng:-157.87,personnel:"~1,200"},{name:"U.S. Coast Guard Base Ketchikan",branch:"Coast Guard",state:"AK",lat:55.34,lng:-131.64,personnel:"~600"},{name:"U.S. Coast Guard Base Kodiak",branch:"Coast Guard",state:"AK",lat:57.75,lng:-152.49,personnel:"~1,500"},{name:"U.S. Coast Guard Base Los Angeles-Long Beach",branch:"Coast Guard",state:"CA",lat:33.72,lng:-118.27,personnel:"~1,000"},{name:"U.S. Coast Guard Base Miami Beach",branch:"Coast Guard",state:"FL",lat:25.77,lng:-80.14,personnel:"~1,000"},{name:"U.S. Coast Guard Base National Capital Region",branch:"Coast Guard",state:"DC",lat:38.87,lng:-77.01,personnel:"~800"},{name:"U.S. Coast Guard Base New Orleans",branch:"Coast Guard",state:"LA",lat:29.95,lng:-90.03,personnel:"~800"},{name:"U.S. Coast Guard Base Portsmouth",branch:"Coast Guard",state:"VA",lat:36.82,lng:-76.35,personnel:"~700"},{name:"U.S. Coast Guard Base Seattle",branch:"Coast Guard",state:"WA",lat:47.59,lng:-122.35,personnel:"~1,200"},{name:"U.S. Coast Guard Base Galveston",branch:"Coast Guard",state:"TX",lat:29.31,lng:-94.77,personnel:"~500"},{name:"U.S. Coast Guard Academy",branch:"Coast Guard",state:"CT",lat:41.37,lng:-72.1,personnel:"~1,000"},{name:"U.S. Coast Guard Training Center Cape May",branch:"Coast Guard",state:"NJ",lat:38.94,lng:-74.91,personnel:"~1,500"},{name:"U.S. Coast Guard Training Center Petaluma",branch:"Coast Guard",state:"CA",lat:38.24,lng:-122.63,personnel:"~1,000"},{name:"U.S. Coast Guard Training Center Yorktown",branch:"Coast Guard",state:"VA",lat:37.23,lng:-76.56,personnel:"~1,000"},{name:"U.S. Coast Guard Air Station Barbers Point",branch:"Coast Guard",state:"HI",lat:21.31,lng:-158.07,personnel:"~400"},{name:"U.S. Coast Guard Air Station Borinquen",branch:"Coast Guard",state:"PR",lat:18.5,lng:-67.13,personnel:"~400"},{name:"U.S. Coast Guard Air Station Cape Cod",branch:"Coast Guard",state:"MA",lat:41.68,lng:-70.52,personnel:"~500"},{name:"U.S. Coast Guard Air Station Clearwater",branch:"Coast Guard",state:"FL",lat:27.91,lng:-82.69,personnel:"~1,000"},{name:"U.S. Coast Guard Air Station Corpus Christi",branch:"Coast Guard",state:"TX",lat:27.69,lng:-97.28,personnel:"~400"},{name:"U.S. Coast Guard Air Station Detroit",branch:"Coast Guard",state:"MI",lat:42.21,lng:-83.16,personnel:"~300"},{name:"U.S. Coast Guard Air Station Elizabeth City",branch:"Coast Guard",state:"NC",lat:36.27,lng:-76.17,personnel:"~600"},{name:"U.S. Coast Guard Air Station Houston",branch:"Coast Guard",state:"TX",lat:29.61,lng:-95.16,personnel:"~300"},{name:"U.S. Coast Guard Air Station Humboldt Bay",branch:"Coast Guard",state:"CA",lat:40.78,lng:-124.21,personnel:"~200"},{name:"U.S. Coast Guard Air Station Miami",branch:"Coast Guard",state:"FL",lat:25.9,lng:-80.28,personnel:"~500"},{name:"U.S. Coast Guard Air Station New Orleans",branch:"Coast Guard",state:"LA",lat:29.83,lng:-90.03,personnel:"~400"},{name:"U.S. Coast Guard Air Station North Bend",branch:"Coast Guard",state:"OR",lat:43.42,lng:-124.25,personnel:"~200"},{name:"U.S. Coast Guard Air Station Port Angeles",branch:"Coast Guard",state:"WA",lat:48.12,lng:-123.41,personnel:"~200"},{name:"U.S. Coast Guard Air Station Sacramento",branch:"Coast Guard",state:"CA",lat:38.69,lng:-121.59,personnel:"~200"},{name:"U.S. Coast Guard Air Station San Francisco",branch:"Coast Guard",state:"CA",lat:37.62,lng:-122.38,personnel:"~300"},{name:"U.S. Coast Guard Air Station Savannah",branch:"Coast Guard",state:"GA",lat:32.13,lng:-81.2,personnel:"~300"},{name:"U.S. Coast Guard Air Station Sitka",branch:"Coast Guard",state:"AK",lat:57.05,lng:-135.36,personnel:"~200"},{name:"U.S. Coast Guard Air Station Traverse City",branch:"Coast Guard",state:"MI",lat:44.74,lng:-85.58,personnel:"~300"},{name:"U.S. Coast Guard Air Station Atlantic City",branch:"Coast Guard",state:"NJ",lat:39.46,lng:-74.58,personnel:"~200"},{name:"U.S. Coast Guard Sector New York",branch:"Coast Guard",state:"NY",lat:40.69,lng:-74.02,personnel:"~800"},{name:"U.S. Coast Guard Sector San Juan",branch:"Coast Guard",state:"PR",lat:18.46,lng:-66.1,personnel:"~500"},{name:"U.S. Coast Guard Sector Key West",branch:"Coast Guard",state:"FL",lat:24.56,lng:-81.8,personnel:"~500"},{name:"U.S. Coast Guard Sector Juneau",branch:"Coast Guard",state:"AK",lat:58.3,lng:-134.42,personnel:"~400"},{name:"U.S. Coast Guard Sector San Diego",branch:"Coast Guard",state:"CA",lat:32.72,lng:-117.17,personnel:"~400"},{name:"U.S. Coast Guard Sector Charleston",branch:"Coast Guard",state:"SC",lat:32.78,lng:-79.93,personnel:"~300"},{name:"U.S. Coast Guard Sector Jacksonville",branch:"Coast Guard",state:"FL",lat:30.33,lng:-81.66,personnel:"~300"},{name:"Joint Base Lewis-McChord",branch:"Joint Base",state:"WA",lat:47.1,lng:-122.58,personnel:"~54,000"},{name:"Joint Base San Antonio",branch:"Joint Base",state:"TX",lat:29.59,lng:-98.62,personnel:"~67,400"},{name:"Joint Base Andrews",branch:"Joint Base",state:"MD",lat:38.81,lng:-76.87,personnel:"~20,000"},{name:"Joint Base Pearl Harbor-Hickam",branch:"Joint Base",state:"HI",lat:21.35,lng:-157.95,personnel:"~42,000"},{name:"Joint Base Elmendorf-Richardson",branch:"Joint Base",state:"AK",lat:61.25,lng:-149.81,personnel:"~18,300"},{name:"Joint Base Langley-Eustis",branch:"Joint Base",state:"VA",lat:37.08,lng:-76.36,personnel:"~24,000"},{name:"Joint Base Charleston",branch:"Joint Base",state:"SC",lat:32.9,lng:-80.04,personnel:"~22,000"},{name:"Fort Jackson",branch:"Army",state:"SC",lat:34.03,lng:-80.96,personnel:"~36,000"},{name:"Camp Bullis",branch:"Army",state:"TX",lat:29.68,lng:-98.56,personnel:"~3,500"},{name:"Fort Devens",branch:"Army",state:"MA",lat:42.54,lng:-71.61,personnel:"~2,000"},{name:"Hunter Army Airfield",branch:"Army",state:"GA",lat:31.99,lng:-81.15,personnel:"~5,500"},{name:"Presidio of Monterey",branch:"Army",state:"CA",lat:36.6,lng:-121.9,personnel:"~5,000"},{name:"Tripler Army Medical Center",branch:"Army",state:"HI",lat:21.36,lng:-157.89,personnel:"~5,500"},{name:"Walter Reed National Military Medical Center",branch:"Army",state:"MD",lat:39,lng:-77.1,personnel:"~8,500"},{name:"Naval Air Weapons Station China Lake",branch:"Navy",state:"CA",lat:35.69,lng:-117.69,personnel:"~5,200"},{name:"Naval Air Station Key West",branch:"Navy",state:"FL",lat:24.58,lng:-81.69,personnel:"~2,000"},{name:"Naval Air Station North Island",branch:"Navy",state:"CA",lat:32.7,lng:-117.2,personnel:"~25,000"},{name:"Naval Air Station Whiting Field",branch:"Navy",state:"FL",lat:30.72,lng:-87.02,personnel:"~3,500"},{name:"Naval Amphibious Base Coronado",branch:"Navy",state:"CA",lat:32.68,lng:-117.17,personnel:"~7,500"},{name:"Naval Base Point Loma",branch:"Navy",state:"CA",lat:32.69,lng:-117.25,personnel:"~4,000"},{name:"Naval Postgraduate School",branch:"Navy",state:"CA",lat:36.6,lng:-121.87,personnel:"~3,500"},{name:"Naval Support Activity Saratoga Springs",branch:"Navy",state:"NY",lat:43.08,lng:-73.75,personnel:"~1,200"},{name:"Naval Weapons Station Charleston",branch:"Navy",state:"SC",lat:32.99,lng:-80.05,personnel:"~3,000"},{name:"United States Naval Academy",branch:"Navy",state:"MD",lat:38.98,lng:-76.49,personnel:"~6,000"},{name:"Naval District Washington",branch:"Navy",state:"DC",lat:38.87,lng:-76.99,personnel:"~3,000"},{name:"Marine Corps Air Station New River",branch:"Marines",state:"NC",lat:34.71,lng:-77.44,personnel:"~7,500"},{name:"Grissom Air Reserve Base",branch:"Air Force",state:"IN",lat:40.65,lng:-86.15,personnel:"~2,800"},{name:"March Air Reserve Base",branch:"Air Force",state:"CA",lat:33.88,lng:-117.26,personnel:"~5,000"},{name:"Pope Field",branch:"Air Force",state:"NC",lat:35.17,lng:-79.01,personnel:"~3,000"},{name:"U.S. Coast Guard Sector Baltimore",branch:"Coast Guard",state:"MD",lat:39.27,lng:-76.58,personnel:"~500"},{name:"U.S. Coast Guard Sector Hampton Roads",branch:"Coast Guard",state:"VA",lat:36.83,lng:-76.1,personnel:"~500"},{name:"U.S. Coast Guard Sector Honolulu",branch:"Coast Guard",state:"HI",lat:21.31,lng:-157.87,personnel:"~800"},{name:"U.S. Coast Guard Sector Puget Sound",branch:"Coast Guard",state:"WA",lat:47.59,lng:-122.34,personnel:"~600"},{name:"U.S. Coast Guard Station San Diego",branch:"Coast Guard",state:"CA",lat:32.72,lng:-117.17,personnel:"~400"}],mB="pk.eyJ1Ijoic291dGhiYXljbGVhcnZ1ZSIsImEiOiJja3pkMmpnOXExamlpMnVsYnJzcDQ1YzEwIn0.0oF1ZIGnCBw9PQV82HXy6A",pB=`https://api.mapbox.com/styles/v1/mapbox/dark-v11/tiles/{z}/{x}/{y}?access_token=${mB}`,xB='© <a href="https://www.mapbox.com/">Mapbox</a> © <a href="https://www.openstreetmap.org/copyright">OSM</a>';function gB(){const[e,t]=y.useState(null),r=e?Id.filter(s=>s.branch===e):Id,a=Id.reduce((s,i)=>(s[i.branch]=(s[i.branch]||0)+1,s),{});return n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] overflow-hidden",children:[n.jsxs("div",{className:"p-5 border-b border-[#1e293b]",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(wt,{className:"w-5 h-5 text-[#00b4ff]"}),n.jsx("h3",{className:"text-lg font-semibold text-white",children:"U.S. Military Installations"}),n.jsxs("span",{className:"text-[#94a3b8] text-sm",children:["(",r.length," bases)"]})]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsxs("button",{onClick:()=>t(null),className:`px-3 py-1 rounded-full text-xs font-medium transition-all ${e?"bg-[#1e293b] text-[#94a3b8] hover:text-white":"bg-[#00b4ff] text-black"}`,children:["All (",Id.length,")"]}),Object.entries(lN).map(([s,i])=>{const o=a[s]||0;return o===0?null:n.jsxs("button",{onClick:()=>
41t(e===s?null:s),className:`px-3 py-1 rounded-full text-xs font-medium transition-all flex items-center gap-1.5 ${e===s?"text-black":"bg-[#1e293b] text-[#94a3b8] hover:text-white"}`,style:e===s?{backgroundColor:i}:void 0,children:[n.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i}}),s," (",o,")"]},s)})]})]}),n.jsx("div",{className:"px-5 pb-3",children:n.jsx("p",{className:"text-[#64748b] text-xs italic",children:"* Personnel figures are estimates based on publicly available data and may not reflect current troop levels. Actual numbers fluctuate with deployments, training rotations, and force structure changes."})}),n.jsx("div",{style:{height:500},className:"relative",children:n.jsxs(aP,{center:oP,zoom:lP,style:{height:"100%",width:"100%",background:"#0a0e17"},zoomControl:!0,scrollWheelZoom:!0,minZoom:3,maxZoom:12,children:[n.jsx(iP,{url:pB,attribution:xB,tileSize:512,zoomOffset:-1}),n.jsx(fB,{}),r.map(s=>{const i=lN[s.branch]??"#94a3b8";return n.jsx(rP,{center:[s.lat,s.lng],radius:3.5,pathOptions:{color:i,fillColor:i,fillOpacity:.55,weight:1,opacity:.7},children:n.jsx(sP,{children:n.jsxs("div",{style:{minWidth:180},children:[n.jsx("div",{style:{fontWeight:700,fontSize:14,marginBottom:4},children:s.name}),n.jsxs("div",{style:{fontSize:12,color:"#666"},children:[n.jsx("span",{style:{color:i,fontWeight:600},children:s.branch})," · ",s.state]}),n.jsxs("div",{style:{fontSize:12,color:"#888",marginTop:2},children:[s.personnel," personnel"]})]})})},`${s.name}-${s.lat}-${s.lng}`)})]})})]})}function Rd({icon:e,label:t,value:r,color:a="#00b4ff"}){return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5 hover:border-[#00b4ff20] transition-all",children:[n.jsxs("div",{className:"flex items-start justify-between mb-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:`${a}15`},children:n.jsx("span",{style:{color:a},children:n.jsx(e,{className:"w-5 h-5"})})}),n.jsx(ii,{className:"w-4 h-4 text-[#22c55e]"})]}),n.jsx("div",{className:"text-2xl font-bold text-white mb-0.5",children:r}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:t})]})}function bB(){const e=ie(F.agencies.getMyAgency);return e?n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:n.jsxs("div",{className:"flex items-start gap-4",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-16 h-16 rounded-lg object-contain bg-white/5 p-1"}):n.jsx("div",{className:"w-16 h-16 rounded-lg bg-[#00b4ff10] flex items-center justify-center",children:n.jsx(Be,{className:"w-8 h-8 text-[#00b4ff]"})}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:e.name}),e.isHonorary&&n.jsx(Vl,{size:"md"}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${e.tier==="platinum"||e.tier==="member"?"bg-[#d4a843]/20 text-[#d4a843] border border-[#d4a843]/30":"bg-[#00b4ff]/10 text-[#00b4ff] border border-[#00b4ff]/20"}`,children:e.tier==="platinum"?"State-Level Featured":e.tier==="member"?"Agency Member":"Participating Agency"})]}),n.jsxs("p",{className:"text-[#94a3b8] text-sm",children:[e.city?`${e.city}, `:"",e.state]})]}),n.jsx(ye,{to:"/profile",children:n.jsx(be,{variant:"outline",size:"sm",className:"border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#00b4ff40]",children:"Edit Profile"})})]})}):n.jsxs("div",{className:"rounded-xl neon-border bg-gradient-to-br from-[#111827] to-[#0d1a2e] p-8 text-center",children:[n.jsx(Rt,{className:"w-12 h-12 text-[#00b4ff] mx-auto mb-4"}),n.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Set Up Your Agency Profile"}),n.jsx("p",{className:"text-[#94a3b8] mb-6 max-w-md mx-auto",children:"Complete your agency profile to appear on VET-TO-LEO's directory and start connecting with veteran candidates."}),n.jsx(ye,{to:"/profile",children:n.jsx(be,{className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold neon-glow-sm",children:"Create Agency Profile"})})]})}function vB(){const e=ie(F.agencies.getMyAgency),t=e?.tier==="member"||e?.tier==="platinum",r=[{icon:Rt,label:"Agency Profile",desc:"Manage your public profile",href:"/profile",color:"#00b4ff"},{icon:ht,label:"Job Postings",desc:t?"Manage your listings":"Upgrade to post jobs",href:"/jobs",color:"#22c55e"},{icon:Wc,label:"Recruiters",desc:"Manage recruiter profiles",href:"/recruiters",color:"#06b6d4"},{icon:Fr,label:"Analytics",desc:t?"View your performance":"Upgrade to view anal
41ytics",href:"/analytics",color:"#a855f7"},{icon:en,label:"Veteran Leads",desc:"See veterans interested in your agency",href:"/leads",color:"#f59e0b"}];return n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:r.map(a=>n.jsxs(ye,{to:a.href,className:"group rounded-xl bg-[#111827] border border-[#1e293b] p-5 hover:border-[#00b4ff20] transition-all",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center mb-3",style:{backgroundColor:`${a.color}15`},children:n.jsx("span",{style:{color:a.color},children:n.jsx(a.icon,{className:"w-5 h-5"})})}),n.jsx("div",{className:"text-white font-semibold mb-0.5 group-hover:text-[#00b4ff] transition-colors",children:a.label}),n.jsx("div",{className:"text-[#94a3b8] text-sm",children:a.desc})]},a.label))})}function yB(){const e=ie(F.agencies.getMyAgency);return!e||e.tier!=="member"&&e.tier!=="platinum"||e.careersUrl?null:n.jsx("div",{className:"rounded-xl p-5",style:{background:"linear-gradient(135deg, #0d1a2e 0%, #162032 100%)",border:"1px solid #22c55e25"},children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"p-2.5 rounded-lg shrink-0",style:{background:"#22c55e15"},children:n.jsx(GC,{className:"w-5 h-5",style:{color:"#22c55e"}})}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-base font-bold text-white",children:"Unlimited Job Postings"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold",style:{background:"#22c55e20",color:"#22c55e"},children:"NO CAP"})]}),n.jsx("p",{className:"text-sm",style:{color:"#94a3b8"},children:"Link your GovernmentJobs.com careers page and VET-TO-LEO will automatically scan it daily. Every new law enforcement opening gets posted to your profile with no limit on listings."}),n.jsx(ye,{to:"/profile",children:n.jsx("button",{className:"mt-3 px-4 py-2 rounded-lg text-sm font-semibold transition-colors",style:{background:"#22c55e",color:"#000"},children:"Link GovernmentJobs.com"})})]})]})})}function jB(){const e=ie(F.agencies.getMyAgency);return!e||e.tier==="member"||e.tier==="platinum"?null:n.jsx("div",{className:"rounded-xl bg-gradient-to-r from-[#0d1a2e] to-[#162032] border border-[#00b4ff20] p-6 animate-pulse-neon",children:n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:"Upgrade to Agency Member"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#d4a843] text-black text-xs font-bold",children:"50% OFF"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Post up to 3 jobs, get veteran leads, and unlock priority listing. Use code AGENCY50 for $299/year (regularly $598)."})]}),n.jsx(ye,{to:"/subscription",children:n.jsx("button",{className:"btn-gold-pill whitespace-nowrap",children:"Upgrade Now"})})]})})}function wB(){const e=ie(F.agencies.getMyAgency),t=ie(F.analytics.getMyAnalytics),r=ie(F.jobs.getActiveCount),a=e?.tier==="member"||e?.tier==="platinum";return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Dashboard"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Welcome to your VET-TO-LEO agency dashboard."})]}),n.jsx(jB,{}),n.jsx(yB,{}),n.jsx(bB,{}),a?n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(Rd,{icon:Wn,label:"Profile Views",value:t?.profileViews??0}),n.jsx(Rd,{icon:ht,label:"Active Jobs",value:r??0,color:"#22c55e"}),n.jsx(Rd,{icon:Vc,label:"Job Clicks",value:t?.jobClicks??0,color:"#a855f7"}),n.jsx(Rd,{icon:Pn,label:"Website Clicks",value:t?.websiteClicks??0,color:"#f59e0b"})]}):e?n.jsx(bf,{feature:"Agency Statistics & Analytics",description:"Upgrade to Agency Member to track profile views, job clicks, website clicks, and veteran engagement in real time."}):null,n.jsx(vB,{}),n.jsx(gB,{})]})}const cP=y.createContext({isComposing:()=>!1,setComposing:()=>{},justEndedComposing:()=>!1,markCompositionEnd:()=>{}}),NB=()=>y.useContext(cP);function wu({...e}){const t=y.useRef(!1),r=y.useRef(!1),a=y.useRef(null),s=y.useMemo(()=>({isComposing:()=>t.current,setComposing:i=>{t.current=i},justEndedComposing:()=>r.current,markCompositionEnd:()=>{r.current=!0,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{r.current=!1},150)}}),[]);return n.jsx(cP.Provider,{value:s,children:n.jsx(kk,{"data-slot":"dialog",...e})})}function _B({...e}){return n.jsx(Ok,{"data-slot":"dialog-portal",...e})}function dP({className:e,...t}){return n.jsx(G0,{"data-slot":"dialog-overlay",className:Ae("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 backdrop-blur-sm",e),...t})}dP.displayName="DialogOverlay";function Nu({className:e,children:t,showCloseButton:r=!0,onEscapeKeyDown:a,...s}){const{isComposing:i}=NB(),o=y.useCallback(c=>{if(c.isComposing||i()){c.preventDefault();return}a?.(c)},[i,a]);return n.jsxs(_B,{"data-slot":"dialog-portal",children:[n.jsx(dP,{}),n.jsxs(K0,{"data-slot":"dialog-content",className:Ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 roun
41ded-xl border p-6 shadow-xl duration-200 sm:max-w-lg",e),onEscapeKeyDown:o,...s,children:[t,r&&n.jsxs(Mk,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-md p-1 opacity-70 transition-opacity hover:opacity-100 hover:bg-muted focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[n.jsx(Me,{}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _u({className:e,...t}){return n.jsx("div",{"data-slot":"dialog-header",className:Ae("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ip({className:e,...t}){return n.jsx("div",{"data-slot":"dialog-footer",className:Ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Su({className:e,...t}){return n.jsx(Y0,{"data-slot":"dialog-title",className:Ae("text-lg leading-none font-semibold",e),...t})}function cN({className:e,...t}){return n.jsx(Z0,{"data-slot":"dialog-description",className:Ae("text-muted-foreground text-sm",e),...t})}var SB=Object.defineProperty,ns=(e,t)=>SB(e,"name",{value:t,configurable:!0}),s1="Switch",[CB,bde]=sr(s1),[AB,i1]=CB(s1);function uP(e){const{__scopeSwitch:t,checked:r,children:a,defaultChecked:s,disabled:i,form:o,name:c,onCheckedChange:d,required:u,value:h="on",internal_do_not_use_render:m}=e,[p,b]=Xa({prop:r,defaultProp:s??!1,onChange:d,caller:s1}),[w,x]=y.useState(null),[g,j]=y.useState(null),S=y.useRef(!1),[_,N]=y.useReducer(P=>P+1,0),C=w?!!o||!!w.closest("form"):!0,A={checked:p,setChecked:b,disabled:i,control:w,setControl:x,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:S,userInteractionCount:_,onUserInteraction:N,required:u,defaultChecked:s,isFormControl:C,bubbleInput:g,setBubbleInput:j};return n.jsx(AB,{scope:t,...A,children:hP(m)?m(A):a})}ns(uP,"SwitchProvider");var kB="SwitchTrigger",PB=y.forwardRef(ns(function({__scopeSwitch:t,onClick:r,...a},s){const{control:i,form:o,value:c,disabled:d,checked:u,required:h,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:b,onUserInteraction:w,isFormControl:x,bubbleInput:g}=i1(kB,t),j=tt(s,m),S=y.useRef(u);return y.useEffect(()=>{const _=o?i?.ownerDocument.getElementById(o):i?.form;if(_ instanceof HTMLFormElement){const N=ns(()=>p(S.current),"reset");return _.addEventListener("reset",N),()=>_.removeEventListener("reset",N)}},[i,o,p]),n.jsx(et.button,{type:"button",role:"switch","aria-checked":u,"aria-required":h,"data-state":o1(u),"data-disabled":d?"":void 0,disabled:d,value:c,...a,ref:j,onClick:Se(r,_=>{w(),p(N=>!N),g&&x&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})})},"SwitchTrigger")),TB=y.forwardRef(ns(function(t,r){const{__scopeSwitch:a,name:s,checked:i,defaultChecked:o,required:c,disabled:d,value:u,onCheckedChange:h,form:m,...p}=t;return n.jsx(uP,{__scopeSwitch:a,checked:i,defaultChecked:o,disabled:d,required:c,onCheckedChange:h,name:s,form:m,value:u,internal_do_not_use_render:({isFormControl:b})=>n.jsxs(n.Fragment,{children:[n.jsx(PB,{...p,ref:r,__scopeSwitch:a}),b&&n.jsx(LB,{__scopeSwitch:a})]})})},"Switch")),OB="SwitchThumb",EB=y.forwardRef(ns(function(t,r){const{__scopeSwitch:a,...s}=t,i=i1(OB,a);return n.jsx(et.span,{"data-state":o1(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})},"SwitchThumb")),MB="SwitchBubbleInput",LB=y.forwardRef(ns(function({__scopeSwitch:t,onClick:r,...a},s){const{control:i,hasConsumerStoppedPropagationRef:o,userInteractionCount:c,checked:d,defaultChecked:u,required:h,disabled:m,name:p,value:b,form:w,bubbleInput:x,setBubbleInput:g}=i1(MB,t),j=tt(s,g),S=R0(i),_=y.useRef(!1),N=y.useRef(d),C=y.useRef(c);y.useEffect(()=>{const P=x;if(!P)return;const O=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(O,"checked").set,M=c!==C.current;C.current=c;const R=N.current!==d;N.current=d;const B=!(M&&o.current);if(R&&$){_.current=!M;const D=new Event("click",{bubbles:B});$.call(P,d),P.dispatchEvent(D),_.current=!1}},[x,d,o,c]);const A=y.useRef(d);return n.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??A.current,required:h,disabled:m,name:p,value:b,form:w,...a,tabIndex:-1,ref:j,onClick:Se(r,P=>{_.current&&P.stopPropagation()}),style:{...a.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})}
41,"SwitchBubbleInput"));function hP(e){return typeof e=="function"}ns(hP,"isFunction");function o1(e){return e?"checked":"unchecked"}ns(o1,"getState");function Vv({className:e,...t}){return n.jsx(TB,{"data-slot":"switch",className:Ae("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-6 w-11 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:n.jsx(EB,{"data-slot":"switch-thumb",className:Ae("bg-background pointer-events-none block size-5 rounded-full shadow-sm ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0.5")})})}function fP(){return!!ie(F.auth.currentUser)?.email?.endsWith("@test.local")}function IB(){const e=ie(F.auth.currentUser),{theme:t,toggleTheme:r,switchable:a}=f9(),{signIn:s,signOut:i}=rs(),o=te(F.users.deleteAccount),c=ar(),d=Yh(),u=fP(),[h,m]=y.useState(!1),[p,b]=y.useState(!1),[w,x]=y.useState(!1),[g,j]=y.useState(""),[S,_]=y.useState(""),[N,C]=y.useState("request"),A=async E=>{E.preventDefault(),j(""),x(!0);const $=new FormData;$.append("email",e?.email||""),$.append("flow","reset");try{await s("password",$),C("verify")}catch{j("Could not send reset code. Please try again.")}finally{x(!1)}}
41,P=async E=>{E.preventDefault(),j(""),x(!0);const $=new FormData(E.currentTarget);$.append("email",e?.email||""),$.append("flow","reset-verification");try{await s("password",$),_("Password changed successfully!"),setTimeout(()=>{m(!1),C("request"),_("")},1500)}catch{j("Invalid code or password. Please try again.")}finally{x(!1)}},O=async()=>{x(!0),j("");try{await o(),await i(),c("/")}catch{j("Could not delete account. Please try again."),x(!1)}};return n.jsxs("div",{className:"space-y-8 max-w-2xl mx-auto",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl md:text-3xl font-bold tracking-tight",children:"Settings"}),n.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your account details and preferences"})]}),n.jsxs(Ki,{className:"overflow-hidden",children:[n.jsx("div",{className:"h-20 bg-gradient-to-r from-primary/20 via-primary/10 to-transparent"}),n.jsx(Yi,{className:"-mt-10 pb-6",children:n.jsxs("div",{className:"flex items-end gap-4",children:[n.jsx(w0,{className:"size-16 border-4 border-background shadow-lg",children:n.jsx(N0,{className:"text-xl bg-primary text-primary-foreground",children:e?.name?.charAt(0).toUpperCase()||n.jsx(Ze,{className:"size-6"})})}),n.jsxs("div",{className:"pb-1",children:[n.jsx("p",{className:"font-semibold",children:e?.name||"User"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:e?.email})]})]})})]}),n.jsxs(Ki,{children:[n.jsx(Nv,{className:"pb-4",children:n.jsxs(_v,{className:"flex items-center gap-2 text-base",children:[n.jsx(S9,{className:"size-4 text-muted-foreground"}),"Appearance"]})}),n.jsx(Yi,{className:"space-y-1",children:a?n.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4 transition-colors hover:bg-muted/50",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"size-10 rounded-full bg-secondary flex items-center justify-center",children:t==="light"?n.jsx(UL,{className:"size-5 text-foreground"}):n.jsx(yI,{className:"size-5 text-foreground"})}),n.jsxs("div",{children:[n.jsx(we,{htmlFor:"dark-mode",className:"font-medium",children:"Dark mode"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Switch between light and dark theme"})]})]}),n.jsx(Vv,{id:"dark-mode",checked:t==="dark",onCheckedChange:r})]}):n.jsx("p",{className:"text-sm text-muted-foreground px-4 py-2",children:"Theme follows your system preference"})})]}),n.jsxs(Ki,{children:[n.jsx(Nv,{className:"pb-4",children:n.jsxs(_v,{className:"flex items-center gap-2 text-base",children:[n.jsx(Ze,{className:"size-4 text-muted-foreground"}),"Account"]})}),n.jsxs(Yi,{className:"space-y-1",children:[d&&n.jsxs("button",{onClick:()=>m(!0),className:"w-full flex items-center justify-between rounded-lg border p-4 transition-colors hover:bg-muted/50 text-left",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-sm",children:"Change password"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Update your password"})]}),n.jsx(Ya,{className:"size-4 text-muted-foreground"})]}),n.jsxs("button",{onClick:()=>!u&&b(!0),className:`w-full flex items-center justify-between rounded-lg border border-destructive/20 p-4 transition-colors text-left ${u?"opacity-50 cursor-not-allowed":"hover:bg-destructive/5"}`,disabled:u,children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-sm text-destructive",children:"Delete account"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Disabled on demo account":"Permanently delete your account"})]}),n.jsx(Ya,{className:"size-4 text-destructive"})]})]})]}),d&&n.jsx(wu,{open:h,onOpenChange:m,children:n.jsxs(Nu,{children:[n.jsxs(_u,{children:[n.jsx(Su,{children:"Change Password"}),n.jsx(cN,{children:N==="request"?"We'll send a verification code to your email.":"Enter the code from your email and your new password."})]}),N==="request"?n.jsxs("form",{onSubmit:A,children:[n.jsx("div",{className:"py-4",children:n.jsxs("p",{className:"text-sm text-muted-foreground",children:["A reset code will be sent to:"," ",n.jsx("span",{className:"font-medium text-foreground",children:e?.email})]})}),g&&n.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-lg px-3 py-2 mb-4",children:g}),n.jsxs(ip,{children:[n.jsx(be,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),n.jsxs(be,{type:"submit",disabled:w,children:[w&&n.jsx(gt,{className:"size-4 animate-spin"}),"Send Code"]})]})]}):n.jsxs("form",{onSubmit:P,className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{htmlFor:"code",children:"Verification Code"}),n.jsx(Ee,{id:"code",name:"code",type:"text",placeholder:"Enter code from email",autoComplete:"one-time-code",required:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{htmlFor:"newPassword",children:"New Password"}),n.jsx(Ee,{id:"newPassword",name:"newPassword",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",minLength:8,autoComplete:"new-password",required:!0})]}),g&&n.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:g}),S&&n.jsx("p",{className:"text-sm text-success bg-success/10 rounded-lg px-3 py-2",children:S}),n.jsxs(ip,{children:[n.jsx(be,{type:"button",variant:"outline",onClick:()=>{C("request"),j("")},children:"Back"}),n.jsxs(be,{type:"submit",disabled:w,children:[w&&n.jsx(gt,{className:"size-4 animate-spin"}),"Change Password"]})]})]})]})}),n.jsx(wu,{open:p,onOpenChange:b,children:n.jsxs(Nu,{children:[n.jsxs(_u,{children:[n.jsx(Su,{children:"Delete Account"}),n.jsx(cN,{children:"This action cannot be undone. This will permanently delete your account and remove all your data."})]}),n.jsx("div",{className:"py-4",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Are you sure you want to delete your account?"})}),g&&n.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:g}),n.jsxs(ip,{children:[n.jsx(be,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),n.jsxs(be,{variant:"destructive",onClick:O,disabled:w,children:[w&&n.jsx(gt,{className:"size-4 animate-spin"}),"Delete Account"]})]})]})})]})}function l1({className:e,...t}){return n.jsx("textarea",{"data-slot":"textarea",className:Ae("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}var RB=Object.defineProperty,DB=(e,t)=>RB(e,"name",{value:t,configurable:!0});function Hv(e,[t,r]){return Math.min(r,Math.max(t,e))}DB(Hv,"clamp");var $B=Object.defineProperty,FB=(e,t)=>$B(e,"name",{value:t,configurable:!0});function mP(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}FB(mP,"usePrevious");var BB=Object.defineProperty,Ye=(e,t)=>
41BB(e,"name",{value:t,configurable:!0}),UB=[" ","Enter","ArrowUp","ArrowDown"],zB=[" ","Enter"],mo="Select",[wf,Nf,WB]=nf(mo),[gi,vde]=sr(mo,[WB,Ko]),c1=Ko(),[qB,os]=gi(mo),[VB,HB]=gi(mo);function pP(e){const{__scopeSelect:t,children:r,open:a,defaultOpen:s,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:u,name:h,autoComplete:m,disabled:p,required:b,form:w,internal_do_not_use_render:x}=e,g=c1(t),[j,S]=y.useState(null),[_,N]=y.useState(null),[C,A]=y.useState(!1),P=rf(u),[O,E]=Xa({prop:a,defaultProp:s??!1,onChange:i,caller:mo}),[$,M]=Xa({prop:o,defaultProp:c,onChange:d,caller:mo}),R=y.useRef(null),B=y.useRef($);y.useEffect(()=>{const re=w?j?.ownerDocument.getElementById(w):j?.form;if(re instanceof HTMLFormElement){const ce=Ye(()=>M(B.current),"reset");return re.addEventListener("reset",ce),()=>re.removeEventListener("reset",ce)}},[w,j,M]);const D=j?!!w||!!j.closest("form"):!0,[U,H]=y.useState(new Set),K=Br(),z=Array.from(U).map(re=>re.props.value).join(";"),X=y.useCallback(re=>{H(ce=>new Set(ce).add(re))},[]),G=y.useCallback(re=>{H(ce=>{const fe=new Set(ce);return fe.delete(re),fe})},[]),Q={required:b,trigger:j,onTriggerChange:S,valueNode:_,onValueNodeChange:N,valueNodeHasChildren:C,onValueNodeHasChildrenChange:A,contentId:K,value:$,onValueChange:M,open:O,onOpenChange:E,dir:P,triggerPointerDownPosRef:R,disabled:p,name:h,autoComplete:m,form:w,nativeOptions:U,nativeSelectKey:z,isFormControl:D};return n.jsx(D0,{...g,children:n.jsx(qB,{scope:t,...Q,children:n.jsx(wf.Provider,{scope:t,children:n.jsx(VB,{scope:t,onNativeOptionAdd:X,onNativeOptionRemove:G,children:vP(x)?x(Q):r})})})})}Ye(pP,"SelectProvider");var GB=Ye(e=>{const{__scopeSelect:t,children:r,...a}=e;return n.jsx(pP,{__scopeSelect:t,...a,internal_do_not_use_render:({isFormControl:s})=>n.jsxs(n.Fragment,{children:[r,s?n.jsx(vU,{__scopeSelect:t}):null]})})},"Select"),KB="SelectTrigger",YB=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,disabled:s=!1,...i}=t,o=c1(a),c=os(KB,a),d=c.disabled||s,u=tt(r,c.onTriggerChange),h=Nf(a),m=y.useRef("touch"),[p,b,w]=u1(g=>{const j=h().filter(N=>!N.disabled),S=j.find(N=>N.value===c.value),_=h1(j,g,S);_!==void 0&&c.onValueChange(_.value)}),x=Ye(g=>{d||(c.onOpenChange(!0),w()),g&&(c.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})},"handleOpen");return n.jsx($0,{asChild:!0,...o,children:n.jsx(et.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Jc(c.value)?"":void 0,...i,ref:u,onClick:Se(i.onClick,g=>{g.currentTarget.focus(),m.current!=="mouse"&&x(g)}),onPointerDown:Se(i.onPointerDown,g=>{m.current=g.pointerType;const j=g.target;j.hasPointerCapture(g.pointerId)&&j.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:Se(i.onKeyDown,g=>{const j=p.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&b(g.key),!(j&&g.key===" ")&&UB.includes(g.key)&&(x(),g.preventDefault())})})})},"SelectTrigger")),ZB="SelectValue",XB=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,className:s,style:i,children:o,placeholder:c="",...d}=t,u=os(ZB,a),{onValueNodeHasChildrenChange:h}=u,m=o!==void 0,p=tt(r,u.onValueNodeChange);yt(()=>{h(m)},[h,m]);const b=Jc(u.value);return n.jsx(et.span,{...d,asChild:b?!1:d.asChild,ref:p,style:{pointerEvents:"none"},children:n.jsx(y.Fragment,{children:b?c:o},b?"placeholder":"value")})},"SelectValue")),JB=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,children:s,...i}=t;return n.jsx(et.span,{"aria-hidden":!0,...i,ref:r,children:s||"â¼"})},"SelectIcon")),QB="SelectPortal",[eU,tU]=gi(QB,{forceMount:void 0}),nU=Ye(e=>{const{__scopeSelect:t,forceMount:r,...a}=e;return n.jsx(eU,{scope:e.__scopeSelect,forceMount:r,children:n.jsx(hf,{asChild:!0,...a})})},"SelectPortal"),Xs="SelectContent",rU=y.forwardRef(Ye(function(t,r){const a=tU(Xs,t.__scopeSelect),{forceMount:s=a.forceMount,...i}=t,o=os(Xs,t.__scopeSelect),[c,d]=y.useState();return yt(()=>{d(new DocumentFragment)},[]),n.jsx(is,{present:s||o.open,children:({present:u})=>u?n.jsx(iU,{...i,ref:r}):n.jsx(aU,{...i,fragment:c})})},"SelectContent")),aU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,children:s,fragment:i}=t;return i?Rc.createPortal(n.jsx(xP,{scope:a,children:n.jsx(wf.Slot,{scope:a,children:n.jsx("div",{ref:r,children:s})})}),i):null},"SelectContentFragment")),jr=10,[xP,bi]=gi(Xs),sU=Hs("SelectContent.RemoveScroll"),iU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a}=t,{position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:d,sideOffset:u,align:h,alignOffset:m,arrowPadding:p,collisionBoundary:b,collisionPadding:w,sticky:x,hideWhenDetached:g,avoidCollisions:j,...S}=t,_=os(Xs,a),[N,C]=y.useState(null),[A,P]=y.useState(null),O=tt(r,C),[E,$]=y.useState(null),[M,R]=y.useState(null),B=Nf(a),[D,U]=y.useState(!1),H=y.useRef(!1);y.useEffect(()=>{if(N)return z0(N)},[N]),Kc();const K=y.useCallback(J=>{const[ae,...ue]=B().map(je=>je.ref.current),[ee]=ue.slice(-1),Y=document.activeElement;for(const je of J)if(je===Y||(je?.scrollIntoView({block:"nearest"}),je===ae&&A&&(A.scrollTop=0),je===ee&&A&&(A.scrollTop=A.scrollHeight),je?.focus(),document.activeElement!==Y))return},[B,A]),z=y.useCallback(()=>K([E,N]),[K,E,N]);y.useEffect(()=>{D&&z()},[D,z]);const{onOpenChange:X,triggerPointerDownPosRef:G}=_;y.useEffect(()=>{if(N){let J={x:0,y:0};const ae=Ye(ee=>{J={x:Math.abs(Math.round(ee.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(ee.pageY)-(G.current?.y??0))}},"handlePointerMove"),ue=Ye(ee=>{J.x<=10&&J.y<=10?ee.preventDefault():ee.composedPath().includes(N)||X(!1),document.removeEventListener("pointermove",ae),G.current=null},"handlePointerUp");return G.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",ue,{capture:!0})}}},[N,X,G]),y.useEffect(()=>{const J=Ye(()=>X(!1),"close");return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[X]);const[Q,re]=u1(J=>{const ae=B().filter(Y=>!Y.disabled),ue=ae.find(Y=>Y.ref.current===document.activeElement),ee=h1(ae,J,ue);ee&&setTimeout(()=>ee.ref.current?.focus())}),ce=y.useCallback((J,ae,ue)=>{const ee=!H.current&&!ue;(_.value!==void 0&&_.value===ae||ee)&&($(J),ee&&(H.current=!0))},[_.value]),fe=y.useCallback(()=>N?.focus(),[N]),me=y.useCallback((J,ae,ue)=>{const ee=!H.current&&!ue;(_.value!==void 0&&_.value===ae||ee)&&R(J)},[_.value]),pe=s==="popper"?dN:oU,Re=pe===dN?{side:d,sideOffset:u,align:h,alignOffset:m,arrowPadding:p,collisionBoundary:b,collisionPadding:w,sticky:x,hideWhenDetached:g,avoidCollisions:j}:{};return n.jsx(xP,{scope:a,content:N,viewport:A,onViewportChange:P,itemRefCallback:ce,selectedItem:E,onItemLeave:fe,itemTextRefCallback:me,focusSelectedItem:z,selectedItemText:M,position:s,isPositioned:D,searchRef:Q,children:n.jsx(pf,{as:sU,allowPinchZoom:!0,children:n.jsx(k0,{asChild:!0,trapped:_.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Se(i,J=>{_.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:n.jsx(af,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:n.jsx(pe,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:J=>J.preventDefault(),...S,...Re,onPlaced:()=>U(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Se(S.onKeyDown,J=>{const ae=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ae&&J.key.length===1&&re(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ee=B().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);
vendor: 5,483 bytes, line 41
41if(["ArrowUp","End"].includes(J.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Y=J.target,je=ee.indexOf(Y);ee=ee.slice(je+1)}setTimeout(()=>K(ee)),J.preventDefault()}})})})})})})},"SelectContentImpl")),oU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,onPlaced:s,...i}=t,o=os(Xs,a),c=bi(Xs,a),[d,u]=y.useState(null),[h,m]=y.useState(null),p=tt(r,m),b=Nf(a),w=y.useRef(!1),x=y.useRef(!0),{viewport:g,selectedItem:j,selectedItemText:S,focusSelectedItem:_}=c,N=y.useCallback(()=>{if(o.trigger&&o.valueNode&&d&&h&&g&&j&&S){const O=o.trigger.getBoundingClientRect(),E=h.getBoundingClientRect(),$=o.valueNode.getBoundingClientRect(),M=S.getBoundingClientRect();if(o.dir!=="rtl"){const Y=M.left-E.left,je=$.left-Y,ke=O.left-je,Le=O.width+ke,Ge=Math.max(Le,E.width),at=window.innerWidth-jr,ot=Hv(je,[jr,Math.max(jr,at-Ge)]);d.style.minWidth=Le+"px",d.style.left=ot+"px"}else{const Y=E.right-M.right,je=window.innerWidth-$.right-Y,ke=window.innerWidth-O.right-je,Le=O.width+ke,Ge=Math.max(Le,E.width),at=window.innerWidth-jr,ot=Hv(je,[jr,Math.max(jr,at-Ge)]);d.style.minWidth=Le+"px",d.style.right=ot+"px"}const R=b(),B=window.innerHeight-jr*2,D=g.scrollHeight,U=window.getComputedStyle(h),H=parseInt(U.borderTopWidth,10),K=parseInt(U.paddingTop,10),z=parseInt(U.borderBottomWidth,10),X=parseInt(U.paddingBottom,10),G=H+K+D+X+z,Q=Math.min(j.offsetHeight*5,G),re=window.getComputedStyle(g),ce=parseInt(re.paddingTop,10),fe=parseInt(re.paddingBottom,10),me=O.top+O.height/2-jr,pe=B-me,Re=j.offsetHeight/2,J=j.offsetTop+Re,ae=H+K+J,ue=G-ae;if(ae<=me){const Y=R.length>0&&j===R[R.length-1].ref.current;d.style.bottom="0px";const je=h.clientHeight-g.offsetTop-g.offsetHeight,ke=Math.max(pe,Re+(Y?fe:0)+je+z),Le=ae+ke;d.style.height=Le+"px"}else{const Y=R.length>0&&j===R[0].ref.current;d.style.top="0px";const ke=Math.max(me,H+g.offsetTop+(Y?ce:0)+Re)+ue;d.style.height=ke+"px",g.scrollTop=ae-me+g.offsetTop}d.style.margin=`${jr}px 0`,d.style.minHeight=Q+"px",d.style.maxHeight=B+"px",s?.(),requestAnimationFrame(()=>w.current=!0)}},[b,o.trigger,o.valueNode,d,h,g,j,S,o.dir,s]);yt(()=>N(),[N]);const[C,A]=y.useState();yt(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const P=y.useCallback(O=>{O&&x.current===!0&&(N(),_?.(),x.current=!1)},[N,_]);return n.jsx(lU,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:w,onScrollButtonChange:P,children:n.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:n.jsx(et.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),dN=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,align:s="start",collisionPadding:i=jr,...o}=t,c=c1(a);return n.jsx(F0,{...c,...o,ref:r,align:s,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[lU,d1]=gi(Xs,{}),uN="SelectViewport",cU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,nonce:s,...i}=t,o=bi(uN,a),c=d1(uN,a),d=tt(r,o.onViewportChange),u=y.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),n.jsx(wf.Slot,{scope:a,children:n.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Se(i.onScroll,h=>{const m=h.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:b}=c;if(b?.current&&p){const w=Math.abs(u.current-m.scrollTop);if(w>0){const x=window.innerHeight-jr*2,g=parseFloat(p.style.minHeight),j=parseFloat(p.style.height),S=Math.max(g,j);if(S<x){const _=S+w,N=Math.min(x,_),C=_-N;p.style.height=N+"px",p.style.bottom==="0px"&&(m.scrollTop=C>0?C:0,p.style.justifyContent="flex-end")}}}u.current=m.scrollTop})})})]})},"SelectViewport")),dU="SelectGroup",[yde,jde]=gi(dU),Gv="SelectItem",[uU,gP]=gi(Gv),hU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,value:s,disabled:i=!1,textValue:o,...c}=t,d=os(Gv,a),u=bi(Gv,a),h=d.value===s,[m,p]=y.useState(o??""),[b,w]=y.useState(!1),x=qn(N=>u.itemRefCallback?.(N,s,i)),g=tt(r,x),j=Br(),S=y.useRef("touch"),_=Ye(()=>{i||(d.onValueChange(s),d.onOpenChange(!1))},"handleSelect");return n.jsx(uU,{scope:a,value:s,disabled:i,textId:j,isSelected:h,onItemTextChange:y.useCallback(N=>{p(C=>C||(N?.textContent??"").trim())},[]),children:n.jsx(wf.ItemSlot,{scope:a,value:s,disabled:i,textValue:m,children:n.jsx(et.div,{role:"option","aria-labelledby":j,"data-highlighted":b?"":void 0,"aria-selected":h&&b,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:Se(c.onFocus,()=>w(!0)),onBlur:Se(c.onBlur,()=>w(!1)),onClick:Se(c.onClick,()=>{S.current!=="mouse"&&_()}),onPointerUp:Se(c.onPointerUp,()=>{S.current==="mouse"&&_()}),onPointerDown:Se(c.onPointerDown,N=>{S.current=N.pointerType}),onPointerMove:Se(c.onPointerMove,N=>{S.current=N.pointerType,i?u.onItemLeave?.():S.current==="mouse"&&N.currentTarget.focu
41s({preventScroll:!0})}),onPointerLeave:Se(c.onPointerLeave,N=>{N.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Se(c.onKeyDown,N=>{i||N.target!==N.currentTarget||u.searchRef?.current!==""&&N.key===" "||(zB.includes(N.key)&&_(),N.key===" "&&N.preventDefault())})})})})},"SelectItem")),Dd="SelectItemText",fU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,className:s,style:i,...o}=t,c=os(Dd,a),d=bi(Dd,a),u=gP(Dd,a),h=HB(Dd,a),[m,p]=y.useState(null),b=qn(_=>d.itemTextRefCallback?.(_,u.value,u.disabled)),w=tt(r,p,u.onItemTextChange,b),x=m?.textContent,g=y.useMemo(()=>n.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:j,onNativeOptionRemove:S}=h;return yt(()=>(j(g),()=>S(g)),[j,S,g]),n.jsxs(n.Fragment,{children:[n.jsx(et.span,{id:u.textId,...o,ref:w}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!Jc(c.value)?Rc.createPortal(o.children,c.valueNode):null]})},"SelectItemText")),mU="SelectItemIndicator",pU=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,...s}=t;return gP(mU,a).isSelected?n.jsx(et.span,{"aria-hidden":!0,...s,ref:r}):null},"SelectItemIndicator")),hN="SelectScrollUpButton",xU=y.forwardRef(Ye(function(t,r){const a=bi(hN,t.__scopeSelect),s=d1(hN,t.__scopeSelect),[i,o]=y.useState(!1),c=tt(r,s.onScrollButtonChange);return yt(()=>{if(a.viewport&&a.isPositioned){let d=function(){const h=u.scrollTop>0;o(h)};Ye(d,"handleScroll");const u=a.viewport;return d(),u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),i?n.jsx(bP,{...t,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:u}=a;d&&u&&(d.scrollTop=d.scrollTop-u.offsetHeight)}}):null},"SelectScrollUpButton")),fN="SelectScrollDownButton",gU=y.forwardRef(Ye(function(t,r){const a=bi(fN,t.__scopeSelect),s=d1(fN,t.__scopeSelect),[i,o]=y.useState(!1),c=tt(r,s.onScrollButtonChange);return yt(()=>{if(a.viewport&&a.isPositioned){let d=function(){const h=u.scrollHeight-u.clientHeight,m=Math.ceil(u.scrollTop)<h;o(m)};Ye(d,"handleScroll");const u=a.viewport;return d(),u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),i?n.jsx(bP,{...t,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:u}=a;d&&u&&(d.scrollTop=d.scrollTop+u.offsetHeight)}}):null},"SelectScrollDownButton")),bP=y.forwardRef(Ye(function(t,r){const{__scopeSelect:a,onAutoScroll:s,...i}=t,o=bi("SelectScrollButton",a),c=y.useRef(null),d=Nf(a),u=y.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return y.useEffect(()=>()=>u(),[u]),yt(()=>{d().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),n.jsx(et.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(s,50))}),onPointerMove:Se(i.onPointerMove,()=>{o.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(s,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{u()})})},"SelectScrollButtonImpl")),bU="SelectBubbleInput",vU=y.forwardRef(Ye(function({__scopeSelect:t,...r},a){const s=os(bU,t),{value:i,onValueChange:o,required:c,disabled:d,name:u,autoComplete:h,form:m}=s,{nativeOptions:p,nativeSelectKey:b}=s,w=y.useRef(null),x=tt(a,w),g=i??"",j=mP(g),S=Array.from(p).some(_=>(_.props.value??"")==="");return y.useEffect(()=>{const _=w.current;if(!_)return;const N=window.HTMLSelectElement.prototype,A=Object.getOwnPropertyDescriptor(N,"value").set;if(j!==g&&A){const P=new Event("change",{bubbles:!0});A.call(_,g),_.dispatchEvent(P)}},[j,g]),n.jsxs(et.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:u,autoComplete:h,disabled:d,form:m,onChange:_=>o(_.target.value),...r,style:{...Fk,...r.style},ref:x,defaultValue:g,children:[Jc(i)&&!S?n.jsx("option",{value:""}):null,Array.from(p)]},b)},"SelectBubbleInput"));function vP(e){return typeof e=="function"}Ye(vP,"isFunction");function Jc(e){return e===""||e===void 0}Ye(Jc,"shouldShowPlaceholder");function u1(e){const t=qn(e),r=y.useRef(""),a=y.useRef(0),s=y.useCallback(o=>{const c=r.current+o;t(c),Ye((function d(u){r.current=u,window.clearTimeout(a.current),u!==""&&(a.current=window.setTimeout(()=>d(""),1e3))}),"updateSearch")(c)},[t]),i=y.useCallback(()=>{r.current="",window.clearTimeout(a.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(a.current),[]),[r,s,i]}Ye(u1,"useTypeaheadSearch");function h1(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=yP(e,Math.max(i,0));s.length===1&&(o=o.filter(u=>u!==r));const d=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==r?d:void 0}Ye(h1,"findNextItem");function yP(e,t){return e.map((r,a)=>e[(t+a)%e.length])}Ye(yP,"wrapArray");function op({...e}){return n.jsx(GB,{"data-slot":"select",...e})}function lp({...e}){return n.jsx(XB,{"data-slot":"select-value",...e})}function cp({className:e,size:t="default",children:r,...a}){return n.jsxs(YB,{"data-slot":"select-trigger","data-size":t,className:Ae("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-9 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[r,n.jsx(JB,{asChild:!0,children:n.jsx(zc,{className:"size-4 opacity-50"})})]})}function dp({className:e,children:t,position:r="popper",align:a="center",...s}){return n.jsx(nU,{children:n.jsxs(rU,{"data-slot":"select-content",className:Ae("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
41de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-lg",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:a,...s,children:[n.jsx(yU,{}),n.jsx(cU,{className:Ae("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),n.jsx(jU,{})]})})}function up({className:e,children:t,...r}){return n.jsxs(hU,{"data-slot":"select-item",className:Ae("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 transition-colors",e),...r,children:[n.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:n.jsx(pU,{children:n.jsx(xn,{className:"size-4"})})}),n.jsx(fU,{children:t})]})}function yU({className:e,...t}){return n.jsx(xU,{"data-slot":"select-scroll-up-button",className:Ae("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(sL,{className:"size-4"})})}function jU({className:e,...t}){return n.jsx(gU,{"data-slot":"select-scroll-down-button",className:Ae("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(zc,{className:"size-4"})})}const wU=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],NU=["Police Department","Sheriff's Office","State Police","Highway Patrol","Tribal Police","University Police","Transit Police","Federal Agency","Corrections","Other"],_U=["LEOFF Plan 2","PERS","State Pension","401(a)","457(b)","DROP Program","PFRS","Other"],SU=["Take-Home Vehicle","Competitive Pay","Education Incentives","Career Development","Wellness Programs","Retirement Benefits","Signing Bonu
41s","Lateral Transfer Program","Tuition Reimbursement","Specialty Unit Opportunities","Bilingual Pay","Overtime Opportunities","Flexible Scheduling","Community Policing Focus","Advanced Training Programs","Mental Health Support","Family-Friendly Culture","Veteran Preference in Hiring","Housing Assistance","Fitness Facilities On-Site","Uniform & Equipment Provided","Union Representation","Promotion from Within","Technology-Forward Department","Rural/Outdoor Environment"];function dr({icon:e,title:t,children:r,color:a="#00b4ff"}){return n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6 space-y-5",children:[n.jsxs("h2",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[n.jsx("span",{style:{color:a},children:n.jsx(e,{className:"w-5 h-5"})}),t]}),r]})}function CU(){const e=ie(F.agencies.getMyAgency),t=te(F.agencies.create),r=te(F.agencies.update),a=te(F.agencies.uploadLogo),s=te(F.storage.generateUploadUrl),i=e===void 0,o=e?.tier==="member"||e?.tier==="platinum",c=!!e,d=!e,[u,h]=y.useState({name:"",state:"",city:"",address:"",email:"",phone:"",website:"",description:"",contactName:"",contactTitle:"",agencyType:"",departmentSize:"",officerCount:"",salaryMin:"",salaryMax:"",signingBonus:"",educationIncentive:"",retirementPlanType:"",retirementDetails:"",benefits:[],socialFacebook:"",socialInstagram:"",socialLinkedin:"",socialTwitter:"",socialYoutube:"",socialTiktok:"",careersUrl:"",autoScanEnabled:!1,autoPublishJobs:!1,consentTerms:!1,consentBranding:!1,interestMilitaryCampaign:!1}),[m,p]=y.useState(!1),[b,w]=y.useState(!1),[x,g]=y.useState(null),[j,S]=y.useState(null);y.useEffect(()=>{e&&h({name:e.name,state:e.state,city:e.city??"",address:e.address??"",email:e.email,phone:e.phone??"",website:e.website??"",description:e.description??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",agencyType:e.agencyType??"",departmentSize:e.departmentSize??"",officerCount:e.officerCount?.toString()??"",salaryMin:e.salaryMin?.toString()??"",salaryMax:e.salaryMax?.toString()??"",signingBonus:e.signingBonus??"",educationIncentive:e.educationIncentive??"",retirementPlanType:e.retirementPlanType??"",retirementDetails:e.retirementDetails??"",benefits:e.benefits??[],socialFacebook:e.socialFacebook??"",socialInstagram:e.socialInstagram??"",socialLinkedin:e.socialLinkedin??"",socialTwitter:e.socialTwitter??"",socialYoutube:e.socialYoutube??"",socialTiktok:e.socialTiktok??"",careersUrl:e.careersUrl??"",autoScanEnabled:e.autoScanEnabled??!1,autoPublishJobs:e.autoPublishJobs??!1,consentTerms:e.consentTerms??!1,consentBranding:e.consentBranding??!1,interestMilitaryCampaign:e.interestMilitaryCampaign??!1})},[e]);const _=A=>{h(P=>P.benefits.includes(A)?{...P,benefits:P.benefits.filter(E=>E!==A)}:P.benefits.length>=6?(W.error("You can select up to 6 benefits."),P):{...P,benefits:[...P.benefits,A]})},N=async A=>{const P=A.target.files?.[0];if(P){w(!0);try{const O=await s(),E=await fetch(O,{method:"POST",headers:{"Content-Type":P.type},body:P}),{storageId:$}=await E.json();if(d){g($);const M=new FileReader;M.onload=()=>S(M.result),M.readAsDataURL(P),W.success("Logo ready.")}else await a({storageId:$}),W.success("Logo uploaded.")}catch{W.error("Failed to upload logo.")}finally{w(!1)}}},C=async A=>{if(A.preventDefault(),!u.name||!u.state||!u.email){W.error("Agency name, state, and email are required.");return}if(d&&(!u.consentTerms||!u.consentBranding)){W.error("You must agree to the Terms of Service and branding consent to register.");return}if(d&&!u.contactName){W.error("Your name is required.");return}if(d&&!u.contactTitle){W.error("Your position/title is required.");return}if(d&&!x){W.error("Please upload your agency logo or badge before registering.");return}p(!0);try{e?(await r({name:u.name,state:u.state,city:u.city||void 0,address:u.address||void 0,phone:u.phone||void 0,website:u.website||void 0,description:u.description||void 0,contactName:u.contactName||void 0,contactTitle:u.contactTitle||void 0,agencyType:u.agencyType||void 0,departmentSize:u.departmentSize||void 0,officerCount:u.officerCount?parseInt(u.officerCount):void 0,salary
41Min:u.salaryMin?parseInt(u.salaryMin):void 0,salaryMax:u.salaryMax?parseInt(u.salaryMax):void 0,signingBonus:u.signingBonus||void 0,educationIncentive:u.educationIncentive||void 0,retirementPlanType:u.retirementPlanType||void 0,retirementDetails:u.retirementDetails||void 0,benefits:u.benefits.length>0?u.benefits:void 0,socialFacebook:u.socialFacebook||void 0,socialInstagram:u.socialInstagram||void 0,socialLinkedin:u.socialLinkedin||void 0,socialTwitter:u.socialTwitter||void 0,socialYoutube:u.socialYoutube||void 0,socialTiktok:u.socialTiktok||void 0,careersUrl:u.careersUrl||void 0,autoScanEnabled:u.autoScanEnabled,autoPublishJobs:u.autoPublishJobs}),W.success("Agency profile updated.")):(await t({name:u.name,state:u.state,city:u.city||void 0,address:u.address||void 0,email:u.email,phone:u.phone||void 0,website:u.website||void 0,description:u.description||void 0,contactName:u.contactName||void 0,contactTitle:u.contactTitle||void 0,consentTerms:u.consentTerms,consentBranding:u.consentBranding,interestMilitaryCampaign:u.interestMilitaryCampaign,logoStorageId:x||void 0}),W.success("Agency registered! Your logo will appear on VET-TO-LEO."))}catch(P){W.error(P instanceof Error?P.message:"Failed to save profile.")}finally{p(!1)}};return!i&&c&&!o?n.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[n.jsxs("div",{className:"text-center",children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Agency Profile"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Upgrade to Agency Member to create your public profile."})]}),n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:n.jsxs("div",{className:"flex items-center gap-3",children:[e?.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-14 h-14 rounded-lg object-contain bg-white/5 p-1"}):n.jsx("div",{className:"w-14 h-14 rounded-lg bg-[#00b4ff10] flex items-center justify-center",children:n.jsx(Be,{className:"w-7 h-7 text-[#00b4ff]"})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-semibold",children:e?.name}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-[#00b4ff]/10 text-[#00b4ff] border border-[#00b4ff]/20",children:"Participating Agency"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Your logo is displayed on VET-TO-LEO's state and national pages."})]})]})}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center space-y-5",children:[n.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-[#d4a843]/10 flex items-center justify-center",children:n.jsx(qc,{className:"w-8 h-8 text-[#d4a843]"})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:"Agency Membership Required"}),n.jsx("p",{className:"text-[#94a3b8] max-w-md mx-auto",children:"Agency Members get a full public profile with recruiter cards, job postings, department details, and verified badge. Subscribe to unlock everything."})]}),n.jsxs("div",{className:"gold-glow-card p-4 max-w-sm mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[n.jsx(It,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] font-semibold text-sm",children:"LIMITED TIME OFFER"})]}),n.jsxs("p",{className:"text-white font-bold text-lg",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-sm mr-1",children:"$598"}),"$299/year"]}),n.jsx("p",{className:"text-[#94a3b8] text-xs mt-1",children:"Use code AGENCY50 at checkout for 50% off"})]}),n.jsx(ye,{to:"/subscription",children:n.jsxs("button",{className:"btn-gold-outline-pill inline-flex items-center gap-2",children:[n.jsx(It,{className:"w-4 h-4"}),"Become an Agency Member"]})})]})]}):n.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[n.jsxs("div",{className:"text-center",children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:d?"Register Your Agency":"Agency Profile"}),n.jsx("p",{className:"text-[#94a3b8]",children:d?"Become a Participating Agency on VET-TO-LEO. It's free.":"Manage your agency's public profile and information."})]}),e&&n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:n.jsxs("div",{className:"flex items-center gap-3",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-14 h-14 roun
41ded-lg object-contain bg-white/5 p-1"}):n.jsx("div",{className:"w-14 h-14 rounded-lg bg-[#00b4ff10] flex items-center justify-center",children:n.jsx(Be,{className:"w-7 h-7 text-[#00b4ff]"})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-semibold",children:e.name}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${e.tier==="member"||e.tier==="platinum"?"bg-[#d4a843]/20 text-[#d4a843] border border-[#d4a843]/30":"bg-[#00b4ff]/10 text-[#00b4ff] border border-[#00b4ff]/20"}`,children:e.tier==="member"||e.tier==="platinum"?"Agency Member":"Participating Agency"})]}),n.jsxs("p",{className:"text-[#94a3b8] text-sm",children:["Status: ",e.status.charAt(0).toUpperCase()+e.status.slice(1)]})]})]})}),n.jsxs("form",{onSubmit:C,className:"space-y-6",children:[n.jsxs(dr,{icon:en,title:d?"Your Information":"Primary Contact",children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Position/Title ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{value:u.contactTitle,onChange:A=>h(P=>({...P,contactTitle:A.target.value})),placeholder:"e.g., Sheriff, Chief, Recruiter",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Full Name ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{value:u.contactName,onChange:A=>h(P=>({...P,contactName:A.target.value})),placeholder:"First & Last Name",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Agency Email ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{type:"email",value:u.email,onChange:A=>h(P=>({...P,email:A.target.value})),placeholder:"[email protected]",disabled:!!e,className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40] disabled:opacity-60"}),d&&n.jsx("p",{className:"text-xs text-[#94a3b8]",children:"Personal emails (Gmail, Yahoo, etc.) are not accepted."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Direct Phone Line ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{value:u.phone,onChange:A=>h(P=>({...P,phone:A.target.value})),placeholder:"(208) 555-0100",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]})]}),n.jsxs(dr,{icon:Rt,title:"Agency Information",children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Agency Name ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{value:u.name,onChange:A=>h(P=>({...P,name:A.target.value})),placeholder:"e.g., Ada County Sheriff's Office",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),o&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Agency Type"}),n.jsxs(op,{value:u.agencyType,onValueChange:A=>h(P=>({...P,agencyType:A})),children:[n.jsx(cp,{className:"bg-[#0a0e17] border-[#1e293b] text-white focus:border-[#00b4ff] focus:ring-[#00b4ff40]",children:n.jsx(lp,{placeholder:"Select type"})}),n.jsx(dp,{className:"bg-[#111827] border-[#1e293b]",children:NU.map(A=>n.jsx(up,{value:A,className:"text-white hover:bg-[#1e293b]",children:A},A))})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["State ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsxs(op,{value:u.state,onValueChange:A=>h(P=>({...P,state:A})),children:[n.jsx(cp,{className:"bg-[#0a0e17] border-[#1e293b] text-white focus:border-[#00b4ff] focus:ring-[#00b4ff40]",children:n.jsx(lp,{placeholder:"Select state"})}),n.jsx(dp,{className:"bg-[#111827] border-[#1e293b]",children:wU.map(A=>n.jsx(up,{value:A,className:"text-white hover:bg-[#1e293b]",children:A},A))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"City"}),n.jsx(Ee,{value:u.city,onChange:A=>h(P=>({...P,city:A.target.value})),placeholder:"e.g., Boise",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Address ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{value:u.address,onChange:A=>h(P=>({...P,address:A.target.value})),placeholder:"1234 Location Street, City, State Zip Code",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),o&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Website"}),n.jsx(Ee,{value:u.website,onChange:A=>h(P=>({...P,website:A.target.value})),placeholder:"https://www.agency.gov",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]}),n.jsx(dr,{icon:Et,title:"Agency Logo",children:n.jsx("div",{className:"border-2 border-dashed border-[#1e293b] rounded-lg p-8 text-center hover:border-[#00b4ff30] transition-colors",children:e?.logoUrl?n.jsxs("div",{children:[n.jsx("img",{src:e.logoUrl,alt:"Logo",className:"w-24 h-24 mx-auto mb-3 object-contain"}),n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 text-[#00b4ff] text-sm hover:underline",children:[n.jsx(Et,{className:"w-4 h-4"}),b?"Uploading...":"Change Logo",n.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:b})]})]}):d?n.jsx("div",{children:j?n.jsxs(n.Fragment,{children:[n.jsx("img",{src:j,alt:"Logo preview",className:"w-24 h-24 mx-auto mb-3 object-contain"}),n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 text-[#00b4ff] text-sm hover:underline",children:[n.jsx(Et,{className:"w-4 h-4"}),b?"Uploading...":"Change Logo",n.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:b})]})]}):n.jsxs(n.Fragment,{children:[n.jsx(Et,{className:"w-8 h-8 text-[#475569] mx-auto mb-3"}),n.jsxs("p",{className:"text-[#94a3b8] text-sm mb-2",children:["Upload your agency logo or badge ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#00b4ff]/10 text-[#00b4ff] text-sm hover:bg-[#00b4ff]/20 transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),b?"Uploading...":"Upload Logo",n.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:b})]}),n.jsx("p",{className:"text-[#475569] text-xs mt-2",children:"Accepted formats: JPG, PNG, GIF. Max 100MB."})]})}):n.jsxs("div",{children:[n.jsx(Et,{className:"w-8 h-8 text-[#475569] mx-auto mb-3"}),n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#00b4ff]/10 text-[#00b4ff] text-sm hover:bg-[#00b4ff]/20 transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),b?"Uploading...":"Upload Logo",n.jsx("input",{type:"file",accept:"image/*",onChange:N,className:"hidden",disabled:b})]}),n.jsx("p",{className:"text-[#475569] text-xs mt-2",children:"Accepted formats: JPG, PNG, GIF. Max 100MB."})]})})}),o&&n.jsxs(n.Fragment,{children:[n.jsxs(dr,{icon:en,title:"Department Size",color:"#22c55e",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Select your department size"}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{value:"small",label:"Small",desc:"Under 49 sworn officers"},{value:"medium",label:"Medium",desc:"50 - 350 sworn officers"},{value:"large",label:"Large",desc:"350+ sworn officers"}].map(A=>n.jsxs("button",{type:"button",onClick:()=>h(P=>({...P,departmentSize:A.value})),className:`p-4 rounded-lg border text-left transition-all ${u.departmentSize===A.value?"border-[#00b4ff] bg-[#00b4ff]/10":"border-[#1e293b] bg-[#0a0e17] hover:border-[#1e293b80]"}`,children:[n.jsx("div",{className:`font-semibold mb-0.5 ${u.departmentSize===A.value?"text-[#00b4ff]":"text-white"}`,children:A.label}),n.jsx("div",{className:"text-[#94a3b8] text-xs",children:A.desc})]},A.value))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Specific Officer Count (optional, for display)"}),n.jsx(Ee,{type:"number",value:u.officerCount,onChange:A=>h(P=>({...P,officerCount:A.target.value})),placeholder:"e.g., 87",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40] max-w-xs"})]})]}),n.jsxs(dr,{icon:b0,title:"Compensation",color:"#f59e0b",children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Starting Salary (minimum)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#475569]",children:"$"}),n.jsx(Ee,{type:"number",value:u.salaryMin,onChange:A=>h(P=>({...P,salaryMin:A.target.value})),placeholder:"65000",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40] pl-7"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Starting Salary (maximum)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[#475569]",children:"$"}),n.jsx(Ee,{type:"number",value:u.salaryMax,onChange:A=>h(P=>({...P,salaryMax:A.target.value})),placeholder:"95000",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40] pl-7"})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Signing Bonu
41s"}),n.jsx(Ee,{value:u.signingBonus,onChange:A=>h(P=>({...P,signingBonus:A.target.value})),placeholder:"e.g., $15,000 or N/A",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Education Incentive"}),n.jsx(Ee,{value:u.educationIncentive,onChange:A=>h(P=>({...P,educationIncentive:A.target.value})),placeholder:"e.g., Up to $200/month",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]})]}),n.jsx(dr,{icon:Be,title:"Retirement",color:"#a855f7",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Retirement Plan Type"}),n.jsxs(op,{value:u.retirementPlanType,onValueChange:A=>h(P=>({...P,retirementPlanType:A})),children:[n.jsx(cp,{className:"bg-[#0a0e17] border-[#1e293b] text-white focus:border-[#00b4ff] focus:ring-[#00b4ff40]",children:n.jsx(lp,{placeholder:"Select plan type"})}),n.jsx(dp,{className:"bg-[#111827] border-[#1e293b]",children:_U.map(A=>n.jsx(up,{value:A,className:"text-white hover:bg-[#1e293b]",children:A},A))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Retirement Details"}),n.jsx(Ee,{value:u.retirementDetails,onChange:A=>h(P=>({...P,retirementDetails:A.target.value})),placeholder:"e.g., 20-year vesting, employer match",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]})}),n.jsx(dr,{icon:Pn,title:"About the Department",children:n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Department Description"}),n.jsx(l1,{value:u.description,onChange:A=>{A.target.value.length<=1500&&h(P=>({...P,description:A.target.value}))},placeholder:"Tell veterans about your agency, your mission, and what makes your department a great place to serve. This is the 'About the Department' section veterans see on your profile.",rows:6,className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40] resize-none"}),n.jsxs("p",{className:"text-xs text-[#475569] text-right",children:[u.description.length,"/1,500 characters"]})]})}),n.jsxs(dr,{icon:BC,title:"Top 6 Reasons to Join",color:"#d4a843",children:[n.jsx("p",{className:"text-[#94a3b8] text-sm",children:'Select the 6 benefits that best represent your department. These display as the "Why Join Us" section on your public profile.'}),n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsxs("span",{className:`text-sm font-medium ${u.benefits.length===6?"text-[#22c55e]":u.benefits.length>6?"text-[#ef4444]":"text-[#94a3b8]"}`,children:[u.benefits.length,"/6 selected"]}),u.benefits.length===6&&n.jsx(gn,{className:"w-4 h-4 text-[#22c55e]"})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:SU.map(A=>{const P=u.benefits.includes(A);return n.jsxs("button",{type:"button",onClick:()=>_(A),className:`flex items-center gap-2 p-3 rounded-lg border text-left text-sm transition-all ${P?"border-[#d4a843] bg-[#d4a843]/10 text-[#d4a843]":"border-[#1e293b] bg-[#0a0e17] text-[#94a3b8] hover:border-[#1e293b80] hover:text-white"}`,children:[n.jsx("div",{className:`w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center ${P?"border-[#d4a843] bg-[#d4a843]":"border-[#475569]"}`,children:P&&n.jsx("svg",{viewBox:"0 0 12 12",className:"w-3 h-3 text-black",children:n.jsx("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}),A]},A)})})]}),n.jsxs(dr,{icon:uI,title:"Social Media",color:"#06b6d4",children:[n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Add your department's social media links. These display as branded icons on your public profile."}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1] flex items-center gap-2",children:[n.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"#1877F2",children:n.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),"Facebook"]}),n.jsx(Ee,{value:u.socialFacebook,onChange:A=>h(P=>({...P,socialFacebook:A.target.value})),placeholder:"https://facebook.com/youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1] flex items-center gap-2",children:[n.jsxs("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"url(#ig-gradient)",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"ig-gradient",x1:"0%",y1:"100%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#FD5"}),n.jsx("stop",{offset:"50%",stopColor:"#FF543E"}),n.jsx("stop",{offset:"100%",stopColor:"#C837AB"})]})}),n.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"})]}),"Instagram"]}),n.jsx(Ee,{value:u.socialInstagram,onChange:A=>h(P=>({...P,socialInstagram:A.target.value})),placeholder:"https://instagram.com/youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1] flex items-center gap-2",children:[n.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"#0A66C2",children:n.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),"LinkedIn"]}),n.jsx(Ee,{value:u.socialLinkedin,onChange:A=>h(P=>({...P,socialLinkedin:A.target.value})),placeholder:"https://linkedin.com/company/youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1] flex items-center gap-2",children:[n.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"white",children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X (Twitter)"]}),n.jsx(Ee,{value:u.socialTwitter,onChange:A=>h(P=>({...P,socialTwitter:A.target.value})),placeholder:"https://x.com/youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1] flex items-center gap-2",children:[n.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"#FF0000",children:n.jsx("path",{d:"M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})}),"YouTube"]}),n.jsx(Ee,{value:u.socialYoutube,onChange:A=>h(P=>({...P,socialYoutube:A.target.value})),placeholder:"https://youtube.com/@youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1] flex items-center gap-2",children:[n.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",fill:"white",children:n.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08
41-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})}),"TikTok"]}),n.jsx(Ee,{value:u.socialTiktok,onChange:A=>h(P=>({...P,socialTiktok:A.target.value})),placeholder:"https://tiktok.com/@youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"})]})]})]}),n.jsx(dr,{icon:XL,title:"Job Scanner",color:"#22d3ee",children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-[#94a3b8]",children:"If your agency uses GovernmentJobs.com, VET-TO-LEO can automatically scan your careers page daily and post new law enforcement openings to your profile."}),n.jsxs("div",{className:"space-y-1",children:[n.jsx(we,{className:"text-sm font-medium text-[#e2e8f0]",children:"Careers / Employment Page URL"}),n.jsx(Ee,{value:u.careersUrl,onChange:A=>h(P=>({...P,careersUrl:A.target.value})),placeholder:"https://www.governmentjobs.com/careers/youragency",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-[#00b4ff40]"}),n.jsx("p",{className:"text-xs text-[#64748b]",children:"Enter your GovernmentJobs.com careers page URL"})]}),n.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[#1e293b] p-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-[#e2e8f0]",children:"Enable Daily Job Scanning"}),n.jsx("p",{className:"text-xs text-[#64748b]",children:"VET-TO-LEO will check your careers page daily for new postings"})]}),n.jsx(Vv,{checked:u.autoScanEnabled,onCheckedChange:A=>h(P=>({...P,autoScanEnabled:A})),disabled:!u.careersUrl?.includes("governmentjobs.com")})]}),u.autoScanEnabled&&n.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-[#1e293b] p-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-[#e2e8f0]",children:"Auto-Publish New Jobs"}),n.jsx("p",{className:"text-xs text-[#64748b]",children:"When off, scanned jobs are saved as drafts for your review"})]}),n.jsx(Vv,{checked:u.autoPublishJobs,onCheckedChange:A=>h(P=>({...P,autoPublishJobs:A}))})]}),e?.lastScannedAt&&n.jsxs("p",{className:"text-xs text-[#64748b]",children:["Last scanned: ",new Date(e.lastScannedAt).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})]})]})})]}),d&&n.jsx(dr,{icon:gn,title:"Consent & Agreements",color:"#22c55e",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[n.jsx("input",{type:"checkbox",checked:u.consentTerms,onChange:A=>h(P=>({...P,consentTerms:A.target.checked})),className:"mt-1 w-4 h-4 rounded border-[#475569] bg-[#0a0e17] text-[#00b4ff] focus:ring-[#00b4ff40]"}),n.jsxs("span",{className:"text-[#94a3b8] text-sm group-hover:text-white transition-colors",children:["I've read and agree with the Terms of Service and Privacy Policy. VET-TO-LEO affirms there are no hidden fees, no contracts, and no strings attached. Becoming a Participating Agency is free. This features my agency logo on VET-TO-LEO's Participating Agencies page and in other spots throughout the website. I understand that this free option does not give me the option to post my agency's open positions."," ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]})]}),n.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[n.jsx("input",{type:"checkbox",checked:u.consentBranding,onChange:A=>h(P=>({...P,consentBranding:A.target.checked})),className:"mt-1 w-4 h-4 rounded border-[#475569] bg-[#0a0e17] text-[#00b4ff] focus:ring-[#00b4ff40]"}),n.jsxs("span",{className:"text-[#94a3b8] text-sm group-hover:text-white transition-colors",children:["By submitting this form, I am acting with authority by my listed organization, and hereby provide consent between our organization and VET-TO-LEO, allowing VET-TO-LEO to feature our organization's name, logo, open jobs, and/or programs in visual promotional/display materials on the VET-TO-LEO website. This consent is voluntary and may be revoked in writing at any time. ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]})]})]})}),n.jsxs(be,{type:"submit",disabled:m,className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold neon-glow-sm px-8",children:[n.jsx(Gs,{className:"w-4 h-4 mr-2"}),m?"Saving...":d?"Register as Participating Agency":"Save Changes"]})]})]})}function AU({open:e,onClose:t,editJob:r}){const a=te(F.jobs.create),s=te(F.jobs.update),[i,o]=y.useState(!1),[c,d]=y.useState({title:r?.t
41itle??"",description:r?.description??"",applicationUrl:r?.applicationUrl??"",salary:r?.salary??"",jobType:r?.jobType??"",recruitmentType:r?.recruitmentType??"limited",expiresAt:r?.expiresAt?new Date(r.expiresAt).toISOString().split("T")[0]:""}),u=async h=>{if(h.preventDefault(),!c.title||!c.description){W.error("Title and description are required.");return}o(!0);try{const m=c.recruitmentType==="limited"&&c.expiresAt?new Date(c.expiresAt).getTime():void 0;r?(await s({jobId:r._id,title:c.title,description:c.description,applicationUrl:c.applicationUrl||void 0,salary:c.salary||void 0,jobType:c.jobType||void 0,recruitmentType:c.recruitmentType,expiresAt:m}),W.success("Job posting updated.")):(await a({title:c.title,description:c.description,applicationUrl:c.applicationUrl||void 0,salary:c.salary||void 0,jobType:c.jobType||void 0,recruitmentType:c.recruitmentType,expiresAt:m}),W.success("Job posting created!")),t()}catch(m){W.error(m instanceof Error?m.message:"Failed to save job.")}finally{o(!1)}};return n.jsx(wu,{open:e,onOpenChange:h=>!h&&t(),children:n.jsxs(Nu,{className:"bg-[#111827] border-[#1e293b] text-white max-w-lg",children:[n.jsx(_u,{children:n.jsx(Su,{className:"text-white",children:r?"Edit Job Posting":"Create Job Posting"})}),n.jsxs("form",{onSubmit:u,className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Job Title ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(Ee,{value:c.title,onChange:h=>d(m=>({...m,title:h.target.value})),placeholder:"e.g., Police Officer",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569]"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Salary Range"}),n.jsx(Ee,{value:c.salary,onChange:h=>d(m=>({...m,salary:h.target.value})),placeholder:"e.g., $55,000 - $72,000",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Job Type"}),n.jsx(Ee,{value:c.jobType,onChange:h=>d(m=>({...m,jobType:h.target.value})),placeholder:"e.g., Full-Time",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569]"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Application URL"}),n.jsx(Ee,{value:c.applicationUrl,onChange:h=>d(m=>({...m,applicationUrl:h.target.value})),placeholder:"https://apply.agency.gov/position",className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569]"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Recruitment Type"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:()=>d(h=>({...h,recruitmentType:"continuous"})),className:`flex-1 px-4 py-2.5 rounded-lg text-sm font-semibold border transition-colors ${c.recruitmentType==="continuous"?"bg-[#00b4ff]/15 border-[#00b4ff]/40 text-[#00b4ff]":"bg-[#0a0e17] border-[#1e293b] text-[#94a3b8] hover:border-[#334155]"}`,children:"Continuous (Always Hiring)"}),n.jsx("button",{type:"button",onClick:()=>d(h=>({...h,recruitmentType:"limited"})),className:`flex-1 px-4 py-2.5 rounded-lg text-sm font-semibold border transition-colors ${c.recruitmentType==="limited"?"bg-[#00b4ff]/15 border-[#00b4ff]/40 text-[#00b4ff]":"bg-[#0a0e17] border-[#1e293b] text-[#94a3b8] hover:border-[#334155]"}`,children:"Limited (Set End Date)"})]})]}),c.recruitmentType==="limited"&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{className:"text-[#cbd5e1]",children:"Closing Date"}),n.jsx(Ee,{type:"date",value:c.expiresAt,onChange:h=>d(m=>({...m,expiresAt:h.target.value})),min:new Date().toISOString().split("T")[0],max:new Date(Date.now()+365*24*60*60*1e3).toISOString().split("T")[0],className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569]"}),n.jsx("p",{className:"text-[11px] text-[#64748b]",children:"Up to 1 year from today. Job will auto-expire on this date."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(we,{className:"text-[#cbd5e1]",children:["Description ",n.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),n.jsx(l1,{value:c.description,onChange:h=>d(m=>({...m,description:h.target.value})),placeholder:"Describe the position, requirements, and what makes this opportunity unique...",rows:5,className:"bg-[#0a0e17] border-[#1e293b] text-white placeholder:text-[#475569] resize-none"})]}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[n.jsx(be,{type:"button",variant:"outline",onClick:t,className:"border-[#1e293b] text-[#94a3b8]",children:"Cancel"}),n.jsx(be,{type:"submit",disabled:i,className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:i?"Saving...":r?"Update":"Create Posting"})]})]})]})})}function kU(){const e=ie(F.agencies.getMyAgency),t=ie(F.jobs.listMyJobs),r=te(F.jobs.remove),[a,s]=y.useState(!1),[i,o]=y.useState(null),c=t?.filter(x=>x.status==="active")??[],d=e?.tier==="member"||e?.tier==="platinum",u=e?.jobPostCredits??0,h=(d?3:0)+u,m=h>0,p=m&&c.length<h,b=x=>e?`${x}?client_reference_id=${e._id}&prefilled_email=${encodeURIComponent(e.email)}`:x,w=async x=>{try{await r({jobId:x}),W.success("Job posting deleted.")}catch{W.error("Failed to delete job.")}};return e?n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Job Postings"}),n.jsx("p",{className:"text-[#94a3b8]",children:m?`${c.length} of ${h} active posting${h===1?"":"s"}`:"Purchase a job posting or become an Agency Member to post jobs"})]}),m&&n.jsxs(be,{onClick:()=>{o(null),s(!0)},disabled:!p,className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:[n.jsx(pt,{className:"w-4 h-4 mr-2"}),"New Posting"]})]}),!d&&u>0&&n.jsx("div",{className:"rounded-xl border border-[#22c55e]/30 bg-[#0f1f16] p-5",children:n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"p-2 rounded-lg bg-[#22c55e]/10 mt-0.5",children:n.jsx(ht,{className:"w-5 h-5 text-[#22c55e]"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-white font-semibold",children:"Annual Job Posting active"}),n.jsxs("p",{className:"text-[#94a3b8] text-sm mt-0.5",children:["You have ",u," paid posting slot",u===1?"":"s",". Create, edit, and close your listing here any time during the year. Analytics, veteran leads, and a full public profile come with Agency Membership."]})]})]}),n.jsx("button",{className:"btn-gold-outline-pill whitespace-nowrap px-5",onClick:()=>window.open(b("https://buy.stripe.com/14A00k0kbeyQ12MecNeME09"),"_blank"),children:"Upgrade to Member"})]})}),e.tier==="participating"&&u===0&&n.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"rounded-xl bg-gradient-to-br from-[#0d1a2e] to-[#162032] border border-[#00b4ff30] p-6 space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"p-2 rounded-lg bg-[#00b4ff]/10",children:n.jsx(ht,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsx("h3",{className:"text-lg font-bold text-white",children:"Annual Job Posting"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Post a single job listing for one full year. Your posting will be visible to veteran candidates actively looking for law enforcement careers."}),n.jsxs("p",{className:"text-white font-bold text-2xl",children:["$129",n.jsx("span",{className:"text-[#94a3b8] text-sm font-normal",children:"/year per posting"})]}),n.jsx("button",{className:"btn-neon-pill w-full",onClick:()=>window.open(b("https://buy.stripe.com/00w5kEff5bmEbHqc4FeME07"),"_blank"),children:"Purchase Job Posting"})]}),n.jsxs("div",{className:"rounded-xl bg-gradient-to-br from-[#1a1a0e] to-[#1e1c12] border border-[#d4a843]/30 p-6 space-y-3 relative overflow-hidden",children:[n.jsx("div",{className:"absolute top-3 right-3 px-2 py-0.5 rounded-full bg-[#d4a843]/15 border border-[#d4a843]/30",children:n.jsx("span",{className:"text-[#d4a843] text-xs font-semibold",children:"BEST VALUE"})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"p-2 rounded-lg bg-[#d4a843]/10",children:n.jsx(It,{className:"w-5 h-5 text-[#d4a843]"})}),n.jsx("h3",{className:"text-lg font-bold text-white",children:"Agency Membership"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Post up to 3 job listings, access analytics, veteran leads, and a full agency profile. Use code AGENCY50 for 50% off."}),n.jsxs("p",{className:"text-white font-bold text-2xl",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-base mr-1",children:"$598"}),"$299",n.jsx("span",{className:"text-[#94a3b8] text-sm font-normal",children:"/year"})]}),n.jsx("button",{className:"btn-gold-outline-pill w-full",onClick:()=>window.open(b("https://buy.stripe.com/14A00k0kbeyQ12MecNeME09"),"_blank"),children:"Become an Agency Member"})]})]}),m&&c.length>=h&&n.jsx("div",{className:"rounded-xl bg-gradient-to-br from-[#0d1a2e] to-[#162032] border border-[#00b4ff30] p-5",children:n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("span",{className:"p-2 rounded-lg bg-[#00b4ff]/10 mt-0.5",children:n.jsx(pt,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-white font-semibold",children:"Need more job postings?"}),n.jsxs("p",{className:"text-[#94a3b8] text-sm mt-0.5",children:["You've reached your ",h,"-posting limit. Purchase additional individual postings at $129/year each."]})]})]}),n.jsx("button",{className:"btn-neon-pill whitespace-nowrap px-6",onClick:()=>window.open(b("https://buy.stripe.com/00w5kEff5bmEbHqc4FeME07"),"_blank"),children:"Purchase Additional Posting"})]})}),t&&t.length>0?n.jsx("div",{className:"space-y-4",children:p0(t).map(x=>n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-lg font-semibold text-white",children:x.title}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${x.status==="active"?"bg-[#22c55e]/15 text-[#22c55e] border border-[#22c55e]/20":x.status==="draft"?"bg-[#f59e0b]/15 text-[#f59e0b] border border-[#f59e0b]/20":"bg-[#ef4444]/15 text-[#ef4444] border border-[#ef4444]/20"}`,children:x.status})]}),n.jsxs("div",{className:"flex items-center gap-4 text-sm text-[#94a3b8] mb
41-2",children:[x.salary&&n.jsx("span",{children:x.salary}),x.jobType&&n.jsx("span",{children:x.jobType}),x.expiresAt&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(At,{className:"w-3 h-3"}),"Expires"," ",new Date(x.expiresAt).toLocaleDateString()]})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm line-clamp-2",children:x.description}),x.applicationUrl&&n.jsxs("a",{href:x.applicationUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[#00b4ff] text-sm mt-2 hover:underline",children:["Application Link",n.jsx(nn,{className:"w-3 h-3"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(be,{variant:"outline",size:"icon",className:"border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#00b4ff40] h-8 w-8",onClick:()=>{o(x),s(!0)},children:n.jsx(qt,{className:"w-3.5 h-3.5"})}),n.jsx(be,{variant:"outline",size:"icon",className:"border-[#1e293b] text-[#94a3b8] hover:text-[#ef4444] hover:border-[#ef4444]/40 h-8 w-8",onClick:()=>w(x._id),children:n.jsx(_n,{className:"w-3.5 h-3.5"})})]})]})},x._id))}):m&&n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-10 text-center",children:[n.jsx(ht,{className:"w-10 h-10 text-[#475569] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:"No job postings yet"}),n.jsx("p",{className:"text-[#94a3b8] text-sm mb-4",children:"Create your first job posting to reach veteran candidates."}),n.jsxs(be,{onClick:()=>{o(null),s(!0)},className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:[n.jsx(pt,{className:"w-4 h-4 mr-2"}),"Create First Posting"]})]}),a&&n.jsx(AU,{open:a,onClose:()=>{s(!1),o(null)},editJob:i})]}):n.jsxs("div",{className:"space-y-6",children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Job Postings"}),n.jsxs("div",{className:"rounded-xl neon-border bg-gradient-to-br from-[#111827] to-[#0d1a2e] p-8 text-center",children:[n.jsx(ht,{className:"w-12 h-12 text-[#00b4ff] mx-auto mb-4"}),n.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Create Your Agency Profile First"}),n.jsx("p",{className:"text-[#94a3b8] mb-4",children:"Set up your agency profile before managing job postings."})]})]})}function $d({icon:e,label:t,value:r,color:a}){return n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{backgroundColor:`${a}12`},children:n.jsx("span",{style:{color:a},children:n.jsx(e,{className:"w-6 h-6"})})}),n.jsx(ii,{className:"w-4 h-4 text-[#22c55e]"})]}),n.jsx("div",{className:"text-3xl font-bold text-white mb-1",children:r}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:t})]})}function PU({events:e}){const t={profile_view:"Profile Viewed",job_click:"Job Click",website_click:"Website Click"},r={profile_view:"#00b4ff",job_click:"#22c55e",website_click:"#f59e0b"};return e.length===0?n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[n.jsx(Fr,{className:"w-5 h-5 text-[#00b4ff]"}),"Recent Activity"]}),n.jsxs("div",{className:"text-center py-8",children:[n.jsx(Fr,{className:"w-10 h-10 text-[#475569] mx-auto mb-3"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No activity recorded yet. Analytics will appear as veterans interact with your agency profile."})]})]}):n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsxs("h3",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[n.jsx(Fr,{className:"w-5 h-5 text-[#00b4ff]"}),"Recent Activity"]}),n.jsx("div",{className:"space-y-3",children:e.map((a,s)=>n.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-[#1e293b] last:border-0",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:r[a.event]??"#94a3b8"}}),n.jsx("span",{className:"text-sm text-white",children:t[a.event]??a.event})]}),n.jsxs("span",{className:"text-xs text-[#94a3b8]",children:[new Date(a.timestamp).toLocaleDateString()," ",new Date(a.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]},`${a.timestamp}-${s}`))})]})}function TU(){const e=ie(F.agencies.getMyAgency),t=ie(F.analytics.getMyAnalytics),r=e?.tier==="member"||e?.tier==="platinum";return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Analytics"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Track how veterans are engaging with your agency profile and job postings."})]}),r?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx($d,{icon:Wn,label:"Profile Views",value:t?.profileViews??0,color:"#00b4ff"}),n.jsx($d,{icon:Vc,label:"Job Clicks",value:t?.jobClicks??0,color:"#22c55e"}),n.jsx($d,{icon:Pn,label:"Website Clicks",value:t?.websiteClicks??0,color:"#f59e0b"}),n.jsx($d,{icon:Fr,label:"Total Events",value:t?.totalEvents??0,color:"#a85
415f7"})]}),n.jsx(PU,{events:t?.recentEvents??[]})]}):n.jsx(bf,{feature:"Analytics & Performance Tracking",description:"Upgrade to Agency Member to access detailed analytics including profile views, job clicks, website traffic, and veteran engagement metrics."})]})}function OU(){const e=ie(F.agencies.getMyAgency),t=e?.tier==="member"||e?.tier==="platinum";return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Veteran Leads"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Veterans who are interested in careers at your agency."})]}),t?n.jsxs("div",{className:"rounded-xl neon-border bg-gradient-to-br from-[#111827] to-[#0d1a2e] p-10 text-center",children:[n.jsx("div",{className:"w-16 h-16 rounded-2xl bg-[#00b4ff10] flex items-center justify-center mx-auto mb-4",children:n.jsx(en,{className:"w-8 h-8 text-[#00b4ff]"})}),n.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Coming Soon"}),n.jsx("p",{className:"text-[#94a3b8] max-w-md mx-auto",children:"Veteran leads will appear here when veterans create accounts and select your agency or state as a career interest. You'll see fresh leads with their background, qualifications, and contact preferences."})]}):n.jsx(bf,{feature:"Veteran Lead Pipeline",description:"Upgrade to Agency Member to receive qualified veteran candidates who are interested in your agency. See their background, qualifications, and contact preferences."})]})}function EU({recruiter:e,onEdit:t,onDelete:r}){return n.jsx("div",{className:"bg-[#111827] border border-[#1e293b] rounded-xl p-6 hover:border-[#00b4ff]/30 transition-colors",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden border-2 border-[#00b4ff]/30 flex-shrink-0",children:n.jsx("img",{src:e.photoUrl,alt:`${e.firstName} ${e.lastName}`,className:"w-full h-full object-cover"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{children:[n.jsxs("h3",{className:"text-lg font-semibold text-white",children:[e.firstName," ",e.lastName]}),e.title&&n.jsx("p",{className:"text-[#00b4ff] text-sm font-medium",children:e.title})]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{onClick:t,className:"p-1.5 text-[#94a3b8] hover:text-[#00b4ff] hover:bg-[#1e293b] rounded-lg transition-colors",children:n.jsx(qt,{className:"w-4 h-4"})}),n.jsx("button",{onClick:r,className:"p-1.5 text-[#94a3b8] hover:text-[#ef4444] hover:bg-[#ef4444]/10 rounded-lg transition-colors",children:n.jsx(_n,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"mt-3 space-y-1",children:[e.email&&n.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#94a3b8]",children:[n.jsx(Sn,{className:"w-3.5 h-3.5"}),n.jsx("span",{children:e.email})]}),e.phone&&n.jsxs("div",{className:"flex items-center gap-2 text-sm text-[#94a3b8]",children:[n.jsx(zo,{className:"w-3.5 h-3.5"}),n.jsx("span",{children:e.phone})]})]}),e.bio&&n.jsx("p",{className:"mt-3 text-sm text-[#cbd5e1] leading-relaxed",children:e.bio})]})]})})}function MU({open:e,onClose:t,recruiter:r}){const a=te(F.recruiters.create),s=te(F.recruiters.update),i=te(F.storage.generateUploadUrl),[o,c]=y.useState(r?.firstName??""),[d,u]=y.useState(r?.lastName??""),[h,m]=y.useState(r?.title??""),[p,b]=y.useState(r?.email??""),[w,x]=y.useState(r?.phone??""),[g,j]=y.useState(r?.bio??""),[S,_]=y.useState(r?.photoUrl??null),[N,C]=y.useState(null),[A,P]=y.useState(!1),[O,E]=y.useState(!!r),$=y.useRef(null),M=!!r,R=U=>{const H=U.target.files?.[0];if(!H)return;if(!H.type.startsWith("image/")){W.error("Please select an image file");return}C(H);const K=new FileReader;K.onload=()=>_(K.result),K.readAsDataURL(H)},B=async U=>{const H=await i(),K=await fetch(H,{method:"POST",headers:{"Content-Type":U.type},body:U}),{storageId:z}=await K.json();return z},D=async U=>{if(U.preventDefault(),!o.trim()||!d.trim()){W.error("First and last name are required");return}if(!h.trim()){W.error("Title / Rank is required");return}if(!p.trim()){W.error("Email is required");return}if(!w.trim()){W.error("Phone number is required");return}if(!g.trim()){W.error("Bio is required");return}if(!M&&!N){W.error("A photo is required for recruiter profiles");return}if(!O){W.error("Please acknowledge the public profile disclosure");return}P(!0);try{if(M){const H={id:r._id,firstName:o.trim(),lastName:d.trim(),title:h.trim()||void 0,email:p.trim()||void 0,phone:w.trim()||void 0,bio:g.trim()||void 0};
41N&&(H.photoStorageId=await B(N)),await s(H),W.success("Recruiter profile updated")}else{const H=await B(N);await a({firstName:o.trim(),lastName:d.trim(),title:h.trim()||void 0,email:p.trim()||void 0,phone:w.trim()||void 0,bio:g.trim()||void 0,photoStorageId:H}),W.success("Recruiter profile created")}t()}catch(H){W.error(H instanceof Error?H.message:"Failed to save recruiter")}finally{P(!1)}};return n.jsx(wu,{open:e,onOpenChange:U=>!U&&t(),children:n.jsxs(Nu,{className:"bg-[#111827] border-[#1e293b] text-white max-w-lg",children:[n.jsx(_u,{children:n.jsx(Su,{className:"text-white",children:M?"Edit Recruiter":"Add Recruiter"})}),n.jsxs("form",{onSubmit:D,className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"w-24 h-24 rounded-full overflow-hidden border-2 border-dashed border-[#334155] flex items-center justify-center cursor-pointer hover:border-[#00b4ff]/50 transition-colors bg-[#0a0e17]",onClick:()=>$.current?.click(),children:S?n.jsx("img",{src:S,alt:"Preview",className:"w-full h-full object-cover"}):n.jsxs("div",{className:"text-center",children:[n.jsx(Et,{className:"w-6 h-6 text-[#475569] mx-auto"}),n.jsx("span",{className:"text-[10px] text-[#475569] mt-1 block",children:"Photo *"})]})}),n.jsx("input",{ref:$,type:"file",accept:"image/*",onChange:R,className:"hidden"}),S&&n.jsxs("button",{type:"button",onClick:()=>{_(null),C(null)},className:"text-xs text-[#94a3b8] hover:text-white flex items-center gap-1",children:[n.jsx(Me,{className:"w-3 h-3"})," Remove photo"]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(we,{className:"text-[#94a3b8] text-xs",children:"First Name *"}),n.jsx(Ee,{value:o,onChange:U=>c(U.target.value),className:"bg-[#0a0e17] border-[#1e293b] text-white",placeholder:"John"})]}),n.jsxs("div",{children:[n.jsx(we,{className:"text-[#94a3b8] text-xs",children:"Last Name *"}),n.jsx(Ee,{value:d,onChange:U=>u(U.target.value),className:"bg-[#0a0e17] border-[#1e293b] text-white",placeholder:"Smith"})]})]}),n.jsxs("div",{children:[n.jsx(we,{className:"text-[#94a3b8] text-xs",children:"Title / Rank *"}),n.jsx(Ee,{value:h,onChange:U=>m(U.target.value),className:"bg-[#0a0e17] border-[#1e293b] text-white",placeholder:"e.g. Sergeant, Recruitment Officer",required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(we,{className:"text-[#94a3b8] text-xs",children:"Email *"}),n.jsx(Ee,{type:"email",value:p,onChange:U=>b(U.target.value),className:"bg-[#0a0e17] border-[#1e293b] text-white",placeholder:"[email protected]",required:!0})]}),n.jsxs("div",{children:[n.jsx(we,{className:"text-[#94a3b8] text-xs",children:"Phone *"}),n.jsx(Ee,{value:w,onChange:U=>x(U.target.value),className:"bg-[#0a0e17] border-[#1e293b] text-white",placeholder:"(208) 555-0100",required:!0})]})]}),n.jsxs("div",{children:[n.jsx(we,{className:"text-[#94a3b8] text-xs",children:"Bio *"}),n.jsx(l1,{value:g,onChange:U=>j(U.target.value),className:"bg-[#0a0e17] border-[#1e293b] text-white min-h-[80px]",placeholder:"Brief background or message to potential recruits...",required:!0})]}),n.jsx("div",{className:"border border-[#1e293b] rounded-lg p-3 bg-[#0a0e17]",children:n.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:O,onChange:U=>E(U.target.checked),className:"mt-0.5 w-4 h-4 rounded border-[#334155] bg-[#0a0e17] accent-[#00b4ff]"}),n.jsxs("span",{className:"text-xs text-[#94a3b8] leading-relaxed",children:["I acknowledge that this is a ",n.jsx("span",{className:"text-white font-medium",children:"public-facing profile"}),". The name, title, photo, email, phone, and bio entered here will be visible to veterans and other members of the VET-TO-LEO network."]})]})}),n.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[n.jsx(be,{type:"button",variant:"ghost",onClick:t,className:"text-[#94a3b8] hover:text-white hover:bg-[#1e293b]",children:"Cancel"}),n.jsx(be,{type:"submit",disabled:A,className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:A?"Saving...":M?"Update Recruiter":"Add Recruiter"})]})]})]})})}function LU(){const e=ie(F.agencies.getMyAgency),t=ie(F.recruiters.list)??[],r=te(F.recruiters.remove),[a,s]=y.useState(!1),[i,o]=y.useState(void 0);if(e===void 0)return n.jsx("div",{className:"flex items-center justify-center h-64 text-[#94a3b8]",children:"Loading..."});if(!e)return n.jsxs("div",{className:"p-6",children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"Recruiter Profiles"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Create your agency profile first to manage recruiters."})]});const c=async d=>{if(confirm("Remove this recruiter profile?"))try{await r({id:d}),W.success("Recruiter removed")}catch{W.error("Failed to remove recruiter")}};return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Recruiter Profiles"}),n.jsx("p",{className:"text-[#94a3b8] text-sm mt-1",children:"Manage your agency's recruiters. Veterans can see who they'll be working with."})]}),n.jsxs(be,{onClick:()=>{o(void 0),s(!0)},className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:[n.jsx(pt,{className:"w-4 h-4 mr-2"}),"Add Recruiter"]})]}),t.length===0?n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-xl p-12 text-center",children:[n.jsx(Wc,{className:"w-16 h-16 text-[#334155] mx-auto mb-4"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"No recruiters yet"}
41),n.jsx("p",{className:"text-[#94a3b8] mb-6 max-w-md mx-auto",children:"Add your agency's recruiters so veterans know who to connect with. Each profile requires a photo."}),n.jsxs(be,{onClick:()=>{o(void 0),s(!0)},className:"bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold",children:[n.jsx(pt,{className:"w-4 h-4 mr-2"}),"Add Your First Recruiter"]})]}):n.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:t.map(d=>n.jsx(EU,{recruiter:d,onEdit:()=>{o(d),s(!0)},onDelete:()=>c(d._id)},d._id))}),a&&n.jsx(MU,{open:a,onClose:()=>{s(!1),o(void 0)},recruiter:i})]})}const bt="#d4a843",IU=["SUN","MON","TUE","WED","THU","FRI","SAT"],Cu=[{value:"America/New_York",label:"Eastern (ET)"},{value:"America/Chicago",label:"Central (CT)"},{value:"America/Denver",label:"Mountain (MT)"},{value:"America/Los_Angeles",label:"Pacific (PT)"},{value:"America/Anchorage",label:"Alaska (AKT)"},{value:"Pacific/Honolulu",label:"Hawaii (HT)"}];function RU(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(Cu.some(t=>t.value===e))return e;if(e.startsWith("US/")){const t={"US/Eastern":"America/New_York","US/Central":"America/Chicago","US/Mountain":"America/Denver","US/Pacific":"America/Los_Angeles","US/Alaska":"America/Anchorage","US/Hawaii":"Pacific/Honolulu"};if(t[e])return t[e]}return e}catch{return"America/Los_Angeles"}}function f1(e){const t=Cu.find(r=>r.value===e);if(t)return t.label;try{return new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}).formatToParts(new Date).find(a=>a.type==="timeZoneName")?.value||e.split("/").pop()?.replace(/_/g," ")||e}catch{return e}}function mN(e,t,r){const[a,s]=e.split(":").map(Number),i=`${t}T${String(a).padStart(2,"0")}:${String(s).padStart(2,"0")}:00`;let o=null;for(const b of[-7,-8]){const w=new Date(`${i}${b>=0?"+":"-"}${String(Math.abs(b)).padStart(2,"0")}:00`),x=w.toLocaleString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",hour12:!1}),[g,j]=x.split(":").map(Number);if(g===a&&j===s){o=w;break}}o||(o=new Date(`${i}-07:00`));const c=parseInt(o.toLocaleString("en-US",{timeZone:r,hour:"2-digit",hour12:!1})),d=parseInt(o.toLocaleString("en-US",{timeZone:r,minute:"2-digit"})),u=`${String(c).padStart(2,"0")}:${String(d).padStart(2,"0")}`,h=c>=12?"PM":"AM",p=`${c===0?12:c>12?c-12:c}:${String(d).padStart(2,"0")} ${h}`;return{time24:u,label:p}}function Ll(e,t,r){const a=mN(e,t,r),s=FU(e),i=mN(s,t,r);return{startLabel:a.label,endLabel:i.label}}function DU(e,t){return new Date(e,t+1,0).getDate()}function $U(e,t){return new Date(e,t,1).getDay()}function FU(e){const[t,r]=e.split(":").map(Number);let a=r+30,s=t;return a>=60&&(s++,a-=60),`${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}function pN(e){const[t,r,a]=e.split("-").map(Number);return new Date(t,r-1,a).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}function BU({value:e,onChange:t}){const[r,a]=y.useState(!1),s=f1(e),i=Cu.some(o=>o.value===e);return n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>a(!r),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-colors hover:bg-[#1e293b]",style:{border:"1px solid #1e293b",color:"#94a3b8"},children:[n.jsx(Pn,{className:"w-3.5 h-3.5"}),s,n.jsx(zc,{className:"w-3 h-3"})]}),r&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>a(!1)}),n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-lg shadow-xl py-1 min-w-[180px]",style:{background:"#111827",border:"1px solid #1e293b"},children:[Cu.map(o=>n.jsx("button",{type:"button",onClick:()=>{t(o.value),a(!1)},className:`w-full text-left px-4 py-2 text-sm transition-colors hover:bg-[#1e293b] ${e===o.value?"font-semibold":""}`,style:{color:e===o.value?bt:"#94a3b8"},children:o.label},o.value)),!i&&n.jsxs("button",{type:"button",className:"w-full text-left px-4 py-2 text-sm font-semibold",style:{color:bt},disabled:!0,children:[s," (detected)"]})]})]})]})}function UU({onBookToday:e,userTz:t}){const r=new Date().toLocaleDateString("en-CA",{timeZone:"America/Los_Angeles"}),a=ie(F.calendar.getBookedSlotsForDate,{date:r}),[s,i,o]=r.split("-").map(Number),c=new Date(s,i-1,o).getDay(),d=c===0||c>=4,u=!d,h=new Date(s,i-1,o).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"}),m=a?.booked??[];return n.jsxs("div",{className:"rounded-xl p-5",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-bold text-white",children:"Today's Schedule"}),n.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider",style:{color:"#22c55e"},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"#22c55e"}}),"Live"]})]}),n.jsx("p",{className:"text-xs text-[#64748b] mb-3",children:h}),d?n.jsx("p",{className:"text-sm text-[#475569]",children:"Office is closed today."}):m.length===0?n.jsx("p",{className:"text-sm text-[#475569]",children:"No consultations booked today."}):n.jsxs("div",{children:[n.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-[#475569] mb-2",children:["Booked Times (",f1(t),")"]}),n.jsx("div",{className:"space-y-1.5",children:m.map(p=>{const{startLabel:b,endLabel:w}=Ll(p,r,t);return n.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:bt},children:[n.jsx(At,{className:"w-3 h-3"}),b," â ",w]},p)})})]}),u&&n.jsx("button",{type:"button",onClick:e,className:"w-full mt-4 py-2.5 rounded-lg text-sm font-bold transition-all hover:brightness-110",style:{background:bt,color:"#000"},children:"Book a Consultation"})]})}function zU({selectedDate:e,onClose:t,userTz:r}){const a=ie(F.calendar.getAvailableSlots,{date:e}),s=te(F.calendar.bookPublicConsultation),[i,o]=y.useState("slots"),[c,d]=y.useState(null),[u,h]=y.useState(!1),[m,p]=y.useState(""),[b,w]=y.useState({organizationName:"",contactName:"",contactEmail:"",contactPhone:"",notes:""}),x=_=>{d(_),o("form")},g=async _=>{if(_.preventDefault(),!!c){p(""),h(!0);try{await s({organizationName:b.organizationName,contactName:b.contactName,contactEmail:b.contactEmail,contactPhone:b.contactPhone||void 0,notes:b.notes||void 0,date:e,startTime:c}),o("success")}catch(N){p(N.message||"Something went wrong. Please try again.")}finally{h(!1)}}},j=(_,N)=>{w(C=>({...C,[_]:N}))},S=f1(r);return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",children:n.jsxs("div",{className:"w-full max-w-lg rounded-2xl shadow-2xl max-h-[90vh] overflow-y-auto",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex items-center justify-between p-5",style:{borderBottom:"1px solid #1e293b"},children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:i==="success"?"Consultation Booked":i==="form"?"Your Information":"Select a Time"}),n.jsx("p",{className:"text-xs mt-1",style:{color:i==="success"?"#64748b":"#22c55e"},children:i==="success"?"We'll be in touch shortly.":pN(e)})]}),n.jsx("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-[#1e293b] transition-colors",style:{color:"#94a3b8"},children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"p-5",children:[i==="slots"&&n.jsx(n.Fragment,{children:a?.closed?n.jsx("p",{className:"text-sm text-[#475569]",children:"This day is closed for scheduling."}):a?.outOfRange?n.jsx("p",{className:"text-sm text-[#475569]",children:a?.tooSoon?"Consultations require at least 48 hours advance notice. Please select a later date.":"This date is outside the booking window."}):!a?.available||a.available.length===0?(()=>{const _=a?.booked??[];return _.length===0?n.jsx("p",{className:"text-sm text-[#475569]",children:"No available slots on this date. Please select another day."}):n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs text-[#64748b] mb-3",children:"All slots on this date are booked. Please select another day."}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:_.map(N=>{const{startLabel:C,endLabel:A}=Ll(N,e,r);return n.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium opacity-40 line-through",style:{background:"rgba(100,116,139,0.08)",border:"1px solid rgba(100,116,139,0.15)",color:"#475569"},children:[n.jsx(At,{className:"w-3.5 h-3.5"}),C," â ",A]},N)})})]})})():n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs text-[#64748b] mb-3",children:["Times shown in your timezone (",S,"). Select an available slot."]}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:(()=>{const _=new Set(a.available);return[...a.available,...a.booked??[]].sort().map(C=>{const A=_.has(C),{startLabel:P,endLabel:O}=Ll(C,e,r);return A?n.jsxs("button",{type:"button",onClick:()=>x(C),className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium transition-all hover:brightness-110",style:{background:`${bt}14`,border:`1px solid ${bt}30`,color:bt},children:[n.jsx(At,{className:"w-3.5 h-3.5"}),P," â ",O]},C):n.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium opacity-40 line-through cursor-not-allowed",style:{background:"rgba(100,116,139,0.08)",border:"1px solid rgba(100,116,139,0.15)",color:"#475569"},children:[n.jsx(At,{className:"w-3.5 h-3.5"}),P," â ",O]},`booked-${C}`)})})()})]})}),i==="form"&&c&&n.jsxs("form",{onSubmit:g,className:"space-y-4",children:[(()=>{const{startLabel:_,endLabel:N}=Ll(c,e,r);return n.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-semibold",style:{background:`${bt}14`,border:`1px solid ${bt}30`,color:bt},children:[n.jsx(At,{className:"w-4 h-4"}),_," â ",N," ",S,n.jsx("button",{type:"button",onClick:()=>{o("slots"),d(null)},className:"ml-auto text-xs underline opacity-70 hover:opacity-100",children:"Change"})]})})(),n.jsxs("div",{children:[n.jsxs("label",{className:"text-sm font-medium text-[#94a3b8] mb
41-1 block",children:["Agency / Organization Name"," ",n.jsx("span",{style:{color:bt},children:"*"})]}),n.jsx("input",{type:"text",required:!0,value:b.organizationName,onChange:_=>j("organizationName",_.target.value),placeholder:"e.g. Ada County Sheriff's Office",className:"w-full px-3 py-2.5 rounded-lg text-white placeholder-[#475569] focus:outline-none transition-colors",style:{background:"#0a0e17",border:"1px solid #1e293b"}})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:["Your Name ",n.jsx("span",{style:{color:bt},children:"*"})]}),n.jsx("input",{type:"text",required:!0,value:b.contactName,onChange:_=>j("contactName",_.target.value),placeholder:"Full name",className:"w-full px-3 py-2.5 rounded-lg text-white placeholder-[#475569] focus:outline-none transition-colors",style:{background:"#0a0e17",border:"1px solid #1e293b"}})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:["Email ",n.jsx("span",{style:{color:bt},children:"*"})]}),n.jsx("input",{type:"email",required:!0,value:b.contactEmail,onChange:_=>j("contactEmail",_.target.value),placeholder:"[email protected]",className:"w-full px-3 py-2.5 rounded-lg text-white placeholder-[#475569] focus:outline-none transition-colors",style:{background:"#0a0e17",border:"1px solid #1e293b"}})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Phone"}),n.jsx("input",{type:"tel",value:b.contactPhone,onChange:_=>j("contactPhone",_.target.value),placeholder:"(555) 555-5555",className:"w-full px-3 py-2.5 rounded-lg text-white placeholder-[#475569] focus:outline-none transition-colors",style:{background:"#0a0e17",border:"1px solid #1e293b"}})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Notes"}),n.jsx("textarea",{value:b.notes,onChange:_=>j("notes",_.target.value),placeholder:"Anything you'd like us to know...",rows:2,className:"w-full px-3 py-2.5 rounded-lg text-white placeholder-[#475569] focus:outline-none transition-colors resize-none",style:{background:"#0a0e17",border:"1px solid #1e293b"}})]}),m&&n.jsx("p",{className:"text-sm text-red-400 bg-red-400/10 px-3 py-2 rounded-lg",children:m}),n.jsx("button",{type:"submit",disabled:u,className:"w-full py-3 rounded-lg text-sm font-bold transition-all hover:brightness-110 disabled:opacity-50",style:{background:bt,color:"#000"},children:u?"Booking...":"Confirm Consultation"})]}),i==="success"&&n.jsxs("div",{className:"text-center py-6",children:[n.jsx(gn,{className:"w-14 h-14 mx-auto mb-4",style:{color:"#22c55e"}}),n.jsx("h3",{className:"text-lg font-bold text-white mb-2",children:"You're All Set"}),n.jsx("p",{className:"text-sm text-[#94a3b8] mb-1",children:"Your consultation is booked for:"}),n.jsx("p",{className:"text-sm font-semibold text-white mb-1",children:pN(e)}),c&&(()=>{const{startLabel:_,endLabel:N}=Ll(c,e,r);return n.jsxs("p",{className:"text-sm font-semibold",style:{color:bt},children:[_," â ",N," ",S]})})(),n.jsx("p",{className:"text-xs text-[#475569] mt-4",children:"We'll send a confirmation to your email shortly."}),n.jsx("button",{type:"button",onClick:t,className:"mt-6 px-6 py-2.5 rounded-lg text-sm font-semibold transition-colors",style:{background:`${bt}14`,border:`1px solid ${bt}30`,color:bt},children:"Close"})]})]})]})})}function WU(){const[e,t]=y.useState(new Date),[r,a]=y.useState(null),[s,i]=y.useState(RU),o=e.getFullYear(),c=e.getMonth(),d=`${o}-${String(c+1).padStart(2,"0")}`,u=new Date().toLocaleDateString("en-CA",{timeZone:"America/Los_Angeles"}),h=ie(F.calendar.getPublicCalendar,{month:d}),m=y.useCallback(()=>{t(new Date(o,c-1,1))},[o,c]),p=y.useCallback(()=>{t(new Date(o,c+1,1))},[o,c]),b=y.useCallback(()=>{t(new Date)},[]),w=e.toLocaleDateString("en-US",{month:"long",year:"numeric"}),x=DU(o,c),g=$U(o,c),j=Math.ceil((g+x)/7)*7,S=h?.days??{},_=A=>{const[P,O,E]=A.split("-").map(Number),$=new Date(P,O-1,E).getDay();$===0||$>=4||a(A)},N=y.useMemo(()=>{const A=new Date;for(let P=2;P<=14;P++){const O=new Date(A);O.setDate(O.getDate()+P);const E=O.getDay();if(E>=1&&E<=3){const $=O.getFullYear(),M=String(O.getMonth()+1).padStart(2,"0"),R=String(O.getDate()).padStart(2,"0");return`${$}-${M}-${R}`}}return null},[]),C=()=>{N&&a(N)};return n.jsxs("div",{style:{background:"#0d1117",borderTop:"1px solid #1e293b"},className:"px-6 py-12 sm:px-10 md:px-16 lg:px-16",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 mb-6 max-w-[1400px] mx-auto",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0",style:{background:`${bt}14`,border:`1px solid ${bt}33`},children:n.jsx(Cr,{className:"w-5 h-5",style:{color:bt}})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-xl font-extrabold text-white",children:"Schedule a Consultation"}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:"Book a time to speak with our team about partnering with VET-TO-LEO"})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(BU,{value:s,onChange:i}),n.jsx("button",{type:"button",onClick:m,className:"w-8 h-8 rounded-lg flex items-center justify-center transition-colors hover:bg-[#1e293b]",style:{border:"1px solid #1e293b",color:"#94a3b8"},children:n.jsx(Xh,{className:"w-4 h-4"})}),n.jsx("span",{className:"text-base font-bold text-white min-w-[140px] text-center",children:w}),n.jsx("button",{type:"button",onClick:p,className:"w-8 h-8 rounded-lg flex items-center justify-center transition-colors hover:bg-[#1e293b]",style:{border:"1px solid #1e293b",color:"#94a3b8"},children:n.jsx(Ya,{className:"w-4 h-4"})}),n.jsx("button",{type:"button",onClick:b,className:"px-4 py-1.5 rounded-lg text-xs font-medium transition-colors hover:text-white hover:border-[#47
415569]",style:{border:"1px solid #1e293b",color:"#94a3b8"},children:"Today"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_280px] gap-6 max-w-[1400px] mx-auto",children:[n.jsxs("div",{className:"rounded-xl overflow-hidden",style:{border:"1px solid #1e293b"},children:[n.jsx("div",{className:"grid grid-cols-7",style:{borderBottom:"1px solid #1e293b"},children:IU.map(A=>n.jsx("div",{className:"py-3 text-center text-[11px] font-bold uppercase tracking-wider",style:{color:"#64748b",background:"#0a0e17"},children:A},A))}),n.jsx("div",{className:"grid grid-cols-7",children:Array.from({length:j},(A,P)=>{const O=P-g+1,E=O>=1&&O<=x,$=E?`${o}-${String(c+1).padStart(2,"0")}-${String(O).padStart(2,"0")}`:"",M=$===u,R=E?new Date(o,c,O).getDay():-1,B=E&&(R===0||R>=4),D=E?S[$]??0:0,U=E&&!B,H=!B&&D>0,K=Math.min(D,2),z=D-K;return n.jsx("div",{onClick:()=>U&&_($),className:`border-r border-b transition-colors ${U?"cursor-pointer hover:bg-[#0f1729]":""}`,style:{height:100,padding:8,borderColor:"#141a25",background:M?"rgba(0,180,255,0.04)":E?"#0a0e17":"rgba(10,14,23,0.3)",opacity:E?1:.2},children:E&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[M?n.jsx("span",{className:"w-[26px] h-[26px] rounded-full flex items-center justify-center text-xs font-bold",style:{background:"#00b4ff",color:"#000"},children:O}):n.jsx("span",{className:"text-[13px] font-semibold",style:{color:B?"#374151":"#94a3b8"},children:O}),B&&n.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-wider",style:{color:"#475569"},children:"CLOSED"}),!B&&D>0&&n.jsx("span",{className:"text-[10px]",style:{color:"#475569"},children:D})]}),H&&n.jsxs("div",{className:"space-y-[3px]",children:[Array.from({length:K},(X,G)=>n.jsx("div",{className:"text-[10px] font-semibold px-2 py-[3px] rounded truncate",style:{background:`${bt}26`,color:bt},children:"â Agency Consultation"},G)),z>0&&n.jsxs("div",{className:"text-[9px] pl-2",style:{color:"#475569"},children:["+",z," more"]})]})]})},P)}
41)})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx(UU,{onBookToday:C,userTz:s}),n.jsxs("div",{className:"rounded-xl p-5 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(Cr,{className:"w-8 h-8 mx-auto mb-3",style:{color:bt,opacity:.6}}),n.jsx("p",{className:"text-sm text-[#94a3b8] mb-1",children:"Select an available date on the calendar to book your consultation."}),n.jsx("p",{className:"text-[11px] text-[#475569]",children:"Mon â Wed ⢠9:00 AM â 4:30 PM PT"})]})]})]}),r&&n.jsx(zU,{selectedDate:r,onClose:()=>a(null),userTz:s})]})}const Ra="#d4a843",hp="#00b4ff",qU=[{label:"Logo on national directory",participating:!0,member:!0,stateFeatured:!0},{label:"Logo on state directory",participating:!0,member:!0,stateFeatured:!0},{label:"Agency profile page",participating:!1,member:!0,stateFeatured:!0},{label:"Basic analytics",participating:!0,member:!0,stateFeatured:!0},{label:"Active job postings",participating:!1,member:[{text:"Up to 3 manual"},{text:"Unlimited via GovernmentJobs.com",highlight:!0}],stateFeatured:[{text:"Unlimited manual"},{text:"Unlimited via GovernmentJobs.com",highlight:!0}]},{label:"Veteran lead pipeline",participating:!1,member:!0,stateFeatured:!0},{label:"Priority directory listing",participating:!1,member:!0,stateFeatured:!0},{label:"Enhanced agency profile",participating:!1,member:!0,stateFeatured:!0},{label:"Recruiter profiles",participating:!1,member:!0,stateFeatured:!0},{label:"Campaign analytics",participating:!1,member:!0,stateFeatured:!0},{label:"State-level featured placement",participating:!1,member:!1,stateFeatured:!0},{label:"Top of state search results",participating:!1,member:!1,stateFeatured:!0},{label:"Featured recruiter spotlight",participating:!1,member:!1,stateFeatured:!0},{label:"Dedicated state landing page",participating:!1,member:!1,stateFeatured:!0}];function fp({value:e}){return e===!0?n.jsx(xn,{className:"w-4 h-4 text-emerald-400 mx-auto"}):e===!1?n.jsx(DL,{className:"w-3.5 h-3.5 text-gray-600 mx-auto"}):Array.isArray(e)?n.jsx("div",{className:"flex flex-col items-center gap-1.5 py-1",children:e.map((t,r)=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(xn,{className:"w-3 h-3 text-emerald-400 shrink-0"}),n.jsx("span",{className:`text-[11px] leading-tight ${t.highlight?"text-[#94a3b8]":"text-white font-medium"}`,children:t.text})]},r))}):n.jsx("span",{className:"text-xs font-medium text-white",children:e})}function VU(){const e=ie(F.agencies.getMyAgency),t=fP(),r=e?.tier??"participating",a=c=>e?`${c}?client_reference_id=${e._id}&prefilled_email=${encodeURIComponent(e.email)}`:c,s=r==="platinum"?"State-Level Featured":r==="member"?"Agency Member":"Participating Agency",i=r==="platinum"?n.jsx(Mw,{className:"w-7 h-7 text-purple-400"}):r==="member"?n.jsx(Za,{className:"w-7 h-7",style:{color:Ra}}):n.jsx(Be,{className:"w-7 h-7",style:{color:hp}}),o=r==="platinum"?"bg-purple-500/10":r==="member"?"bg-[#d4a843]/15":"bg-[#00b4ff]/10";return n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Subscription"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Manage your VET-TO-LEO agency subscription and billing."})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:"Current Plan"}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-14 h-14 rounded-xl flex items-center justify-center ${o}`,children:i}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xl font-bold text-white",children:s}),(r==="member"||r==="platinum")&&n.jsx(Uc,{className:"w-5 h-5",style:{color:Ra}})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:r==="platinum"?"Premium state-level featured placement with unlimited job postings.":r==="member"?"Full access with job postings, leads, and priority listing.":"Free tier with logo display and basic analytics."})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] overflow-hidden",children:[n.jsxs("div",{className:"p-6 border-b border-[#1e293b]",children:[n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Compare Plans"}),n.jsx("p",{className:"text-sm text-[#94a3b8] mt-1",children:"Find the right plan for your agency's recruiting goals."})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[#1e293b]",children:[n.jsx("th",{className:"text-left px-6 py-5 w-[40%]",children:n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Features"})}),n.jsx("th",{className:"px-4 py-5 text-center",children:n.jsxs("div",{className:`rounded-lg p-3 ${r==="participating"?"bg-[#00b4ff]/5 ring-1 ring-[#00b4ff]/30":""}`,children:[n.jsx(Be,{className:"w-5 h-5 mx-auto mb-1.5",style:{color:hp}}),n.jsx("div",{className:"text-sm font-bold text-white",children:"Participating"}),n.jsx("div",{className:"text-lg font-bold text-white mt-1",children:"Free"}),r==="participating"&&n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mt-1.5",style:{color:hp},children:"Current"})]})}),n.jsx("th",{className:"px-4 py-5 text-center",children:n.jsxs("div",{className:`rounded-lg p-3 ${r==="member"?"ring-1 ring-[#d4a843]/30 bg-[#d4a843]/5":""}`,children:[n.jsx(Nn,{className:"w-5 h-5 mx-auto mb-1.5",style:{color:Ra}}),n.jsxs("div",{className:"text-sm font-bold text-white flex items-center justify-center gap-1",children:["Agency Member",n.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-[#d4a843] text-black text-[10px] font-bold",children:"50% OFF"})]}),n.jsxs("div",{className:"flex items-baseline justify-center gap-1.5 mt-1",children:[n.jsx("span",{className:"text-sm text-gray-500 line-through",children:"$598"}),n.jsx("span",{className:"text-lg font-bold text-white",children:"$299"}),n.jsx("span",{className:"text-xs text-gray-500",children:"/yr"})]}),r==="member"&&n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mt-1.5",style:{color:Ra},children:"Current"})]})}),n.jsx("th",{className:"px-4 py-5 text-center",children:n.jsxs("div",{className:`rounded-lg p-3 ${r==="platinum"?"bg-purple-500/5 ring-1 ring-purple-500/30":""}`,children:[n.jsx(Mw,{className:"w-5 h-5 mx-auto mb-1.5 text-purple-400"}),n.jsx("div",{className:"text-sm font-bold text-white",children:"State Featured"}),n.jsxs("div",{className:"flex items-baseline justify-center gap-1 mt-1",children:[n.jsx("span",{className:"text-lg font-bold text-white",children:"$349"}),n.jsx("span",{className:"text-xs text-gray-500",children:"/mo"})]}),n.jsx("div",{className:"text-[10px] text-gray-500 mt-0.5",children:"Add-on for Members"}),r==="platinum"&&n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mt-1.5 text-purple-400",children:"Current"})]})})]})}),n.jsx("tbody",{children:qU.map((c,d)=>n.jsxs("tr",{className:`border-b border-[#1e293b]/50 ${d%2===0?"bg-[#0d1117]/30":""}`,children:[n.jsx("td",{className:"px-6 py-3 text-sm text-[#cbd5e1]",children:c.label}),n.jsx("td",{className:"px-4 py-3 text-center",children:n.jsx(fp,{value:c.participating})}),n.jsx("td",{className:"px-4 py-3 text-center",children:n.jsx(fp,{value:c.member})}),n.jsx("td",{className:"px-4 py-3 text-center",children:n.jsx(fp,{value:c.stateFeatured})})]},c.label))}),n.jsx("tfoot",{children:n.jsxs("tr",{className:"border-t border-[#1e293b]",children:[n.jsx("td",{className:"px-6 py-5"}),n.jsx("td",{className:"px-4 py-5 text-center",children:r==="participating"?n.jsx("span",{className:"text-xs font-medium text-gray-500",children:"Your plan"}):n.jsx("span",{className:"text-xs text-gray-600",children:"â"})}),n.jsx("td",{className:"px-4 py-5 text-center",children:r==="participating"?n.jsx("button",{className:`btn-gold-pill px-5 py-2 text-sm ${t?"opacity-50 cursor-not-allowed":""}`,disabled:t,onClick:()=>t?W.info("Subscriptions are disabled on the demo account."):window.open(a("https://buy.stripe.com/14A00k0kbeyQ12MecNeME09"),"_blank"),children:t?"Demo Account":"Upgrade to Member"}):r==="member"?n.jsx("span",{className:"text-xs font-medium",style:{color:Ra},children:"Your plan"}):n.jsx("span",{className:"text-xs font-medium",style:{color:Ra},children:"Included"})}),n.jsx("td",{className:"px-4 py-5 text-center",children:r==="participating"?n.jsx("span",{className:"text-xs text-gray-600",children:"Members only"}):r==="member"?n.jsx("button",{className:`px-5 py-2 text-sm font-semibold rounded-full bg-purple-500/20 text-purple-300 border border-purple-500/30 transition-colors ${t?"opacity-50 cursor-not-allowed":"hover:bg-purple-500/30"}`,disabled:t,onClick:()=>t?W.info("Subscriptions are disabled on the demo account."):window.open(a("https://buy.stripe.com/dRmaEYeb1bmEeTC1q1eME00"),"_blank"),children:t?"Demo Account":"Add State Featured"}):n.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Your plan"})})]})})]})})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"Annual Job Posting"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Individual 12-month job listing. For non-members or members who need more than 3 postings."})]}),n.jsxs("div",{className:"text-right shrink-0",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:"$129"}),n.jsx("div",{className:"text-xs text-[#94a3b8]",children:"per listing / year"})]})]}),n.jsx("div",{className:"mt-4",children:n.jsx("button",{className:`px-5 py-2 text-sm font-medium rounded-full border border-[#1e293b] text-[#94a3b8] transition-colors ${t?"opacity-50 cursor-not-allowed":"hover:text-white hover:border-[#00b4ff40]"}`,disabled:t,onClick:()=>t?W.info("Purchases are disabled on the demo account."):window.open(a("https://buy.stripe.com/00w5kEff5bmEbHqc4FeME07"),"_blank"),children:t?"Demo Account":"Purchase Job Posting"})})]}),n.jsx("div",{className:"rounded-xl bg-gradient-to-r from-[#0d1a2e] to-[#162032] border border-[#d4a843]/20 p-5",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#d4a843]/15 flex items-center justify-center",children:n.jsx(Nn,{className:"w-5 h-5",style:{color:Ra}})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-medium text-sm",children:"Early Adopter Discount"}),n.jsxs("p",{className:"text-[#94a3b8] text-sm",children:["Use code ",n.jsx("span",{className:"font-bold",style:{color:Ra},children:"AGENCY50"})," at checkout for 50% off Agency Membership."]})]})]})}),n.jsx(WU,{})]})}const HU={Alabama:[32.806671,-86.79113],Alaska:[61.370716,-152.404419],Arizona:[33.729759,-111.431221],Arkansas:[34.969704,-92.373123],California:[36.116203,-119.681564],Colorado:[39.059811,-105.311104],Connecticut:[41.597782,-72.755371],Delaware:[39.318523,-75.507141],Florida:[27.766279,-81.686783],Georgia:[33.040619,-83.643074],Hawaii:[21.094318,-157.498337],Idaho:[44.240459,-114.478828],Illinois:[40.349457,-88.986137],Indiana:[39.849426,-86.258278],Iowa:[42.011539,-93.210526],Kansas:[38.5266,-96.726486],Kentucky:[37.66814,-84.670067],Louisiana:[31.169546,-91.867805],Maine:[44.693947,-69.381927],Maryland:[39.063946,-76.802101],Massachusetts:[42.230171,-71.530106],Michigan:[43.326618,-84.536095],Minnesota:[45.694454,-93.900192],Mississippi:[32.741646,-89.678696],Missouri:[38.456085,-92.288368],Montana:[46.921925,-110.454353],Nebraska:[41.12537,-98.268082],Nevada:[38.313515,-117.055374],"New Hampshire":[43.452492,-71.563896],"New Jersey":[40.298904,-74.521011],"New Mexico":[34.840515,-106.248482],"New York":[42.165726,-74.948051],"North Carolina":[35.630066,-79.806419],"North Dakota":[47.528912,-99.784012],Ohio:[40.388783,-82.764915],Oklahoma:[35.565342,-96.928917],Oregon:[44.572021,-122.070938],Pennsylvania:[40.590752,-77.209755],"Rhode Island":[41.680893,-71.51178],"South Carolina":[33.856892,-80.945007],"South Dakota":[44.299782,-99.438828],Tennessee:[35.747845,-86.692345],Texas:[31.054487,-97.563461],Utah:[40.150032,-111.862434],Vermont:[44.045876,-72.710686],Virginia:[37.769337,-78.169968],Washington:[47.400902,-121.490494],"West Virginia":[38.491226,-80.954453],Wisconsin:[44.268543,-89.616508],Wyoming:[42.755966,-107.30249],"District of Columbia":[38.897438,-77.026817]},mp={participating:"#00b4ff",member:"#d4a843",platinum:"#8b5cf6"},GU={participating:"Participating Agency",member:"Agency Member",platinum:"State-Level Featured"};function KU(){const e=nP();return n.jsx("button",{onClick:()=>e.setView([39.8283,-98.5795],4),className:"absolute top-2 right-2 z-[1000] px-3 py-1.5 rounded-lg bg-[#111827] border border-[#1e293b] text-white text-xs font-medium hover:bg-[#1e293b] transition-colors",children:"Reset View"})}function YU(){const e=ie(F.admin.getAllAgencies),t=y.useRef(null),[r,a]=y.useState(!1);y.useEffect(()=>{a(!0)},[]);const s=y.useMemo(()=>
41{if(!e)return[];const i=e.filter(d=>d.status==="active"),o=[],c=[];for(const d of i){let u=d.latitude,h=d.longitude;if(!u||!h){const m=HU[d.state];if(!m)continue;u=m[0],h=m[1]}for(const[m,p]of c)if(Math.abs(u-m)<.05&&Math.abs(h-p)<.05){u+=.08*(Math.random()-.5),h+=.08*(Math.random()-.5);break}c.push([u,h]),o.push({lat:u,lng:h,agency:d})}return o},[e]);return r?n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] overflow-hidden",children:[n.jsxs("div",{className:"p-4 border-b border-[#1e293b] flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Agency Map"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Geographic distribution of registered agencies"})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-[#00b4ff]"}),n.jsx("span",{className:"text-[#94a3b8]",children:"Participating"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-[#d4a843]"}),n.jsx("span",{className:"text-[#94a3b8]",children:"Member"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-3 h-3 rounded-full bg-[#8b5cf6]"}),n.jsx("span",{className:"text-[#94a3b8]",children:"State Featured"})]})]})]}),n.jsx("div",{className:"relative h-[400px]",children:n.jsxs(aP,{center:[39.8283,-98.5795],zoom:4,scrollWheelZoom:!0,className:"h-full w-full",ref:t,style:{background:"#0a0e17"},children:[n.jsx(iP,{url:"https://api.mapbox.com/styles/v1/mapbox/dark-v11/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoic291dGhiYXljbGVhcnZ1ZSIsImEiOiJja3pkMmpnOXExamlpMnVsYnJzcDQ1YzEwIn0.0oF1ZIGnCBw9PQV82HXy6A",attribution:"",tileSize:512,zoomOffset:-1}),s.map((i,o)=>n.jsx(rP,{center:[i.lat,i.lng],radius:4,pathOptions:{fillColor:mp[i.agency.tier]||"#00b4ff",fillOpacity:.8,color:mp[i.agency.tier]||"#00b4ff",weight:1,opacity:.3},children:n.jsx(sP,{children:n.jsxs("div",{className:"text-sm min-w-[180px]",children:[n.jsx("strong",{className:"block text-base",children:i.agency.name}),n.jsxs("span",{className:"text-gray-600",children:[i.agency.city?`${i.agency.city}, `:"",i.agency.state]}),n.jsx("br",{}),n.jsx("span",{className:"inline-block mt-1 px-2 py-0.5 rounded-full text-xs font-medium text-white",style:{backgroundColor:mp[i.agency.tier]||"#00b4ff"},children:GU[i.agency.tier]||i.agency.tier})]})})},`${i.agency._id}-${o}`)),n.jsx(KU,{})]})})]}):null}function Mr({icon:e,label:t,value:r,color:a="#00b4ff",href:s}){const i=n.jsx("div",{className:`h-full rounded-xl bg-[#111827] border border-[#1e293b] p-5 transition-all ${s?"hover:border-[#1e293b80] hover:bg-[#111827cc] cursor-pointer":""}`,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 shrink-0 rounded-lg flex items-center justify-center",style:{backgroundColor:`${a}15`},children:n.jsx("span",{style:{color:a},children:n.jsx(e,{className:"w-5 h-5"})})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:r}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:t})]})]})});return s?n.jsx(ye,{to:s,className:"h-full",children:i}):i}const ZU=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],jP={agency:"#00b4ff",academy:"#8b5cf6",college:"#22c55e",business:"#f59e0b",other:"#94a3b8"},wP="#eab308";function xN(e){return e.isAutoBlocked?wP:jP[e.organizationType]??"#94a3b8"}function XU(e,t){return new Date(e,t+1,0).getDate()}function JU(e,t){return new Date(e,t,1).getDay()}function Fd(e){const[t,r]=e.split(":").map(Number),a=t>=12?"PM":"AM";return`${t===0?12:t>12?t-12:t}:${r.toString().padStart(2,"0")} ${a}`}function QU(){const e=new Date,[t,r]=y.useState(e.getFullYear()),[a,s]=y.useState(e.getMonth()),i=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,[o,c]=y.useState(i),d=`${t}-${String(a+1).padStart(2,"0")}`,u=ie(F.calendar.listAppointments,{month:d}),h=y.useMemo(()=>{const N={};for(const C of u??[])(N[C.date]??=[]).push(C);return N},[u]),m=`${e.getFullYear()}
41-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,p=XU(t,a),b=JU(t,a),w=Math.ceil((b+p)/7)*7,x=new Date(t,a).toLocaleDateString("en-US",{month:"long",year:"numeric"}),g=()=>{a===0?(s(11),r(N=>N-1)):s(N=>N-1),c(null)},j=()=>{a===11?(s(0),r(N=>N+1)):s(N=>N+1),c(null)},S=()=>{r(e.getFullYear()),s(e.getMonth()),c(m)},_=o?h[o]??[]:[];return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Cr,{className:"w-5 h-5 text-[#00b4ff]"}),n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Calendar"})]}),n.jsx(ye,{to:"/admin/calendar",className:"text-sm text-[#00b4ff] hover:underline",children:"Manage Calendar"})]}),n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("button",{type:"button",onClick:g,className:"p-1.5 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Xh,{className:"w-5 h-5"})}),n.jsx("h3",{className:"text-base font-semibold text-white min-w-[160px] text-center",children:x}),n.jsx("button",{type:"button",onClick:j,className:"p-1.5 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Ya,{className:"w-5 h-5"})}),n.jsx("button",{type:"button",onClick:S,className:"px-3 py-1 rounded-lg text-xs font-medium border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#475569] transition-colors ml-1",children:"Today"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:[n.jsx("div",{className:"lg:col-span-2",children:n.jsxs("div",{className:"rounded-lg bg-[#0a0e17] border border-[#1e293b] overflow-hidden",children:[n.jsx("div",{className:"grid grid-cols-7 border-b border-[#1e293b]",children:ZU.map(N=>n.jsx("div",{className:"py-2 text-center text-xs font-semibold text-[#94a3b8] uppercase tracking-wider",children:N},N))}),n.jsx("div",{className:"grid grid-cols-7",children:Array.from({length:w},(N,C)=>{const A=C-b+1,P=A>=1&&A<=p,O=P?`${t}-${String(a+1).padStart(2,"0")}-${String(A).padStart(2,"0")}`:"",E=O===m,$=O===o,M=P?h[O]??[]:[],R=P?new Date(t,a,A).getDay():-1,B=P&&(R===0||R>=4);return n.jsx("div",{className:`min-h-[80px] border-b border-r border-[#1e293b]/50 p-1.5 transition-colors ${P?B?"bg-[#0a0e17]/80 cursor-default":"cursor-pointer hover:bg-[#111827]":"bg-[#060a12]/50"} ${$?"bg-[#00b4ff]/5 ring-1 ring-inset ring-[#00b4ff]/30":""}`,onClick:()=>P&&!B&&c(O),children:P&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:`text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full ${E?"bg-[#00b4ff] text-white":B?"text-[#475569]":"text-[#94a3b8]"}`,children:A}),B&&n.jsx("span",{className:"text-[9px] text-[#374151] font-medium uppercase",children:"Closed"}),!B&&M.length>0&&n.jsx("span",{className:"text-[10px] text-[#475569]",children:M.length})]}),!B&&n.jsxs("div",{className:"space-y-0.5",children:[M.slice(0,2).map(D=>{const U=xN(D);return n.jsxs("div",{className:"flex items-center gap-1 px-1 py-0.5 rounded text-[10px] truncate",style:{backgroundColor:`${U}15`,color:U},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:U}}),n.jsx("span",{className:"truncate",children:D.isAutoBlocked?"Blocked Out":D.title})]},D._id)}),M.length>2&&n.jsxs("div",{className:"text-[10px] text-[#475569] pl-1",children:["+",M.length-2," more"]})]})]})},C)})})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"rounded-lg bg-[#0a0e17] border border-[#1e293b] p-4 min-h-[200px] max-h-[500px] overflow-y-auto",children:o?(()=>{const N=o===m,C=_.filter(O=>!O.isAutoBlocked),A=_.filter(O=>O.isAutoBlocked),P=new Date().toLocaleTimeString("en-US",{timeZone:"America/Los_Angeles",hour12:!1,hour:"2-digit",minute:"2-digit"});return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h4",{className:"text-sm font-semibold text-white",children:N?"Today's Schedule":new Date(Number(o.split("-")[0]),Number(o.split("-")[1])-1,Number(o.split("-")[2])).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric"})}),N&&n.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-[#22c55e] font-medium",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#22c55e] animate-pulse"}),"Live"]})]}),C.length===0&&A.length===0?n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No appointments this day."}):n.jsxs("div",{className:"space-y-1.5",children:[C.map(O=>{const E=xN(O),$=N&&O.endTime<=P,M=N&&O.startTime<=P&&O.endTime>P;return n.jsxs(ye,{to:"/admin/calendar",className:`block p-3 rounded-lg border transition-colors ${M?"bg-[#00b4ff]/10 border-[#00b4ff]/40":"bg-[#111827] border-[#1e293b] hover:border-[#47
415569]"} ${$?"opacity-50":""}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[M&&n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#00b4ff] animate-pulse shrink-0"}),n.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:E}}),n.jsx("span",{className:"text-white text-sm font-medium truncate",children:O.title}),M&&n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-[#00b4ff]/20 text-[#00b4ff] font-medium shrink-0",children:"Now"})]}),n.jsx("div",{className:"text-[#94a3b8] text-xs pl-4",children:O.organizationName}),n.jsxs("div",{className:"text-[#94a3b8] text-xs pl-4 mt-0.5",children:[Fd(O.startTime)," â ",Fd(O.endTime)]}),O.status!=="scheduled"&&n.jsx("div",{className:"mt-1 pl-4",children:n.jsx("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full",style:{backgroundColor:`${O.status==="completed"?"#22c55e":O.status==="cancelled"?"#94a3b8":"#ef4444"}20`,color:O.status==="completed"?"#22c55e":O.status==="cancelled"?"#94a3b8":"#ef4444"},children:O.status==="no-show"?"No Show":O.status.charAt(0).toUpperCase()+O.status.slice(1)})})]},O._id)}),A.length>0&&n.jsxs("div",{className:"pt-2 border-t border-[#1e293b]/50",children:[n.jsx("p",{className:"text-[10px] text-[#475569] uppercase tracking-wider font-semibold mb-1.5",children:"Blocked Slots"}),A.map(O=>n.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 text-xs text-[#eab308]/70",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#eab308]"}),Fd(O.startTime)," â ",Fd(O.endTime)]},O._id))]})]})]})})():n.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8 text-center",children:[n.jsx(Cr,{className:"w-8 h-8 text-[#475569] mb-2"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Click a day to see appointments"})]})}),n.jsxs("div",{className:"mt-3 flex flex-wrap gap-3 text-[11px]",children:[Object.entries({agency:"Agency",academy:"Academy",college:"College",business:"Business"}).map(([N,C])=>n.jsxs("div",{className:"flex items-center gap-1.5 text-[#94a3b8]",children:[n.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:jP[N]}}),C]},N)),n.jsxs("div",{className:"flex items-center gap-1.5 text-[#94a3b8]",children:[n.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:wP}}),"Blocked Out"]})]})]})]})]})}function ez(){const e=ie(F.admin.getAdminStats),t=ie(F.admin.getPendingAgencies),r=ie(F.veterans.getPendingVeterans),a=ie(F.veterans.getVeteranStats);return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(Ln,{className:"w-6 h-6 text-[#d4a843]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Admin Dashboard"})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"Manage agencies, veterans, approvals, and memberships."})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:[n.jsx(Mr,{icon:At,label:"Pending Agencies",value:e?.pendingCount??0,color:"#f59e0b",href:"/admin/pending"}),n.jsx(Mr,{icon:en,label:"Total Active Agencies",value:e?.totalActive??0,href:"/admin/all-agencies"}),n.jsx(Mr,{icon:Be,label:"Participating",value:e?.participatingCount??0,color:"#00b4ff",href:"/admin/participating"}),n.jsx(Mr,{icon:Za,label:"Members",value:e?.memberCount??0,color:"#d4a843",href:"/admin/members"}),n.jsx(Mr,{icon:Nn,label:"State Featured",value:e?.platinumCount??0,color:"#8b5cf6",href:"/admin/platinum"}),n.jsx(Mr,{icon:Pn,label:"States",value:e?.stateCount??0,color:"#a855f7"})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsx(Mr,{icon:At,label:"Pending Veterans",value:a?.pendingCount??0,color:"#f59e0b",href:"/admin/veterans/pending"}),n.jsx(Mr,{icon:qr,label:"Active Veterans",value:a?.activeCount??0,color:"#00b4ff",href:"/admin/veterans"}),n.jsx(Mr,{icon:Ze,label:"Total Veterans",value:a?.totalCount??0,color:"#22c55e",href:"/admin/veterans"}),n.jsx(Mr,{icon:Be,label:"Suspended",value:a?.suspendedCount??0,color:"#ef4444"})]}),t&&t.length>0&&n.jsxs("div",{className:"rounded-xl border border-[#f59e0b]/30 bg-[#111827] p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(At,{className:"w-5 h-5 text-[#f59e0b]"}),n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Pending Approvals"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-[#f59e0b]/20 text-[#f59e0b]",children:t.length})]}),n.jsx(ye,{to:"/admin/pending",className:"text-sm text-[#00b4ff] hover:underline",children:"View all"})]}),n.jsx("div",{className:"space-y-2",children:t.slice(0,3).map(s=>n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-[#0a0e17] border border-[#1e293b]",children:[s.logoUrl?n.jsx("img",{src:s.logoUrl,alt:s.name,className:"w-10 h-10 rounded-lg object-contain bg-white/5 p-0.5"}):n.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#f59e0b]/10 flex items-center justify-center",children:n.jsx(Be,{className:"w-5 h-5 text-[#f59e0b]"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"text-white font-medium truncate block",children:s.name}),n.jsxs("span",{className:"text-[#94a3b8] text-xs",children:[s.city?`${s.city}, `:"",s.state]})]}),n.jsx("span",{className:"text-[#94a3b8] text-xs",children:new Date(s._creationTime).toLocaleDateString()})]},s._id))})]}),t&&t.length===0&&n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-8 text-center",children:[n.jsx(gn,{className:"w-10 h-10 text-[#22c55e] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:"All caught up"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No pending agency approvals right now."})]}),r&&r.length>0&&n.jsxs("div",{className:"rounded-xl border border-[#00b4ff]/30 bg-[#111827] p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(qr,{className:"w-5 h-5 text-[#00b4ff]"}),n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Pending Veteran Profiles"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-[#00b4ff]/20 text-[#00b4ff]",children:r.length})]}),n.jsx(ye,{to:"/admin/veterans/pending",className:"text-sm text-[#00b4ff] hover:underline",children:"View all"})]}),n.jsx("div",{className:"space-y-2",children:r.slice(0,3).map(s=>n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-[#0a0e17] border border-[#1e293b]",children:[s.photoUrl?n.jsx("img",{src:s.photoUrl,alt:`${s.firstName} ${s.lastName}`,className:"w-10 h-10 rounded-lg object-cover border border-[#1e293b]"}):n.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#00b4ff]/10 flex items-center justify-center",children:n.jsx(Ze,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("span",{className:"text-white font-medium truncate block",children:[s.firstName," ",s.lastName]}),n.jsxs("span",{className:"text-[#94a3b8] text-xs",children:[s.rank?`${s.rank}
41 · `:"",s.branch]})]}),n.jsx("span",{className:"text-[#94a3b8] text-xs",children:new Date(s._creationTime).toLocaleDateString()})]},s._id))})]}),n.jsx(QU,{}),n.jsx(YU,{}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsx("h2",{className:"text-lg font-semibold text-white mb-3",children:"Recent Activity"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Agency activity and changes will appear here."})]})]})}function tz({agency:e,onApprove:t,onReject:r,onUploadLogo:a}){const s=new Date(e._creationTime);return n.jsxs("div",{className:"rounded-xl border border-[#f59e0b]/30 bg-[#111827] p-5 space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex items-start gap-4",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-16 h-16 rounded-lg object-contain bg-white/5 p-1"}):n.jsx("div",{className:"w-16 h-16 rounded-lg bg-[#f59e0b]/10 flex items-center justify-center",children:n.jsx(Be,{className:"w-8 h-8 text-[#f59e0b]"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:e.name}),n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8] text-sm mt-0.5",children:[n.jsx(wt,{className:"w-3.5 h-3.5"}),n.jsxs("span",{children:[e.city?`${e.city}, `:"",e.state]})]}),e.address&&n.jsx("p",{className:"text-[#94a3b8] text-xs mt-1",children:e.address})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-[#f59e0b]/15 border border-[#f59e0b]/30",children:[n.jsx(At,{className:"w-3.5 h-3.5 text-[#f59e0b]"}),n.jsx("span",{className:"text-[#f59e0b] text-xs font-medium",children:"Pending"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(Ze,{className:"w-4 h-4 text-[#475569]"}),n.jsxs("span",{children:[e.contactTitle?`${e.contactTitle} - `:"",e.contactName||"Not provided"]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(Sn,{className:"w-4 h-4 text-[#475569]"}),n.jsx("span",{children:e.email})]}),e.phone&&n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(zo,{className:"w-4 h-4 text-[#475569]"}),n.jsx("span",{children:e.phone})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(At,{className:"w-4 h-4 text-[#475569]"}),n.jsxs("span",{children:["Submitted ",s.toLocaleDateString()," at ",s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]}),e.interestMilitaryCampaign&&n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#00b4ff]/5 border border-[#00b4ff]/15",children:[n.jsx(Pn,{className:"w-4 h-4 text-[#00b4ff]"}),n.jsx("span",{className:"text-[#00b4ff] text-sm",children:"Interested in military base campaigns"})]}),n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 px-3 py-1.5 rounded-lg bg-[#1e293b] text-[#94a3b8] text-sm hover:text-white hover:bg-[#2a3a50] transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),e.logoUrl?"Change Logo":"Upload Logo",n.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:i=>{const o=i.target.files?.[0];o&&a(e._id,o)}})]})}),n.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-[#1e293b]",children:[n.jsxs(be,{onClick:t,className:"bg-[#22c55e] hover:bg-[#16a34a] text-black font-semibold flex-1",children:[n.jsx(gn,{className:"w-4 h-4 mr-2"}),"Approve"]}),n.jsxs(be,{onClick:r,variant:"outline",className:"border-[#ef4444]/30 text-[#ef4444] hover:bg-[#ef4444]/10 flex-1",children:[n.jsx(Wo,{className:"w-4 h-4 mr-2"}),"Reject"]})]})]})}function nz(){const e=ie(F.admin.getPendingAgencies),t=te(F.admin.approveAgency),r=te(F.admin.rejectAgency),a=te(F.admin.adminUploadLogo),s=te(F.storage.generateUploadUrl),i=async d=>{try{await t({agencyId:d}),W.success("Agency approved and published.")}catch{W.error("Failed to approve agency.")}},o=async d=>{try{await r({agencyId:d}),W.success("Agency rejected.")}catch{W.error("Failed to reject agency.")}},c=async(d,u)=>{try{const h=await s(),m=await fetch(h,{method:"POST",headers:{"Content-Type":u.type},body:u}),{storageId:p}=await m.json();await a({agencyId:d,storageId:p}),W.success("Logo updated.")}catch{W.error("Failed to upload logo.")}};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(At,{className:"w-6 h-6 text-[#f59e0b]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Pending Approvals"}),e&&e.length>0&&n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-[#f59e0b]/20 text-[#f59e0b]",children:e.length})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"Review and approve new agency registrations."})]}),e&&e.length>0?n.jsx("div",{className:"space-y-4",children:e.map(d=>n.jsx(tz,{agency:d,onApprove:()=>i(d._id),onReject:()=>o(d._id),onUploadLogo:c},d._id))}):n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-10 text-center",children:[n.jsx(gn,{className:"w-10 h-10 text-[#22c55e] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:"All caught up"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No pending agency approvals right now."})]})]})}function rz({agency:e,onClose:t,onSave:r,onUploadLogo:a}){const[s,i]=y.useState({name:e.name,contactName:e.contactName||"",contactTitle:e.contactTitle||"",email:e.email,phone:e.phone||"",website:e.website||"",city:e.city||"",state:e.state,address:e.address||""}),[o,c]=y.useState(e.logoUrl||null),[d,u]=y.useState(!1),h=async w=>{const x=w.target.files?.[0];if(!x)return;u(!0);const g=new FileReader;g.onload=()=>
41c(g.result),g.readAsDataURL(x),a(e._id,x),u(!1)},m=w=>{w.preventDefault(),r(e._id,s),t()},p="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]",b="block text-xs font-medium text-[#94a3b8] mb-1";return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-2xl w-full max-w-lg mx-4 shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b] sticky top-0 bg-[#111827] z-10",children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:"Edit Agency"}),n.jsx("button",{onClick:t,className:"p-1.5 rounded-lg text-[#94a3b8] hover:text-white hover:bg-[#1e293b] transition-colors",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:m,className:"p-5 space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Agency Logo"}),n.jsxs("div",{className:"flex items-center gap-4",children:[o?n.jsx("img",{src:o,alt:"Logo",className:"w-16 h-16 rounded-xl object-contain bg-white/10 p-1 border border-[#1e293b]"}):n.jsx("div",{className:"w-16 h-16 rounded-xl bg-[#1e293b] flex items-center justify-center border border-[#1e293b]",children:n.jsx(Be,{className:"w-7 h-7 text-[#475569]"})}),n.jsxs("label",{className:"cursor-pointer flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium bg-[#1e293b] text-[#94a3b8] hover:text-white hover:bg-[#2a3a50] transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),d?"Uploading...":o?"Change Logo":"Upload Logo",n.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:h})]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Agency Name"}),n.jsx("input",{type:"text",value:s.name,onChange:w=>i({...s,name:w.target.value}),className:p,required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Contact Name"}),n.jsx("input",{type:"text",value:s.contactName,onChange:w=>i({...s,contactName:w.target.value}),className:p})]}),n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Contact Title"}),n.jsx("input",{type:"text",value:s.contactTitle,onChange:w=>i({...s,contactTitle:w.target.value}),className:p})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Email"}),n.jsx("input",{type:"email",value:s.email,onChange:w=>i({...s,email:w.target.value}),className:p,required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Phone"}),n.jsx("input",{type:"text",value:s.phone,onChange:w=>i({...s,phone:w.target.value}),className:p})]}),n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Website"}),n.jsx("input",{type:"text",value:s.website,onChange:w=>i({...s,website:w.target.value}),className:p})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:b,children:"Address"}),n.jsx("input",{type:"text",value:s.address,onChange:w=>i({...s,address:w.target.value}),className:p,placeholder:"123 Main St"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:b,children:"City"}),n.jsx("input",{type:"text",value:s.city,onChange:w=>i({...s,city:w.target.value}),className:p})]}),n.jsxs("div",{children:[n.jsx("label",{className:b,children:"State"}),n.jsx("input",{type:"text",value:s.state,onChange:w=>i({...s,state:w.target.value}),className:p,required:!0})]})]}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[n.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 rounded-lg text-sm text-[#94a3b8] bg-[#1e293b] hover:bg-[#2a3a50] transition-colors",children:"Cancel"}),n.jsx("button",{type:"submit",className:"px-4 py-2 rounded-lg text-sm font-medium text-white bg-[#00b4ff] hover:bg-[#0090cc] transition-colors",children:"Save Changes"})]})]})]})})}const az=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","N
41orth Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],sz=["Police Department","Sheriff's Office","State Police","Highway Patrol","Department of Corrections","Federal Agency","Campus Police","Transit Police","Fish & Wildlife","Other"];function iz({onClose:e,onSave:t,onUploadLogo:r}){const[a,s]=y.useState({name:"",state:"",city:"",address:"",email:"",phone:"",website:"",tier:"participating",contactName:"",contactTitle:"",description:"",agencyType:"",departmentSize:"",officerCount:"",retirementPlanType:"",socialFacebook:"",socialInstagram:"",socialLinkedin:"",socialTwitter:"",socialYoutube:"",socialTiktok:""}),[i,o]=y.useState(1),[c,d]=y.useState(null),[u,h]=y.useState(null),m=j=>{const S=j.target.files?.[0];if(!S)return;d(S);const _=new FileReader;_.onload=()=>h(_.result),_.readAsDataURL(S)},p=async j=>{j.preventDefault();const S={name:a.name,state:a.state,email:a.email,tier:a.tier};a.city&&(S.city=a.city),a.address&&(S.address=a.address),a.phone&&(S.phone=a.phone),a.website&&(S.website=a.website),a.contactName&&(S.contactName=a.contactName),a.contactTitle&&(S.contactTitle=a.contactTitle),a.description&&(S.description=a.description),a.agencyType&&(S.agencyType=a.agencyType),a.departmentSize&&(S.departmentSize=a.departmentSize),a.officerCount&&(S.officerCount=Number(a.officerCount)),a.retirementPlanType&&(S.retirementPlanType=a.retirementPlanType),a.socialFacebook&&(S.socialFacebook=a.socialFacebook),a.socialInstagram&&(S.socialInstagram=a.socialInstagram),a.socialLinkedin&&(S.socialLinkedin=a.socialLinkedin),a.socialTwitter&&(S.socialTwitter=a.socialTwitter),a.socialYoutube&&(S.socialYoutube=a.socialYoutube),a.socialTiktok&&(S.socialTiktok=a.socialTiktok);const _=await t(S);c&&_&&r(_,c),e()},b="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]",w="block text-xs font-medium text-[#94a3b8] mb-1",x="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none",g={participating:"#00b4ff",member:"#d4a843",platinum:"#8b5cf6"};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-2xl w-full max-w-2xl mx-4 shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b] sticky top-0 bg-[#111827] z-10",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-9 h-9 rounded-xl bg-[#00b4ff]/15 flex items-center justify-center",children:n.jsx(pt,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:"Add Agency"}),n.jsxs("p",{className:"text-xs text-[#64748b]",children:["Step ",i," of 2 â ",i===1?"Core Details":"Additional Info"]})]})]}),n.jsx("button",{onClick:e,className:"p-1.5 rounded-lg text-[#94a3b8] hover:text-white hover:bg-[#1e293b] transition-colors",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:p,className:"p-5 space-y-4",children:[i===1&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Agency Tier"}),n.jsx("div",{className:"grid grid-cols-3 gap-2",children:["participating","member","platinum"].map(j=>{const S={participating:"Participating Agency",member:"Agency Member",platinum:"State-Level Featured"},N={participating:Be,member:Za,platinum:Nn}[j],C=a.tier===j;return n.jsxs("button",{type:"button",onClick:()=>s({...a,tier:j}),className:`flex items-center gap-2 px-3 py-2.5 rounded-xl border text-sm font-medium transition-all ${C?"border-opacity-60 bg-opacity-15":"border-[#1e293b] bg-[#0a0e17] text-[#64748b] hover:border-[#2a3a50]"}`,style:C?{color:g[j],borderColor:g[j],backgroundColor:`${g[j]}15`}:void 0,children:[n.jsx(N,{className:"w-4 h-4"}),S[j]]},j)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Agency Name *"}),n.jsx("input",{type:"text",value:a.name,onChange:j=>s({...a,name:j.target.value}),className:b,placeholder:"e.g. Boise Police Department",required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:w,children:"State *"}),n.jsxs("select",{value:a.state,onChange:j=>s({...a,state:j.target.value}),className:x,required:!0,children:[n.jsx("option",{value:"",children:"Select state..."}),az.map(j=>n.jsx("option",{value:j,children:j},j))]})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"City"}),n.jsx("input",{type:"text",value:a.city,onChange:j=>s({...a,city:j.target.value}),className:b,placeholder:"e.g. Boise"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Address"}),n.jsx("input",{type:"text",value:a.address,onChange:j=>s({...a,address:j.target.value}),className:b,placeholder:"123 Main St"})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Agency Email *"}),n.jsx("input",{type:"email",value:a.email,onChange:j=>s({...a,email:j.target.value}),className:b,placeholder:"[email protected]",required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Phone"}
41),n.jsx("input",{type:"text",value:a.phone,onChange:j=>s({...a,phone:j.target.value}),className:b,placeholder:"(208) 555-0100"})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Website"}),n.jsx("input",{type:"text",value:a.website,onChange:j=>s({...a,website:j.target.value}),className:b,placeholder:"https://agency.gov"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Contact Name"}),n.jsx("input",{type:"text",value:a.contactName,onChange:j=>s({...a,contactName:j.target.value}),className:b,placeholder:"Sgt. John Smith"})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Contact Title"}),n.jsx("input",{type:"text",value:a.contactTitle,onChange:j=>s({...a,contactTitle:j.target.value}),className:b,placeholder:"Recruiting Coordinator"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Agency Logo"}),n.jsxs("div",{className:"flex items-center gap-4",children:[u?n.jsx("img",{src:u,alt:"Logo preview",className:"w-16 h-16 rounded-xl object-contain bg-white/10 p-1 border border-[#1e293b]"}):n.jsx("div",{className:"w-16 h-16 rounded-xl bg-[#0a0e17] border border-[#1e293b] flex items-center justify-center",children:n.jsx(Et,{className:"w-5 h-5 text-[#475569]"})}),n.jsxs("label",{className:"px-4 py-2 rounded-lg text-sm font-medium text-[#00b4ff] bg-[#00b4ff]/10 border border-[#00b4ff]/30 hover:bg-[#00b4ff]/20 transition-colors cursor-pointer",children:[u?"Change Logo":"Upload Logo",n.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:m})]}),u&&n.jsx("button",{type:"button",onClick:()=>{d(null),h(null)},className:"text-xs text-[#64748b] hover:text-red-400 transition-colors",children:"Remove"})]})]}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[n.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 rounded-lg text-sm text-[#94a3b8] bg-[#1e293b] hover:bg-[#2a3a50] transition-colors",children:"Cancel"}),n.jsx("button",{type:"button",onClick:()=>{if(!a.name||!a.state||!a.email){W.error("Agency name, state, and email are required.");return}o(2)},className:"px-5 py-2 rounded-lg text-sm font-medium text-white bg-[#00b4ff] hover:bg-[#0090cc] transition-colors",children:"Next Step â"})]})]}),i===2&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Agency Type"}
41),n.jsxs("select",{value:a.agencyType,onChange:j=>s({...a,agencyType:j.target.value}),className:x,children:[n.jsx("option",{value:"",children:"Select type..."}),sz.map(j=>n.jsx("option",{value:j,children:j},j))]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Department Size"}),n.jsxs("select",{value:a.departmentSize,onChange:j=>s({...a,departmentSize:j.target.value}),className:x,children:[n.jsx("option",{value:"",children:"Select size..."}),n.jsx("option",{value:"small",children:"Small (Under 49 Officers)"}),n.jsx("option",{value:"medium",children:"Medium (50â350 Officers)"}),n.jsx("option",{value:"large",children:"Large (350+ Officers)"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Officer Count"}),n.jsx("input",{type:"number",value:a.officerCount,onChange:j=>s({...a,officerCount:j.target.value}),className:b,placeholder:"e.g. 150"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Retirement Plan Type"}
41),n.jsx("input",{type:"text",value:a.retirementPlanType,onChange:j=>s({...a,retirementPlanType:j.target.value}),className:b,placeholder:"e.g. PERSI, State Pension"})]}),n.jsxs("div",{children:[n.jsx("label",{className:w,children:"Description"}),n.jsx("textarea",{value:a.description,onChange:j=>s({...a,description:j.target.value}),className:`${b} resize-none`,rows:3,placeholder:"Brief description of the agency..."})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-[#94a3b8] mb-2",children:"Social Media Links"}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx("input",{type:"text",value:a.socialFacebook,onChange:j=>s({...a,socialFacebook:j.target.value}),className:b,placeholder:"Facebook URL"}),n.jsx("input",{type:"text",value:a.socialInstagram,onChange:j=>s({...a,socialInstagram:j.target.value}),className:b,placeholder:"Instagram URL"}),n.jsx("input",{type:"text",value:a.socialTwitter,onChange:j=>s({...a,socialTwitter:j.target.value}),className:b,placeholder:"X / Twitter URL"}),n.jsx("input",{type:"text",value:a.socialLinkedin,onChange:j=>s({...a,socialLinkedin:j.target.value}),className:b,placeholder:"LinkedIn URL"}),n.jsx("input",{type:"text",value:a.socialYoutube,onChange:j=>s({...a,socialYoutube:j.target.value}),className:b,placeholder:"YouTube URL"}),n.jsx("input",{type:"text",value:a.socialTiktok,onChange:j=>s({...a,socialTiktok:j.target.value}),className:b,placeholder:"TikTok URL"})]})]}),n.jsxs("div",{className:"flex justify-between gap-3 pt-2",children:[n.jsx("button",{type:"button",onClick:()=>o(1),className:"px-4 py-2 rounded-lg text-sm text-[#94a3b8] bg-[#1e293b] hover:bg-[#2a3a50] transition-colors",children:"â Back"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 rounded-lg text-sm text-[#94a3b8] bg-[#1e293b] hover:bg-[#2a3a50] transition-colors",children:"Cancel"}),n.jsxs("button",{type:"submit",className:"px-5 py-2 rounded-lg text-sm font-medium text-white bg-[#22c55e] hover:bg-[#16a34a] transition-colors flex items-center gap-2",children:[n.jsx(pt,{className:"w-4 h-4"}),"Create Agency"]})]})]})]})]})]})})}function oz({agency:e,onChangeTier:t,onChangeStatus:r,onDelete:a,onUploadLogo:s,onToggleHonorary:i,onEdit:o,presence:c,now:d}){const u={participating:"#00b4ff",member:"#d4a843",platinum:"#8b5cf6"},h={participating:"Participating Agency",member:"Agency Member",platinum:"State-Level Featured"};return n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-4 hover:border-[#1e293b80] transition-colors",children:n.jsxs("div",{className:"flex items-center gap-4",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-12 h-12 rounded-lg object-contain bg-white/5 p-0.5 flex-shrink-0"}):n.jsx("div",{className:"w-12 h-12 rounded-lg bg-[#1e293b] flex items-center justify-center flex-shrink-0",children:n.jsx(Be,{className:"w-6 h-6 text-[#475569]"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(ye,{to:`/admin/agency/${e._id}`,className:"text-white font-semibold truncate hover:text-[#00b4ff] transition-colors",children:e.name}),(e.tier==="member"||e.tier==="platinum")&&n.jsx(Uc,{className:"w-4 h-4 flex-shrink-0",style:{color:"#d4a843"}}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium border",style:{color:u[e.tier],backgroundColor:`${u[e.tier]}15`,borderColor:`${u[e.tier]}30`},children:h[e.tier]}),e.isHonorary&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Vl,{size:"sm"}),n.jsx("span",{className:"text-xs font-medium text-[#d4a843]",children:"Verified"})]}),e.status==="suspended"&&n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium border border-[#ef4444]/30 bg-[#ef4444]/15 text-[#ef4444]",children:"Suspended"})]}),n.jsxs("div",{className:"flex items-center gap-3 text-[#94a3b8] text-sm mt-0.5",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(wt,{className:"w-3 h-3"}),e.city?`${e.city}, `:"",e.state]}),n.jsx("span",{className:"text-[#475569]",children:"|"}),n.jsx("span",{children:e.email}),e.contactName&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-[#475569]",children:"|"}),n.jsx("span",{children:e.contactName})]})]}),n.jsx("div",{className:"mt-1",children:n.jsx(xi,{status:c,now:d,showLogin:!0})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsxs("select",{value:e.tier,onCh
41ange:m=>t(e._id,m.target.value),className:"bg-[#0a0e17] border border-[#1e293b] text-white text-xs rounded-lg px-2 py-1.5 focus:border-[#00b4ff] focus:outline-none",children:[n.jsx("option",{value:"participating",children:"Participating Agency"}),n.jsx("option",{value:"member",children:"Agency Member"}),n.jsx("option",{value:"platinum",children:"State-Level Featured"})]}),n.jsx(ye,{to:`/admin/agency/${e._id}`,className:"p-1.5 rounded-lg bg-[#1e293b] text-[#94a3b8] hover:text-[#22c55e] hover:bg-[#22c55e]/10 transition-colors",title:"View agency dashboard",children:n.jsx(Wn,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>o(e),className:"p-1.5 rounded-lg bg-[#1e293b] text-[#94a3b8] hover:text-[#00b4ff] hover:bg-[#00b4ff]/10 transition-colors",title:"Edit agency details",children:n.jsx(qt,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>i(e._id,!e.isHonorary),className:`p-1 rounded-lg transition-all ${e.isHonorary?"bg-[#d4a843]/15 ring-1 ring-[#d4a843]/40":"bg-[#1e293b] opacity-35 hover:opacity-100"}`,title:e.isHonorary?"Remove verified badge":"Give verified badge",children:n.jsx(Vl,{size:"sm"})}),n.jsxs("label",{className:"cursor-pointer p-1.5 rounded-lg bg-[#1e293b] text-[#94a3b8] hover:text-white hover:bg-[#2a3a50] transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),n.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:m=>{const p=m.target.files?.[0];p&&s(e._id,p)}})]}),e.status==="active"?n.jsx("button",{onClick:()=>r(e._id,"suspended"),className:"p-1.5 rounded-lg text-[#94a3b8] hover:text-[#f59e0b] hover:bg-[#f59e0b]/10 transition-colors",title:"Suspend agency",children:n.jsx(Qh,{className:"w-4 h-4"})}):n.jsx("button",{onClick:()=>r(e._id,"active"),className:"p-1.5 rounded-lg text-[#94a3b8] hover:text-[#22c55e] hover:bg-[#22c55e]/10 transition-colors",title:"Reactivate agency",children:n.jsx(gn,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>a(e._id,e.name),className:"p-1.5 rounded-lg text-[#94a3b8] hover:text-[#ef4444] hover:bg-[#ef4444]/10 transition-colors",title:"Delete agency",children:n.jsx(_n,{className:"w-4 h-4"})})]})]})})}function Bd({filter:e="all"}){const t=ie(F.admin.getAllAgencies),r=ie(F.presence.agencyStatuses),a=pi(),s=new Map((r??[]).map(z=>[z.agencyId,z])),i=te(F.admin.setAgencyTier),o=te(F.admin.setAgencyStatus),c=te(F.admin.deleteAgency),d=te(F.admin.setHonorary),u=te(F.admin.adminUploadLogo),h=te(F.admin.updateAgency),m=te(F.storage.generateUploadUrl),p=te(F.admin.createAgency),[b,w]=y.useState(""),[x,g]=y.useState(null),[j,S]=y.useState(!1),_=async(z,X)=>{try{await i({agencyId:z,tier:X});const G={participating:"Participating Agency",member:"Agency Member",platinum:"State-Level Featured"};W.success(`Tier updated to ${G[X]}.`)}catch{W.error("Failed to update tier.")}},N=async(z,X)=>{try{await o({agencyId:z,status:X}),W.success(`Agency ${X==="active"?"reactivated":"suspended"}.`)}catch{W.error("Failed to update status.")}},C=async(z,X)=>{if(window.confirm(`Are you sure you want to permanently delete "${X}"? This cannot be undone.`))try{await c({agencyId:z}),W.success(`"${X}" has been deleted.`)}catch{W.error("Failed to delete agency.")}},A=async(z,X)=>{try{await d({agencyId:z,isHonorary:X}),W.success(X?"Honorary status added.":"Honorary status removed.")}catch{W.error("Failed to update honorary status.")}},P=async(z,X)=>{try{const G=await m(),Q=await fetch(G,{method:"POST",headers:{"Content-Type":X.type},body:X}),{storageId:re}=await Q.json();await u({agencyId:z,storageId:re}),W.success("Logo updated.")}catch{W.error("Failed to upload logo.")}},O=async z=>{try{const X=await p(z);return W.success(`"${z.name}" has been created.`),X}catch{W.error("Failed to create agency.")}},E=async(z,X)=>{try{await h({agencyId:z,name:X.name,contactName:X.contactName,contactTitle:X.contactTitle,email:X.email,phone:X.phone,website:X.website,city:X.city,state:X.state,address:X.address}),W.success("Agency updated.")}catch{W.error("Failed to update agency.")}},$={all:{title:"All Agencies",icon:en,color:"#00b4ff",desc:"View and manage all registered agencies."}
41,members:{title:"Agency Members",icon:Za,color:"#d4a843",desc:"Subscribed agency members with full dashboard access."},participating:{title:"Participating Agencies",icon:Be,color:"#00b4ff",desc:"Free-tier agencies with logo display."},platinum:{title:"State-Level Featured",icon:Nn,color:"#8b5cf6",desc:"Premium state-level featured agencies."}},{title:M,icon:R,color:B,desc:D}=$[e];let U=t?.filter(z=>z.status!=="pending")??[];if(e==="members"&&(U=U.filter(z=>z.tier==="member")),e==="participating"&&(U=U.filter(z=>z.tier==="participating")),e==="platinum"&&(U=U.filter(z=>z.tier==="platinum")),b){const z=b.toLowerCase();U=U.filter(X=>X.name.toLowerCase().includes(z)||X.state.toLowerCase().includes(z)||X.email.toLowerCase().includes(z)||X.city?.toLowerCase().includes(z)||X.contactName?.toLowerCase().includes(z))}U.sort((z,X)=>X._creationTime-z._creationTime);const K={all:en,members:Za,participating:Be,platinum:Nn}[e];return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{style:{color:B},children:n.jsx(R,{className:"w-6 h-6"})}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:M}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-[#1e293b] text-[#94a3b8]",children:U.length})]}),n.jsx("p",{className:"text-[#94a3b8]",children:D})]}),n.jsxs("button",{onClick:()=>S(!0),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium text-white bg-[#00b4ff] hover:bg-[#0090cc] transition-colors shadow-lg shadow-[#00b4ff]/20 flex-shrink-0",children:[n.jsx(pt,{className:"w-4 h-4"}),"Add Agency"]})]}),n.jsxs("div",{className:"relative",children:[n.jsx(Dt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#475569]"}),n.jsx("input",{type:"text",value:b,onChange:z=>w(z.target.value),placeholder:"Search by name, state, email, or contact...",className:"w-full pl-10 pr-4 py-2.5 rounded-xl bg-[#111827] border border-[#1e293b] text-white placeholder-[#475569] text-sm focus:border-[#00b4ff] focus:outline-none"})]}),U.length>0?n.jsx("div",{className:"space-y-3",children:U.map(z=>n.jsx(oz,{agency:z,onChangeTier:_,onChangeStatus:N,onDelete:C,onUploadLogo:P,onToggleHonorary:A,onEdit:g,presence:r===void 0?void 0:s.get(z._id)??null,now:a},z._id))}):n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-10 text-center",children:[n.jsx(K,{className:"w-10 h-10 text-[#475569] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:b?"No results found":`No ${e==="all"?"agencies":M.toLowerCase()} yet`}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:b?"Try adjusting your search terms.":"Agencies will appear here once registered."})]}),x&&n.jsx(rz,{agency:x,onClose:()=>g(null),onSave:E,onUploadLogo:P}),j&&n.jsx(iz,{onClose:()=>S(!1),onSave:O,onUploadLogo:P})]})}const lz=Zi,cz=_0;function dz(){const e=ie(F.presence.adminTeamStatus),t=pi(),r=new Map((e??[]).map(a=>[a.email,a]));return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(qo,{className:"w-6 h-6 text-[#94a3b8]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Admin Settings"})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"System configuration and preferences."})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-6 space-y-4",children:[n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Super Admin Emails"}),n.jsx("div",{className:"space-y-2",children:lz.map(a=>n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 px-4 py-2.5 rounded-lg bg-[#0a0e17] border border-[#1e293b]",children:[a.photo?n.jsx("img",{src:a.photo,alt:a.name,className:"w-8 h-8 rounded-full object-cover shrink-0"}):n.jsx("div",{className:"w-8 h-8 rounded-full shrink-0 bg-[#1e293b] border border-[#334155] flex items-center justify-center text-[#94a3b8] text-xs font-semibold",children:cz(a.name)}),n.jsxs("div",{className:"flex flex-col flex-1 min-w-[10rem]",children:[n.jsx("span",{className:"text-white text-sm font-medium",children:a.name}),n.jsx("span",{className:"text-[#94a3b8] text-xs break-words",children:a.email})]}
41),n.jsx("div",{className:"w-full pl-11 sm:w-auto sm:pl-0 sm:text-right",children:n.jsx(xi,{status:e===void 0?void 0:r.get(a.email)??null,now:t,showLogin:!0})})]},a.email))}),n.jsx("p",{className:"text-[#475569] text-xs",children:"Contact your developer to modify admin access."})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-6 space-y-4",children:[n.jsx("h2",{className:"text-lg font-semibold text-white",children:"Notification Emails"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"New agency registrations will send email notifications to the super admin emails listed above."})]})]})}const pp="#00b4ff",ws="#d4a843",Au="#2563eb",Qi={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},NP=Object.keys(Qi).sort((e,t)=>Qi[e].localeCompare(Qi[t])),uz={name:"",email:"",phone:"",street:"",city:"",state:"",zip:"",officeCode:"",cageCode:"",uei:"",website:"",contactForm:"",notes:""};function _P(e){const t=[e.city,[e.state,e.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ");return[e.street,t].filter(Boolean).join(", ")}function hz(e){return e.replace(/^https?:\/\//i,"").replace(/^www\./i,"").replace(/\/$/,"")}function fz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function mz({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Au}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${ws}15`,border:`1px solid ${ws}30`},children:n.jsx(Rt,{className:"w-5 h-5",style:{color:ws}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${pp}15`,color:pp,border:`1px solid ${pp}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${ws}15`,color:ws,border:`1px solid ${ws}30`},children:"Prospect"})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:_P(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsxs("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:[e.officeCode&&n.jsxs("span",{children:["Office"," ",n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.officeCode})]}),e.cageCode&&n.jsxs("span",{children:["CAGE"," ",n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.cageCode})]}),e.uei&&n.jsxs("span",{children:["UEI ",n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.uei})]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] mt-1.5 pt-1.5 min-w-0",style:{borderTop:"1px dashed #1e293b"},children:[n.jsx(Pn,{className:"w-3.5 h-3.5 shrink-0",style:{color:"#64748b"}}),e.website?n.jsx("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),className:"truncate hover:underline",style:{color:"#38bdf8"},title:e.website,children:hz(e.website)}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add website"})]})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,title:e.emailSource?`Found on ${e.emailSource}`:void 0,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function ur({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
415569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function pz({initial:e,onClose:t,onDeleted:r}){const a=te(F.businessProspects.create),s=te(F.businessProspects.update),i=te(F.businessProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",officeCode:e.officeCode??"",cageCode:e.cageCode??"",uei:e.uei??"",website:e.website??"",contactForm:e.contactForm??"",notes:e.notes??""}:uz),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("Business name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{e?(await s({id:e._id,...h}),W.success("Business updated")):(await a(h),W.success("Business added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 42`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("Business deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit Business":"Add Business"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["Defense Contractors",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(ur,{className:"sm:col-span-6",label:"Business Name",value:h.name,onChange:p("name"),placeholder:"Company name"}),n.jsx(ur,{className:"sm:col-span-3",label:"Email Address",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(ur,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(ur,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.company.com/contact"}),n.jsx(ur,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.company.com"}),n.jsx(ur,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"123 Main St, Suite 100"}),n.jsx(ur,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),NP.map(x=>n.jsxs("option",{value:x,children:[Qi[x]," (",x,")"]},x))]})]}),n.jsx(ur,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsx(ur,{className:"sm:col-span-2",label:"DCAA Office Code",value:h.officeCode,onChange:p("officeCode")}),n.jsx(ur,{className:"sm:col-span-2",label:"CAGE Code",value:h.cageCode,onChange:p("cageCode")}),n.jsx(ur,{className:"sm:col-span-2",label:"Unique Entity ID (UEI)",value:h.uei,onChange:p("uei")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
425569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:_P(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this business?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Au,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add Business"})]})]})})}function xz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),s=fz(r.trim(),300),[i,o]=y.useState(null),[c,d]=y.useState(null),u=ie(F.businessProspects.stateCounts),{results:h,status:m,loadMore:p}=Xr(F.businessProspects.list,{state:e||void 0,search:s||void 0},{initialNumItems:50});y.useEffect(()=>{if(!i)return;const g=h.find(j=>j._id===i._id);g&&g!==i&&o(g)},[h,i]);const b=y.useMemo(()=>{if(u)return e?u.states.find(g=>g.state===e)?.count??0:u.total},[u,e]),w=e?Qi[e]??e:"All States",x=s?`${h.length}${m==="CanLoadMore"?"+":""} matches`:b!==void 0?`${b.toLocaleString()} ${b===1?"business":"businesses"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>d({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Au,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Au}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add Business"]}),n.jsxs("button",{onClick:()=>i&&d({mode:"edit",p:i}),disabled:!i,title:i?`Edit ${i.name}`:"Check a business in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit Business"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:g=>{t(g.target.value),o(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:ws},children:[n.jsxs("option",{value:"",style:{background:"#111827"},children:["All States",u?` (${u.total.toLocaleString()})`:""]}),NP.map(g=>{const j=u?.states.find(S=>S.state===g)?.count??0;return n.jsxs("option",{value:g,style:{background:"#111827"},children:[Qi[g]," (",g,")",u?` · ${j}`:""]},g)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:r,onChange:g=>a(g.target.value),placeholder:"Search name, city, CAGE, UEI, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),r&&n.jsx("button",{onClick:()=>a(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[w,x?` · ${x}`:""]}),n.jsx("div",{className:"flex-1 h-px min-w-6",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] sm:whitespace-nowrap",style:{color:"#475569"}
42,children:[u?`${u.total.toLocaleString()} total prospects · ${u.withWebsite.toLocaleString()} with website · ${u.withEmail.toLocaleString()} with email`:"",i?" · 1 selected":""]})]}),m==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):h.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(Rt,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:"No businesses match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:h.map(g=>n.jsx(mz,{p:g,selected:i?._id===g._id,onToggle:()=>o(j=>j?._id===g._id?null:g),onEdit:()=>{o(g),d({mode:"edit",p:g})}},g._id))}),n.jsx("div",{className:"text-center",children:m==="CanLoadMore"?n.jsxs("button",{onClick:()=>p(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",h.length.toLocaleString(),!s&&b!==void 0?` of ${b.toLocaleString()}
42`:""," ","· Load more"]}):m==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",h.length.toLocaleString()]})})]}),c&&n.jsx(pz,{initial:c.mode==="edit"?c.p:null,onClose:()=>d(null),onDeleted:()=>o(null)},c.mode==="edit"?c.p._id:"add")]})}const xp="#00b4ff",Ns="#d4a843",ku="#2563eb",eo={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},gN=["Public University","Private University","Community College","Private 2-Year College","For-Profit College","Technical College","Tribal College","Other"],SP=Object.keys(eo).sort((e,t)=>eo[e].localeCompare(eo[t])),gz={name:"",institutionType:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",contactForm:"",notes:""};function CP(e){const t=[e.city,[e.state,e.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ");return[e.street,t].filter(Boolean).join(", ")}function bz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function vz({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${ku}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${Ns}15`,border:`1px solid ${Ns}30`},children:n.jsx(pn,{className:"w-5 h-5",style:{color:Ns}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${xp}15`,color:xp,border:`1px solid ${xp}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${Ns}15`,color:Ns,border:`1px solid ${Ns}30`},children:e.institutionType||"Prospect"})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:CP(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),e.contactName||e.contactTitle?n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]}):n.jsx("span",{style:{color:"#475569"},children:"No president listed"})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Veteran Admissions: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function hr({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
425569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function yz({initial:e,onClose:t,onDeleted:r}){const a=te(F.collegeProspects.create),s=te(F.collegeProspects.update),i=te(F.collegeProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,institutionType:e.institutionType??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),contactForm:e.contactForm??"",notes:e.notes??""}:gz),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("College or university name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("College updated")):(await a(x),W.success("College added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 43`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("College deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit College":"Add College"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["Colleges & Universities",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(hr,{className:"sm:col-span-4",label:"College / University Name",value:h.name,onChange:p("name"),placeholder:"Boise State University"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Type"}),n.jsxs("select",{value:h.institutionType,onChange:x=>p("institutionType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select type"}),h.institutionType&&!gN.includes(h.institutionType)&&n.jsx("option",{value:h.institutionType,children:h.institutionType}),gN.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(hr,{className:"sm:col-span-3",label:"President / Administrator",value:h.contactName,onChange:p("contactName"),placeholder:"Dr. Jane Smith"}),n.jsx(hr,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"President"}),n.jsx(hr,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(hr,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(hr,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.college.edu/contact"}),n.jsx(hr,{className:"sm:col-span-6",label:"Veteran Admissions Emails (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(hr,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.college.edu"}),n.jsx(hr,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"1910 University Dr"}),n.jsx(hr,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),SP.map(x=>n.jsxs("option",{value:x,children:[eo[x]," (",x,")"]},x))]})]}),n.jsx(hr,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
435569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:CP(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this college?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:ku,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add College"})]})]})})}function jz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),s=bz(r.trim(),300),[i,o]=y.useState(null),[c,d]=y.useState(null),u=ie(F.collegeProspects.stateCounts),{results:h,status:m,loadMore:p}=Xr(F.collegeProspects.list,{state:e||void 0,search:s||void 0},{initialNumItems:50});y.useEffect(()=>{if(!i)return;const g=h.find(j=>j._id===i._id);g&&g!==i&&o(g)},[h,i]);const b=y.useMemo(()=>{if(u)return e?u.states.find(g=>g.state===e)?.count??0:u.total},[u,e]),w=e?eo[e]??e:"All States",x=s?`${h.length}${m==="CanLoadMore"?"+":""} matches`:b!==void 0?`${b.toLocaleString()} ${b===1?"college":"colleges"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>d({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:ku,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${ku}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add College"]}),n.jsxs("button",{onClick:()=>i&&d({mode:"edit",p:i}),disabled:!i,title:i?`Edit ${i.name}`:"Check a college in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit College"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:g=>{t(g.target.value),o(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:Ns},children:[n.jsxs("option",{value:"",style:{background:"#111827"},children:["All States",u?` (${u.total.toLocaleString()})`:""]}),SP.map(g=>{const j=u?.states.find(S=>S.state===g)?.count??0;return n.jsxs("option",{value:g,style:{background:"#111827"},children:[eo[g]," (",g,")",u?` · ${j}`:""]},g)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:r,onChange:g=>a(g.target.value),placeholder:"Search name, city, type, contact, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),r&&n.jsx("button",{onClick:()=>a(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[w,x?` · ${x}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"}
43,children:[u?`${u.total.toLocaleString()} total ${u.total===1?"college":"colleges"} · ${u.withEmail.toLocaleString()} with email`:"",i?" · 1 selected":""]})]}),m==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):h.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(pn,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:u&&u.total===0&&!s&&!e?"No colleges yet. Click Add College to start the list.":"No colleges match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:h.map(g=>n.jsx(vz,{p:g,selected:i?._id===g._id,onToggle:()=>o(j=>j?._id===g._id?null:g),onEdit:()=>{o(g),d({mode:"edit",p:g})}},g._id))}),n.jsx("div",{className:"text-center",children:m==="CanLoadMore"?n.jsxs("button",{onClick:()=>p(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",h.length.toLocaleString(),!s&&b!==void 0?` of ${b.toLocaleString()}`:""," · Load more"]}):m==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",h.length.toLocaleString()]})})]}),c&&n.jsx(yz,{initial:c.mode==="edit"?c.p:null,onClose:()=>d(null),onDeleted:()=>o(null)},c.mode==="edit"?c.p._id:"add")]})}const Es="#00b4ff",_s="#d4a843",Pu="#2563eb",to={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico",GU:"Guam",VI:"U.S. Virgin Islands",MP:"Northern Mariana Islands"},Tu=["State Workforce Agency","American Job Center","Regional / Local Office","Veterans Employment Program","Other"],AP=Object.keys(to).sort((e,t)=>to[e].localeCompare(to[t])),wz={name:"",orgType:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",contactForm:"",notes:""};function kP(e){const t=[e.city,[e.state,e.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ");return[e.street,t].filter(Boolean).join(", ")}function Nz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function _z({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Pu}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${_s}15`,border:`1px solid ${_s}30`},children:n.jsx(ht,{className:"w-5 h-5",style:{color:_s}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${Es}15`,color:Es,border:`1px solid ${Es}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${_s}15`,color:_s,border:`1px solid ${_s}30`},children:e.orgType||"Prospect"})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:kP(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),e.contactName||e.contactTitle?n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]}):n.jsx("span",{style:{color:"#475569"},children:"No contact listed"})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Veteran Reps: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function fr({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
435569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function Sz({initial:e,onClose:t,onDeleted:r}){const a=te(F.workforceProspects.create),s=te(F.workforceProspects.update),i=te(F.workforceProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,orgType:e.orgType??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),contactForm:e.contactForm??"",notes:e.notes??""}:wz),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("State workforce agency name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("Agency updated")):(await a(x),W.success("Agency added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 44`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("Agency deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit Agency":"Add Agency"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["State Workforce Agencies",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(fr,{className:"sm:col-span-4",label:"Agency Name",value:h.name,onChange:p("name"),placeholder:"Idaho Department of Labor"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Type"}),n.jsxs("select",{value:h.orgType,onChange:x=>p("orgType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select type"}),h.orgType&&!Tu.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),Tu.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(fr,{className:"sm:col-span-3",label:"Director / Contact",value:h.contactName,onChange:p("contactName"),placeholder:"Jane Smith"}),n.jsx(fr,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"Veterans Program Coordinator"}),n.jsx(fr,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(fr,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(fr,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.labor.state.gov/contact"}),n.jsx(fr,{className:"sm:col-span-6",label:"Veteran Rep Emails, DVOP / LVER (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(fr,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.labor.idaho.gov"}),n.jsx(fr,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"317 W Main St"}),n.jsx(fr,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),AP.map(x=>n.jsxs("option",{value:x,children:[to[x]," (",x,")"]},x))]})]}),n.jsx(fr,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
445569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:kP(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this agency?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Pu,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add Agency"})]})]})})}function Cz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),o=Nz(s.trim(),300),[c,d]=y.useState(null),[u,h]=y.useState(null),m=ie(F.workforceProspects.stateCounts),{results:p,status:b,loadMore:w}=Xr(F.workforceProspects.list,{state:e||void 0,orgType:r||void 0,search:o||void 0},{initialNumItems:50});y.useEffect(()=>{if(!c)return;const N=p.find(C=>C._id===c._id);N&&N!==c&&d(N)},[p,c]);const x=y.useMemo(()=>{const N={};for(const C of m?.types??[])e&&C.state!==e||(N[C.orgType]=(N[C.orgType]??0)+C.count);return N},[m,e]),g=y.useMemo(()=>{const N=Object.keys(x).filter(A=>A!=="__none"&&!Tu.includes(A)).sort(),C=[...Tu,...N].map(A=>({key:A,label:A,count:x[A]??0}));return x.__none&&C.push({key:"__none",label:"Uncategorized",count:x.__none}),C},[x]),j=y.useMemo(()=>{if(m)return r?x[r]??0:e?m.states.find(N=>N.state===e)?.count??0:m.total},[m,e,r,x]),S=(e?to[e]??e:"All States")+(r?` · ${r==="__none"?"Uncategorized":r}`:""),_=o?`${p.length}${b==="CanLoadMore"?"+":""} matches`:j!==void 0?`${j.toLocaleString()} ${j===1?"agency":"agencies"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>h({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Pu,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Pu}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add Agency"]}),n.jsxs("button",{onClick:()=>c&&h({mode:"edit",p:c}),disabled:!c,title:c?`Edit ${c.name}`:"Check a agency in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit Agency"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:N=>{t(N.target.value),d(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:_s},children:[n.jsxs("option",{value:"",style:{background:"#111827"}
44,children:["All States",m?` (${m.total.toLocaleString()})`:""]}),AP.map(N=>{const C=m?.states.find(A=>A.state===N)?.count??0;return n.jsxs("option",{value:N,style:{background:"#111827"},children:[to[N]," (",N,")",m?` · ${C}`:""]},N)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:s,onChange:N=>i(N.target.value),placeholder:"Search name, city, type, contact, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Type:"}),[{key:"",label:"All",count:Object.values(x).reduce((N,C)=>N+C,0)},...g].map(({key:N,label:C,count:A})=>{const P=r===N;return n.jsxs("button",{onClick:()=>{a(N),d(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:P?`${Es}18`:"#111827",border:`1px solid ${P?`${Es}50`:"#1e293b"}`,color:P?Es:"#94a3b8"},children:[C,m?n.jsxs("span",{style:{color:P?Es:"#475569"},children:[" · ",A.toLocaleString()]}):null]},N||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[S,_?` · ${_}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"},children:[m?`${m.total.toLocaleString()} total ${m.total===1?"agency":"agencies"} · ${m.withEmail.toLocaleString()} with email`:"",c?" · 1 selected":""]})]}),b==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):p.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(ht,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:m&&m.total===0&&!o&&!e?"No agencies yet. Click Add Agency to start the list.":"No agencies match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:p.map(N=>n.jsx(_z,{p:N,selected:c?._id===N._id,onToggle:()=>d(C=>C?._id===N._id?null:N),onEdit:()=>{d(N),h({mode:"edit",p:N})}},N._id))}),n.jsx("div",{className:"text-center",children:b==="CanLoadMore"?n.jsxs("button",{onClick:()=>w(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",p.length.toLocaleString(),!o&&j!==void 0?` of ${j.toLocaleString()}`:""," · Load more"]}):b==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",p.length.toLocaleString()]})})]}),u&&n.jsx(Sz,{initial:u.mode==="edit"?u.p:null,onClose:()=>h(null),onDeleted:()=>d(null)},u.mode==="edit"?u.p._id:"add")]})}const Ms="#00b4ff",Ss="#d4a843",Ou="#2563eb",no={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico",GU:"Guam",VI:"U.S. Virgin Islands",OS:"Overseas"},Eu=["Army","Navy","Air Force","Marine Corps","Space Force","Coast Guard","National Guard","Reserve","Joint / DoD","Other"],PP=Object.keys(no).filter(e=>e!=="OS").sort((e,t)=>
44no[e].localeCompare(no[t])).concat("OS"),Az={name:"",orgType:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",contactForm:"",notes:""};function TP(e){if(!e.city&&!e.zip)return e.street??"";const t=[e.state==="OS"?void 0:e.state,e.zip].filter(Boolean).join(" "),r=[e.city,t].filter(Boolean).join(", ");return[e.street,r].filter(Boolean).join(", ")}function kz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function Pz({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Ou}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${Ss}15`,border:`1px solid ${Ss}30`},children:n.jsx(as,{className:"w-5 h-5",style:{color:Ss}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${Ms}15`,color:Ms,border:`1px solid ${Ms}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${Ss}15`,color:Ss,border:`1px solid ${Ss}30`},children:e.orgType||"Prospect"})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:TP(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),e.contactName||e.contactTitle?n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]}):n.jsx("span",{style:{color:"#475569"},children:"No TAP manager listed"})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Staff: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function mr({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
445569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function Tz({initial:e,onClose:t,onDeleted:r}){const a=te(F.tapProspects.create),s=te(F.tapProspects.update),i=te(F.tapProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,orgType:e.orgType??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),contactForm:e.contactForm??"",notes:e.notes??""}:Az),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("TAP office name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("TAP Office updated")):(await a(x),W.success("TAP Office added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 45`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("TAP Office deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit TAP Office":"Add TAP Office"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["Transition Assistance Programs (TAP)",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(mr,{className:"sm:col-span-4",label:"TAP Office Name",value:h.name,onChange:p("name"),placeholder:"Mountain Home AFB Transition Assistance Program"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Branch"}),n.jsxs("select",{value:h.orgType,onChange:x=>p("orgType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select branch"}),h.orgType&&!Eu.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),Eu.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(mr,{className:"sm:col-span-3",label:"TAP Manager / Contact",value:h.contactName,onChange:p("contactName"),placeholder:"John Smith"}),n.jsx(mr,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"TAP Manager"}),n.jsx(mr,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(mr,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(mr,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.installation.mil/tap/contact"}),n.jsx(mr,{className:"sm:col-span-6",label:"Additional Staff Emails, counselors (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(mr,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.installation.mil/tap"}),n.jsx(mr,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"366 Gunfighter Ave"}),n.jsx(mr,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),PP.map(x=>n.jsxs("option",{value:x,children:[no[x]," (",x,")"]},x))]})]}),n.jsx(mr,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
455569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:TP(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this TAP office?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Ou,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add TAP Office"})]})]})})}function Oz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),o=kz(s.trim(),300),[c,d]=y.useState(null),[u,h]=y.useState(null),m=ie(F.tapProspects.stateCounts),{results:p,status:b,loadMore:w}=Xr(F.tapProspects.list,{state:e||void 0,orgType:r||void 0,search:o||void 0},{initialNumItems:50});y.useEffect(()=>{if(!c)return;const N=p.find(C=>C._id===c._id);N&&N!==c&&d(N)},[p,c]);const x=y.useMemo(()=>{const N={};for(const C of m?.types??[])e&&C.state!==e||(N[C.orgType]=(N[C.orgType]??0)+C.count);return N},[m,e]),g=y.useMemo(()=>{const N=Object.keys(x).filter(A=>A!=="__none"&&!Eu.includes(A)).sort(),C=[...Eu,...N].map(A=>({key:A,label:A,count:x[A]??0}));return x.__none&&C.push({key:"__none",label:"Uncategorized",count:x.__none}),C},[x]),j=y.useMemo(()=>{if(m)return r?x[r]??0:e?m.states.find(N=>N.state===e)?.count??0:m.total},[m,e,r,x]),S=(e?no[e]??e:"All States")+(r?` · ${r==="__none"?"Uncategorized":r}`:""),_=o?`${p.length}${b==="CanLoadMore"?"+":""} matches`:j!==void 0?`${j.toLocaleString()} ${j===1?"TAP office":"TAP offices"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>h({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Ou,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Ou}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add TAP Office"]}),n.jsxs("button",{onClick:()=>c&&h({mode:"edit",p:c}),disabled:!c,title:c?`Edit ${c.name}`:"Check a TAP office in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit TAP Office"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:N=>{t(N.target.value),d(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:Ss},children:[n.jsxs("option",{value:"",style:{background:"#111827"}
45,children:["All States",m?` (${m.total.toLocaleString()})`:""]}),PP.map(N=>{const C=m?.states.find(A=>A.state===N)?.count??0;return n.jsxs("option",{value:N,style:{background:"#111827"},children:[no[N]," (",N,")",m?` · ${C}`:""]},N)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:s,onChange:N=>i(N.target.value),placeholder:"Search name, city, branch, contact, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Branch:"}),[{key:"",label:"All",count:Object.values(x).reduce((N,C)=>N+C,0)},...g].map(({key:N,label:C,count:A})=>{const P=r===N;return n.jsxs("button",{onClick:()=>{a(N),d(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:P?`${Ms}18`:"#111827",border:`1px solid ${P?`${Ms}50`:"#1e293b"}`,color:P?Ms:"#94a3b8"},children:[C,m?n.jsxs("span",{style:{color:P?Ms:"#475569"},children:[" · ",A.toLocaleString()]}):null]},N||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[S,_?` · ${_}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"},children:[m?`${m.total.toLocaleString()} total ${m.total===1?"TAP office":"TAP offices"} · ${m.withEmail.toLocaleString()} with email`:"",c?" · 1 selected":""]})]}),b==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):p.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(as,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:m&&m.total===0&&!o&&!e?"No TAP offices yet. Click Add TAP Office to start the list.":"No TAP offices match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:p.map(N=>n.jsx(Pz,{p:N,selected:c?._id===N._id,onToggle:()=>d(C=>C?._id===N._id?null:N),onEdit:()=>{d(N),h({mode:"edit",p:N})}},N._id))}),n.jsx("div",{className:"text-center",children:b==="CanLoadMore"?n.jsxs("button",{onClick:()=>w(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",p.length.toLocaleString(),!o&&j!==void 0?` of ${j.toLocaleString()}`:""," · Load more"]}):b==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",p.length.toLocaleString()]})})]}),u&&n.jsx(Tz,{initial:u.mode==="edit"?u.p:null,onClose:()=>h(null),onDeleted:()=>d(null)},u.mode==="edit"?u.p._id:"add")]})}const OP="#00b4ff",Il="#d4a843",Mu="#2563eb",ro={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},EP=Object.keys(ro).sort((e,t)=>
45ro[e].localeCompare(ro[t])),bN=["Police Department","Sheriff's Office","State / Special Agency","School / University","Tribal","Marshal","Constable","District Attorney","Other"],MP=[{key:"Not Contacted",color:"#94a3b8"},{key:"Email Sent",color:"#38bdf8"},{key:"No Action Taken",color:"#f97316"},{key:"Responded",color:"#a78bfa"},{key:"Meeting Scheduled",color:"#facc15"},{key:"Meeting Complete",color:"#2dd4bf"},{key:"Participating",color:"#22c55e"}],Ez=e=>MP.find(t=>t.key===e)?.color??"#94a3b8",vN=[{key:"emailSent",label:"Email Sent"},{key:"responded",label:"Responded"},{key:"meetingScheduled",label:"Meeting Scheduled"},{key:"meetingComplete",label:"Meeting Complete"},{key:"noActionTaken",label:"No Action Taken"},{key:"participating",label:"Participating Agency"},{key:"agencyProfile",label:"Agency Profile"},{key:"stateLevel",label:"State Level Feature Agency"},{key:"bonusPaid",label:"Bonus Paid"}],Mz={name:"",orgType:"",state:"",email:"",phone:"",contactForm:"",additionalContacts:"",revenue:"",notes:"",emailSent:!1,responded:!1,meetingScheduled:!1,meetingComplete:!1,noActionTaken:!1,participating:!1,agencyProfile:!1,stateLevel:!1,bonusPaid:!1},LP=/[^\s@,;:<>()"']+@[^\s@,;:<>()"']+\.[a-z]{2,}/gi;function Lz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function Ud({text:e,color:t,upper:r=!0}){return n.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold whitespace-nowrap ${r?"uppercase":""}`,style:{background:`${t}15`,color:t,border:`1px solid ${t}30`},children:e})}function Iz({text:e}){const t=[];let r=0;for(const a of e.matchAll(LP)){const s=a.index??0;s>r&&t.push(e.slice(r,s)),t.push(n.jsx("a",{href:`mailto:${a[0]}`,onClick:i=>i.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:a[0]},s)),r=s+a[0].length}return r<e.length&&t.push(e.slice(r)),n.jsx(n.Fragment,{children:t})}function Rz({p:e,selected:t,onToggle:r,onEdit:a}){const s=[e.agencyProfile&&"Agency Profile",e.stateLevel&&"State Level Featured",e.revenue&&`Revenue ${e.revenue}`,e.bonusPaid&&"Bonus Paid"].filter(Boolean);return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Mu}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${Il}15`,border:`1px solid ${Il}30`},children:n.jsx(Be,{className:"w-5 h-5",style:{color:Il}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx(Ud,{text:e.state,color:OP}),e.orgType&&n.jsx(Ud,{text:e.orgType,color:Il}),n.jsx(Ud,{text:e.stage,color:Ez(e.stage)})]}),e.additionalContacts&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(en,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words min-w-0",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Additional contacts: "}),n.jsx(Iz,{text:e.additionalContacts})]})]}),s.length>0&&n.jsx("div",{className:"flex gap-1.5 flex-wrap mt-1",children:s.map(i=>n.jsx(Ud,{text:i,color:"#22c55e",upper:!1},i))}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[280px] min-w-0",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:i=>i.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:i=>i.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:i=>{i.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function Di({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
455569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function Dz({initial:e,onClose:t,onDeleted:r}){const a=te(F.lawEnforcementProspects.create),s=te(F.lawEnforcementProspects.update),i=te(F.lawEnforcementProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>{if(!e)return Mz;const j=Object.fromEntries(vN.map(({key:S})=>[S,!!e[S]]));return{name:e.name,orgType:e.orgType??"",state:e.state,email:e.email??"",phone:Wt(e.phone)??"",contactForm:e.contactForm??"",additionalContacts:e.additionalContacts??"",revenue:e.revenue??"",notes:e.notes??"",...j}}),p=j=>S=>m(_=>({..._,[j]:S})),b=j=>S=>m(_=>({..._,[j]:S}));y.useEffect(()=>{const j=S=>S.key==="Escape"&&t();return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[t]);const w=async()=>{if(!h.name.trim())return W.error("Agency name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const j={...h,veteranEmails:Array.from(h.additionalContacts.matchAll(LP)).map(S=>S[0].toLowerCase())};e?(await s({id:e._id,...j}),W.success("Agency updated")):(await a(j),W.success("Agency added")),t()}catch(j){W.error(String(j?.data??j?.message??j).replace(/^.*Uncaught Error: /,"").split(` 46`)[0])}finally{c(!1)}},x=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("Agency deleted"),r(),t()}catch(j){W.error(String(j?.message??j))}finally{c(!1)}}},g=e?.sheetTab?`Master List · ${e.sheetTab} tab${e.sheetRow?`, row ${e.sheetRow}`:""}`:"";return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:j=>j.target===j.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit Agency":"Add Agency"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["Law Enforcement",g?` · ${g}`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(Di,{className:"sm:col-span-4",label:"Agency Name",value:h.name,onChange:p("name"),placeholder:"Boise County Sheriff's Office"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:j=>p("state")(j.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),EP.map(j=>n.jsxs("option",{value:j,children:[ro[j]," (",j,")"]},j))]})]}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Agency Type"}),n.jsxs("select",{value:h.orgType,onChange:j=>p("orgType")(j.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Detect from name"}),h.orgType&&!bN.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),bN.map(j=>n.jsx("option",{value:j,children:j},j))]})]}),n.jsx(Di,{className:"sm:col-span-2",label:"Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(Di,{className:"sm:col-span-2",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(Di,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.city.gov/police/contact"}),n.jsx(Di,{className:"sm:col-span-6",label:"Additional Contacts",value:h.additionalContacts,onChange:p("additionalContacts"),placeholder:"[email protected]; [email protected]"}),n.jsxs("div",{className:"sm:col-span-6",children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-2",style:{color:"#94a3b8"},children:"Outreach Pipeline"}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-4 gap-y-2 rounded-lg px-3 py-3",style:{background:"#0a0e17",border:"1px solid #2a3550"},children:vN.map(({key:j,label:S})=>n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none min-w-0",children:[n.jsx("input",{type:"checkbox",checked:h[j],onChange:_=>b(j)(_.target.checked),className:"w-4 h-4 shrink-0 accent-[#22c55e]"}),n.jsx("span",{className:"text-[13px]",style:{color:"#cbd5e1"},children:S})]},j))})]}),n.jsx(Di,{className:"sm:col-span-2",label:"Revenue",value:h.revenue,onChange:p("revenue"),placeholder:"$129.00"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:j=>p("notes")(j.target.value),placeholder:"Add notes about this agency...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
465569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this agency?"}),n.jsx("button",{onClick:x,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:w,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Mu,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add Agency"})]})]})})}function $z(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),o=Lz(s.trim(),300),[c,d]=y.useState(null),[u,h]=y.useState(null),m=ie(F.lawEnforcementProspects.stateCounts),{results:p,status:b,loadMore:w}=Xr(F.lawEnforcementProspects.list,{state:e||void 0,stage:r||void 0,search:o||void 0},{initialNumItems:50});y.useEffect(()=>{if(!c)return;const _=p.find(N=>N._id===c._id);_&&_!==c&&d(_)},[p,c]);const x=y.useMemo(()=>{const _={};for(const N of m?.stages??[])e&&N.state!==e||(_[N.stage]=(_[N.stage]??0)+N.count);return _},[m,e]),g=y.useMemo(()=>{if(m)return r?x[r]??0:e?m.states.find(_=>_.state===e)?.count??0:m.total},[m,e,r,x]),j=(e?ro[e]??e:"All States")+(r?` · ${r}`:""),S=o?`${p.length}${b==="CanLoadMore"?"+":""}
46 matches`:g!==void 0?`${g.toLocaleString()} ${g===1?"agency":"agencies"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>h({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Mu,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Mu}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add Agency"]}),n.jsxs("button",{onClick:()=>c&&h({mode:"edit",p:c}),disabled:!c,title:c?`Edit ${c.name}`:"Check an agency in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit Agency"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold max-w-full min-w-0",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:_=>{t(_.target.value),d(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer min-w-0 flex-1 truncate",style:{color:Il},children:[n.jsxs("option",{value:"",style:{background:"#111827"},children:["All States",m?` (${m.total.toLocaleString()})`:""]}),EP.map(_=>{const N=m?.states.find(C=>C.state===_)?.count??0;return n.jsxs("option",{value:_,style:{background:"#111827"},children:[ro[_]," (",_,")",m?` · ${N.toLocaleString()}`:""]},_)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:s,onChange:_=>i(_.target.value),placeholder:"Search agency, type, phone, email...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Pipeline:"}),[{key:"",color:OP,label:"All",count:Object.values(x).reduce((_,N)=>_+N,0)},...MP.map(_=>({..._,label:_.key,count:x[_.key]??0}))].map(({key:_,color:N,label:C,count:A})=>{const P=r===_;return n.jsxs("button",{onClick:()=>{a(_),d(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:P?`${N}18`:"#111827",border:`1px solid ${P?`${N}50`:"#1e293b"}`,color:P?N:"#94a3b8"},children:[C,m?n.jsxs("span",{style:{color:P?N:"#475569"},children:[" · ",A.toLocaleString()]}):null]},_||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[j,S?` · ${S}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap hidden sm:block",style:{color:"#475569"},children:[m?`${m.total.toLocaleString()} total agencies · ${m.withEmail.toLocaleString()} with email`:"",c?" · 1 selected":""]})]}),b==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):p.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(Be,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:m&&m.total===0&&!o&&!e?"No agencies yet. Click Add Agency to start the list.":"No agencies match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:p.map(_=>n.jsx(Rz,{p:_,selected:c?._id===_._id,onToggle:()=>d(N=>N?._id===_._id?null:_),onEdit:()=>{d(_),h({mode:"edit",p:_})}},_._id))}),n.jsx("div",{className:"text-center",children:b==="CanLoadMore"?n.jsxs("button",{onClick:()=>w(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"}
46,children:["Showing ",p.length.toLocaleString(),!o&&g!==void 0?` of ${g.toLocaleString()}`:""," · Load more"]}):b==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",p.length.toLocaleString()]})})]}),u&&n.jsx(Dz,{initial:u.mode==="edit"?u.p:null,onClose:()=>h(null),onDeleted:()=>d(null)},u.mode==="edit"?u.p._id:"add")]})}const Ls="#00b4ff",Cs="#d4a843",Lu="#2563eb",ao={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},Iu=["Agency","College","State Agency","Agency/College"],IP=Object.keys(ao).sort((e,t)=>ao[e].localeCompare(ao[t])),Fz={name:"",orgType:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",emailSent:!1,contactForm:"",notes:""};function RP(e){if(!e.city&&!e.zip)return e.street??"";const t=[e.state,e.zip].filter(Boolean).join(" "),r=[e.city,t].filter(Boolean).join(", ");return[e.street,r].filter(Boolean).join(", ")}function Bz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function Uz({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Lu}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${Cs}15`,border:`1px solid ${Cs}30`},children:n.jsx(pn,{className:"w-5 h-5",style:{color:Cs}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${Ls}15`,color:Ls,border:`1px solid ${Ls}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${Cs}15`,color:Cs,border:`1px solid ${Cs}30`},children:e.orgType||"Academy"}),e.emailSent&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:"#22c55e15",color:"#4ade80",border:"1px solid #22c55e30"},children:[n.jsx(OL,{className:"w-3 h-3"})," Email sent"]})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:RP(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),(e.contactName||e.contactTitle)&&n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"}
46,children:"Other contacts: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function pr({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#475569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function zz({initial:e,onClose:t,onDeleted:r}){const a=te(F.academyProspects.create),s=te(F.academyProspects.update),i=te(F.academyProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,orgType:e.orgType??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),emailSent:!!e.emailSent,contactForm:e.contactForm??"",notes:e.notes??""}:Fz),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("Academy name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("Academy updated")):(await a(x),W.success("Academy added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 47`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("Academy deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit Academy":"Add Academy"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["Law Enforcement Academies",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(pr,{className:"sm:col-span-4",label:"Academy Name",value:h.name,onChange:p("name"),placeholder:"Golden West College Regional Criminal Justice Training Center"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Type"}
47),n.jsxs("select",{value:h.orgType,onChange:x=>p("orgType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select type"}),h.orgType&&!Iu.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),Iu.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(pr,{className:"sm:col-span-3",label:"Academy Contact",value:h.contactName,onChange:p("contactName"),placeholder:"John Smith"}),n.jsx(pr,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"Academy Director"}),n.jsx(pr,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(pr,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(pr,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.academy.gov/contact"}),n.jsx(pr,{className:"sm:col-span-6",label:"Other Contact Emails (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(pr,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.college.edu/police-academy"}),n.jsx(pr,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"15744 Goldenwest Street"}),n.jsx(pr,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),IP.map(x=>n.jsxs("option",{value:x,children:[ao[x]," (",x,")"]},x))]})]}),n.jsx(pr,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex items-center gap-2.5 sm:col-span-6 cursor-pointer select-none",children:[n.jsx("input",{type:"checkbox",checked:h.emailSent,onChange:x=>p("emailSent")(x.target.checked),className:"w-4 h-4 accent-[#22c55e]"}),n.jsx("span",{className:"text-[13px]",style:{color:"#cbd5e1"},children:"Outreach email sent"})]}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#475569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:RP(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this academy?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Lu,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add Academy"})]})]})})}function Wz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),o=Bz(s.trim(),300),[c,d]=y.useState(null),[u,h]=y.useState(null),m=ie(F.academyProspects.stateCounts),{results:p,status:b,loadMore:w}=Xr(F.academyProspects.list,{state:e||void 0,orgType:r||void 0,search:o||void 0},{initialNumItems:50});y.useEffect(()=>{if(!c)return;const N=p.find(C=>C._id===c._id);N&&N!==c&&d(N)},[p,c]);const x=y.useMemo(()=>{const N={};for(const C of m?.types??[])e&&C.state!==e||(N[C.orgType]=(N[C.orgType]??0)+C.count);return N},[m,e]),g=y.useMemo(()=>{const N=Object.keys(x).filter(A=>A!=="__none"&&!Iu.includes(A)).sort(),C=[...Iu,...N].map(A=>({key:A,label:A,count:x[A]??0}));return x.__none&&C.push({key:"__none",label:"Uncategorized",count:x.__none}),C},[x]),j=y.useMemo(()=>
47{if(m)return r?x[r]??0:e?m.states.find(N=>N.state===e)?.count??0:m.total},[m,e,r,x]),S=(e?ao[e]??e:"All States")+(r?` · ${r==="__none"?"Uncategorized":r}`:""),_=o?`${p.length}${b==="CanLoadMore"?"+":""} matches`:j!==void 0?`${j.toLocaleString()} ${j===1?"academy":"academies"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>h({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Lu,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Lu}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add Academy"]}),n.jsxs("button",{onClick:()=>c&&h({mode:"edit",p:c}),disabled:!c,title:c?`Edit ${c.name}`:"Check an academy in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit Academy"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold max-w-full min-w-0",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:N=>{t(N.target.value),d(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer min-w-0 flex-1 truncate",style:{color:Cs},children:[n.jsxs("option",{value:"",style:{background:"#111827"},children:["All States",m?` (${m.total.toLocaleString()})`:""]}),IP.map(N=>{const C=m?.states.find(A=>A.state===N)?.count??0;return n.jsxs("option",{value:N,style:{background:"#111827"},children:[ao[N]," (",N,")",m?` · ${C}`:""]},N)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:s,onChange:N=>i(N.target.value),placeholder:"Search name, city, type, contact, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Type:"}),[{key:"",label:"All",count:Object.values(x).reduce((N,C)=>N+C,0)},...g].map(({key:N,label:C,count:A})=>{const P=r===N;return n.jsxs("button",{onClick:()=>{a(N),d(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:P?`${Ls}18`:"#111827",border:`1px solid ${P?`${Ls}50`:"#1e293b"}`,color:P?Ls:"#94a3b8"},children:[C,m?n.jsxs("span",{style:{color:P?Ls:"#475569"},children:[" · ",A.toLocaleString()]}):null]},N||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[S,_?` · ${_}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"},children:[m?`${m.total.toLocaleString()} total ${m.total===1?"academy":"academies"} · ${m.withEmail.toLocaleString()} with email`:"",c?" · 1 selected":""]})]}),b==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):p.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(pn,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:m&&m.total===0&&!o&&!e?"No academies yet. Click Add Academy to start the list.":"No academies match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:p.map(N=>n.jsx(Uz,{p:N,selected:c?._id===N._id,onToggle:()=>d(C=>C?._id===N._id?null:N),onEdit:()=>{d(N),h({mode:"edit",p:N})}},N._id))}),n.jsx("div",{className:"text-center",children:b==="CanLoadMore"?n.jsxs("button",{onClick:()=>w(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"}
47,children:["Showing ",p.length.toLocaleString(),!o&&j!==void 0?` of ${j.toLocaleString()}`:""," · Load more"]}):b==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",p.length.toLocaleString()]})})]}),u&&n.jsx(zz,{initial:u.mode==="edit"?u.p:null,onClose:()=>h(null),onDeleted:()=>d(null)},u.mode==="edit"?u.p._id:"add")]})}const Is="#00b4ff",Nr="#d4a843",Ru="#2563eb",so={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico",GU:"Guam",VI:"U.S. Virgin Islands"},Du=["Army National Guard","Air National Guard"],$u=["Recruiting Office","Recruiter","Recruiting Team Leader","State Recruiting HQ","Marketing & Specialty Contact","Social Media","National HQ"],DP=Object.keys(so).filter(e=>e!=="OS").sort((e,t)=>so[e].localeCompare(so[t])),qz={name:"",orgType:"",category:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",contactForm:"",notes:""};function $P(e){const t=[e.city,[e.state,e.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ");return[e.street,t].filter(Boolean).join(", ")}function Vz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function Hz({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Ru}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${Nr}15`,border:`1px solid ${Nr}30`},children:n.jsx(as,{className:"w-5 h-5",style:{color:Nr}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${Is}15`,color:Is,border:`1px solid ${Is}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${Nr}15`,color:Nr,border:`1px solid ${Nr}30`},children:e.orgType||"Prospect"}),e.category&&n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:"#22c55e15",color:"#4ade80",border:"1px solid #22c55e30"},children:e.category})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:$P(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),e.contactName||e.contactTitle?n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]}):n.jsx("span",{style:{color:"#475569"},children:"No contact listed"})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Staff: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function xr({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
475569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function Gz({initial:e,onClose:t,onDeleted:r}){const a=te(F.nationalGuardProspects.create),s=te(F.nationalGuardProspects.update),i=te(F.nationalGuardProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,orgType:e.orgType??"",category:e.category??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),contactForm:e.contactForm??"",notes:e.notes??""}:qz),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("Guard unit name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("Guard Unit updated")):(await a(x),W.success("Guard Unit added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 48`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("Guard Unit deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit Guard Unit":"Add Guard Unit"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["National Guard",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(xr,{className:"sm:col-span-6",label:"Guard Unit Name",value:h.name,onChange:p("name"),placeholder:"Idaho Army National Guard, Gowen Field Recruiting Office"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-3",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Component"}),n.jsxs("select",{value:h.orgType,onChange:x=>p("orgType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select component"}),h.orgType&&!Du.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),Du.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-3",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Category"}),n.jsxs("select",{value:h.category,onChange:x=>p("category")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select category"}),h.category&&!$u.includes(h.category)&&n.jsx("option",{value:h.category,children:h.category}),$u.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(xr,{className:"sm:col-span-3",label:"Contact",value:h.contactName,onChange:p("contactName"),placeholder:"SFC John Smith"}),n.jsx(xr,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"Recruiting & Retention NCO"}),n.jsx(xr,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(xr,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(xr,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.nationalguard.mil/contact"}),n.jsx(xr,{className:"sm:col-span-6",label:"Additional Staff Emails, recruiters (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(xr,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.nationalguard.com"}),n.jsx(xr,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"4794 General Manning Ave"}),n.jsx(xr,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),DP.map(x=>n.jsxs("option",{value:x,children:[so[x]," (",x,")"]},x))]})]}),n.jsx(xr,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
485569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:$P(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this Guard unit?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Ru,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add Guard Unit"})]})]})})}function Kz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),[o,c]=y.useState(""),d=Vz(o.trim(),300),[u,h]=y.useState(null),[m,p]=y.useState(null),b=ie(F.nationalGuardProspects.stateCounts),{results:w,status:x,loadMore:g}=Xr(F.nationalGuardProspects.list,{state:e||void 0,orgType:r||void 0,category:s||void 0,search:d||void 0},{initialNumItems:50});y.useEffect(()=>{if(!u)return;const O=w.find(E=>E._id===u._id);O&&O!==u&&h(O)},[w,u]);const j=y.useMemo(()=>{const O={};for(const E of b?.types??[])e&&E.state!==e||(O[E.orgType]=(O[E.orgType]??0)+E.count);return O},[b,e]),S=y.useMemo(()=>{const O=Object.keys(j).filter($=>$!=="__none"&&!Du.includes($)).sort(),E=[...Du,...O].map($=>({key:$,label:$,count:j[$]??0}));return j.__none&&E.push({key:"__none",label:"Uncategorized",count:j.__none}),E},[j]),_=y.useMemo(()=>{const O={};for(const E of b?.cats??[])e&&E.state!==e||r&&E.orgType!==r||(O[E.category]=(O[E.category]??0)+E.count);return O},[b,e,r]),N=y.useMemo(()=>{const O=Object.keys(_).filter($=>$!=="__none"&&!$u.includes($)).sort(),E=[...$u,...O].map($=>({key:$,label:$,count:_[$]??0}));return _.__none&&E.push({key:"__none",label:"Uncategorized",count:_.__none}),E},[_]),C=y.useMemo(()=>{if(b)return s?_[s]??0:r?j[r]??0:e?b.states.find(O=>O.state===e)?.count??0:b.total},[b,e,r,s,j,_]),A=(e?so[e]??e:"All States")+(r?` · ${r==="__none"?"Uncategorized":r}`:"")+(s?` · ${s==="__none"?"Uncategorized":s}`:""),P=d?`${w.length}${x==="CanLoadMore"?"+":""} matches`:C!==void 0?`${C.toLocaleString()} ${C===1?"Guard unit":"Guard units"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>p({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Ru,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Ru}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add Guard Unit"]}),n.jsxs("button",{onClick:()=>u&&p({mode:"edit",p:u}),disabled:!u,title:u?`Edit ${u.name}`:"Check a Guard unit in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit Guard Unit"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}
48),n.jsxs("select",{value:e,onChange:O=>{t(O.target.value),h(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:Nr},children:[n.jsxs("option",{value:"",style:{background:"#111827"},children:["All States",b?` (${b.total.toLocaleString()})`:""]}),DP.map(O=>{const E=b?.states.find($=>$.state===O)?.count??0;return n.jsxs("option",{value:O,style:{background:"#111827"},children:[so[O]," (",O,")",b?` · ${E}`:""]},O)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:o,onChange:O=>c(O.target.value),placeholder:"Search name, city, component, category, contact, phone, email...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),o&&n.jsx("button",{onClick:()=>c(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Component:"}),[{key:"",label:"All",count:Object.values(j).reduce((O,E)=>O+E,0)},...S].map(({key:O,label:E,count:$})=>{const M=r===O;return n.jsxs("button",{onClick:()=>{a(O),h(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:M?`${Is}18`:"#111827",border:`1px solid ${M?`${Is}50`:"#1e293b"}`,color:M?Is:"#94a3b8"},children:[E,b?n.jsxs("span",{style:{color:M?Is:"#475569"},children:[" · ",$.toLocaleString()]}):null]},O||"all")})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Category:"}),[{key:"",label:"All",count:Object.values(_).reduce((O,E)=>O+E,0)},...N].map(({key:O,label:E,count:$})=>{const M=s===O;return n.jsxs("button",{onClick:()=>{i(O),h(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:M?`${Nr}18`:"#111827",border:`1px solid ${M?`${Nr}50`:"#1e293b"}`,color:M?Nr:"#94a3b8"},children:[E,b?n.jsxs("span",{style:{color:M?Nr:"#475569"},children:[" · ",$.toLocaleString()]}):null]},O||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[A,P?` · ${P}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"},children:[b?`${b.total.toLocaleString()} total ${b.total===1?"Guard unit":"Guard units"} · ${b.withEmail.toLocaleString()} with email`:"",u?" · 1 selected":""]})]}),x==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):w.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(as,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:b&&b.total===0&&!d&&!e?"No Guard units yet. Click Add Guard Unit to start the list.":"No Guard units match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:w.map(O=>n.jsx(Hz,{p:O,selected:u?._id===O._id,onToggle:()=>h(E=>E?._id===O._id?null:O),onEdit:()=>{h(O),p({mode:"edit",p:O})}},O._id))}),n.jsx("div",{className:"text-center",children:x==="CanLoadMore"?n.jsxs("button",{onClick:()=>g(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",w.length.toLocaleString(),!d&&C!==void 0?` of ${C.toLocaleString()}`:""," · Load more"]}):x==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"}
48,children:["Showing all ",w.length.toLocaleString()]})})]}),m&&n.jsx(Gz,{initial:m.mode==="edit"?m.p:null,onClose:()=>p(null),onDeleted:()=>h(null)},m.mode==="edit"?m.p._id:"add")]})}const Rs="#00b4ff",As="#d4a843",Fu="#2563eb",io={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico",GU:"Guam",VI:"U.S. Virgin Islands",OS:"Overseas"},Bu=["Army Reserve","Navy Reserve","Marine Corps Reserve","Air Force Reserve","Coast Guard Reserve"],FP=Object.keys(io).filter(e=>e!=="OS").sort((e,t)=>io[e].localeCompare(io[t])).concat("OS"),Yz={name:"",orgType:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",contactForm:"",notes:""};function BP(e){const t=[e.city,[e.state,e.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ");return[e.street,t].filter(Boolean).join(", ")}function Zz(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function Xz({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Fu}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${As}15`,border:`1px solid ${As}30`},children:n.jsx(as,{className:"w-5 h-5",style:{color:As}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${Rs}15`,color:Rs,border:`1px solid ${Rs}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${As}15`,color:As,border:`1px solid ${As}30`},children:e.orgType||"Prospect"})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:BP(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),e.contactName||e.contactTitle?n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]}):n.jsx("span",{style:{color:"#475569"},children:"No contact listed"})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Staff: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function gr({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
485569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function Jz({initial:e,onClose:t,onDeleted:r}){const a=te(F.reserveProspects.create),s=te(F.reserveProspects.update),i=te(F.reserveProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,orgType:e.orgType??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),contactForm:e.contactForm??"",notes:e.notes??""}:Yz),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("Reserve unit name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("Reserve Unit updated")):(await a(x),W.success("Reserve Unit added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 49`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("Reserve Unit deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit Reserve Unit":"Add Reserve Unit"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["Reserve Component",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(gr,{className:"sm:col-span-4",label:"Reserve Unit Name",value:h.name,onChange:p("name"),placeholder:"Boise Armed Forces Reserve Center"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Branch"}),n.jsxs("select",{value:h.orgType,onChange:x=>p("orgType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select branch"}),h.orgType&&!Bu.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),Bu.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(gr,{className:"sm:col-span-3",label:"Contact",value:h.contactName,onChange:p("contactName"),placeholder:"John Smith"}),n.jsx(gr,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"Unit Administrator"}),n.jsx(gr,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(gr,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(gr,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.unit.mil/contact"}),n.jsx(gr,{className:"sm:col-span-6",label:"Additional Staff Emails, admins / recruiters (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(gr,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.usar.army.mil"}),n.jsx(gr,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"4040 W Guard St"}),n.jsx(gr,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),FP.map(x=>n.jsxs("option",{value:x,children:[io[x]," (",x,")"]},x))]})]}),n.jsx(gr,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
495569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:BP(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this Reserve unit?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Fu,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add Reserve Unit"})]})]})})}function Qz(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),o=Zz(s.trim(),300),[c,d]=y.useState(null),[u,h]=y.useState(null),m=ie(F.reserveProspects.stateCounts),{results:p,status:b,loadMore:w}=Xr(F.reserveProspects.list,{state:e||void 0,orgType:r||void 0,search:o||void 0},{initialNumItems:50});y.useEffect(()=>{if(!c)return;const N=p.find(C=>C._id===c._id);N&&N!==c&&d(N)},[p,c]);const x=y.useMemo(()=>{const N={};for(const C of m?.types??[])e&&C.state!==e||(N[C.orgType]=(N[C.orgType]??0)+C.count);return N},[m,e]),g=y.useMemo(()=>{const N=Object.keys(x).filter(A=>A!=="__none"&&!Bu.includes(A)).sort(),C=[...Bu,...N].map(A=>({key:A,label:A,count:x[A]??0}));return x.__none&&C.push({key:"__none",label:"Uncategorized",count:x.__none}),C},[x]),j=y.useMemo(()=>{if(m)return r?x[r]??0:e?m.states.find(N=>N.state===e)?.count??0:m.total},[m,e,r,x]),S=(e?io[e]??e:"All States")+(r?` · ${r==="__none"?"Uncategorized":r}`:""),_=o?`${p.length}${b==="CanLoadMore"?"+":""} matches`:j!==void 0?`${j.toLocaleString()} ${j===1?"Reserve unit":"Reserve units"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>h({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Fu,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Fu}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add Reserve Unit"]}),n.jsxs("button",{onClick:()=>c&&h({mode:"edit",p:c}),disabled:!c,title:c?`Edit ${c.name}`:"Check a Reserve unit in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit Reserve Unit"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:N=>{t(N.target.value),d(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:As},children:[n.jsxs("option",{value:"",style:{background:"#111827"}
49,children:["All States",m?` (${m.total.toLocaleString()})`:""]}),FP.map(N=>{const C=m?.states.find(A=>A.state===N)?.count??0;return n.jsxs("option",{value:N,style:{background:"#111827"},children:[io[N]," (",N,")",m?` · ${C}`:""]},N)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:s,onChange:N=>i(N.target.value),placeholder:"Search name, city, branch, contact, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Branch:"}),[{key:"",label:"All",count:Object.values(x).reduce((N,C)=>N+C,0)},...g].map(({key:N,label:C,count:A})=>{const P=r===N;return n.jsxs("button",{onClick:()=>{a(N),d(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:P?`${Rs}18`:"#111827",border:`1px solid ${P?`${Rs}50`:"#1e293b"}`,color:P?Rs:"#94a3b8"},children:[C,m?n.jsxs("span",{style:{color:P?Rs:"#475569"},children:[" · ",A.toLocaleString()]}):null]},N||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[S,_?` · ${_}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"},children:[m?`${m.total.toLocaleString()} total ${m.total===1?"Reserve unit":"Reserve units"} · ${m.withEmail.toLocaleString()} with email`:"",c?" · 1 selected":""]})]}),b==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):p.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(as,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:m&&m.total===0&&!o&&!e?"No Reserve units yet. Click Add Reserve Unit to start the list.":"No Reserve units match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:p.map(N=>n.jsx(Xz,{p:N,selected:c?._id===N._id,onToggle:()=>d(C=>C?._id===N._id?null:N),onEdit:()=>{d(N),h({mode:"edit",p:N})}},N._id))}),n.jsx("div",{className:"text-center",children:b==="CanLoadMore"?n.jsxs("button",{onClick:()=>w(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",p.length.toLocaleString(),!o&&j!==void 0?` of ${j.toLocaleString()}`:""," · Load more"]}):b==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",p.length.toLocaleString()]})})]}),u&&n.jsx(Jz,{initial:u.mode==="edit"?u.p:null,onClose:()=>h(null),onDeleted:()=>d(null)},u.mode==="edit"?u.p._id:"add")]})}const Ds="#00b4ff",ks="#d4a843",Uu="#2563eb",oo={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico",GU:"Guam",VI:"U.S. Virgin Islands"},zu=["Army ROTC","Naval ROTC","Marine Corps (NROTC / PLC)","Air Force ROTC","Space Force (AFROTC)","Coast Guard (CSPI)"],UP=Object.keys(oo).filter(e=>e!=="OS").sort((e,t)=>
49oo[e].localeCompare(oo[t])),eW={name:"",orgType:"",email:"",phone:"",street:"",city:"",state:"",zip:"",website:"",contactName:"",contactTitle:"",veteranEmails:"",contactForm:"",notes:""};function zP(e){const t=[e.city,[e.state,e.zip].filter(Boolean).join(" ")].filter(Boolean).join(", ");return[e.street,t].filter(Boolean).join(", ")}function tW(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function nW({p:e,selected:t,onToggle:r,onEdit:a}){return n.jsxs("div",{onClick:r,onDoubleClick:a,className:"flex items-center gap-3.5 px-4 py-3 cursor-pointer transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b70",background:t?`${Uu}14`:void 0,boxShadow:t?"inset 3px 0 0 #3b82f6":void 0},children:[n.jsx("div",{className:"w-[18px] h-[18px] rounded-[5px] flex items-center justify-center shrink-0",style:{border:`1.5px solid ${t?"#3b82f6":"#334155"}`,background:t?"#3b82f6":"transparent"},children:t&&n.jsx(xn,{className:"w-3 h-3 text-white",strokeWidth:3})}),n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center shrink-0 hidden sm:flex",style:{background:`${ks}15`,border:`1px solid ${ks}30`},children:n.jsx(as,{className:"w-5 h-5",style:{color:ks}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white break-words",children:e.name}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${Ds}15`,color:Ds,border:`1px solid ${Ds}30`},children:e.state}),n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${ks}15`,color:ks,border:`1px solid ${ks}30`},children:e.orgType||"Prospect"})]}),n.jsx("div",{className:"text-[12.5px] mt-0.5 break-words",style:{color:"#cbd5e1"},children:zP(e)||n.jsx("span",{style:{color:"#475569"},children:"No address"})}),n.jsx("div",{className:"flex gap-4 flex-wrap text-[11px] mt-0.5",style:{color:"#64748b"},children:n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),e.contactName||e.contactTitle?n.jsxs("span",{children:[e.contactName&&n.jsx("b",{style:{color:"#94a3b8",fontWeight:600},children:e.contactName}),e.contactName&&e.contactTitle?`, ${e.contactTitle}`:e.contactTitle]}):n.jsx("span",{style:{color:"#475569"},children:"No contact listed"})]})}),e.veteranEmails&&e.veteranEmails.length>0&&n.jsxs("div",{className:"flex items-start gap-1.5 text-[11.5px] mt-1",style:{color:"#64748b"},children:[n.jsx(Ln,{className:"w-3 h-3 mt-[2px] shrink-0",style:{color:"#22c55e"}}),n.jsxs("span",{className:"break-words",children:[n.jsx("span",{className:"font-semibold",style:{color:"#94a3b8"},children:"Staff: "}),e.veteranEmails.map((s,i)=>n.jsxs("span",{children:[i>0&&", ",n.jsx("a",{href:`mailto:${s}`,onClick:o=>o.stopPropagation(),className:"hover:underline break-all",style:{color:"#4ade80"},children:s})]},s))]})]}),e.notes&&n.jsx("div",{className:"text-[11.5px] mt-1 italic break-words",style:{color:"#94a3b8"},children:e.notes})]}),n.jsxs("div",{className:"text-right shrink-0 text-[12.5px] max-w-[40%] sm:max-w-[260px]",children:[n.jsx("div",{className:"mb-1",style:{color:e.phone?"#e2e8f0":"#475569"},children:Wt(e.phone)||"No phone"}),e.email?n.jsx("a",{href:`mailto:${e.email}`,onClick:s=>s.stopPropagation(),className:"break-all hover:underline",style:{color:"#38bdf8"},children:e.email}):e.contactForm?n.jsxs("a",{href:/^https?:\/\//i.test(e.contactForm)?e.contactForm:`https://${e.contactForm}`,target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 hover:underline",style:{color:"#38bdf8"},title:e.contactForm,children:["Contact form ",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("button",{onClick:s=>{s.stopPropagation(),a()},className:"px-2 py-px rounded-[5px] text-[11.5px] hover:text-[#94a3b8]",style:{color:"#475569",border:"1px dashed #334155"},children:"+ Add email or form"})]})]})}function br({label:e,value:t,onChange:r,placeholder:a,className:s="",type:i="text"}){return n.jsxs("label",{className:`flex flex-col gap-1.5 ${s}`,children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:e}),n.jsx("input",{type:i,value:t,placeholder:a,onChange:o=>r(o.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
495569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"})]})}function rW({initial:e,onClose:t,onDeleted:r}){const a=te(F.rotcProspects.create),s=te(F.rotcProspects.update),i=te(F.rotcProspects.remove),[o,c]=y.useState(!1),[d,u]=y.useState(!1),[h,m]=y.useState(()=>e?{name:e.name,orgType:e.orgType??"",email:e.email??"",phone:Wt(e.phone)??"",street:e.street??"",city:e.city??"",state:e.state,zip:e.zip??"",website:e.website??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",veteranEmails:(e.veteranEmails??[]).join(", "),contactForm:e.contactForm??"",notes:e.notes??""}:eW),p=x=>g=>m(j=>({...j,[x]:g}));y.useEffect(()=>{const x=g=>g.key==="Escape"&&t();return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[t]);const b=async()=>{if(!h.name.trim())return W.error("ROTC program name is required.");if(!h.state)return W.error("Pick a state.");c(!0);try{const x={...h,veteranEmails:h.veteranEmails.split(/[,;\s]+/).map(g=>g.trim()).filter(Boolean)};e?(await s({id:e._id,...x}),W.success("ROTC Program updated")):(await a(x),W.success("ROTC Program added")),t()}catch(x){W.error(String(x?.data??x?.message??x).replace(/^.*Uncaught Error: /,"").split(` 50`)[0])}finally{c(!1)}},w=async()=>{if(e){c(!0);try{await i({id:e._id}),W.success("ROTC Program deleted"),r(),t()}catch(x){W.error(String(x?.message??x))}finally{c(!1)}}};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:pt-24",style:{background:"#02050ccc"},onMouseDown:x=>x.target===x.currentTarget&&t(),children:n.jsxs("div",{className:"w-full max-w-[760px] rounded-2xl p-6",style:{background:"#111827",border:"1px solid #2a3550",boxShadow:"0 20px 60px #000"},children:[n.jsxs("div",{className:"flex justify-between items-start mb-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xl font-extrabold text-white",children:e?"Edit ROTC Program":"Add ROTC Program"}),n.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#64748b"},children:["ROTC",e?.source&&e.source!=="manual"?` · ${e.source} list`:""]})]}),n.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-[#1e293b]","aria-label":"Close",children:n.jsx(Me,{className:"w-5 h-5",style:{color:"#64748b"}})})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-6 gap-3.5",children:[n.jsx(br,{className:"sm:col-span-4",label:"ROTC Program Name",value:h.name,onChange:p("name"),placeholder:"Boise State University Army ROTC (Bronco Battalion)"}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Program"}),n.jsxs("select",{value:h.orgType,onChange:x=>p("orgType")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select program"}),h.orgType&&!zu.includes(h.orgType)&&n.jsx("option",{value:h.orgType,children:h.orgType}),zu.map(x=>n.jsx("option",{value:x,children:x},x))]})]}),n.jsx(br,{className:"sm:col-span-3",label:"Contact",value:h.contactName,onChange:p("contactName"),placeholder:"LTC John Smith"}),n.jsx(br,{className:"sm:col-span-3",label:"Title",value:h.contactTitle,onChange:p("contactTitle"),placeholder:"Professor of Military Science"}),n.jsx(br,{className:"sm:col-span-3",label:"General Contact Email",type:"email",value:h.email,onChange:p("email"),placeholder:"[email protected]"}),n.jsx(br,{className:"sm:col-span-3",label:"Phone",value:h.phone,onChange:p("phone"),placeholder:"(208) 555-0100"}),n.jsx(br,{className:"sm:col-span-6",label:"Contact Form Link (if no email)",value:h.contactForm,onChange:p("contactForm"),placeholder:"https://www.university.edu/rotc/contact"}),n.jsx(br,{className:"sm:col-span-6",label:"Additional Staff Emails, cadre / recruiting officers (comma separated)",value:h.veteranEmails,onChange:p("veteranEmails"),placeholder:"[email protected], [email protected]"}),n.jsx(br,{className:"sm:col-span-6",label:"Website",value:h.website,onChange:p("website"),placeholder:"www.university.edu/rotc"}),n.jsx(br,{className:"sm:col-span-6",label:"Street Address",value:h.street,onChange:p("street"),placeholder:"1910 University Dr"}),n.jsx(br,{className:"sm:col-span-2",label:"City",value:h.city,onChange:p("city")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"State"}),n.jsxs("select",{value:h.state,onChange:x=>p("state")(x.target.value),className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none",children:[n.jsx("option",{value:"",children:"Select state"}),UP.map(x=>n.jsxs("option",{value:x,children:[oo[x]," (",x,")"]},x))]})]}),n.jsx(br,{className:"sm:col-span-2",label:"ZIP",value:h.zip,onChange:p("zip")}),n.jsxs("label",{className:"flex flex-col gap-1.5 sm:col-span-6",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide",style:{color:"#94a3b8"},children:"Notes"}),n.jsx("textarea",{rows:3,value:h.notes,onChange:x=>p("notes")(x.target.value),placeholder:"Add notes about this prospect...",className:"rounded-lg px-3 py-2.5 text-[13.5px] text-white placeholder-[#47
505569] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none resize-y"})]})]}),n.jsxs("div",{className:"mt-4 rounded-lg px-3 py-2.5",style:{background:"#0d1321",border:"1px dashed #2a3550"},children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wide mb-1",style:{color:"#94a3b8"},children:"Shows in the list as"}),n.jsx("div",{className:"text-[13px] break-words",style:{color:"#cbd5e1"},children:zP(h)||n.jsx("span",{style:{color:"#475569"},children:"Fill in the address above"})})]}),n.jsxs("div",{className:"flex items-center gap-2.5 mt-5 flex-wrap",children:[e&&(d?n.jsxs("div",{className:"flex items-center gap-2 mr-auto",children:[n.jsx("span",{className:"text-[13px]",style:{color:"#fca5a5"},children:"Delete this ROTC program?"}),n.jsx("button",{onClick:w,disabled:o,className:"px-3 py-1.5 rounded-lg text-[13px] font-semibold text-white",style:{background:"#dc2626"},children:"Yes, delete"}),n.jsx("button",{onClick:()=>u(!1),className:"text-[13px]",style:{color:"#94a3b8"},children:"No"})]}):n.jsx("button",{onClick:()=>u(!0),className:"mr-auto text-[13px] font-semibold",style:{color:"#ef4444"},children:"Delete"})),!e&&n.jsx("div",{className:"mr-auto"}),n.jsx("button",{onClick:t,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:"#151c2c",border:"1px solid #2a3550"},children:"Cancel"}),n.jsx("button",{onClick:b,disabled:o,className:"px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white disabled:opacity-60",style:{background:Uu,border:"1px solid #3b82f6"},children:o?"Saving...":e?"Save Changes":"Add ROTC Program"})]})]})})}function aW(){const[e,t]=y.useState(""),[r,a]=y.useState(""),[s,i]=y.useState(""),o=tW(s.trim(),300),[c,d]=y.useState(null),[u,h]=y.useState(null),m=ie(F.rotcProspects.stateCounts),{results:p,status:b,loadMore:w}=Xr(F.rotcProspects.list,{state:e||void 0,orgType:r||void 0,search:o||void 0},{initialNumItems:50});y.useEffect(()=>{if(!c)return;const N=p.find(C=>C._id===c._id);N&&N!==c&&d(N)},[p,c]);const x=y.useMemo(()=>{const N={};for(const C of m?.types??[])e&&C.state!==e||(N[C.orgType]=(N[C.orgType]??0)+C.count);return N},[m,e]),g=y.useMemo(()=>{const N=Object.keys(x).filter(A=>A!=="__none"&&!zu.includes(A)).sort(),C=[...zu,...N].map(A=>({key:A,label:A,count:x[A]??0}));return x.__none&&C.push({key:"__none",label:"Uncategorized",count:x.__none}),C},[x]),j=y.useMemo(()=>{if(m)return r?x[r]??0:e?m.states.find(N=>N.state===e)?.count??0:m.total},[m,e,r,x]),S=(e?oo[e]??e:"All States")+(r?` · ${r==="__none"?"Uncategorized":r}`:""),_=o?`${p.length}${b==="CanLoadMore"?"+":""} matches`:j!==void 0?`${j.toLocaleString()} ${j===1?"ROTC program":"ROTC programs"}`:"";return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-2.5 rounded-2xl p-3",style:{background:"#0d1321",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex gap-2.5 flex-wrap",children:[n.jsxs("button",{onClick:()=>h({mode:"add"}),className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold text-white",style:{background:Uu,border:"1px solid #3b82f6",boxShadow:`0 4px 14px ${Uu}55`},children:[n.jsx(pt,{className:"w-4 h-4"})," Add ROTC Program"]}),n.jsxs("button",{onClick:()=>c&&h({mode:"edit",p:c}),disabled:!c,title:c?`Edit ${c.name}`:"Check a ROTC program in the list first",className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-[10px] text-sm font-semibold disabled:opacity-50 disabled:cursor-not-allowed",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(qt,{className:"w-4 h-4"})," Edit ROTC Program"]}),n.jsxs("label",{className:"inline-flex items-center gap-2 pl-4 pr-2 py-1.5 rounded-[10px] text-sm font-semibold",style:{background:"#151c2c",border:"1px solid #2a3550",color:"#e2e8f0"},children:[n.jsx(wt,{className:"w-4 h-4"}),n.jsx("span",{className:"whitespace-nowrap",children:"Search by State:"}),n.jsxs("select",{value:e,onChange:N=>{t(N.target.value),d(null)},className:"bg-transparent font-semibold focus:outline-none py-1 cursor-pointer",style:{color:ks},children:[n.jsxs("option",{value:"",style:{background:"#111827"}
50,children:["All States",m?` (${m.total.toLocaleString()})`:""]}),UP.map(N=>{const C=m?.states.find(A=>A.state===N)?.count??0;return n.jsxs("option",{value:N,style:{background:"#111827"},children:[oo[N]," (",N,")",m?` · ${C}`:""]},N)})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-0",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"}}),n.jsx("input",{type:"text",value:s,onChange:N=>i(N.target.value),placeholder:"Search name, city, program, contact, phone, email, website...",className:"w-full pl-10 pr-9 py-2.5 rounded-[10px] text-[13px] text-white placeholder-[#64748b] bg-[#0a0e17] border border-[#2a3550] focus:border-[#3b82f6] focus:outline-none"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-3 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#64748b"}})})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider mr-1",style:{color:"#64748b"},children:"Program:"}),[{key:"",label:"All",count:Object.values(x).reduce((N,C)=>N+C,0)},...g].map(({key:N,label:C,count:A})=>{const P=r===N;return n.jsxs("button",{onClick:()=>{a(N),d(null)},className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:P?`${Ds}18`:"#111827",border:`1px solid ${P?`${Ds}50`:"#1e293b"}`,color:P?Ds:"#94a3b8"},children:[C,m?n.jsxs("span",{style:{color:P?Ds:"#475569"},children:[" · ",A.toLocaleString()]}):null]},N||"all")})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wider whitespace-nowrap",style:{color:"#475569"},children:[S,_?` · ${_}`:""]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsxs("div",{className:"text-[11px] whitespace-nowrap",style:{color:"#475569"},children:[m?`${m.total.toLocaleString()} total ${m.total===1?"ROTC program":"ROTC programs"} · ${m.withEmail.toLocaleString()} with email`:"",c?" · 1 selected":""]})]}),b==="LoadingFirstPage"?n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."}):p.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(as,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:m&&m.total===0&&!o&&!e?"No ROTC programs yet. Click Add ROTC Program to start the list.":"No ROTC programs match."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:p.map(N=>n.jsx(nW,{p:N,selected:c?._id===N._id,onToggle:()=>d(C=>C?._id===N._id?null:N),onEdit:()=>{d(N),h({mode:"edit",p:N})}},N._id))}),n.jsx("div",{className:"text-center",children:b==="CanLoadMore"?n.jsxs("button",{onClick:()=>w(100),className:"px-4 py-2 rounded-lg text-xs font-semibold",style:{background:"#111827",border:"1px solid #1e293b",color:"#94a3b8"},children:["Showing ",p.length.toLocaleString(),!o&&j!==void 0?` of ${j.toLocaleString()}`:""," · Load more"]}):b==="LoadingMore"?n.jsx("span",{className:"text-xs",style:{color:"#475569"},children:"Loading..."}):n.jsxs("span",{className:"text-xs",style:{color:"#475569"},children:["Showing all ",p.length.toLocaleString()]})})]}),u&&n.jsx(rW,{initial:u.mode==="edit"?u.p:null,onClose:()=>h(null),onDeleted:()=>d(null)},u.mode==="edit"?u.p._id:"add")]})}const m1=[{key:"le",label:"Law Enforcement",color:"#3b82f6"},{key:"academy",label:"Academy",color:"#d4a843"},{key:"business",label:"Defense Contractor",color:"#00b4ff"},{key:"college",label:"College",color:"#22c55e"},{key:"workforce",label:"Workforce",color:"#e879f9"},{key:"tap",label:"TAP",color:"#f59e0b"},{key:"guard",label:"National Guard",color:"#84cc16"},{key:"reserve",label:"Reserve",color:"#14b8a6"},{key:"rotc",label:"ROTC",color:"#f472b6"}],Wu=[{key:"le_participating",leadType:"le",name:"Law Enforcement: Participating Agency invitation",subject:"Invitation for the {orgName} to Become a Participating Agency with VET-TO-LEO",body:`{greeting} 51 52VET-TO-LEO is expanding into {state}, and we'd like to invite the {orgName} to become a Participating Agency with us at no cost. 53 54We connect military veterans with law enforcement agencies across the country. Our mission is to help veterans find agencies that value military service and want to hire them. Even if you're not actively hiring, your agency will still benef
54it from the free visibility! You can learn more about us at: vettoleo.com. 55 56Becoming a Participating Agency is free. Here's what it includes: 57 58⢠Your agency listed on our national Agencies page, organized by state; 59⢠Your agency logo displayed on our website, visited by veteran applicants each day; 60⢠Visibility with veterans leaving the military and actively looking at law enforcement careers. 61 62VET-TO-LEO is a government-recognized employment navigator and veteran resource organization. Successful referrals to agencies are happening regularly. 63 64You can join for free here: vettoleo.com/login 65 66If you're hiring and want to market your jobs to veterans, we'd love to partner with you! You can see how law enforcement agencies are taking advantage of cost-effective agency memberships. 67 68I'm Kameron Elumbaugh, the founder of VET-TO-LEO. I'd welcome the opportunity to show you why agencies across the country are choosing to partner with us. 69 70Respectfully,`},{key:"academy_listing",leadType:"academy",name:"Academies: Free academy listing invitation",subject:"Invitation to List {orgName} with VET-TO-LEO",body:`{greeting} 71 72The Armed Forces Veteran to Law Enforcement Officer Employment Initiative (VET-TO-LEO) is expanding into {state}, and we'd like to list your academy in our directory at no cost. We are connecting with academies before we start introductions to law enforcement agencies. 73 74VET-TO-LEO connects military veterans with law enforcement career opportunities nationwide. A growing number of veterans in our network are interested in self-sponsoring through POST-certified academies using their GI Bill (Chapter 33) and Vocational Rehabilitation and Employment (Chapter 31) benefits. We want to make sure they know where to go. 75 76We list law enforcement academies for free. Here's what your academy gets: 77 78- Your academy featured on our {state} state page and academy directory. 79- Visibility to veterans actively exploring the self-sponsor pathway into law enforcement. 80 81To list your academy, please visit our website at: vettoleo.com/list-your-academic-programs 82Fill out our short form, and we will take care of the rest. This will make it easier for veterans participating in the Transition Assistance Program (TAP) to connect with your academies and find their next opportunity. 83 84VET-TO-LEO is a government-recognized employment navigator and veteran resource organization. We work with law enforcement agencies across the country to help veterans find their path into law enforcement. 85 86If your academy is connected to a law enforcement agency, we highly encourage you to connect with us about becoming a Participating Agency, also free. We have cost-effective options beyond that through our Agency Membership, if you want to publish your recruiter's information and feature your open positions with us. Right now we are offering those at 50% off for early adopters. 87 88I'm Kameron Elumbaugh, founder of VET-TO-LEO. You can reach me directly at any time. 89 90Happy to answer any questions. Let's connect. 91 92Respectfully,`},{key:"business_intro",leadType:"business",name:"Defense Contractors: Business Contributor intro",subject:"Supporting veterans moving into law enforcement",body:`{greeting} 93 94VET-TO-LEO connects military veterans with law enforcement agencies across the country. Veterans use our site to find agencies that value their service, see open positions, and reach recruiters directly. It's free for every veteran. 95 96Companies that work with the Department of Defense already know what veterans bring to a team. That's why we're reaching out to {orgName}. Our Business Contributors put their name behind veterans making that next move, and their logo is shown on vettoleo.com to the veterans and agencies who use it every day. 97 98You can see how it works here: vettoleo.com/mission 99 100I'm Kameron Elumbaugh, the founder of VET-TO-LEO. I'd be glad to set up a short call and answer any questions. 101 102Respectfully,`},{key:"college_intro",leadType:"college",name:"Colleges: Veteran Services intro",subject:"A career resource for student veterans at {orgName}",body:`{greeting} 103 104VET-TO-LEO connects military veterans with law enforcement agencies across the country, and we'd like to be a resource for the student veterans at {orgName}. 105 106A lot of veterans finishing a degree are looking at law enforcement and don't know
106which agencies value their service. Our directory shows them participating agencies in {state} and nationwide, with open positions and recruiter contacts. It's free for veterans. 107 108Would your veteran services team be open to sharing VET-TO-LEO with your students? I can send a flyer for your Veterans Center or set up a short call. 109 110I'm Kameron Elumbaugh, the founder of VET-TO-LEO. You can learn more at vettoleo.com. 111 112Respectfully,`},{key:"workforce_intro",leadType:"workforce",name:"Workforce: DVOP / LVER intro",subject:"A free law enforcement career resource for your veteran job seekers",body:`{greeting} 113 114VET-TO-LEO is a government-recognized employment navigator that connects military veterans with law enforcement agencies across the country. 115 116When a veteran on your caseload says they're interested in law enforcement, we can help. Our site shows them agencies in {state} and nationwide that want to hire veterans, with open positions and recruiter contacts in one place. Signing up is free for veterans at vettoleo.com. 117 118I'd like to make sure {orgName} has us on its list of referral resources. I'm happy to send a one-page flyer for your office or set up a short call with your veteran staff. 119 120I'm Kameron Elumbaugh, the founder of VET-TO-LEO. 121 122Respectfully,`},{key:"tap_intro",leadType:"tap",name:"TAP: Transition resource intro",subject:"VET-TO-LEO: a law enforcement career resource for transitioning service members",body:`{greeting} 123 124VET-TO-LEO connects transitioning service members and veterans with law enforcement agencies across the country. A lot of the people coming through TAP are already thinking about law enforcement, and our site shows them agencies that value military service, with open positions and recruiter contacts. It's free for every service member and veteran. 125 126I'd like to offer VET-TO-LEO as a resource for {orgName}. I can send flyers for your center, and I'd welcome the chance to brief at one of your employment workshops, in person or virtually. 127 128I'm Kameron Elumbaugh, the founder of VET-TO-LEO. You can learn more at vettoleo.com. 129 130Respectfully,`},{key:"guard_intro",leadType:"guard",name:"National Guard: Recruiting intro",subject:"Partnering with VET-TO-LEO for Guard members pursuing law enforcement",body:`{greeting} 131 132VET-TO-LEO connects military veterans and service members with law enforcement agencies across the country. A lot of Guard members want a full-time law enforcement career alongside their drill commitment, and many agencies actively recruit them. 133 134Our site shows soldiers and airmen the agencies in {state} and nationwide that value Guard service, with open positions and recruiter contacts. It's free for every service member. 135 136I'd like VET-TO-LEO to be a resource your team can hand to members who are separating, going part-time, or looking for a civilian career. I can send flyers or set up a short call. 137 138I'm Kameron Elumbaugh, the founder of VET-TO-LEO. You can learn more at vettoleo.com. 139 140Respectfully,`},{key:"reserve_intro",leadType:"reserve",name:"Reserve: Unit / Recruiting intro",subject:"A law enforcement career resource for {branch} reservists",body:`{greeting} 141 142VET-TO-LEO connects military veterans and reservists with law enforcement agencies across the country. Reservists bring the training and discipline agencies want, and many departments work around drill schedules to hire them. 143 144Our site shows reservists agencies in {state} and nationwide that value military service, with open positions and recruiter contacts. It's free for every service member. 145 146I'd like to offer VET-TO-LEO as a resource for the members of {orgName}. I can send flyers for your unit or set up a short call. 147 148I'm Kameron Elumbaugh, the founder of VET-TO-LEO. You can learn more at vettoleo.com. 149 150Respectfully,`},{key:"rotc_intro",leadType:"rotc",name:"ROTC: Cadre intro",subject:"VET-TO-LEO: law enforcement careers after military service",body:`{greeting} 151 152VET-TO-LEO connects military veterans with law enforcement agencies across the country. Officers who finish their service commitment often look at law enforcement leadership roles, and many agencies want exactly that experience. 153 154I'd like {orgName} to know VET-TO-LEO is there for your cadets and cadre when they're ready for that step. Our site shows agencies in {state} and nationwide that value military service, with open positions and recruiter contacts. It's free for every veteran. 155 156I'm happy to send information you can share or set up a short call. 157 158I'm Kameron Elumbaugh, the founder of VET-TO-LEO. You can learn more at vettoleo.com. 159 160Respectfully,`},{key:"blank",leadType:"any",name:"Blank email",subject:"",body:`{greeting} 161 162 163 164Respectfully,`}];function sW(e){return Wu.find(t=>t.leadType===e)??Wu.find(t=>t.key==="blank")}const iW={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"Washington, D.C.",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming",PR:"Puerto Rico",GU:"Guam",VI:"the U.S. Virgin Islands"};function WP(e){if(!e)return"";const t=e.trim().toUpperCase();return t==="OS"?"":iW[t]??e}const oW=new Set(["LLC","LLP","LP","PLLC","USA","US","II","III","IV","JV","PC","NA","DBA","IT","AI","UAS","SBA"]),lW=new Set(["of","and","the","for","at","in","on","to","a"]);function Sa(e){if(!e)return e;const t=e.replace(/[^A-Za-z]/g,"");return!t||t!==t.toUpperCase()?e:e.toLowerCase().split(/(\s+|-|\/)/).map((r,a)=>{const s=r.replace(/[^a-z]/g,"").toUpperCase();return oW.has(s)?r.toUpperCase():s==="INC"?r.replace(/inc/i,"Inc"):s==="CORP"?r.replace(/corp/i,"Corp"):a>0&&lW.has(r)?r:r.charAt(0).toUpperCase()+r.slice(1)}).join("")}function p1(e){return m1.find(t=>t.key===e)}function yN(e){if(!e)return"";const t=e.trim();return/[,;/&]| - | and /i.test(t)||t.split(/\s+/).length>4?"":t}function cW(e,t){if(!e)return"Hello,";const r=Sa(e.name);if(e.leadType==="business")return`Hello ${r} team,`;if(e.leadType==="college")return"Hello,";if(e.leadType==="workforce"){const s=e.emails.find(o=>o.label.includes("veteran rep")),i=yN(e.contactName);return i&&s&&t&&s.email.toLowerCase()===t.toLowerCase()?`Hello ${i},`:"Hello,"}const a=yN(e.contactName);return a?`Hello ${a},`:"Hello,"}function dW(e,t,r){const a=t?Sa(t.name):"",s={greeting:cW(t,r),orgName:a||"your organization",state:WP(t?.state)||"your state",contactName:t?.contactName||"",branch:(t?.orgType||"").replace(/ Reserve$/i,"")||"military"},i=o=>o.replace(/\{(\w+)\}/g,(c,d)=>d in s?s[d]:c);return{subject:i(e.subject),body:i(e.body)}}function qP(e){const t=new Date(e),r=new Date;if(t.toDateString()===r.toDateString())return t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});const a=new Date(r);return a.setDate(r.getDate()-1),t.toDateString()===a.toDateString()?"Yesterday":t.getFullYear()===r.getFullYear()?t.toLocaleDateString("en-US",{month:"short",day:"numeric"}):t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}
164function qu(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Kv(e){const t=e.match(/^\s*"?([^"<]*)"?\s*<([^>]+)>/);return t?{name:t[1].trim()||t[2],email:t[2]}:{name:e,email:e}}const mn="#d4a843",Ur="#00b4ff",cn="#1e293b",Vu="#111827",ga="#0d1321";function VP(e,t){const[r,a]=y.useState(e);return y.useEffect(()=>{const s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),r}function _f({type:e}){const t=p1(e);return t?n.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded-[5px] text-[10px] font-bold whitespace-nowrap shrink-0",style:{color:t.color,border:`1px solid ${t.color}55`,background:`${t.color}14`},children:t.label}):null}function uW({email:e,size:t=18}){const r=Hc(e);return r?r.photo?n.jsx("img",{src:r.photo,alt:r.name,title:`Handled by ${r.name}`,className:"rounded-full object-cover shrink-0",style:{width:t,height:t,border:"1px solid #334155"}}):n.jsx("span",{title:`Handled by ${r.name}`,className:"rounded-full shrink-0 flex items-center justify-center text-[9px] font-bold",style:{width:t,height:t,background:"#1e293b",color:"#94a3b8"},children:_0(r.name)}):null}function er({children:e,onClick:t,variant:r="ghost",disabled:a,title:s,className:i=""}){const o=r==="gold"?{background:mn,color:"#0a0e17"}:r==="ghost"?{background:"#1e293b",color:"#cbd5e1",border:"1px solid #2a3550"}:{color:"#94a3b8"};return n.jsx("button",{type:"button",title:s,disabled:a,onClick:t,className:`inline-flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold transition-opacity disabled:opacity-40 hover:opacity-90 ${i}`,style:o,children:e})}function hW({folder:e,setFolder:t,leadType:r,setLeadType:a,onCompose:s}){const i=ie(F.mailbox.folderCounts),o=ie(F.mailbox.syncStatus),c=iu(F.mailboxNode.syncNow),[d,u]=y.useState(!1),[,h]=y.useState(0);y.useEffect(()=>{const w=setInterval(()=>h(x=>x+1),1e4);return()=>clearInterval(w)},[]);const m=[{key:"inbox",label:"Inbox",icon:VC,count:i?.inboxUnread},{key:"sent",label:"Sent",icon:si},{key:"drafts",label:"Drafts",icon:WC,count:i?.drafts},{key:"spam",label:"Spam",icon:ZC,count:i?.spam},{key:"all",label:"All Mail",icon:FC}],p=o?.lastSyncAt?Math.max(0,Math.round((Date.now()-o.lastSyncAt)/1e3)):null,b=p===null?"never":p<60?`${p} sec ago`:`${Math.round(p/60)} min ago`;return n.jsxs("div",{className:"flex flex-col gap-1 p-3 overflow-y-auto",style:{borderRight:`1px solid ${cn}`},children:[n.jsxs(er,{variant:"gold",onClick:s,className:"w-full py-2 mb-2 text-[13px]",children:[n.jsx(Cv,{className:"w-4 h-4"})," Compose"]}),n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider px-2 mb-1",style:{color:"#64748b"},children:"Gmail folders"}),m.map(({key:w,label:x,icon:g,count:j})=>{const S=e===w;return n.jsxs("button",{type:"button",onClick:()=>t(w),className:"flex items-center gap-2.5 px-2.5 py-2 rounded-lg text-[13px] text-left transition-colors hover:bg-[#1e293b80]",style:S?{background:`${mn}20`,color:mn,fontWeight:700}:{color:"#cbd5e1"},children:[n.jsx(g,{className:"w-4 h-4 shrink-0"}),n.jsx("span",{className:"flex-1",children:x}),!!j&&n.jsx("span",{className:"text-[11px] font-semibold",style:{color:S?mn:"#64748b"},children:j>=500?"500+":j})]},w)}),n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider px-2 mt-4 mb-1",style:{color:"#64748b"},children:"Filter by lead list"}),[{key:"",label:"All emails",color:"#64748b"},...m1].map(w=>{const x=r===w.key;return n.jsxs("button",{type:"button",onClick:()=>a(w.key),className:"flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-[12px] text-left hover:bg-[#1e293b80]",style:{color:x?"#fff":"#94a3b8",background:x?"#1e293b":void 0,fontWeight:x?600:400},children:[n.jsx("span",{className:"w-2 h-2 rounded-[2px] shrink-0",style:{background:w.color}}),w.label]},w.key||"any")}),n.jsxs("div",{className:"mt-4 p-2.5 rounded-lg text-[11px] leading-relaxed",style:{background:ga,border:`1px solid ${cn}`,color:"#94a3b8"},children:[o&&!o.configured?n.jsxs("div",{className:"flex items-center gap-1.5 font-bold",style:{color:"#f59e0b"},children:[n.jsx(fI,{className:"w-3.5 h-3.5"})," Not connected"]}):o?.lastError?n.jsx("div",{className:"font-bold",style:{color:"#f87171"},title:o.lastError,children:"Sync problem, retrying"}):n.jsxs("div",{className:"flex items-center gap-1.5 font-bold",style:{color:"#22c55e"},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"#22c55e"}})," Synced with Gmail"]}),n.jsx("div",{className:"break-all",children:o?.address??"[email protected]"}),n.jsxs("div",{style:{color:"#64748b"},children:["Last sync ",b]}),o?.backfilling&&n.jsx("div",{style:{color:"#64748b"},children:"Loading older mailâ¦"}),n.jsxs("button",{type:"button",disabled:d,onClick:async()=>{u(!0);try{await c({})}catch(w){W.error(w?.message??"Sync failed")}finally{u(!1)}},className:"mt-1.5 inline-flex items-center gap-1 text-[11px] font-semibold hover:underline disabled:opacity-50",style:{color:Ur},children:[n.jsx(QL,{className:`w-3 h-3 ${d?"animate-spin":""}`})," Sync now"]})]})]})}function fW({t:e,active:t,folder:r,onOpen:a}){const i=r==="sent"||r==="drafts"?`To: ${e.counterpartName?Kv(e.counterpartName).name:e.counterpartEmail??"(no recipient)"}`:e.counterpartName?Kv(e.counterpartName).name:e.counterpartEmail??"(unknown)",o=e.lastInboundAt&&e.lastOutboundAt;return n.jsxs("button",{type:"button",onClick:a,className:"w-full text-left flex gap-2.5 px-3 py-2.5 transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1a2233",background:t?`${mn}12`:void 0,boxShadow:t?`inset 3px 0 0 ${mn}`:void 0},children:[n.jsx("div",{className:"pt-1.5 w-2 shrink-0",children:e.unread&&n.jsx("span",{className:"block w-2 h-2 rounded-full",style:{background:Ur}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[n.jsxs("span",{className:`truncate text-[13px] text-white ${e.unread?"font-bold":"font-medium"}`,children:[i,e.messageCount>1&&n.jsxs("span",{className:"font-normal",style:{color:"#64748b"},children:[" (",e.messageCount,")"]})]}),n.jsx("span",{className:"text-[11px] whitespace-nowrap shrink-0",style:{color:"#64748b"},children:qP(e.lastMessageAt)}
164)]}),(e.leadType||e.inDraft)&&n.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5 min-w-0",children:[e.inDraft&&n.jsx("span",{className:"px-1.5 py-px rounded-[5px] text-[10px] font-bold shrink-0",style:{color:"#f59e0b",border:"1px solid #f59e0b55",background:"#f59e0b14"},children:"Draft"}),n.jsx(_f,{type:e.leadType}),e.leadName&&n.jsx("span",{className:"truncate text-[11px]",style:{color:"#94a3b8"},children:Sa(e.leadName)})]}),n.jsx("div",{className:`truncate text-[12.5px] mt-0.5 ${e.unread?"font-bold text-[#e2e8f0]":"text-[#cbd5e1]"}`,children:e.subject}),n.jsx("div",{className:"truncate text-[11.5px] mt-0.5",style:{color:"#64748b"},children:e.snippet}),e.bounced||e.inSent&&(e.opens||e.clicks||o)?n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 text-[10.5px] font-semibold",children:[e.bounced&&n.jsxs("span",{className:"inline-flex items-center gap-1",style:{color:"#f87171"},children:[n.jsx(ZC,{className:"w-3 h-3"})," Bounced"]}),o&&n.jsxs("span",{className:"inline-flex items-center gap-1",style:{color:"#22c55e"},children:[n.jsx(XC,{className:"w-3 h-3"})," Replied"]}),!!e.opens&&n.jsxs("span",{className:"inline-flex items-center gap-1",style:{color:Ur},children:[n.jsx(Wn,{className:"w-3 h-3"})," Opened ",e.opens,"Ã"]}),!!e.clicks&&n.jsxs("span",{className:"inline-flex items-center gap-1",style:{color:"#a855f7"},children:[n.jsx(YC,{className:"w-3 h-3"})," ",e.clicks," click",e.clicks===1?"":"s"]})]}):null]}),n.jsx("div",{className:"pt-0.5",children:n.jsx(uW,{email:e.handledBy})})]})}function mW({folder:e,leadType:t,selected:r,onOpen:a}){const[s,i]=y.useState(""),[o,c]=y.useState("all"),d=VP(s,300),{results:u,status:h,loadMore:m}=Xr(F.mailbox.listThreads,{folder:e,filter:o,leadType:t||void 0,search:d||void 0},{initialNumItems:40}),p=[{key:"all",label:"All"},{key:"unread",label:"Unread"},{key:"replied",label:"Replied"},{key:"awaiting",label:"Awaiting reply"}];return n.jsxs("div",{className:"flex flex-col min-h-0",style:{borderRight:`1px solid ${cn}`},children:[n.jsxs("div",{className:"p-3 shrink-0",style:{borderBottom:`1px solid ${cn}`},children:[n.jsxs("div",{className:"relative",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{color:"#64748b"}}),n.jsx("input",{value:s,onChange:b=>i(b.target.value),placeholder:"Search mail, contacts, organizations...",className:"w-full pl-9 pr-8 py-2 rounded-lg text-[13px] text-white placeholder-[#64748b] focus:outline-none focus:border-[#00b4ff]",style:{background:ga,border:"1px solid #2a3550"}}),s&&n.jsx("button",{type:"button",onClick:()=>i(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2",style:{color:"#64748b"},children:n.jsx(Me,{className:"w-4 h-4"})})]}),n.jsx("div",{className:"flex gap-1.5 mt-2 flex-wrap",children:p.map(b=>n.jsx("button",{type:"button",onClick:()=>c(b.key),className:"px-2.5 py-1 rounded-md text-[11px] font-semibold",style:{background:o===b.key?`${mn}20`:Vu,border:`1px solid ${o===b.key?`${mn}80`:cn}`,color:o===b.key?mn:"#94a3b8"},children:b.label},b.key))})]}),n.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:h==="LoadingFirstPage"?n.jsxs("div",{className:"flex items-center justify-center py-12 text-sm gap-2",style:{color:"#64748b"},children:[n.jsx(gt,{className:"w-4 h-4 animate-spin"})," Loading mailâ¦"]}):u.length===0?n.jsx("div",{className:"text-center py-12 px-6 text-sm",style:{color:"#64748b"},children:d?"No emails match this search.":"Nothing here."}):n.jsxs(n.Fragment,{children:[u.map(b=>n.jsx(fW,{t:b,folder:e,active:r===b._id,onOpen:()=>a(b._id)},b._id)),h==="CanLoadMore"&&n.jsx("div",{className:"p-3 text-center",children:n.jsx(er,{onClick:()=>m(40),children:"Load more"})}),h==="LoadingMore"&&n.jsx("div",{className:"p-3 text-center text-xs",style:{color:"#64748b"},children:"Loadingâ¦"})]})})]})}function HP({onPick:e,autoFocus:t}){const[r,a]=y.useState(""),[s,i]=y.useState(""),o=VP(r,250),c=ie(F.mailbox.searchLeads,o.trim().length>=2?{q:o,leadType:s||void 0}:"skip");return n.jsxs("div",{children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Dt,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{color:"#64748b"}}),n.jsx("input",{autoFocus:t,value:r,onChange:d=>
164a(d.target.value),placeholder:"Search the lead lists: name, school, unit, city, email...",className:"w-full pl-9 pr-3 py-2 rounded-lg text-[13px] text-white placeholder-[#64748b] focus:outline-none focus:border-[#00b4ff]",style:{background:ga,border:"1px solid #2a3550"}})]}),n.jsxs("select",{value:s,onChange:d=>i(d.target.value),className:"px-2 rounded-lg text-[12px] text-white focus:outline-none",style:{background:ga,border:"1px solid #2a3550"},children:[n.jsx("option",{value:"",children:"All lead lists"}),m1.map(d=>n.jsx("option",{value:d.key,children:d.label},d.key))]})]}),o.trim().length>=2&&n.jsx("div",{className:"mt-2 rounded-lg max-h-[260px] overflow-y-auto",style:{border:`1px solid ${cn}`,background:ga},children:c===void 0?n.jsx("div",{className:"p-3 text-xs",style:{color:"#64748b"},children:"Searchingâ¦"}):c.length===0?n.jsxs("div",{className:"p-3 text-xs",style:{color:"#64748b"},children:['No leads match "',o,'".']}):c.map(d=>n.jsxs("button",{type:"button",onClick:()=>{e(d),a("")},className:"w-full text-left px-3 py-2 flex items-start gap-2.5 hover:bg-[#1e293b80]",style:{borderBottom:"1px solid #1a2233"},children:[n.jsx(_f,{type:d.leadType}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-[12.5px] font-semibold text-white truncate",children:Sa(d.name)}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"#94a3b8"},children:[d.contactName,[d.city&&Sa(d.city),d.state].filter(Boolean).join(", ")].filter(Boolean).join(" · ")})]}),n.jsx("div",{className:"text-[11px] text-right shrink-0 max-w-[45%] truncate",style:{color:d.emails.length?"#38bdf8":"#475569"},children:d.emails[0]?.email??"No email on file"})]},d.leadKey))})]})}function jN({lead:e,onClear:t}){const r=p1(e.leadType);return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg text-[11.5px] flex-wrap",style:{background:`${r?.color??Ur}10`,border:`1px solid ${r?.color??Ur}35`,color:"#94a3b8"},children:[n.jsx(_f,{type:e.leadType}),n.jsx("b",{className:"text-[#e2e8f0]",children:Sa(e.name)}),e.contactName&&n.jsxs("span",{children:["· ",e.contactName,e.contactTitle&&!e.contactTitle.startsWith("Served by")?`, ${e.contactTitle}`:""]}),(e.city||e.state)&&n.jsxs("span",{children:["· ",[e.city&&Sa(e.city),e.state].filter(Boolean).join(", ")]}),t&&n.jsxs("button",{type:"button",onClick:t,className:"ml-auto inline-flex items-center gap-1 hover:text-white",title:"Remove lead",children:[n.jsx(Me,{className:"w-3.5 h-3.5"})," Change"]})]})}function yl({label:e,children:t}){return n.jsxs("div",{className:"flex items-start gap-3 px-4 py-2",style:{borderBottom:`1px solid ${cn}`},children:[n.jsx("span",{className:"w-16 shrink-0 pt-1.5 text-[11.5px]",style:{color:"#64748b"},children:e}),n.jsx("div",{className:"flex-1 min-w-0",children:t})]})}function pW({init:e,onClose:t,onSent:r}){const a=iu(F.mailboxNode.send),s=iu(F.mailboxNode.saveDraft),i=iu(F.mailboxNode.deleteDraft),o=te(F.mailbox.generateUploadUrl),c=ie(F.mailbox.getLead,e.leadKey?{leadKey:e.leadKey}:"skip"),[d,u]=y.useState(null),[h,m]=y.useState((e.to??[]).join(", ")),[p,b]=y.useState((e.cc??[]).join(", ")),[w,x]=y.useState(!!e.cc?.length),[g,j]=y.useState(e.subject??""),[S,_]=y.useState(e.bodyText??""),[N,C]=y.useState(e.templateKey??""),[A,P]=y.useState(!0),[O,E]=y.useState(""),[$,M]=y.useState([]),[R,B]=y.useState(!1),[D,U]=y.useState(e.draftMessageId),H=y.useRef(null),K=y.useRef(null),z=!!e.replyToMessageId;y.useEffect(()=>{c&&!d&&u(c)},[c,d]);const X=(ee,Y,je,ke=!1)=>{const Le=Wu.find(ot=>ot.key===ee);if(!Le||S.trim()&&(!H.current||H.current.body!==S)&&!ke&&!window.confirm("Replace what you've written with this template?"))return;const at=dW(Le,Y,je);z||j(at.subject),_(at.body),H.current={subject:at.subject,body:at.body},C(ee)},G=ee=>{u(ee);const Y=ee.emails[0]?.email??"";if(m(Y),z)return;const je=sW(ee.leadType);X(je.key,ee,Y,!S.trim()||H.current?.body===S)},Q=ee=>{m(ee),N&&H.current?.body===S&&X(N,d,ee,!0)},re=()=>({to:h.split(/[,;]+/).map(ee=>ee.trim()).filter(Boolean),cc:p.split(/[,;]+/).map(ee=>ee.trim()).filter(Boolean),subject:g,bodyText:S,threadId:e.threadId,replyToMessageId:e.replyToMessageId,draftMessageId:D,leadKey:d?.leadKey,leadType:d?.leadType,leadName:d?d.name:void 0,templateKey:N||void 0,attachmentIds:$.length?$:void 0}),ce=async()=>{const ee=re();if(!ee.to.length)return W.error("Add a recipient.");if(!(!ee.subject.trim()&&!window.confirm("Send without a subject?"))){E("send");try{const Y=await a({...ee,track:A});W.success("Email sent from [email protected]"),r(Y.threadId)}catch(Y){W.error(Y?.message?.replace(/^.*Uncaught Error: /,"").split(` 165`)[0]??"Send failed")}finally{E("")}}},fe=async()=>{E("draft");try{const{attachmentIds:ee,...Y}=re(),je=await s(Y);W.success("Draft saved to partnerships@ Drafts"),r(je.threadId)}catch(ee){W.error(ee?.message?.replace(/^.*Uncaught Error: /,"").split(` 166`)[0]??"Could not save draft")}finally{E("")}},me=async()=>
166{if(D){if(!window.confirm("Delete this draft from partnerships@?"))return;E("discard");try{await i({messageId:D}),U(void 0)}finally{E("")}}else if(S.trim()&&H.current?.body!==S&&!window.confirm("Discard this email?"))return;t()},pe=async ee=>{if(ee?.length){B(!0);try{for(const Y of Array.from(ee)){if(Y.size>15*1024*1024){W.error(`${Y.name} is over 15 MB`);continue}const je=await o({}),ke=await fetch(je,{method:"POST",headers:{"Content-Type":Y.type||"application/octet-stream"},body:Y}),{storageId:Le}=await ke.json();M(Ge=>[...Ge,{storageId:Le,filename:Y.name,contentType:Y.type||"application/octet-stream",size:Y.size}])}}catch{W.error("Upload failed")}finally{B(!1)}}},Re=h.split(/[,;]+/)[0]?.trim()??"",J=d?.emails.filter(ee=>ee.email.toLowerCase()!==Re.toLowerCase())??[],ae=d?.emails.find(ee=>ee.email.toLowerCase()===Re.toLowerCase())?.label,ue=Wu.filter(ee=>!d||ee.leadType===d.leadType||ee.leadType==="any");return n.jsxs("div",{className:"flex flex-col min-h-0 h-full",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 shrink-0",style:{borderBottom:`1px solid ${cn}`,background:Vu},children:[n.jsxs("b",{className:"flex items-center gap-2 text-white text-[14px]",children:[n.jsx(Sn,{className:"w-4 h-4",style:{color:mn}}),z?"Reply":D?"Edit draft":"New email"]}),n.jsx("button",{type:"button",onClick:t,title:"Close",style:{color:"#64748b"},className:"hover:text-white",children:n.jsx(Me,{className:"w-4 h-4"})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[!z&&n.jsxs("div",{className:"px-4 py-3",style:{borderBottom:`1px solid ${cn}`},children:[n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-2",style:{color:"#64748b"},children:"Email a lead"}),d?n.jsx(jN,{lead:d,onClear:()=>u(null)}):n.jsx(HP,{onPick:G,autoFocus:!e.to?.length}),d&&d.emails.length===0&&n.jsx("div",{className:"mt-2 text-[11.5px]",style:{color:"#f59e0b"},children:"This lead has no email on file. Type an address in the To line."})]}),z&&d&&n.jsx("div",{className:"px-4 py-3",style:{borderBottom:`1px solid ${cn}`},children:n.jsx(jN,{lead:d})}),n.jsx(yl,{label:"From",children:n.jsxs("div",{className:"pt-1 text-[13px]",children:[n.jsx("b",{className:"text-white",children:"[email protected]"}),n.jsxs("span",{className:"text-[11px]",style:{color:"#64748b"},children:[" ","· replies come back to this Mailbox"]})]})}),n.jsxs(yl,{label:"To",children:[n.jsx("input",{value:h,onChange:ee=>m(ee.target.value),placeholder:"[email protected]",className:"w-full bg-transparent py-1 text-[13px] text-white placeholder-[#475569] focus:outline-none"}),(ae||J.length>0)&&n.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[11px] mt-0.5",children:[ae&&n.jsx("span",{style:{color:"#64748b"},children:ae}),J.slice(0,4).map(ee=>n.jsxs("button",{type:"button",onClick:()=>Q(ee.email),className:"hover:underline",style:{color:Ur},children:["Switch to ",ee.label.toLowerCase(),": ",ee.email]},ee.email))]}),!w&&n.jsx("button",{type:"button",onClick:()=>x(!0),className:"text-[11px] hover:underline mt-0.5",style:{color:"#64748b"},children:"+ Add CC"})]}),w&&n.jsx(yl,{label:"CC",children:n.jsx("input",{value:p,onChange:ee=>b(ee.target.value),placeholder:"Separate addresses with commas",className:"w-full bg-transparent py-1 text-[13px] text-white placeholder-[#475569] focus:outline-none"})}),!z&&n.jsx(yl,{label:"Template",children:n.jsxs("div",{className:"relative inline-block",children:[n.jsxs("select",{value:N,onChange:ee=>X(ee.target.value,d,Re),className:"appearance-none pl-3 pr-8 py-1.5 rounded-md text-[12.5px] text-white focus:outline-none",style:{background:"#1e293b",border:"1px solid #2a3550"},children:[n.jsx("option",{value:"",children:"Choose a templateâ¦"}),ue.map(ee=>n.jsx("option",{value:ee.key,children:ee.name},ee.key))]}),n.jsx(zc,{className:"w-3.5 h-3.5 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none",style:{color:"#94a3b8"}})]})}),n.jsx(yl,{label:"Subject",children:n.jsx("input",{value:g,onChange:ee=>j(ee.target.value),placeholder:z?"Re: â¦":"Subject",className:"w-full bg-transparent py-1 text-[13px] text-white placeholder-[#47
1665569] focus:outline-none"})}),n.jsx("textarea",{value:S,onChange:ee=>_(ee.target.value),placeholder:d||z?"Write your emailâ¦":"Pick a lead above to fill in a template, or just start typingâ¦",className:"w-full bg-transparent px-4 py-3 text-[13.5px] leading-relaxed text-[#e2e8f0] placeholder-[#475569] focus:outline-none resize-none",style:{minHeight:320}}),n.jsxs("div",{className:"px-4 pb-3 text-[11px]",style:{color:"#64748b"},children:["Kameron's email signature is added automatically.",z?" The earlier message is quoted below it.":""]}),$.length>0&&n.jsx("div",{className:"px-4 pb-3 flex gap-2 flex-wrap",children:$.map(ee=>n.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-[11.5px]",style:{background:"#1e293b",color:"#cbd5e1"},children:[n.jsx(fu,{className:"w-3 h-3"})," ",ee.filename,n.jsx("button",{type:"button",onClick:()=>M(Y=>Y.filter(je=>je.storageId!==ee.storageId)),style:{color:"#64748b"},children:n.jsx(Me,{className:"w-3 h-3"})})]},ee.storageId))})]}),n.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 py-2.5 shrink-0 flex-wrap",style:{borderTop:`1px solid ${cn}`,background:Vu},children:[n.jsxs("div",{className:"flex items-center gap-3 text-[11.5px]",style:{color:"#94a3b8"},children:[n.jsx("input",{ref:K,type:"file",multiple:!0,className:"hidden",onChange:ee=>pe(ee.target.files)}),n.jsxs("button",{type:"button",onClick:()=>K.current?.click(),className:"inline-flex items-center gap-1 hover:text-white",disabled:R,children:[R?n.jsx(gt,{className:"w-3.5 h-3.5 animate-spin"}):n.jsx(fu,{className:"w-3.5 h-3.5"})," Attach"]}),n.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",title:"Logs opens and link clicks for this email",children:[n.jsx("input",{type:"checkbox",checked:A,onChange:ee=>P(ee.target.checked),className:"accent-[#d4a843]"}),"Track opens & clicks"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(er,{onClick:me,disabled:!!O,children:[O==="discard"?n.jsx(gt,{className:"w-3.5 h-3.5 animate-spin"}):null,D?"Delete draft":"Discard"]}),n.jsxs(er,{onClick:fe,disabled:!!O,children:[O==="draft"?n.jsx(gt,{className:"w-3.5 h-3.5 animate-spin"}):null,"Save draft"]}),n.jsxs(er,{variant:"gold",onClick:ce,disabled:!!O||R,children:[O==="send"?n.jsx(gt,{className:"w-3.5 h-3.5 animate-spin"}):n.jsx(si,{className:"w-3.5 h-3.5"}),"Send"]})]})]})]})}function xW({html:e}){const t=y.useRef(null),[r,a]=y.useState(120),s=y.useMemo(()=>`<!doctype html><html><head><meta charset="utf-8"><base target="_blank"><style>html,body{margin:0;padding:14px 16px;background:#fff;color:#1f2937;font-family:Arial,Helvetica,sans-serif;font-size:14px;line-height:1.5;word-wrap:break-word}img{max-width:100%;height:auto}blockquote{margin-left:4px}table{max-width:100%}</style></head><body>${e}</body></html>`,[e]),i=()=>{const o=t.current?.contentDocument;o?.body&&a(Math.min(4e3,Math.max(60,o.documentElement.scrollHeight+4)))};return n.jsx("iframe",{ref:t,title:"email",srcDoc:s,sandbox:"allow-same-origin allow-popups allow-popups-to-escape-sandbox",onLoad:()=>{i(),setTimeout(i,400),setTimeout(i,1500)},className:"w-full rounded-lg",style:{height:r,border:0,background:"#fff"}})}function gW({t:e}){return e?n.jsxs("div",{className:"flex items-center gap-3 flex-wrap text-[11px] mt-2",style:{color:"#64748b"},children:[e.opens>0?n.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold",style:{color:Ur},children:[n.jsx(Wn,{className:"w-3.5 h-3.5"})," Opened ",e.opens," time",e.opens===1?"":"s",e.lastOpenAt?n.jsxs("span",{className:"font-normal",style:{color:"#64748b"},children:[" · last ",qu(e.lastOpenAt)]}):null]}):n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Wn,{className:"w-3.5 h-3.5"})," Not opened yet (or images blocked)"]}),e.clicks>0&&n.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold",style:{color:"#a855f7"},children:[n.jsx(YC,{className:"w-3.5 h-3.5"})," ",e.clicks," link click",e.clicks===1?"":"s"]}),e.autoOpens>0&&n.jsxs("span",{title:"Opens from Apple Mail privacy, spam scanners, or within seconds of sending. Not counted.",children:[e.autoOpens," auto-open",e.autoOpens===1?"":"s"," ignored"]})]}):null}
166function bW({m:e,expanded:t,onToggle:r,onEditDraft:a}){if(e.notice&&!t)return n.jsxs("button",{type:"button",onClick:r,className:"w-full text-left flex items-center gap-2 py-1.5 text-[11.5px]",style:{color:"#64748b",borderBottom:"1px solid #1a2233"},children:[n.jsx(Wn,{className:"w-3.5 h-3.5 shrink-0"}),n.jsxs("span",{className:"truncate",children:["Mailsuite alert: ",e.subject]}),n.jsx("span",{className:"ml-auto whitespace-nowrap shrink-0",children:qu(e.date)})]});const s=e.outbound?Hc(e.sentByAdmin):void 0,i=e.outbound?e.sentByName??e.fromName??"VET-TO-LEO":e.fromName||e.fromEmail,o=(i||"?").split(/\s+/).map(d=>d[0]).join("").slice(0,2).toUpperCase(),c=e.to.map(d=>Kv(d).name).join(", ");return n.jsxs("div",{className:"py-3",style:{borderBottom:"1px solid #1a2233"},children:[n.jsxs("button",{type:"button",onClick:r,className:"w-full text-left flex gap-3",children:[s?.photo?n.jsx("img",{src:s.photo,alt:"",className:"w-8 h-8 rounded-full object-cover shrink-0",style:{border:"1px solid #334155"}}):n.jsx("span",{className:"w-8 h-8 rounded-full shrink-0 flex items-center justify-center text-[11px] font-bold",style:e.outbound?{background:`${mn}25`,color:mn,border:`1px solid ${mn}55`}:{background:"#1e293b",color:"#94a3b8",border:"1px solid #334155"},children:o}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[n.jsxs("span",{className:"min-w-0 truncate",children:[n.jsx("b",{className:"text-white text-[13px]",children:i}),e.outbound&&n.jsx("span",{className:"ml-1.5 px-1.5 py-px rounded-[5px] text-[9.5px] font-bold",style:{color:"#a855f7",border:"1px solid #a855f755",background:"#a855f714"},children:"TEAM"}),e.isDraft&&n.jsx("span",{className:"ml-1.5 px-1.5 py-px rounded-[5px] text-[9.5px] font-bold",style:{color:"#f59e0b",border:"1px solid #f59e0b55",background:"#f59e0b14"},children:"DRAFT"}),n.jsx("span",{className:"text-[11.5px] ml-1.5",style:{color:"#64748b"},children:e.outbound?`to ${c||"(no recipient)"}`:`<${e.fromEmail}>`})]}),n.jsx("span",{className:"text-[11px] whitespace-nowrap shrink-0",style:{color:"#64748b"},children:qu(e.date)})]}),!t&&n.jsx("div",{className:"text-[12px] truncate mt-0.5",style:{color:"#64748b"},children:(e.text||e.snippet||"").replace(/\s+/g," ").slice(0,200)})]})]}),t&&n.jsxs("div",{className:"mt-3 pl-11",children:[e.cc?.length>0&&n.jsxs("div",{className:"text-[11px] mb-2",style:{color:"#64748b"},children:["CC: ",e.cc.join(", ")]}),e.html?n.jsx(xW,{html:e.html}):n.jsx("div",{className:"whitespace-pre-wrap text-[13px] leading-relaxed text-[#e2e8f0]",children:e.text||"(empty message)"}),e.attachments?.length>0&&n.jsx("div",{className:"flex gap-2 flex-wrap mt-3",children:e.attachments.map((d,u)=>d.url?n.jsxs("a",{href:d.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-[11.5px] hover:underline",style:{background:"#1e293b",color:"#cbd5e1"},children:[n.jsx(fu,{className:"w-3 h-3"})," ",d.filename," ",n.jsxs("span",{style:{color:"#64748b"},children:["(",Math.max(1,Math.round(d.size/1024))," KB)"]})]},u):n.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-[11.5px]",style:{background:"#1e293b",color:"#64748b"},children:[n.jsx(fu,{className:"w-3 h-3"})," ",d.filename," (too large, open in Gmail)"]},u))}),e.outbound&&!e.isDraft&&n.jsx(gW,{t:e.tracking}),e.isDraft&&n.jsx("div",{className:"mt-3",children:n.jsxs(er,{variant:"gold",onClick:a,children:[n.jsx(WC,{className:"w-3.5 h-3.5"})," Edit draft"]})})]})]})}function vW({thread:e}){const t=ie(F.mailbox.getLead,e.leadKey?{leadKey:e.leadKey}:"skip"),r=te(F.mailbox.linkThreadToLead),[a,s]=y.useState(!1);if(!e.leadKey)return a?n.jsxs("div",{className:"mt-3 p-3 rounded-lg",style:{background:ga,border:`1px solid ${cn}`},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"#64748b"},children:"Link this conversation to a lead"}),n.jsx("button",{type:"button",onClick:()=>s(!1),style:{color:"#64748b"},children:n.jsx(Me,{className:"w-4 h-4"})})]}),n.jsx(HP,{autoFocus:!0,onPick:async o=>{await r({threadId:e._id,leadKey:o.leadKey}),s(!1)}})]}):n.jsxs("button",{type:"button",onClick:()=>s(!0),className:"mt-3 inline-flex items-center gap-1.5 text-[11.5px] hover:underline",style:{color:"#64748b"},children:[n.jsx(SL,{className:"w-3.5 h-3.5"})," Link to a lead"]});const i=p1(e.leadType);return n.jsxs("div",{className:"mt-3 p-3 rounded-xl flex items-start gap-3",style:{background:ga,border:`1px solid ${i?.color??Ur}40`},children:[n.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center shrink-0",style:{background:`${i?.color??Ur}20`,color:i?.color??Ur},children:n.jsx(Ze,{className:"w-4 h-4"})}),n.jsxs("div",{className:"flex-1 min-w-0 leading-relaxed",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("b",{className:"text-white text-[13px]",children:Sa(t?.name??e.leadName??"")}),n.jsx(_f,{type:e.leadType})]}),t&&n.jsx("div",{className:"text-[11.5px]",style:{color:"#94a3b8"},children:[t.contactName&&`${t.contactName}${t.contactTitle&&!t.contactTitle.startsWith("Served by")?`, ${t.contactTitle}`:""}
166`,[t.city&&Sa(t.city),WP(t.state)||t.state].filter(Boolean).join(", "),t.phone].filter(Boolean).join(" · ")}),n.jsx("div",{className:"text-[11px]",style:{color:"#64748b"},children:[e.handledBy&&`Handled by ${Hc(e.handledBy)?.name??e.handledBy}`,`${e.messageCount} message${e.messageCount===1?"":"s"}`,e.lastInboundAt&&e.lastOutboundAt?`Replied ${qP(e.lastInboundAt)}`:e.lastOutboundAt?"Awaiting reply":null].filter(Boolean).join(" · ")})]}),n.jsx("button",{type:"button",title:"Unlink lead",onClick:()=>r({threadId:e._id,leadKey:void 0}),className:"text-[11px] hover:underline shrink-0",style:{color:"#64748b"},children:"Unlink"})]})}function yW({threadId:e,onCompose:t,onBack:r,onGone:a}){const s=ie(F.mailbox.getThread,{threadId:e}),i=te(F.mailbox.markThreadRead),o=te(F.mailbox.archiveThread),c=te(F.mailbox.trashThread),d=te(F.mailbox.markNotSpam),[u,h]=y.useState(new Set),[m,p]=y.useState(!1);if(y.useEffect(()=>{h(new Set),p(!1)},[e]),y.useEffect(()=>{s?.thread.unread&&i({threadId:e,read:!0}).catch(()=>{})},[s?.thread.unread,e,i]),s===void 0)return n.jsxs("div",{className:"flex items-center justify-center h-full text-sm gap-2",style:{color:"#64748b"},children:[n.jsx(gt,{className:"w-4 h-4 animate-spin"})," Loadingâ¦"]});if(s===null)return n.jsx("div",{className:"p-8 text-sm",style:{color:"#64748b"},children:"This conversation is gone."});const{thread:b,messages:w,events:x}=s,g=w.filter(A=>!A.isDraft&&!A.notice),j=g[g.length-1]??w.filter(A=>!A.isDraft)[w.filter(A=>!A.isDraft).length-1]??w[w.length-1],S=A=>u.has(A._id)||(A._id===j?._id||A.isDraft)&&!A.notice||A.notice&&g.length===0&&A._id===j?._id,_=[...g].reverse().find(A=>!A.outbound)??j,N=()=>{if(!j)return;const A=_&&!_.outbound?[_.fromEmail]:j.to;t({threadId:e,replyToMessageId:j._id,to:A,subject:/^re:/i.test(b.subject)?b.subject:`Re: ${b.subject}`,leadKey:b.leadKey})},C=A=>t({draftMessageId:A._id,threadId:e,replyToMessageId:A.draft?.replyToMessageId,to:A.draft?.to??A.to,cc:A.draft?.cc??A.cc,subject:A.draft?.subject??A.subject,bodyText:A.draft?.bodyText??(A.text||"").split(/\n-- ?\n/)[0],leadKey:A.draft?.leadKey??b.leadKey,templateKey:A.draft?.templateKey});return n.jsxs("div",{className:"flex flex-col min-h-0 h-full",children:[n.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-5 py-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[n.jsx("button",{type:"button",onClick:r,className:"lg:hidden mt-1 shrink-0",style:{color:"#94a3b8"},title:"Back",children:n.jsx(Zr,{className:"w-4 h-4"})}),n.jsx("h2",{className:"text-[17px] font-bold text-white leading-snug break-words",children:b.subject})]}),n.jsxs("div",{className:"flex gap-1.5 shrink-0",children:[b.inSpam&&n.jsxs(er,{title:"Not spam",onClick:async()=>{await d({threadId:e}),W.success("Moved to Inbox"),a()},children:[n.jsx(xn,{className:"w-3.5 h-3.5"})," Not spam"]}),b.inInbox&&n.jsx(er,{title:"Archive (remove from Inbox)",onClick:async()=>{await o({threadId:e}),W.success("Archived"),a()},children:n.jsx(FC,{className:"w-3.5 h-3.5"})}),n.jsx(er,{title:"Mark unread",onClick:async()=>{await i({threadId:e,read:!1}),a()},children:n.jsx(ML,{className:"w-3.5 h-3.5"})}),n.jsx(er,{title:"Move to Trash",onClick:async()=>{window.confirm("Move this conversation to Trash in partnerships@?")&&(await c({threadId:e}),W.success("Moved to Trash"),a())},children:n.jsx(_n,{className:"w-3.5 h-3.5"})})]})]}),n.jsx(vW,{thread:b}),n.jsx("div",{className:"mt-2",children:w.map(A=>n.jsx(bW,{m:A,expanded:S(A),onEditDraft:()=>C(A),onToggle:()=>h(P=>{const O=new Set(P);return O.has(A._id)?O.delete(A._id):O.add(A._id),O})},A._id))}),x.length>0&&n.jsxs("div",{className:"mt-3",children:[n.jsxs("button",{type:"button",onClick:()=>p(A=>!A),className:"text-[11.5px] font-semibold hover:underline inline-flex items-center gap-1",style:{color:"#94a3b8"},children:[n.jsx(zc,{className:`w-3.5 h-3.5 transition-transform ${m?"rotate-180":""}`})," Tracking activity (",x.length,")"]}),m&&n.jsx("div",{className:"mt-2 rounded-lg p-2.5 text-[11.5px] space-y-1",style:{background:ga,border:`1px solid ${cn}`},children:x.map((A,P)=>n.jsxs("div",{className:"flex gap-2",style:{color:A.auto?"#475569":"#cbd5e1"},children:[n.jsx("span",{className:"w-36 shrink-0",style:{color:"#64748b"},children:qu(A.at)}),n.jsxs("span",{children:[A.kind==="open"?"Opened":`Clicked ${A.url??"a link"}`,A.auto?" (automatic, not counted)":""]})]},P))})]})]}),j&&!b.inSpam&&n.jsx("div",{className:"px-5 py-3 shrink-0",style:{borderTop:`1px solid ${cn}`},children:n.jsxs("button",{type:"button",onClick:N,className:"w-full text-left px-4 py-3 rounded-lg text-[13px] flex items-center gap-2 hover:border-[#00b4ff]",style:{background:ga,border:"1px solid #2a3550",color:"#64748b"},children:[n.jsx(XC,{className:"w-4 h-4"})," Reply from [email protected]â¦"]})})]})}function jW(){const[e,t]=y.useState("inbox"),[r,a]=y.useState(""),[s,i]=y.useState(null),[o,c]=y.useState(null),[d,u]=y.useState(0),h=p=>{c(p),u(b=>b+1)},m=!!o||!!s;return n.jsxs("div",{className:"rounded-xl overflow-hidden grid grid-cols-1 lg:grid-cols-[200px_minmax(300px,380px)_minmax(0,1fr)]",style:{background:Vu,border:`1px solid ${cn}`,height:"calc(100vh - 290px)",minHeight:640},children:[n.jsx("div",{className:"hidden lg:flex flex-col min-h-0",children:n.jsx(hW,{folder:e,setFolder:p=>{t(p),i(null)},leadType:r,setLeadType:a,onCompose:()=>h({})})}),n.jsxs("div",{className:`${m?"hidden lg:flex":"flex"} flex-col min-h-0`,children:[n.jsxs("div",{className:"lg:hidden flex gap-1.5 p-2 overflow-x-auto shrink-0",style:{borderBottom:`1px solid ${cn}`},children:[n.jsxs(er,{variant:"gold",onClick:()=>h({}),children:[n.jsx(Cv,{className:"w-3.5 h-3.5"})," Compose"]}),["inbox","sent","drafts","spam","all"].map(p=>n.jsx("button",{type:"button",onClick:()=>t(p),className:"px-2.5 py-1 rounded-md text-[11.5px] font-semibold capitalize whitespace-nowrap",style:{background:e===p?`${mn}20`:"#0d1321",color:e===p?mn:"#94a3b8",border:`1px solid ${e===p?`${mn}80`:cn}`},children:p==="all"?"All Mail":p},p))]}),n.jsx(mW,{folder:e,leadType:r,selected:s,onOpen:p=>{c(null),i(p)}})]}),n.jsx("div",{className:`${m?"flex":"hidden lg:flex"} flex-col min-h-0`,children:o?n.jsx(pW,{init:o,onClose:()=>c(null),onSent:p=>{c(null),i(p)}},d):s?n.jsx(yW,{threadId:s,onCompose:h,onBack:()=>i(null),onGone:()=>i(null)}):n.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-8",style:{color:"#64748b"},children:[n.jsx(Sn,{className:"w-10 h-10 mb-3",style:{color:"#334155"}}),n.jsx("div",{className:"text-sm font-semibold text-[#94a3b8]",children:"Pick a conversation, or start a new email"}),n.jsx("div",{className:"text-[12px] mt-1 max-w-sm",children:"Everything here is the real [email protected] Gmail. Sending from here puts the email in Gmail's Sent folder too."}),n.jsx("div",{className:"mt-4",children:n.jsxs(er,{variant:"gold",onClick:()=>h({}),children:[n.jsx(Cv,{className:"w-3.5 h-3.5"})," Compose"]})})]})})]})}function wW(){return ie(F.mailbox.folderCounts)?.inboxUnread??0}const x1="#00b4ff",oa="#d4a843",NW={participating:x1,member:oa,platinum:"#8b5cf6"},_W={participating:Be,member:Za,platinum:Nn};function g1(e){const t=Date.now()-e,r=Math.floor(t/6e4),a=Math.floor(t/36e5),s=Math.floor(t/864e5);return r<1?"Just now":r<60?`${r}m ago`:a<24?`${a}h ago`:s<7?`${s}d ago`:s<30?`${Math.floor(s/7)}w ago`:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function SW(e){const t={};for(const r of e){const s=new Date(r._creationTime).toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"America/Denver"});
166t[s]||(t[s]=[]),t[s].push(r)}return t}const Bt="#a855f7";function CW({event:e}){const t=String(e.actorName||"?").split(/\s+/).map(a=>a[0]).join("").slice(0,2).toUpperCase(),r=Hc(e.actorEmail)?.photo;return n.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b30"},children:[r?n.jsx("img",{src:r,alt:e.actorName,className:"w-10 h-10 rounded-full object-cover shrink-0",style:{border:`1px solid ${Bt}40`}}):n.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center shrink-0 text-xs font-bold",style:{background:`${Bt}18`,border:`1px solid ${Bt}40`,color:Bt},children:t}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{className:"text-sm font-semibold text-white break-words",children:[e.actorName," ",n.jsx("span",{style:{color:"#94a3b8",fontWeight:500},children:e.action.charAt(0).toLowerCase()+e.action.slice(1)}),e.targetName?n.jsxs(n.Fragment,{children:[" · ",e.targetName]}):null]}),n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${Bt}15`,color:Bt,border:`1px solid ${Bt}25`},children:[n.jsx(JC,{className:"w-3 h-3"}),"Team"]}),n.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold",style:{background:"#1e293b",color:"#94a3b8"},children:e.area})]}),e.fields?.length>0&&n.jsxs("p",{className:"text-[12px] mt-0.5 break-words",style:{color:"#64748b"},children:["Fields: ",e.fields.join(", ")]})]}),n.jsxs("div",{className:"text-right shrink-0",children:[n.jsx("div",{className:"text-[11px] font-medium",style:{color:"#64748b"},children:g1(e._creationTime)}),n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"#475569"},children:new Date(e._creationTime).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",timeZone:"America/Denver"})})]})]})}function AW({selected:e,onSelect:t,stats:r}){const a=ie(F.presence.adminTeamStatus),s=pi(),i=new Map((a??[]).map(c=>[c.email,c])),o=Zi.filter(c=>Jk(i.get(c.email)?.lastSeenAt,s)).length;return n.jsxs("div",{className:"rounded-xl p-4 space-y-2",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap px-1 pb-1",children:[n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"#64748b"},children:"Admin Team"}),n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px]",style:{color:o?"#22c55e":"#64748b"},children:[n.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:o?"#22c55e":"#475569"}}),a===void 0?"Checking...":`${o} of ${Zi.length} online now`]})]}),Zi.map(c=>{const d=e===c.email,u=r?.get(c.email);return n.jsxs("button",{type:"button",onClick:()=>t(d?"":c.email),"aria-pressed":d,className:"w-full text-left flex flex-wrap items-center gap-x-3 gap-y-1.5 px-4 py-3 rounded-lg transition-all",style:{background:d?`${Bt}14`:"#0a0e17",border:`1px solid ${d?`${Bt}80`:"#1e293b"}`,boxShadow:d?`0 0 0 1px ${Bt}40, 0 0 18px ${Bt}25`:"none"},children:[c.photo?n.jsx("img",{src:c.photo,alt:c.name,className:"w-9 h-9 rounded-full object-cover shrink-0"}):n.jsx("div",{className:"w-9 h-9 rounded-full shrink-0 bg-[#1e293b] border border-[#334155] flex items-center justify-center text-[#94a3b8] text-xs font-semibold",children:_0(c.name)}),n.jsxs("div",{className:"flex flex-col flex-1 min-w-[10rem]",children:[n.jsxs("span",{className:"text-white text-sm font-semibold flex items-center gap-2 flex-wrap",children:[c.name,d&&n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${Bt}20`,color:Bt,border:`1px solid ${Bt}40`},children:"Viewing activity"})]}),n.jsx("span",{className:"text-[#94a3b8] text-xs break-words",children:c.email}),n.jsx("span",{className:"text-[11px] mt-0.5",style:{color:"#64748b"},children:r===void 0?" ":u&&u.count>0?`${u.count} action${u.count===1?"":"s"} logged · last: ${u.lastAction}${u.lastAt?` (${g1(u.lastAt)}
166)`:""}`:"No actions logged yet"})]}),n.jsx("div",{className:"w-full pl-12 sm:w-auto sm:pl-0 sm:text-right",children:n.jsx(xi,{status:a===void 0?void 0:i.get(c.email)??null,now:s,showLogin:!0})})]},c.email)}),n.jsx("p",{className:"text-[11px] px-1 pt-1",style:{color:"#475569"},children:"Click an admin to see only their activity. Click them again to go back to everyone."})]})}function kW({event:e}){if(e.entityType==="admin")return n.jsx(CW,{event:e});const t=e.entityType==="agency",r=e.entityType==="veteran",a=NW[e.tier]||x1,s=_W[e.tier]||Be;return n.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl transition-colors hover:bg-[#0d1321]",style:{borderBottom:"1px solid #1e293b30"},children:[n.jsxs("div",{className:"relative shrink-0",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:"",className:"w-10 h-10 rounded-xl object-contain bg-white/10 p-0.5 border border-[#1e293b]"}):r?n.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"#22c55e15",border:"1px solid #22c55e30"},children:n.jsx(Sv,{className:"w-5 h-5",style:{color:"#22c55e"}})}):n.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center",style:{background:`${a}15`,border:`1px solid ${a}30`},children:n.jsx(Rt,{className:"w-5 h-5",style:{color:a}})}),n.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2",style:{borderColor:"#111827",background:e.status==="active"?"#22c55e":e.status==="pending"?"#f59e0b":"#ef4444"}})]}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-semibold text-white truncate",children:e.title}),t&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:`${a}15`,color:a,border:`1px solid ${a}25`},children:[n.jsx(s,{className:"w-3 h-3"}),e.tier==="platinum"?"Featured":e.tier==="member"?"Member":"Participating"]}),r&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-bold uppercase",style:{background:"#22c55e15",color:"#22c55e",border:"1px solid #22c55e25"},children:[n.jsx(Sv,{className:"w-3 h-3"}),"Veteran"]}),n.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold",style:{background:e.status==="active"?"#22c55e12":e.status==="pending"?"#f59e0b12":"#ef444412",color:e.status==="active"?"#22c55e":e.status==="pending"?"#f59e0b":"#ef4444"},children:e.status})]}),e.subtitle&&n.jsx("p",{className:"text-[12px] mt-0.5",style:{color:"#64748b"}
166,children:e.subtitle})]}),n.jsx("div",{className:"text-right shrink-0",children:n.jsx("div",{className:"text-[11px] font-medium",style:{color:"#64748b"},children:g1(e._creationTime)})})]})}function PW(){const e=ie(F.admin.getRecentActivity),[t,r]=y.useState(()=>new URLSearchParams(window.location.search).get("tab")==="mailbox"?"mailbox":"all"),a=wW(),[s,i]=y.useState(""),[o,c]=y.useState(""),d=ie(F.adminAudit.list,{actorEmail:o||void 0,limit:500}),u=ie(F.adminAudit.list,t==="admin_team"?{limit:1e3}:"skip"),h=y.useMemo(()=>{if(!u)return;const S=new Map;for(const _ of u.items){const N=S.get(_.actorEmail);if(N)N.count++;else{const C=_.action.charAt(0).toLowerCase()+_.action.slice(1);S.set(_.actorEmail,{count:1,lastAt:_._creationTime,lastAction:_.targetName?`${C} · ${_.targetName}`:C})}}return S},[u]),m=Zi.find(S=>S.email===o),p=y.useMemo(()=>(d?.items??[]).map(S=>({...S,type:"admin_action",entityType:"admin",status:"",title:`${S.actorName} ${S.action}`,subtitle:[S.area,S.targetName,S.fields.join(" ")].filter(Boolean).join(" ")})),[d]),b=e,w=y.useMemo(()=>{if(!e)return[];let S=t==="admin_team"?p:t==="all"?[...e,...p].sort((_,N)=>N._creationTime-_._creationTime):e;if(t==="new_member"&&(S=S.filter(_=>_.type==="new_member")),t==="new_participating"&&(S=S.filter(_=>_.type==="new_participating")),t==="new_veteran"&&(S=S.filter(_=>_.type==="new_veteran")),s){const _=s.toLowerCase();S=S.filter(N=>N.title.toLowerCase().includes(_)||N.subtitle?.toLowerCase().includes(_))}return S},[e,p,t,s,o]),x=y.useMemo(()=>SW(w),[w]),g=Object.keys(x),j=y.useMemo(()=>{if(!b)return{agencies:0,members:0,veterans:0,thisWeek:0};const S=Date.now()-7*864e5;return{agencies:b.filter(_=>_.entityType==="agency").length,members:b.filter(_=>_.type==="new_member").length,veterans:b.filter(_=>_.entityType==="veteran").length,thisWeek:b.filter(_=>_._creationTime>S).length}},[b]);return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(Hl,{className:"w-6 h-6",style:{color:"#a855f7"}}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Activity Log"})]}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:"New agency signups, member subscriptions, and veteran registrations."})]}),n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Total Agencies",value:j.agencies,color:x1,icon:Rt},{label:"Paying Members",value:j.members,color:oa,icon:Za},{label:"Veterans",value:j.veterans,color:"#22c55e",icon:Sv},{label:"This Week",value:j.thisWeek,color:"#a855f7",icon:At}].map(({label:S,value:_,color:N,icon:C})=>n.jsxs("div",{className:"rounded-xl p-4",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx("div",{className:"flex items-center justify-between mb-2",children:n.jsx(C,{className:"w-4 h-4",style:{color:N}})}),n.jsx("div",{className:"text-2xl font-bold",style:{color:N},children:_}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"#64748b"},children:S})]},S))}),(()=>{const S=({key:P,label:O})=>n.jsx("button",{onClick:()=>r(P),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:t===P?`${oa}20`:"#111827",border:`1px solid ${t===P?`${oa}50`:"#1e293b"}`,color:t===P?oa:"#94a3b8"},children:O},P),_=P=>n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider w-32 shrink-0",style:{color:"#64748b"},children:P}),N=[{key:"all",label:"All Activity"},{key:"new_member",label:"Agency Members"},{key:"new_participating",label:"Participating"},{key:"new_veteran",label:"Veterans"},{key:"admin_team",label:"Admin Team"}],C=[{key:"le_prospects",label:"Law Enforcement"},{key:"academy_prospects",label:"Academies"},{key:"business_prospects",label:"Defense Contractors"},{key:"college_prospects",label:"Colleges & Universities"},{key:"workforce_prospects",label:"State Workforce Agencies"},{key:"tap_prospects",label:"Transition Assistance Programs (TAP)"},{key:"national_guard_prospects",label:"National Guard"},{key:"reserve_prospects",label:"Reserve Component"},{key:"rotc_prospects",label:"ROTC"}],A=C.some(P=>P.key===t);return n.jsxs("div",{className:"space-y-4",children:[!A&&t!=="mailbox"&&n.jsxs("div",{className:"relative",children:[n.jsx(Dt,{className:"w-5 h-5 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none",style:{color:"#94a3b8"}}),n.jsx("input",{type:"text",placeholder:"Search activity by name, branch, rank, city, or state...",value:s,onChange:P=>i(P.target.value),className:"w-full pl-12 pr-11 py-3 rounded-xl text-sm text-white placeholder-[#64748b] bg-[#111827] border border-[#2a3550] focus:border-[#00b4ff] focus:outline-none transition-colors"}),s&&n.jsx("button",{onClick:()=>i(""),className:"absolute right-4 top-1/2 -translate-y-1/2","aria-label":"Clear search",children:n.jsx(Me,{className:"w-4 h-4",style:{color:"#94a3b8"}})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(y0,{className:"w-4 h-4",style:{color:"#64748b"}}),_("Activity"),N.map(S),n.jsxs("button",{onClick:()=>r("mailbox"),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors inline-flex items-center gap-1.5",style:{background:t==="mailbox"?`${oa}20`:"#111827",border:`1px solid ${t==="mailbox"?`${oa}50`:"#1e293b"}`,color:t==="mailbox"?oa:"#94a3b8"},children:[n.jsx(Sn,{className:"w-3.5 h-3.5"}),"Mailbox",a>0&&n.jsx("span",{className:"px-1.5 rounded-full text-[10px] font-extrabold",style:{background:oa,color:"#0a0e17"},children:a>=500?"500+":a})]},"mailbox")]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(_I,{className:"w-4 h-4",style:{color:"#64748b"}}),_("Lead Generation"),C.map(S)]})]})]})})(),t==="admin_team"&&d&&n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(JC,{className:"w-4 h-4",style:{color:Bt}}),[{email:"",name:"Everyone"},...d.actors].map(({email:S,name:_})=>{const N=o===S;return n.jsx("button",{onClick:()=>c(S),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:N?`${Bt}20`:"#111827",border:`1px solid ${N?`${Bt}50`:"#1e293b"}`,color:N?Bt:"#94a3b8"},children:_},S||"all")}),n.jsx("span",{className:"text-[11px] ml-1",style:{color:"#475569"},children:"Every add, edit, delete and approval an admin makes in the console."})]}),t==="admin_team"&&n.jsx(AW,{selected:o,onSelect:c,stats:h}),t==="admin_team"&&n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:Bt},children:m?`${m.name}'s activity`:"Everyone's activity"}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}})]}),t==="mailbox"?n.jsx(jW,{}):t==="le_prospects"?n.jsx($z,{}):t==="academy_prospects"?n.jsx(Wz,{}):t==="business_prospects"?n.jsx(xz,{}):t==="college_prospects"?n.jsx(jz,{}):t==="workforce_prospects"?n.jsx(Cz,{}):t==="tap_prospects"?n.jsx(Oz,{}):t==="national_guard_prospects"?n.jsx(Kz,{}):t==="reserve_prospects"?n.jsx(Qz,{}):t==="rotc_prospects"?n.jsx(aW,{}):b?w.length===0?n.jsxs("div",{className:"rounded-xl p-10 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(Hl,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:t==="admin_team"?s?"No admin actions match this search.":m?`${m.name} hasn't made any logged changes yet. Their adds, edits, deletes and approvals show up here as they happen.`:"No admin actions logged yet. They start showing up as soon as someone makes a change.":"No activity matching this filter."})]}):n.jsx("div",{className:"space-y-6",children:g.map(S=>n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"#475569"},children:S}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsx("div",{className:"text-[11px]",style:{color:"#475569"},children:x[S].length})]}),n.jsx("div",{className:"rounded-xl overflow-hidden",style:{background:"#111827",border:"1px solid #1e293b"},children:x[S].map(_=>n.jsx(kW,{event:_},_._id))})]},S))}):n.jsx("div",{className:"text-center py-12 text-sm",style:{color:"#64748b"},children:"Loading..."})]})}const jl="#d4a843",GP="#00b4ff",po={audit:{icon:Hl,label:"Audit",color:"#3b82f6"},fix:{icon:EI,label:"Fix Applied",color:"#22c55e"},alert:{icon:Dc,label:"Alert",color:"#f59e0b"},deployment:{icon:nI,label:"Deployment",color:"#8b5cf6"},info:{icon:$C,label:"Info",color:"#64748b"}},wN={success:{icon:gn,color:"#22c55e"},warning:{icon:Dc,color:"#f59e0b"},error:{icon:Wo,color:"#ef4444"},info:{icon:$C,color:"#3b82f6"}},TW=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function OW(e){const t=new Date(e),a=new Date().getTime()-t.getTime(),s=Math.floor(a/6e4),i=Math.floor(a/36e5),o=Math.floor(a/864e5);let c;s<1?c="Just now":s<60?c=`${s}m ago`:i<24?c=`${i}h ago`:o<7?c=`${o}d ago`:c=t.toLocaleDateString();const d=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"America/Los_Angeles"}),u=t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"America/Los_Angeles"});return`${c} · ${u} at ${d} PT`}function NN(e){const t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),r=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1,0,0,0,0);return{start:t.getTime(),end:r.getTime()}}function EW(e,t){const r=new Date(e,t,1,0,0,0,0),a=new Date(e,t+1,1,0,0,0,0);return{start:r.getTime(),end:a.getTime()}}function MW(e,t){return new Date(e,t+1,0).getDate()}function LW(e,t){return new Date(e,t,1).getDay()}function _N(e){return`${e.getFullYear()}
166-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}const SN={audit:"#3b82f6",fix:"#22c55e",alert:"#f59e0b",deployment:"#8b5cf6",info:"#64748b"};function IW(e){const t=e.type;if(t==="fix"||t==="deployment"){const r=new Date(e._creationTime),a=parseInt(r.toLocaleString("en-US",{hour:"numeric",hour12:!1,timeZone:"America/Denver"}));return a>=8&&a<20?{name:"Kameron",photo:"/kameron-profile.jpg"}:{name:"Astik",photo:"/astik-profile.png"}}return{name:"System",photo:"/nec-globe.png"}}function CN({update:e}){const t=po[e.type]||po.info,r=wN[e.severity]||wN.info,a=t.icon,s=r.icon,i=IW(e);return n.jsx("div",{className:"rounded-xl p-4 transition-colors hover:border-[#2a3344]",style:{background:"#111827",border:"1px solid #1e293b",borderLeft:`3px solid ${r.color}`},children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("img",{src:i.photo,alt:i.name,className:"w-9 h-9 rounded-full object-cover shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-sm font-bold text-white",children:i.name}),n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",style:{background:`${t.color}18`,color:t.color,border:`1px solid ${t.color}30`},children:[n.jsx(a,{className:"w-3 h-3"}),t.label]}),e.autoFixed&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold",style:{background:"#22c55e14",color:"#22c55e",border:"1px solid #22c55e30"},children:[n.jsx(gn,{className:"w-3 h-3"}),"Auto-Fixed"]}),e.page&&n.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full",style:{background:"#1e293b",color:"#94a3b8"},children:e.page})]}),n.jsxs("div",{className:"flex items-start gap-2 mt-1.5",children:[n.jsx(s,{className:"w-4 h-4 shrink-0 mt-0.5",style:{color:r.color}}),n.jsx("h3",{className:"text-sm font-semibold text-white",children:e.title})]}),n.jsx("p",{className:"text-[13px] mt-1.5 ml-6 leading-relaxed",style:{color:"#94a3b8"},children:e.description}),e.details&&n.jsxs("details",{className:"mt-2 ml-6",children:[n.jsx("summary",{className:"text-xs cursor-pointer select-none",style:{color:GP},children:"View details"}),n.jsx("div",{className:"mt-2 p-3 rounded-lg text-xs space-y-1",style:{background:"#0a0e17",color:"#94a3b8",border:"1px solid #1e293b",maxHeight:300,overflowY:"auto"},children:e.details.split(` 167`).map((o,c)=>n.jsx("div",{className:"flex items-start gap-2",children:o.trim()?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"shrink-0 mt-px",children:"â "}),n.jsx("span",{children:o.trim()})]}):null},c))})]}),n.jsx("div",{className:"mt-2 ml-6 text-[11px]",style:{color:"#475569"},children:OW(e._creationTime)})]})]})})}function RW({update:e}){const t=po[e.type]||po.info;return n.jsxs("div",{className:"w-full text-left px-2 py-1 rounded text-xs truncate",style:{background:`${t.color}15`,color:t.color,border:`1px solid ${t.color}25`},children:[n.jsx("span",{className:"mr-1",children:"â"}),e.title.length>22?e.title.slice(0,22)+"...":e.title]})}function DW(){const[e,t]=y.useState("all"),r=new Date,[a,s]=y.useState(r.getFullYear()),[i,o]=y.useState(r.getMonth()),[c,d]=y.useState(null),u=y.useMemo(()=>NN(new Date),[]),h=_N(new Date),m=ie(F.systemUpdates.listByDateRange,{startTime:u.start,endTime:u.end,type:e==="all"?void 0:e,limit:25}),p=y.useMemo(()=>EW(a,i),[a,i]),b=ie(F.systemUpdates.listByDateRange,{startTime:p.start,endTime:p.end,limit:500}),w=y.useMemo(()=>{if(!c)return null;const[M,R,B]=c.split("-").map(Number),D=new Date(M,R-1,B);return NN(D)},[c]),x=ie(F.systemUpdates.listByDateRange,w?{startTime:w.start,endTime:w.end,type:e==="all"?void 0:e,limit:100}:"skip"),g=ie(F.systemUpdates.getStats),j=y.useMemo(()=>{if(!b)return{};const M={};for(const R of b){const B=new Date(R._creationTime),D=_N(B);M[D]||(M[D]=[]),M[D].push(R)}return M},[b]),S=MW(a,i),_=LW(a,i),N=Math.ceil((_+S)/7)*7,C=new Date(a,i).toLocaleDateString("en-US",{month:"long",year:"numeric"});function A(){i===0?(s(a-1),o(11)):o(i-1),d(null)}function P(){i===11?(s(a+1),o(0)):o(i+1),d(null)}function O(){const M=new Date;s(M.getFullYear()),o(M.getMonth()),d(null)}function E(M){d(c===M?null:M)}function $(M){const[R,B,D]=M.split("-").map(Number);return new Date(R,B-1,D).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold",children:"System Updates"}),n.jsx("p",{className:"text-sm mt-1",style:{color:"#64748b"},children:"Automated audit results, fixes, and deployment history"})]}),n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-lg",style:{background:"#22c55e14",border:"1px solid #22c55e30"},children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),n.jsx("span",{className:"text-xs font-semibold",style:{color:"#22c55e"},children:"Monitoring Active"})]})]}),g&&n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Last 24h",value:g.last24h,color:GP},{label:"Last 7 Days",value:g.last7d,color:jl},{label:"Fixes Applied",value:g.fixes,color:"#22c55e"},{label:"Total Audits",value:g.audits,color:"#8b5cf6"}].map(({label:M,value:R,color:B})=>n.jsxs("div",{className:"rounded-xl p-4",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx("div",{className:"text-2xl font-bold",style:{color:B},children:R}),n.jsx("div",{className:"text-xs mt-1",style:{color:"#64748b"},children:M})]},M))}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(y0,{className:"w-4 h-4",style:{color:"#64748b"}}),[{key:"all",label:"All"},{key:"audit",label:"Audits"},{key:"fix",label:"Fixes"},{key:"alert",label:"Alerts"},{key:"deployment",label:"Deployments"},{key:"info",label:"Info"}].map(({key:M,label:R})=>n.jsx("button",{onClick:()=>t(M),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{background:e===M?`${jl}20`:"#111827",border:`1px solid ${e===M?`${jl}50`:"#1e293b"}`,color:e===M?jl:"#94a3b8"},children:R},M))]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"#64748b"},children:"Today"}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsx("div",{className:"text-xs",style:{color:"#475569"},children:m?`${m.length} update${m.length!==1?"s":""}`:"Loading..."})]}),m?m.length===0?n.jsxs("div",{className:"rounded-xl p-8 text-center",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(hu,{className:"w-8 h-8 mx-auto mb-2",style:{color:"#374151"}}),n.jsx("p",{className:"text-sm",style:{color:"#64748b"},children:"No updates today yet. Next audit runs shortly."})]}):n.jsx("div",{className:"space-y-3 overflow-y-auto pr-1",style:{maxHeight:660},children:m.map(M=>n.jsx(CN,{update:M},M._id))}):n.jsx("div",{className:"text-center py-8 text-sm",style:{color:"#64748b"},children:"Loading..."})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"#64748b"},children:"Update Archive"}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Cr,{className:"w-5 h-5",style:{color:jl}}),n.jsx("button",{type:"button",onClick:A,className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Xh,{className:"w-5 h-5"})}),n.jsx("h2",{className:"text-lg font-semibold text-white min-w-[180px] text-center",children:C}),n.jsx("button",{type:"button",onClick:P,className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Ya,{className:"w-5 h-5"})}),n.jsx("button",{type:"button",onClick:O,className:"px-3 py-1.5 rounded-lg text-xs font-medium border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#47
1675569] transition-colors ml-1",children:"Today"})]}),n.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:Object.entries(SN).map(([M,R])=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:R}}),n.jsx("span",{className:"text-[10px] text-[#94a3b8] capitalize",children:M})]},M))})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsx("div",{className:"lg:col-span-2",children:n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] overflow-hidden",children:[n.jsx("div",{className:"grid grid-cols-7 border-b border-[#1e293b]",children:TW.map(M=>n.jsx("div",{className:"py-2.5 text-center text-xs font-semibold text-[#94a3b8] uppercase tracking-wider",children:M},M))}),n.jsx("div",{className:"grid grid-cols-7",children:Array.from({length:N},(M,R)=>{const B=R-_+1,D=B>=1&&B<=S,U=D?`${a}-${String(i+1).padStart(2,"0")}-${String(B).padStart(2,"0")}`:"",H=U===h,K=U===c,z=D?j[U]??[]:[];return n.jsx("div",{className:`min-h-[100px] border-b border-r border-[#1e293b]/50 p-1.5 transition-colors ${D?"cursor-pointer hover:bg-[#0a0e17]":"bg-[#0a0e17]/30"} ${K?"bg-[#00b4ff]/5 ring-1 ring-inset ring-[#00b4ff]/30":""}`,onClick:()=>D&&E(U),children:D&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:`text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full ${H?"bg-[#00b4ff] text-white":"text-[#94a3b8]"}`,children:B}),z.length>0&&n.jsx("span",{className:"text-[10px] text-[#475569]",children:z.length})]}),n.jsxs("div",{className:"space-y-0.5",children:[z.slice(0,2).map(X=>n.jsx(RW,{update:X},X._id)),z.length>2&&n.jsxs("div",{className:"text-[10px] text-[#475569] pl-2",children:["+",z.length-2," more"]})]})]})},R)})})]})}),n.jsx("div",{className:"space-y-4",children:c?n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-semibold text-white",children:$(c)}),n.jsx("div",{className:"flex items-center gap-1",children:n.jsx("span",{className:"text-[10px] font-medium",style:{color:"#22c55e"},children:"â Live"})})]}),x?x.length===0?n.jsx("p",{className:"text-[#475569] text-sm",children:"No updates on this day."}):n.jsx("div",{className:"space-y-3 overflow-y-auto pr-1",style:{maxHeight:500},children:x.map(M=>n.jsx(CN,{update:M},M._id))}):n.jsx("p",{className:"text-[#475569] text-sm",children:"Loading..."})]}):n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx("h3",{className:"text-sm font-semibold text-white",children:"Today's Schedule"}),n.jsx("div",{className:"flex items-center gap-1 ml-auto",children:n.jsx("span",{className:"text-[10px] font-medium",style:{color:"#22c55e"},children:"â Live"})})]}),n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-3",style:{color:"#475569"},children:"Recent Activity"}),!m||m.length===0?n.jsx("p",{className:"text-[#475569] text-sm",children:"No updates yet today."}):n.jsx("div",{className:"space-y-2",children:m.slice(0,6).map(M=>{const R=po[M.type]||po.info,B=new Date(M._creationTime).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"America/Los_Angeles"});return n.jsxs("div",{className:"flex items-start gap-2 py-1.5",style:{borderBottom:"1px solid #1e293b20"},children:[n.jsx("div",{className:"w-2 h-2 rounded-full mt-1.5 shrink-0",style:{background:R.color}}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-xs text-white truncate",children:M.title}),n.jsxs("div",{className:"text-[10px]",style:{color:"#475569"},children:[B," PT"]})]})]},M._id)})}),n.jsx("div",{className:"mt-4 pt-3 flex items-center gap-3 flex-wrap",style:{borderTop:"1px solid #1e293b"},children:Object.entries(SN).map(([M,R])=>n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:R}}),n.jsx("span",{className:"text-[10px] text-[#94a3b8] capitalize",children:M})]},M))})]})})]})]})}function $W(){const e=Yh(),[t,r]=y.useState("signin"),{isAuthenticated:a,isLoading:s}=Vn(),i=ar();if(!s&&a)return i("/admin",{replace:!0}),null;const o=()=>{i("/admin",{replace:!0})};return n.jsxs("div",{className:"min-h-screen bg-[#0a0e17] flex items-center justify-center p-4 relative",children:[n.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden",children:[n.jsx("div",{className:"absolute top-0 right-1/4 size-96 rounded-full bg-[#d4a843]/5 blur-[120px]"}),n.jsx("div",{className:"absolute bottom-0 left-1/4 size-96 rounded-full bg-[#d4a843]/3 blur-[100px]"})]}),n.jsxs("div",{className:"w-full max-w-sm space-y-6",children:[n.jsxs("div",{className:"text-center space-y-3",children:[n.jsx("img",{src:"/vettoleo-logo.png",alt:"
167VET-TO-LEO",className:"mx-auto h-14 w-auto mb-3 drop-shadow-[0_0_12px_rgba(212,168,67,0.3)]"}),n.jsxs("div",{className:"flex items-center justify-center gap-2",children:[n.jsx(Ln,{className:"w-5 h-5 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] text-sm font-bold uppercase tracking-widest",children:"Admin Console"})]}),n.jsx("h1",{className:"text-2xl font-bold tracking-tight text-white",children:t==="signin"?"Admin Sign In":"Create Admin Account"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Restricted to authorized administrators only."})]}),n.jsx("div",{className:"rounded-xl border border-[#d4a843]/20 bg-[#111827] p-6",children:e&&(t==="signin"?n.jsx(g0,{onAuthenticated:o,showPasswordToggle:!0}):n.jsx(DC,{}))}),e&&n.jsx("p",{className:"text-center text-sm text-[#94a3b8]",children:t==="signin"?n.jsxs(n.Fragment,{children:["Need an account?"," ",n.jsx("button",{onClick:()=>r("signup"),className:"font-medium text-[#d4a843] hover:underline",children:"Create one"})]}):n.jsxs(n.Fragment,{children:["Already have an account?"," ",n.jsx("button",{onClick:()=>r("signin"),className:"font-medium text-[#d4a843] hover:underline",children:"Sign in"})]})})]})]})}const FW={"U.S. Army":"#4d7c0f","U.S. Navy":"#1e40af","U.S. Marine Corps":"#991b1b","U.S. Air Force":"#1e3a5f","U.S. Coast Guard":"#ea580c","U.S. Space Force":"#1e293b"};function BW({vet:e,onApprove:t,onReject:r}){const a=new Date(e._creationTime),s=FW[e.branch]||"#475569";return n.jsxs("div",{className:"rounded-xl border border-[#00b4ff]/30 bg-[#111827] p-5 space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex items-start gap-4",children:[e.photoUrl?n.jsx("img",{src:e.photoUrl,alt:`${e.firstName} ${e.lastName}`,className:"w-16 h-16 rounded-lg object-cover border-2 border-[#00b4ff]/30"}):n.jsx("div",{className:"w-16 h-16 rounded-lg bg-[#00b4ff]/10 flex items-center justify-center",children:n.jsx(Ze,{className:"w-8 h-8 text-[#00b4ff]"})}),n.jsxs("div",{children:[n.jsxs(ye,{to:`/admin/veteran/${e._id}`,className:"text-lg font-bold text-white hover:text-[#00b4ff] transition-colors",children:[e.firstName," ",e.lastName]}),e.rank&&n.jsxs("p",{className:"text-[#00b4ff] text-sm font-medium",children:[e.rank," · ",e.branch]}),!e.rank&&n.jsx("p",{className:"text-[#00b4ff] text-sm font-medium",children:e.branch}),(e.city||e.state)&&n.jsxs("div",{className:"flex items-center gap-1.5 text-[#94a3b8] text-sm mt-0.5",children:[n.jsx(wt,{className:"w-3.5 h-3.5"}),n.jsxs("span",{children:[e.city?`${e.city}, `:"",e.state||""]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wide",style:{backgroundColor:`${s}30`,color:s==="#1e293b"?"#94a3b8":s.replace(/1e|0f|1b|3a/,"5f")},children:e.branch.replace("U.S. ","")}),n.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-[#00b4ff]/15 border border-[#00b4ff]/30",children:[n.jsx(At,{className:"w-3.5 h-3.5 text-[#00b4ff]"}),n.jsx("span",{className:"text-[#00b4ff] text-xs font-medium",children:"Pending"})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(Sn,{className:"w-4 h-4 text-[#475569]"}),n.jsx("span",{children:e.email})]}),e.phone&&n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(zo,{className:"w-4 h-4 text-[#475569]"}),n.jsx("span",{children:e.phone})]}),e.mos&&n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(Be,{className:"w-4 h-4 text-[#475569]"}),n.jsxs("span",{children:["MOS: ",e.mos]})]}),e.yearsOfService&&n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(qr,{className:"w-4 h-4 text-[#475569]"}),n.jsxs("span",{children:[e.yearsOfService," Years of Service"]})]}),e.dischargeStatus&&n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(gn,{className:"w-4 h-4 text-[#475569]"}),n.jsxs("span",{children:[e.dischargeStatus," Discharge"]})]}),e.education&&n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(pn,{className:"w-4 h-4 text-[#475569]"}),n.jsx("span",{children:e.education})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[#94a3b8]",children:[n.jsx(At,{className:"w-4 h-4 text-[#475569]"}),n.jsxs("span",{children:["Submitted ",a.toLocaleDateString()," at ",a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]})]}),e.skills&&e.skills.length>0&&n.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.skills.map(i=>n.jsx("span",{className:"px-2 py-0.5 rounded-md bg-[#00b4ff]/10 text-[#00b4ff] text-xs font-medium border border-[#00b4ff]/15",children:i},i))}),n.jsxs("div",{className:"flex items-center gap-3 pt-2 border-t border-[#1e293b]",children:[n.jsxs(be,{onClick:t,className:"bg-[#22c55e] hover:bg-[#16a34a] text-black font-semibold flex-1",children:[n.jsx(gn,{className:"w-4 h-4 mr-2"}),"Approve"]}),n.jsxs(be,{onClick:r,variant:"outline",className:"border-[#ef4444]/30 text-[#ef4444] hover:bg-[#ef4444]/10 flex-1",children:[n.jsx(Wo,{className:"w-4 h-4 mr-2"}),"Reject"]})]})]})}function UW(){const e=ie(F.veterans.getPendingVeterans),t=te(F.veterans.approveVeteran),r=te(F.veterans.rejectVeteran),a=async i=>{try{await t({veteranId:i}),W.success("Veteran profile approved and published.")}catch{W.error("Failed to approve veteran.")}},s=async i=>{try{await r({veteranId:i}),W.success("Veteran profile rejected.")}catch{W.error("Failed to reject veteran.")}};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(At,{className:"w-6 h-6 text-[#00b4ff]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Pending Veteran Profiles"}),e&&e.length>0&&n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-[#00b4ff]/20 text-[#00b4ff]",children:e.length})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"Review and approve new veteran profile submissions."})]}),e&&e.length>0?n.jsx("div",{className:"space-y-4",children:e.map(i=>n.jsx(BW,{vet:i,onApprove:()=>a(i._id),onReject:()=>s(i._id)},i._id))}):n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-10 text-center",children:[n.jsx(gn,{className:"w-10 h-10 text-[#22c55e] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:"All caught up"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No pending veteran profiles right now."})]})]})}const KP=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","N
167orth Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],YP=["U.S. Army","U.S. Navy","U.S. Marine Corps","U.S. Air Force","U.S. Coast Guard","U.S. Space Force"],ZP=["Honorable","General (Under Honorable Conditions)","Other Than Honorable","Bad Conduct","Dishonorable","Medical"];function zW({veteran:e,onClose:t,onSave:r,onUploadPhoto:a}){const[s,i]=y.useState({firstName:e.firstName,lastName:e.lastName,email:e.email,phone:e.phone||"",city:e.city||"",state:e.state||"",branch:e.branch,rank:e.rank||"",mos:e.mos||"",yearsOfService:e.yearsOfService?.toString()||"",separationDate:e.separationDate||"",dischargeStatus:e.dischargeStatus||"",education:e.education||""}),[o,c]=y.useState(e.photoUrl||null),d=p=>{const b=p.target.files?.[0];if(!b)return;const w=new FileReader;w.onload=()=>c(w.result),w.readAsDataURL(b),a(e._id,b)},u=p=>{p.preventDefault();const b={...s};b.yearsOfService?b.yearsOfService=parseInt(b.yearsOfService):delete b.yearsOfService,r(e._id,b),t()},h="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]",m="block text-xs font-medium text-[#94a3b8] mb-1";return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-2xl w-full max-w-lg mx-4 shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b] sticky top-0 bg-[#111827] z-10",children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:"Edit Veteran Profile"}),n.jsx("button",{onClick:t,className:"text-[#94a3b8] hover:text-white p-1",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:u,className:"p-5 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[o?n.jsx("img",{src:o,alt:"Photo",className:"w-16 h-16 rounded-lg object-cover border-2 border-[#00b4ff]/30"}):n.jsx("div",{className:"w-16 h-16 rounded-lg bg-[#00b4ff]/10 flex items-center justify-center",children:n.jsx(Ze,{className:"w-8 h-8 text-[#00b4ff]"})}),n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 px-3 py-1.5 rounded-lg bg-[#1e293b] text-[#94a3b8] text-sm hover:text-white hover:bg-[#2a3a50] transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),o?"Change Photo":"Upload Photo",n.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:d})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:m,children:"First Name"}),n.jsx("input",{value:s.firstName,onChange:p=>i({...s,firstName:p.target.value}),className:h,required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Last Name"}),n.jsx("input",{value:s.lastName,onChange:p=>i({...s,lastName:p.target.value}),className:h,required:!0})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Email"}),n.jsx("input",{type:"email",value:s.email,onChange:p=>i({...s,email:p.target.value}),className:h,required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Phone"}),n.jsx("input",{value:s.phone,onChange:p=>i({...s,phone:p.target.value}),className:h,placeholder:"(208) 555-0100"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:m,children:"City"}),n.jsx("input",{value:s.city,onChange:p=>i({...s,city:p.target.value}),className:h})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"State"}),n.jsxs("select",{value:s.state,onChange:p=>i({...s,state:p.target.value}),className:h,children:[n.jsx("option",{value:"",children:"Select..."}),KP.map(p=>n.jsx("option",{value:p,children:p},p))]})]})]}),n.jsx("div",{className:"border-t border-[#1e293b] pt-4",children:n.jsx("p",{className:"text-xs font-semibold text-[#475569] uppercase tracking-wider mb-3",children:"Military Backgroun
167d"})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Branch"}),n.jsxs("select",{value:s.branch,onChange:p=>i({...s,branch:p.target.value}),className:h,required:!0,children:[n.jsx("option",{value:"",children:"Select..."}),YP.map(p=>n.jsx("option",{value:p,children:p},p))]})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Rank"}),n.jsx("input",{value:s.rank,onChange:p=>i({...s,rank:p.target.value}),className:h,placeholder:"Staff Sergeant"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:m,children:"MOS / Specialty"}),n.jsx("input",{value:s.mos,onChange:p=>i({...s,mos:p.target.value}),className:h,placeholder:"31B - Military Police"})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Years of Service"}),n.jsx("input",{type:"number",value:s.yearsOfService,onChange:p=>i({...s,yearsOfService:p.target.value}),className:h,min:"0",max:"40"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Separation Date"}),n.jsx("input",{value:s.separationDate,onChange:p=>i({...s,separationDate:p.target.value}),className:h,placeholder:"March 2024"})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Discharge Status"}),n.jsxs("select",{value:s.dischargeStatus,onChange:p=>i({...s,dischargeStatus:p.target.value}),className:h,children:[n.jsx("option",{value:"",children:"Select..."}),ZP.map(p=>n.jsx("option",{value:p,children:p},p))]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:m,children:"Education"}),n.jsx("input",{value:s.education,onChange:p=>i({...s,education:p.target.value}),className:h,placeholder:"B.S. Criminal Justice"})]}),n.jsxs("div",{className:"flex gap-3 pt-4 border-t border-[#1e293b]",children:[n.jsx(be,{type:"submit",className:"flex-1 bg-[#00b4ff] hover:bg-[#0090cc] text-white font-semibold",children:"Save Changes"}),n.jsx(be,{type:"button",variant:"outline",onClick:t,className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b]",children:"Cancel"})]})]})]})})}function WW({onClose:e}){const t=te(F.veterans.createVeteran),[r,a]=y.useState({firstName:"",lastName:"",email:"",phone:"",city:"",state:"",branch:"",rank:"",mos:"",yearsOfService:"",separationDate:"",dischargeStatus:"",education:""}),s=async c=>{c.preventDefault();try{const d={...r};d.yearsOfService?d.yearsOfService=parseInt(d.yearsOfService):delete d.yearsOfService;for(const u of Object.keys(d))d[u]===""&&delete d[u];if(!d.firstName||!d.lastName||!d.email||!d.branch){W.error("First name, last name, email, and branch are required.");return}await t(d),W.success("Veteran profile created."),e()}catch{W.error("Failed to create veteran.")}},i="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]",o="block text-xs font-medium text-[#94a3b8] mb-1";return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-2xl w-full max-w-lg mx-4 shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b] sticky top-0 bg-[#111827] z-10",children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:"Add Veteran"}),n.jsx("button",{onClick:e,className:"text-[#94a3b8] hover:text-white p-1",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:s,className:"p-5 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:o,children:"First Name *"}),n.jsx("input",{value:r.firstName,onChange:c=>a({...r,firstName:c.target.value}),className:i,required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Last Name *"}),n.jsx("input",{value:r.lastName,onChange:c=>a({...r,lastName:c.target.value}),className:i,required:!0})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Email *"}),n.jsx("input",{type:"email",value:r.email,onChange:c=>a({...r,email:c.target.value}),className:i,required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Phone"}),n.jsx("input",{value:r.phone,onChange:c=>a({...r,phone:c.target.value}),className:i})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:o,children:"City"}),n.jsx("input",{value:r.city,onChange:c=>a({...r,city:c.target.value}),className:i})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"State"}),n.jsxs("select",{value:r.state,onChange:c=>a({...r,state:c.target.value}),className:i,children:[n.jsx("option",{value:"",children:"Select..."}),KP.map(c=>n.jsx("option",{value:c,children:c},c))]})]})]}),n.jsx("div",{className:"border-t border-[#1e293b] pt-4",children:n.jsx("p",{className:"text-xs font-semibold text-[#475569] uppercase tracking-wider mb-3",children:"Military Backgroun
167d"})}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Branch *"}),n.jsxs("select",{value:r.branch,onChange:c=>a({...r,branch:c.target.value}),className:i,required:!0,children:[n.jsx("option",{value:"",children:"Select..."}),YP.map(c=>n.jsx("option",{value:c,children:c},c))]})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Rank"}),n.jsx("input",{value:r.rank,onChange:c=>a({...r,rank:c.target.value}),className:i})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:o,children:"MOS / Specialty"}),n.jsx("input",{value:r.mos,onChange:c=>a({...r,mos:c.target.value}),className:i})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Years of Service"}),n.jsx("input",{type:"number",value:r.yearsOfService,onChange:c=>a({...r,yearsOfService:c.target.value}),className:i,min:"0",max:"40"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Separation Date"}),n.jsx("input",{value:r.separationDate,onChange:c=>a({...r,separationDate:c.target.value}),className:i,placeholder:"March 2024"})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Discharge Status"}),n.jsxs("select",{value:r.dischargeStatus,onChange:c=>a({...r,dischargeStatus:c.target.value}),className:i,children:[n.jsx("option",{value:"",children:"Select..."}),ZP.map(c=>n.jsx("option",{value:c,children:c},c))]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:o,children:"Education"}),n.jsx("input",{value:r.education,onChange:c=>a({...r,education:c.target.value}),className:i})]}),n.jsxs("div",{className:"flex gap-3 pt-4 border-t border-[#1e293b]",children:[n.jsx(be,{type:"submit",className:"flex-1 bg-[#00b4ff] hover:bg-[#0090cc] text-white font-semibold",children:"Create Veteran"}),n.jsx(be,{type:"button",variant:"outline",onClick:e,className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b]",children:"Cancel"})]})]})]})})}function qW({vet:e,presence:t,now:r,onEdit:a,onSuspend:s,onReactivate:i,onDelete:o}){const d={active:{bg:"bg-[#22c55e]/10",text:"text-[#22c55e]",label:"Active"},pending:{bg:"bg-[#f59e0b]/10",text:"text-[#f59e0b]",label:"Pending"},suspended:{bg:"bg-[#ef4444]/10",text:"text-[#ef4444]",label:"Suspended"}}[e.status];return n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-xl bg-[#111827] border border-[#1e293b] hover:border-[#1e293b80] transition-all",children:[e.photoUrl?n.jsx("img",{src:e.photoUrl,alt:`${e.firstName} ${e.lastName}`,className:"w-12 h-12 rounded-lg object-cover border border-[#1e293b]"}):n.jsx("div",{className:"w-12 h-12 rounded-lg bg-[#00b4ff]/10 flex items-center justify-center flex-shrink-0",children:n.jsx(Ze,{className:"w-6 h-6 text-[#00b4ff]"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(ye,{to:`/admin/veteran/${e._id}`,className:"text-white font-semibold truncate hover:text-[#00b4ff] transition-colors",children:[e.firstName," ",e.lastName]}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold ${d.bg} ${d.text}`,children:d.label})]}),n.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#94a3b8] mt-0.5",children:[e.rank&&n.jsx("span",{children:e.rank}),n.jsx("span",{className:"text-[#00b4ff]",children:e.branch.replace("U.S. ","")}),e.mos&&n.jsxs("span",{children:["· ",e.mos]})]}),n.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#475569] mt-0.5",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Sn,{className:"w-3 h-3"}),e.email]}),(e.city||e.state)&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(wt,{className:"w-3 h-3"}),e.city?`${e.city}, `:"",e.state]})]}),n.jsx("div",{className:"mt-1",children:n.jsx(xi,{status:t,now:r,showLogin:!0})})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[n.jsx(ye,{to:`/admin/veteran/${e._id}`,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#00b4ff] hover:bg-[#00b4ff]/10 transition-colors",title:"View full profile",children:n.jsx(Wn,{className:"w-4 h-4"})}),n.jsx("button",{onClick:a,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#00b4ff] hover:bg-[#00b4ff]/10 transition-colors",title:"Quick edit",children:n.jsx(qt,{className:"w-4 h-4"})}),e.status==="active"?n.jsx("button",{onClick:s,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#f59e0b] hover:bg-[#f59e0b]/10 transition-colors",title:"Suspend",children:n.jsx(Qh,{className:"w-4 h-4"})}):e.status==="suspended"?n.jsx("button",{onClick:i,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#22c55e] hover:bg-[#22c55e]/10 transition-colors",title:"Reactivate",children:n.jsx(ef,{className:"w-4 h-4"})}):null,n.jsx("button",{onClick:o,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#ef4444] hover:bg-[#ef4444]/10 transition-colors",title:"Delete",children:n.jsx(_n,{className:"w-4 h-4"})})]})]})}function VW(){const e=ie(F.veterans.getAllVeterans),t=ie(F.veterans.getVeteranStats),r=ie(F.presence.veteranStatuses),a=pi(),s=new Map((r??[]).map(E=>[E.veteranId,E])),i=te(F.veterans.updateVeteran),o=te(F.veterans.suspendVeteran),c=te(F.veterans.reactivateVeteran),d=te(F.veterans.deleteVeteran),u=te(F.veterans.adminUploadPhoto),h=te(F.storage.generateUploadUrl),[m,p]=y.useState(""),[b,w]=y.useState("all"),[x,g]=y.useState(null),[j,S]=y.useState(!1),_=(e??[]).filter(E=>{if(b!=="all"&&E.status!==b||E.status==="pending")return!1;if(m){const $=m.toLowerCase();return`${E.firstName} ${E.lastName}`.toLowerCase().includes($)||E.email.toLowerCase().includes($)||E.branch.toLowerCase().includes($)||E.state?.toLowerCase().includes($)}return!0}),N=async(E,$)=>{try{await i({veteranId:E,...$}),W.success("Veteran updated.")}catch{W.error("Failed to update veteran.")}},C=async(E,$)=>{try{const M=await h(),R=await fetch(M,{method:"POST",headers:{"Content-Type":$.type},body:$}),{storageId:B}=await R.json();await u({veteranId:E,storageId:B}),W.success("Photo updated.")}catch{W.error("Failed to upload photo.")}},A=async E=>{try{await o({veteranId:E}
167),W.success("Veteran suspended.")}catch{W.error("Failed.")}},P=async E=>{try{await c({veteranId:E}),W.success("Veteran reactivated.")}catch{W.error("Failed.")}},O=async E=>{if(confirm("Permanently delete this veteran profile?"))try{await d({veteranId:E}),W.success("Veteran deleted.")}catch{W.error("Failed.")}};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(qr,{className:"w-6 h-6 text-[#00b4ff]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"All Veterans"}),t&&n.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-[#00b4ff]/20 text-[#00b4ff]",children:[t.activeCount," active"]})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"Manage all approved veteran profiles."})]}),n.jsxs(be,{onClick:()=>S(!0),className:"bg-[#00b4ff] hover:bg-[#0090cc] text-white font-semibold gap-2",children:[n.jsx(pt,{className:"w-4 h-4"}),"Add Veteran"]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Dt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#475569]"}),n.jsx("input",{value:m,onChange:E=>p(E.target.value),placeholder:"Search by name, email, branch, or state...",className:"w-full pl-10 pr-4 py-2.5 rounded-xl bg-[#111827] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]"})]}),n.jsx("div",{className:"flex rounded-xl overflow-hidden border border-[#1e293b]",children:["all","active","suspended"].map(E=>n.jsx("button",{onClick:()=>w(E),className:`px-4 py-2.5 text-xs font-semibold capitalize transition-colors ${b===E?"bg-[#00b4ff]/15 text-[#00b4ff]":"bg-[#111827] text-[#94a3b8] hover:text-white"}`,children:E},E))})]}),_.length>0?n.jsx("div",{className:"space-y-2",children:_.map(E=>n.jsx(qW,{vet:E,presence:r===void 0?void 0:s.get(E._id)??null,now:a,onEdit:()=>g(E),onSuspend:()=>A(E._id),onReactivate:()=>P(E._id),onDelete:()=>O(E._id)},E._id))}):n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-10 text-center",children:[n.jsx(Ze,{className:"w-10 h-10 text-[#475569] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:m?"No veterans match your search":"No veteran profiles yet"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:m?"Try a different search term.":"Veteran profiles will appear here once approved."})]}),x&&n.jsx(zW,{veteran:x,onClose:()=>g(null),onSave:N,onUploadPhoto:C}),j&&n.jsx(WW,{onClose:()=>S(!1)})]})}const AN=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],kN=["U.S. Army","U.S. Navy","U.S. Marine Corps","U.S. Air Force","U.S. Coast Guard","U.S. Space Force"],PN=["Honorable","General (Under Honorable Conditions)","Other Than Honorable","Bad Conduct","Dishonorable","Medical"],TN=["High School / GED","Some College","Associate's Degree","Bachelor's Degree","Master's Degree","Doctorate"],HW=["Field Training Officer (FTO)","Drug Recognition Expert (DRE)","Advanced Roadside Impairment Driving Enforcement (ARIDE)","Speed Measurement (RADAR/LIDAR)","SWAT/SRT","K9","Crisis/Hostage Negotiator","Digital Forensics Examiner","Crash Reconstructionist","Crisis Intervention Team (CIT)","NA
167SRO's SRO Program(s)"],ON=[{key:"completedWithoutDisciplinary",label:"Completed service without disciplinary separation",options:["Yes","No"]},{key:"receivedNjp",label:"Received non-judicial punishment (Article 15, NJP, Captain's Mast)",options:["Yes","No","Prefer to discuss during background investigation"]},{key:"courtMartialConviction",label:"Convicted by Summary, Special, or General Court-Martial",options:["Yes","No"]},{key:"requiredDisclosures",label:"Has disciplinary matters requiring disclosure in a background investigation",options:["Yes","No"]},{key:"separatedForMisconduct",label:"Administratively separated for misconduct",options:["Yes","No"]},{key:"clearanceSuspendedRevoked",label:"Security clearance suspended or revoked",options:["Yes","No","Not Applicable"]}],Gt="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]",Kt="block text-xs font-medium text-[#94a3b8] mb-1";function GW(e){switch(e){case"active":return"bg-[#22c55e]/10 text-[#22c55e] border-[#22c55e]/20";case"pending":return"bg-[#f59e0b]/10 text-[#f59e0b] border-[#f59e0b]/20";case"suspended":return"bg-[#ef4444]/10 text-[#ef4444] border-[#ef4444]/20";default:return"bg-[#475569]/10 text-[#475569] border-[#475569]/20"}}function KW(e){switch(e){case"accepted":case"offered":return"bg-[#22c55e]/10 text-[#22c55e]";case"rejected":case"withdrawn":return"bg-[#ef4444]/10 text-[#ef4444]";case"interview":return"bg-[#a855f7]/10 text-[#a855f7]";default:return"bg-[#00b4ff]/10 text-[#00b4ff]"}}function EN(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function Da({icon:e,title:t,color:r="#00b4ff"}){return n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${r}15`},children:n.jsx("span",{style:{color:r},children:n.jsx(e,{className:"w-4 h-4"})})}),n.jsx("h3",{className:"text-base font-bold text-white",children:t})]})}function Rn({label:e,value:t,href:r}){const a=t==null||t==="";return n.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-[#1e293b] last:border-0",children:[n.jsx("span",{className:"text-[#64748b] text-sm min-w-[150px] shrink-0",children:e}),a?n.jsx("span",{className:"text-[#475569] text-sm italic",children:"Not provided"}):r?n.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-[#00b4ff] text-sm hover:underline break-words",children:t}):n.jsx("span",{className:"text-white text-sm break-words",children:t})]})}function wl({items:e}){return!e||e.length===0?n.jsx("p",{className:"text-[#475569] text-sm italic",children:"None listed"}):n.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(t=>n.jsx("span",{className:"px-2.5 py-1 rounded-lg bg-[#00b4ff]/10 text-[#00b4ff] text-xs font-medium",children:t},t))})}function YW(){const{id:e}=x0(),t=ar(),r=e,a=ie(F.veterans.getVeteranProfile,r?{veteranId:r}:"skip"),s=ie(F.presence.veteranStatus,r?{veteranId:r}:"skip"),i=pi(),o=te(F.veterans.adminUpdateVeteranFull),c=te(F.veterans.adminUploadPhoto),d=te(F.veterans.adminUploadResume),u=te(F.veterans.adminRemoveResume),h=te(F.storage.generateUploadUrl),m=te(F.veterans.approveVeteran),p=te(F.veterans.suspendVeteran),b=te(F.veterans.reactivateVeteran),w=te(F.veterans.deleteVeteran),[x,g]=y.useState(!1),[j,S]=y.useState(!1),[_,N]=y.useState(null),C=y.useRef(null),A=y.useRef(null);if(y.useEffect(()=>{!a||x||N({firstName:a.firstName,lastName:a.lastName,email:a.email,phone:a.phone??"",city:a.city??"",state:a.state??"",branch:a.branch,rank:a.rank??"",mos:a.mos??"",yearsOfService:a.yearsOfService?.toString()??"",separationDate:a.separationDate??"",dischargeStatus:a.dischargeStatus??"",education:a.education??"",certifications:(a.certifications??[]).join(", "),skills:(a.skills??[]).join(", "),leCertifications:a.leCertifications??[],interestedStates:(a.interestedStates??[]).join(", "),preferredAgencies:(a.preferredAgencies??[]).join(", "),completedWithoutDisciplinary:a.completedWithoutDisciplinary??"",receivedNj
167p:a.receivedNjp??"",courtMartialConviction:a.courtMartialConviction??"",requiredDisclosures:a.requiredDisclosures??"",separatedForMisconduct:a.separatedForMisconduct??"",clearanceSuspendedRevoked:a.clearanceSuspendedRevoked??""})},[a,x]),a===void 0)return n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsx("div",{className:"w-8 h-8 border-2 border-[#d4a843] border-t-transparent rounded-full animate-spin"})});if(a===null)return n.jsxs("div",{className:"text-center py-20",children:[n.jsx(Be,{className:"w-12 h-12 text-[#475569] mx-auto mb-4"}),n.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Veteran Not Found"}),n.jsx("p",{className:"text-[#94a3b8] mb-6",children:"This profile doesn't exist or you don't have access."}),n.jsx(ye,{to:"/admin/veterans",className:"text-[#00b4ff] hover:underline text-sm",children:"Back to All Veterans"})]});const P=D=>D.split(",").map(U=>U.trim()).filter(Boolean),O=async()=>{if(!(!_||!r)){if(!_.firstName.trim()||!_.lastName.trim()||!_.email.trim()||!_.branch){W.error("First name, last name, email, and branch are required.");return}S(!0);try{const D=_.yearsOfService.trim();await o({veteranId:r,firstName:_.firstName.trim(),lastName:_.lastName.trim(),email:_.email.trim(),phone:_.phone,city:_.city,state:_.state,branch:_.branch,rank:_.rank,mos:_.mos,yearsOfService:D===""?void 0:Number(D),clearYearsOfService:D==="",separationDate:_.separationDate,dischargeStatus:_.dischargeStatus,education:_.education,certifications:P(_.certifications),skills:P(_.skills),leCertifications:_.leCertifications,interestedStates:P(_.interestedStates),preferredAgencies:P(_.preferredAgencies),completedWithoutDisciplinary:_.completedWithoutDisciplinary,receivedNjp:_.receivedNjp,courtMartialConviction:_.courtMartialConviction,requiredDisclosures:_.requiredDisclosures,separatedForMisconduct:_.separatedForMisconduct,clearanceSuspendedRevoked:_.clearanceSuspendedRevoked}),W.success("Profile saved."),g(!1)}catch{W.error("Could not save the profile.")}finally{S(!1)}}},E=async D=>{if(r)try{const U=await h(),H=await fetch(U,{method:"POST",headers:{"Content-Type":D.type},body:D}),{storageId:K}=await H.json();await c({veteranId:r,storageId:K}),W.success("Photo updated.")}catch{W.error("Photo upload failed.")}},$=async D=>{if(r)try{const U=await h(),H=await fetch(U,{method:"POST",headers:{"Content-Type":D.type},body:D}),{storageId:K}=await H.json();await d({veteranId:r,storageId:K,fileName:D.name}),W.success("Resume updated.")}catch{W.error("Resume upload failed.")}},M=async()=>{if(r&&confirm(`Permanently delete ${a.firstName} ${a.lastName}'s profile? This cannot be undone.`))try{await w({veteranId:r}),W.success("Veteran deleted."),t("/admin/veterans")}catch{W.error("Delete failed.")}},R=[a.city,a.state].filter(Boolean).join(", "),B=D=>N(U=>U&&{...U,...D});return n.jsxs("div",{className:"space-y-6 max-w-5xl",children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[n.jsxs(ye,{to:"/admin/veterans",className:"inline-flex items-center gap-2 text-[#94a3b8] hover:text-white text-sm transition-colors",children:[n.jsx(Zr,{className:"w-4 h-4"}),"Back to All Veterans"]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs(ye,{to:`/admin/messages?to=veteran:${a._id}`,className:"inline-flex items-center gap-2 h-9 px-3 rounded-md border border-[#d4a843]/50 text-[#d4a843] hover:bg-[#d4a843]/10 text-sm font-medium",children:[n.jsx(tn,{className:"w-4 h-4"})," Message"]}),x?n.jsxs(n.Fragment,{children:[n.jsxs(be,{onClick:O,disabled:j,className:"bg-[#00b4ff] hover:bg-[#0090cc] text-white font-semibold gap-2",children:[n.jsx(Gs,{className:"w-4 h-4"}),j?"Saving...":"Save Changes"]}),n.jsxs(be,{variant:"outline",onClick:()=>g(!1),className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b] gap-2",children:[n.jsx(Me,{className:"w-4 h-4"}),"Cancel"]})]}):n.jsxs(n.Fragment,{children:[n.jsxs(be,{onClick:()=>g(!0),className:"bg-[#00b4ff] hover:bg-[#0090cc] text-white font-semibold gap-2",children:[n.jsx(qt,{className:"w-4 h-4"}),"Edit Profile"]}),a.status==="pending"&&n.jsxs(be,{onClick:async()=>
167{if(r)try{await m({veteranId:r}),W.success("Veteran approved.")}catch{W.error("Approval failed.")}},className:"bg-[#22c55e] hover:bg-[#16a34a] text-white font-semibold gap-2",children:[n.jsx(gn,{className:"w-4 h-4"}),"Approve"]}),a.status==="active"&&n.jsxs(be,{variant:"outline",onClick:async()=>{if(r)try{await p({veteranId:r}),W.success("Veteran suspended.")}catch{W.error("Suspend failed.")}},className:"border-[#f59e0b]/40 text-[#f59e0b] hover:bg-[#f59e0b]/10 gap-2",children:[n.jsx(Qh,{className:"w-4 h-4"}),"Suspend"]}),a.status==="suspended"&&n.jsxs(be,{variant:"outline",onClick:async()=>{if(r)try{await b({veteranId:r}),W.success("Veteran reactivated.")}catch{W.error("Reactivate failed.")}},className:"border-[#22c55e]/40 text-[#22c55e] hover:bg-[#22c55e]/10 gap-2",children:[n.jsx(ef,{className:"w-4 h-4"}),"Reactivate"]}),n.jsxs(be,{variant:"outline",onClick:M,className:"border-[#ef4444]/40 text-[#ef4444] hover:bg-[#ef4444]/10 gap-2",children:[n.jsx(_n,{className:"w-4 h-4"}),"Delete"]})]})]})]}),n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:n.jsxs("div",{className:"flex flex-col sm:flex-row items-start gap-5",children:[n.jsxs("div",{className:"relative",children:[a.photoUrl?n.jsx("img",{src:a.photoUrl,alt:`${a.firstName} ${a.lastName}`,className:"w-20 h-20 rounded-xl object-cover border border-[#1e293b]"}):n.jsx("div",{className:"w-20 h-20 rounded-xl bg-[#00b4ff]/10 flex items-center justify-center border border-[#1e293b]",children:n.jsx(Ze,{className:"w-10 h-10 text-[#00b4ff]"})}),n.jsx("button",{onClick:()=>C.current?.click(),className:"absolute -bottom-2 -right-2 p-1.5 rounded-lg bg-[#1e293b] border border-[#334155] text-[#94a3b8] hover:text-white transition-colors",title:"Change photo",children:n.jsx(Et,{className:"w-3.5 h-3.5"})}),n.jsx("input",{ref:C,type:"file",accept:"image/*",className:"hidden",onChange:D=>{const U=D.target.files?.[0];U&&E(U),D.target.value=""}})]}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1 flex-wrap",children:[n.jsxs("h1",{className:"text-2xl font-bold text-white break-words",children:[a.firstName," ",a.lastName]}),n.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-medium border ${GW(a.status)}`,children:a.status.charAt(0).toUpperCase()+a.status.slice(1)})]}),n.jsx("div",{className:"mb-1",children:n.jsx(xi,{status:s,now:i,showLogin:!0})}),n.jsxs("div",{className:"flex items-center gap-4 text-sm text-[#94a3b8] mt-1 flex-wrap",children:[n.jsxs("span",{className:"flex items-center gap-1 text-[#00b4ff]",children:[n.jsx(qr,{className:"w-3.5 h-3.5"}),a.branch,a.rank?` · ${a.rank}`:""]}),R&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(wt,{className:"w-3.5 h-3.5"}),R]}),n.jsxs("a",{href:`mailto:${a.email}`,className:"flex items-center gap-1 hover:text-[#00b4ff] break-all",children:[n.jsx(Sn,{className:"w-3.5 h-3.5"}),a.email]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs text-[#64748b] mt-2 flex-wrap",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Cr,{className:"w-3 h-3"}),"Joined ",EN(a._creationTime)]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),a.hasAccount?`Account: ${a.accountEmail??"linked"}`:"No login account"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(ht,{className:"w-3 h-3"}),a.savedJobsCount," saved jobs"]})]})]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:Ze,title:"Contact"}),x&&_?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"First Name *"}),n.jsx("input",{value:_.firstName,onChange:D=>B({firstName:D.target.value}),className:Gt})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Last Name *"}),n.jsx("input",{value:_.lastName,onChange:D=>B({lastName:D.target.value}),className:Gt})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Email *"}),n.jsx("input",{type:"email",value:_.email,onChange:D=>B({email:D.target.value}),className:Gt})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Phone"}),n.jsx("input",{value:_.phone,onChange:D=>B({phone:D.target.value}),className:Gt})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"City"}),n.jsx("input",{value:_.city,onChange:D=>B({city:D.target.value}),className:Gt})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"State"}),n.jsxs("select",{value:_.state,onChange:D=>B({state:D.target.value}),className:Gt,children:[n.jsx("option",{value:"",children:"Select..."}),AN.map(D=>n.jsx("option",{value:D,children:D},D)),_.state&&!AN.includes(_.state)&&n.jsx("option",{value:_.state,children:_.state})]})]})]})]}):n.jsxs(n.Fragment,{children:[n.jsx(Rn,{label:"Email",value:a.email,href:`mailto:${a.email}`}),n.jsx(Rn,{label:"Phone",value:Wt(a.phone)}),n.jsx(Rn,{label:"City",value:a.city}),n.jsx(Rn,{label:"State",value:a.state}),n.jsx(Rn,{label:"Login Account",value:a.hasAccount?a.accountEmail??"Linked":"None"})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:qr,title:"Military Backgroun
167d",color:"#d4a843"}),x&&_?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Branch *"}),n.jsxs("select",{value:_.branch,onChange:D=>B({branch:D.target.value}),className:Gt,children:[n.jsx("option",{value:"",children:"Select..."}),kN.map(D=>n.jsx("option",{value:D,children:D},D)),_.branch&&!kN.includes(_.branch)&&n.jsx("option",{value:_.branch,children:_.branch})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Rank"}),n.jsx("input",{value:_.rank,onChange:D=>B({rank:D.target.value}),className:Gt})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"MOS / Specialty"}),n.jsx("input",{value:_.mos,onChange:D=>B({mos:D.target.value}),className:Gt})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Years of Service"}),n.jsx("input",{type:"number",min:"0",max:"40",value:_.yearsOfService,onChange:D=>B({yearsOfService:D.target.value}),className:Gt})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Separation Date"}),n.jsx("input",{value:_.separationDate,onChange:D=>B({separationDate:D.target.value}),className:Gt,placeholder:"March 2024"})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Discharge Status"}),n.jsxs("select",{value:_.dischargeStatus,onChange:D=>B({dischargeStatus:D.target.value}),className:Gt,children:[n.jsx("option",{value:"",children:"Select..."}),PN.map(D=>n.jsx("option",{value:D,children:D},D)),_.dischargeStatus&&!PN.includes(_.dischargeStatus)&&n.jsx("option",{value:_.dischargeStatus,children:_.dischargeStatus})]})]})]})]}):n.jsxs(n.Fragment,{children:[n.jsx(Rn,{label:"Branch",value:a.branch}),n.jsx(Rn,{label:"Rank",value:a.rank}),n.jsx(Rn,{label:"MOS / Specialty",value:a.mos}),n.jsx(Rn,{label:"Years of Service",value:a.yearsOfService}),n.jsx(Rn,{label:"Separation Date",value:a.separationDate}),n.jsx(Rn,{label:"Discharge Status",value:a.dischargeStatus})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:pn,title:"Education & Skills",color:"#a855f7"}),x&&_?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Education"}),n.jsxs("select",{value:_.education,onChange:D=>B({education:D.target.value}),className:Gt,children:[n.jsx("option",{value:"",children:"Select..."}),TN.map(D=>n.jsx("option",{value:D,children:D},D)),_.education&&!TN.includes(_.education)&&n.jsx("option",{value:_.education,children:_.education})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Certifications (comma separated)"}),n.jsx("input",{value:_.certifications,onChange:D=>B({certifications:D.target.value}),className:Gt})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Skills (comma separated)"}),n.jsx("input",{value:_.skills,onChange:D=>B({skills:D.target.value}),className:Gt})]})]}):n.jsxs(n.Fragment,{children:[n.jsx(Rn,{label:"Education",value:a.education}),n.jsxs("div",{className:"pt-3",children:[n.jsx("p",{className:"text-xs font-semibold text-[#475569] uppercase tracking-wider mb-2",children:"Certifications"}),n.jsx(wl,{items:a.certifications})]}),n.jsxs("div",{className:"pt-3",children:[n.jsx("p",{className:"text-xs font-semibold text-[#475569] uppercase tracking-wider mb-2",children:"Skills"}),n.jsx(wl,{items:a.skills})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:BC,title:"Law Enforcement Certifications",color:"#22c55e"}),x&&_?n.jsx("div",{className:"grid grid-cols-1 gap-2",children:HW.map(D=>{const U=_.leCertifications.includes(D);return n.jsxs("label",{className:"flex items-center gap-2 text-sm text-[#cbd5e1] cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:U,onChange:()=>B({leCertifications:U?_.leCertifications.filter(H=>H!==D):[..._.leCertifications,D]}),className:"accent-[#00b4ff]"}),D]},D)})}):n.jsx(wl,{items:a.leCertifications})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:wt,title:"Job Preferences",color:"#f59e0b"}),x&&_?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Interested States (comma separated)"}),n.jsx("input",{value:_.interestedStates,onChange:D=>B({interestedStates:D.target.value}),className:Gt})]}),n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:"Preferred Agencies (comma separated)"}
167),n.jsx("input",{value:_.preferredAgencies,onChange:D=>B({preferredAgencies:D.target.value}),className:Gt})]})]}):n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-xs font-semibold text-[#475569] uppercase tracking-wider mb-2",children:"Interested States"}),n.jsx(wl,{items:a.interestedStates}),n.jsx("p",{className:"text-xs font-semibold text-[#475569] uppercase tracking-wider mb-2 mt-4",children:"Preferred Agencies"}),n.jsx(wl,{items:a.preferredAgencies})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:hu,title:"Resume",color:"#00b4ff"}),a.resumeUrl?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("a",{href:a.resumeUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-[#00b4ff] text-sm hover:underline break-all",children:[n.jsx(hu,{className:"w-4 h-4 shrink-0"}),a.resumeFileName??"View resume"]}),n.jsxs("div",{className:"flex gap-2 flex-wrap",children:[n.jsxs(be,{variant:"outline",onClick:()=>A.current?.click(),className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b] gap-2 text-xs h-8",children:[n.jsx(Et,{className:"w-3.5 h-3.5"}),"Replace"]}),n.jsxs(be,{variant:"outline",onClick:async()=>{if(r&&confirm("Remove this resume?"))try{await u({veteranId:r}),W.success("Resume removed.")}catch{W.error("Could not remove the resume.")}},className:"border-[#ef4444]/40 text-[#ef4444] hover:bg-[#ef4444]/10 gap-2 text-xs h-8",children:[n.jsx(_n,{className:"w-3.5 h-3.5"}),"Remove"]})]})]}):n.jsxs("div",{className:"space-y-3",children:[n.jsx("p",{className:"text-[#475569] text-sm italic",children:"No resume on file."}),n.jsxs(be,{variant:"outline",onClick:()=>A.current?.click(),className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b] gap-2 text-xs h-8",children:[n.jsx(Et,{className:"w-3.5 h-3.5"}),"Upload Resume"]})]}),n.jsx("input",{ref:A,type:"file",accept:".pdf,.doc,.docx",className:"hidden",onChange:D=>{const U=D.target.files?.[0];U&&$(U),D.target.value=""}})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:Be,title:"Military Conduct & Administrative Actions",color:"#ef4444"}),x&&_?n.jsx("div",{className:"space-y-4",children:ON.map(D=>n.jsxs("div",{children:[n.jsx("label",{className:Kt,children:D.label}),n.jsxs("select",{value:_[D.key],onChange:U=>B({[D.key]:U.target.value}),className:Gt,children:[n.jsx("option",{value:"",children:"Not answered"}),D.options.map(U=>n.jsx("option",{value:U,children:U},U))]})]},D.key))}):n.jsx("div",{children:ON.map(D=>n.jsx(Rn,{label:D.label,value:a[D.key]},D.key))})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx(Da,{icon:ht,title:`Applications (${a.applications.length})`,color:"#22c55e"}),a.applications.length===0?n.jsx("p",{className:"text-[#475569] text-sm italic",children:"No applications submitted through the platform yet."}):n.jsx("div",{className:"space-y-2",children:a.applications.map(D=>n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 p-3 rounded-lg bg-[#0a0e17] border border-[#1e293b]",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-white text-sm font-medium break-words",children:D.jobTitle??"Position removed"}),n.jsxs("p",{className:"text-xs text-[#64748b] break-words",children:[D.agencyName??"Agency removed"," · ",EN(D.appliedAt)]})]}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase shrink-0 ${KW(D.status)}`,children:D.status.replace("_"," ")})]},D._id))})]})]})}function ZW(e){return e===void 0?"â":`$${(e/100).toLocaleString("en-US",{minimumFractionDigits:2})}`}function XW(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}const JW={member:"Agency Member",platinum:"State-Level Featured",job_credit:"Job posting slot",review:"Needs a decision",subscription_ended:"Subscription ended"};function QW(){const[e,t]=y.useState(!1),r=ie(F.stripeBilling.listEvents,{onlyNeedsReview:e,limit:200}),a=te(F.stripeBilling.resolveEvent),s=(r??[]).filter(i=>i.outcome==="needs_review"&&!i.resolvedAt).length;return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Billing Activity"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Every Stripe payment the site received and what it changed."})]}),n.jsx("button",{onClick:()=>t(i=>!i),className:`px-4 py-2 rounded-full text-sm font-medium border transition-colors ${e?"bg-[#f59e0b]/15 text-[#f59e0b] border-[#f59e0b]/40":"text-[#94a3b8] border-[#1e293b] hover:text-white"}`,children:e?"Showing needs review":`Needs review (${s})`})]}),s>0&&!e&&n.jsxs("div",{className:"rounded-xl border border-[#f59e0b]/30 bg-[#1f1a0c] p-4 flex items-start gap-3",children:[n.jsx(Dc,{className:"w-5 h-5 text-[#f59e0b] mt-0.5 shrink-0"}),n.jsxs("p",{className:"text-sm text-[#e2e8f0]",children:[s," payment",s===1?"":"s"," could not be applied automatically. Open the agency, set the right tier or job slots, then mark the row handled."]})]}),n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] overflow-hidden",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{className:"bg-[#0d1117] text-[#94a3b8]",children:n.jsxs("tr",{children:[n.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Received"}),n.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Agency"}),n.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Email"}),n.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Amount"}),n.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Granted"}),n.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Result"}),n.jsx("th",{className:"px-4 py-3"})]})}),n.jsx("tbody",{children:r===void 0?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"px-4 py-10 text-center text-[#64748b]",children:"Loadingâ¦"})}):r.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:7,className:"px-4 py-10 text-center text-[#64748b]",children:[n.jsx(It,{className:"w-8 h-8 mx-auto mb-2 text-[#334155]"}),"No Stripe events recorded yet."]})}):r.map(i=>n.jsxs("tr",{className:"border-t border-[#1e293b]/60",children:[n.jsx("td",{className:"px-4 py-3 text-[#cbd5e1] whitespace-nowrap",children:XW(i.receivedAt)}),n.jsx("td",{className:"px-4 py-3",children:i.agencyId?n.jsxs(ye,{to:`/admin/agency/${i.agencyId}`,className:"text-[#00b4ff] hover:underline inline-flex items-center gap-1",children:[i.agencyName??"Agency",n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("span",{className:"text-[#f59e0b]",children:"Unmatched"})}),n.jsx("td",{className:"px-4 py-3 text-[#94a3b8]",children:i.customerEmail??"â"}),n.jsx("td",{className:"px-4 py-3 text-white",children:ZW(i.amountTotal)}),n.jsx("td",{className:"px-4 py-3 text-[#cbd5e1]",children:JW[i.action]??i.action}),n.jsxs("td",{className:"px-4 py-3",children:[n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${i.outcome==="applied"?"bg-[#22c55e]/15 text-[#22c55e] border border-[#22c55e]/25":i.resolvedAt?"bg-[#334155]/40 text-[#94a3b8] border border-[#334155]":"bg-[#f59e0b]/15 text-[#f59e0b] border border-[#f59e0b]/25"}`,children:i.outcome==="applied"?"Applied":i.resolvedAt?"Handled":"Needs review"}),i.note&&n.jsx("div",{className:"text-xs text-[#64748b] mt-1 max-w-md",children:i.note})]}),n.jsx("td",{className:"px-4 py-3 text-right",children:i.outcome==="needs_review"&&!i.resolvedAt&&n.jsxs("button",{onClick:async()=>{try{await a({eventRowId:i._id}),W.success("Marked handled.")}catch{W.error("Could not update that row.")}},className:"inline-flex items-center gap-1 px-3 py-1.5 rounded-full text-xs font-medium border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#22c55e]/40",children:[n.jsx(xn,{className:"w-3 h-3"}),"Mark handled"]})})]},i._id))})]})})]})}const eq={paid:{label:"Paid $47/yr",color:"#22c55e"},comped:{label:"Comped",color:"#22c55e"},unpaid:{label:"Unpaid",color:"#f59e0b"},canceled:{label:"Subscription canceled",color:"#ef4444"}},tq={annual129:{label:"Gold $129/yr",color:"#d4a843"},platinum47:{label:"Platinum $47/yr",color:"#a5b4fc"}},nq={paid:{label:"Paid",color:"#22c55e"},comped:{label:"Comped",color:"#22c55e"},unpaid:{label:"Not paid yet",color:"#f59e0b"},canceled:{label:"Subscription canceled",color:"#ef4444"}};function rq({partner:e}){const t=e.sponsorTier?tq[e.sponsorTier]:void 0,r=e.paymentStatus?nq[e.paymentStatus]:void 0;return!t&&!r&&!e.sponsoredAgencyName&&!e.requestedAgencyName&&!e.selfSignup?null:n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] mt-1.5",children:[t&&n.jsx("span",{className:"px-2 py-0.5 rounded-md",style:{background:`${t.color}18`,color:t.color},children:t.label}),e.selfSignup&&n.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-[#1e293b] text-[#94a3b8]",children:["Signed up on /mission",e.submittedAt?` ${new Date(e.submittedAt).toLocaleDateString()}`:""]}),r&&n.jsx("span",{className:"px-2 py-0.5 rounded-md",style:{background:`${r.color}18`,color:r.color},children:r.label}),e.sponsoredAgencyName&&n.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-[#00b4ff]/10 text-[#00b4ff]",children:["Sponsors ",e.sponsoredAgencyName]}),!e.sponsoredAgencyName&&e.requestedAgencyName&&n.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-[#f59e0b]/10 text-[#f59e0b]",children:["Wants to sponsor ",e.requestedAgencyName," (not on VET-TO-LEO)"]})]})}function XP({partner:e,category:t}){if(t==="business")return n.jsx(rq,{partner:e});if(!e.hasLogin)return null;const r=e.paymentStatus?eq[e.paymentStatus]:void 0;return n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] mt-1.5",children:[n.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-[#1e293b] text-[#94a3b8]",children:["Portal signup",e.submittedAt?` ${new Date(e.submittedAt).toLocaleDateString()}`:""]}),t==="academies"&&n.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-[#f59e0b]/10 text-[#f59e0b]",children:["POST: ",e.postAgency||"not given",e.postCertNumber?` #${e.postCertNumber}`:""]}),t==="colleges"&&r&&n.jsx("span",{className:"px-2 py-0.5 rounded-md",style:{background:`${r.color}18`,color:r.color},children:r.label}),t==="colleges"&&n.jsx("span",{className:"px-2 py-0.5 rounded-md bg-[#1e293b]",style:{color:e.officialEmailDomain?"#22c55e":"#f59e0b"},children:e.officialEmailDomain?".edu login":"Non-.edu login"}),t==="colleges"&&n.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-[#1e293b] text-[#94a3b8]",children:[e.programCount??0," programs"]})]})}function aq({items:e,category:t,onApprove:r,onComp:a,onReject:s}){return e.length===0?null:n.jsxs("div",{className:"rounded-xl border border-[#f59e0b]/40 bg-[#f59e0b]/5 p-4 space-y-3",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-sm font-bold text-[#f59e0b]",children:["Waiting for review (",e.length,")"]}),n.jsx("p",{className:"text-xs text-[#94a3b8] mt-0.5",children:t==="academies"?"Check the academy against the state POST list before approving. Approving emails the academy that it's live.":t==="business"?"Sponsors who filled out the form on /mission but haven't paid yet. They go live on their own once Stripe payment posts. List free skips the payment.":".edu colleges go live on their own once paid. These need you: unpaid, or paid with a non-.edu login."})]}),e.map(i=>n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-3 p-3 rounded-lg bg-[#111827] border border-[#1e293b]",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-white font-semibold break-words",children:i.name}),n.jsxs("div",{className:"text-xs text-[#94a3b8] mt-0.5 break-words",children:[[i.city,i.state].filter(
167Boolean).join(", ")," · ",i.email,i.contactName?` · ${i.contactName}${i.contactTitle?`, ${i.contactTitle}`:""}`:"",i.website?n.jsxs(n.Fragment,{children:[" · ",n.jsx("a",{href:i.website,target:"_blank",rel:"noreferrer",className:"text-[#00b4ff]",children:"website"})]}):null]}),n.jsx(XP,{partner:i,category:t})]}),n.jsxs("div",{className:"flex gap-2 shrink-0",children:[t!=="business"&&n.jsx(be,{size:"sm",onClick:()=>r(i._id),className:"bg-[#22c55e] hover:bg-[#16a34a] text-white",children:"Approve"}),(t==="colleges"||t==="business")&&i.paymentStatus!=="paid"&&n.jsx(be,{size:"sm",variant:"outline",onClick:()=>a(i._id),className:"border-[#22c55e]/50 text-[#22c55e]",title:"List it without payment",children:t==="business"?"List free":"Approve free"}),n.jsx(be,{size:"sm",variant:"outline",onClick:()=>s(i._id),className:"border-[#ef4444]/40 text-[#ef4444]",children:"Reject"})]})]},i._id))]})}function JP({value:e,onChange:t,className:r,labelClass:a}){return n.jsxs("div",{children:[n.jsx("label",{className:a,children:"Sponsor Level"}),n.jsxs("select",{value:e,onChange:s=>t(s.target.value),className:r,children:[n.jsx("option",{value:"annual129",children:"Gold Sponsor $129/yr (homepage + everywhere)"}),n.jsx("option",{value:"platinum47",children:"Platinum Sponsor $47/yr (/mission directory only)"}),n.jsx("option",{value:"standard",children:"Other contributor (homepage, after Gold)"})]})]})}const Sf={colleges:{title:"Colleges & Universities",subtitle:"Manage college and university partnerships.",icon:pn,color:"#8b5cf6",entityLabel:"College/University"},academies:{title:"Law Enforcement Academies",subtitle:"Manage law enforcement academy partnerships.",icon:ja,color:"#f59e0b",entityLabel:"Academy"},business:{title:"Business Contributors",subtitle:"Manage business contributors and sponsors.",icon:Rt,color:"#22c55e",entityLabel:"Business"}},QP=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],sq=5*1024*1024;function eT(e,t){if(!e.type.startsWith("image/"))return W.error("The logo must be an image file."),!1;if(e.size>sq)return W.error("Logo must be under 5 MB."),!1;const r=new FileReader;return r.onload=()=>t(r.result),r.readAsDataURL(e),!0}function tT({preview:e,color:t,Icon:r,required:a,missing:s,onPick:i}){return n.jsxs("div",{children:[a&&n.jsx("label",{className:"block text-xs font-medium text-[#94a3b8] mb-1",children:"Logo *"}),n.jsxs("div",{className:`flex items-center gap-4 ${s?"p-2 rounded-lg border border-[#ef4444]":""}`,children:[e?n.jsx("img",{src:e,alt:"Logo",className:"w-16 h-16 rounded-lg object-contain bg-white/5 p-1"}):n.jsx("div",{className:"w-16 h-16 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t}15`},children:n.jsx(r,{className:"w-8 h-8",style:{color:t}})}),n.jsxs("label",{className:"cursor-pointer inline-flex items-center gap-2 px-3 py-1.5 rounded-lg bg-[#1e293b] text-[#94a3b8] text-sm hover:text-white hover:bg-[#2a3a50] transition-colors",children:[n.jsx(Et,{className:"w-4 h-4"}),e?"Change Logo":"Upload Logo",n.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:i})]})]}),s&&n.jsx("p",{className:"text-xs text-[#ef4444] mt-1",children:"A logo is required."})]})}function iq({partner:e,category:t,onClose:r,onSave:a,onUploadLogo:s}){const i=Sf[t],o=t==="business",[c,d]=y.useState(null),[u,h]=y.useState(!1),[m,p]=y.useState(!1),[b,w]=y.useState({name:e.name,contactName:e.contactName||"",contactTitle:e.contactTitle||"",email:e.email,phone:e.phone||"",website:e.website||"",city:e.city||"",state:e.state||"",address:e.address||"",description:e.description||""}),[x,g]=y.useState(e.logoUrl||null),[j,S]=y.useState(e.sponsorTier??"standard"),[_,N]=y.useState(e.sponsoredAgencyId??""),C=ie(F.sponsors.listSponsorableAgencies,o?{}:"skip"),A=te(F.sponsors.setSponsoredAgency),P=M=>{const R=M.target.files?.[0];M.target.value="",R&&eT(R,g)&&(h(!1),o?d(R):s(e._id,R))},O=async M=>{if(M.preventDefault(),o&&!c&&!e.logoUrl){h(!0),W.error("A logo is required for every business.");return}p(!0);const R=o?{...b,sponsorTier:j}:b;let B=await a(e._id,R,o?c:null);if(B&&o&&_!==(e.sponsoredAgencyId??""))try{await A({id:e._id,agencyId:_||null})}catch{W.error("Saved, but the sponsored agency didn't update."),B=!1}p(!1),B&&r()},E="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#47
1675569]",$="block text-xs font-medium text-[#94a3b8] mb-1";return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-2xl w-full max-w-lg mx-4 shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b] sticky top-0 bg-[#111827] z-10",children:[n.jsxs("h2",{className:"text-lg font-bold text-white",children:["Edit ",i.entityLabel]}),n.jsx("button",{onClick:r,className:"text-[#94a3b8] hover:text-white p-1",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:O,className:"p-5 space-y-4",children:[n.jsx(tT,{preview:x,color:i.color,Icon:i.icon,required:o,missing:u,onPick:P}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Name"}),n.jsx("input",{value:b.name,onChange:M=>w({...b,name:M.target.value}),className:E,required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Contact Name"}),n.jsx("input",{value:b.contactName,onChange:M=>w({...b,contactName:M.target.value}),className:E})]}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Contact Title"}),n.jsx("input",{value:b.contactTitle,onChange:M=>w({...b,contactTitle:M.target.value}),className:E})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Email"}),n.jsx("input",{type:"email",value:b.email,onChange:M=>w({...b,email:M.target.value}),className:E,required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Phone"}),n.jsx("input",{value:b.phone,onChange:M=>w({...b,phone:M.target.value}),className:E})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:$,children:"City"}),n.jsx("input",{value:b.city,onChange:M=>w({...b,city:M.target.value}),className:E})]}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"State"}),n.jsxs("select",{value:b.state,onChange:M=>w({...b,state:M.target.value}),className:E,children:[n.jsx("option",{value:"",children:"Select..."}),QP.map(M=>n.jsx("option",{value:M,children:M},M))]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Address"}),n.jsx("input",{value:b.address,onChange:M=>w({...b,address:M.target.value}),className:E})]}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Website"}),n.jsx("input",{value:b.website,onChange:M=>w({...b,website:M.target.value}),className:E,placeholder:"https://"})]}),o&&n.jsx(JP,{value:j,onChange:S,className:E,labelClass:$}),o&&n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Sponsored Agency (logo shows on that agency's profile)"}),n.jsxs("select",{value:_,onChange:M=>N(M.target.value),className:E,children:[n.jsx("option",{value:"",children:"None"}),(C??[]).map(M=>n.jsxs("option",{value:M._id,children:[M.name,M.state?` (${M.state})`:""]},M._id))]}),e.requestedAgencyName&&!e.sponsoredAgencyId&&n.jsxs("p",{className:"text-[11px] text-[#f59e0b] mt-1",children:["They asked to sponsor: ",e.requestedAgencyName]})]}),n.jsxs("div",{children:[n.jsx("label",{className:$,children:"Description"}),n.jsx("textarea",{value:b.description,onChange:M=>w({...b,description:M.target.value}),className:`${E} h-20 resize-none`})]}),n.jsxs("div",{className:"flex gap-3 pt-4 border-t border-[#1e293b]",children:[n.jsx(be,{type:"submit",disabled:m,className:"flex-1 text-white font-semibold",style:{backgroundColor:i.color},children:m?"Saving...":"Save Changes"}),n.jsx(be,{type:"button",variant:"outline",onClick:r,className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b]",children:"Cancel"})]})]})]})})}function oq({category:e,onClose:t,onCreate:r}){const a=Sf[e],s=e==="business",[i,o]=y.useState({name:"",email:"",phone:"",city:"",state:"",address:"",website:"",description:"",contactName:"",contactTitle:""}),[c,d]=y.useState(null),[u,h]=y.useState("annual129"),[m,p]=y.useState(null),[b,w]=y.useState(!1),[x,g]=y.useState(!1),j=C=>{const A=C.target.files?.[0];C.target.value="",A&&eT(A,p)&&(d(A),w(!1))},S=async C=>
167{if(C.preventDefault(),!i.name||!i.email){W.error("Name and email are required.");return}if(s&&!c){w(!0),W.error("A logo is required for every business.");return}const A={};for(const[O,E]of Object.entries(i))E&&(A[O]=E);s&&(A.sponsorTier=u),g(!0);const P=await r(A,s?c:null);g(!1),P&&t()},_="w-full px-3 py-2 rounded-lg bg-[#0a0e17] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#475569]",N="block text-xs font-medium text-[#94a3b8] mb-1";return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-2xl w-full max-w-lg mx-4 shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b] sticky top-0 bg-[#111827] z-10",children:[n.jsxs("h2",{className:"text-lg font-bold text-white",children:["Add ",a.entityLabel]}),n.jsx("button",{onClick:t,className:"text-[#94a3b8] hover:text-white p-1",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:S,className:"p-5 space-y-4",children:[s&&n.jsx(tT,{preview:m,color:a.color,Icon:a.icon,required:!0,missing:b,onPick:j}),n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Name *"}),n.jsx("input",{value:i.name,onChange:C=>o({...i,name:C.target.value}),className:_,required:!0})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Contact Name"}),n.jsx("input",{value:i.contactName,onChange:C=>o({...i,contactName:C.target.value}),className:_})]}),n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Contact Title"}),n.jsx("input",{value:i.contactTitle,onChange:C=>o({...i,contactTitle:C.target.value}),className:_})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Email *"}),n.jsx("input",{type:"email",value:i.email,onChange:C=>o({...i,email:C.target.value}),className:_,required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Phone"}),n.jsx("input",{value:i.phone,onChange:C=>o({...i,phone:C.target.value}),className:_})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:N,children:"City"}),n.jsx("input",{value:i.city,onChange:C=>o({...i,city:C.target.value}),className:_})]}),n.jsxs("div",{children:[n.jsx("label",{className:N,children:"State"}),n.jsxs("select",{value:i.state,onChange:C=>o({...i,state:C.target.value}),className:_,children:[n.jsx("option",{value:"",children:"Select..."}),QP.map(C=>n.jsx("option",{value:C,children:C},C))]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Website"}),n.jsx("input",{value:i.website,onChange:C=>o({...i,website:C.target.value}),className:_,placeholder:"https://"})]}),s&&n.jsx(JP,{value:u,onChange:h,className:_,labelClass:N}),n.jsxs("div",{children:[n.jsx("label",{className:N,children:"Description"}),n.jsx("textarea",{value:i.description,onChange:C=>o({...i,description:C.target.value}),className:`${_} h-20 resize-none`})]}),n.jsxs("div",{className:"flex gap-3 pt-4 border-t border-[#1e293b]",children:[n.jsx(be,{type:"submit",disabled:x,className:"flex-1 text-white font-semibold",style:{backgroundColor:a.color},children:x?"Saving...":`Create ${a.entityLabel}`}),n.jsx(be,{type:"button",variant:"outline",onClick:t,className:"border-[#1e293b] text-[#94a3b8] hover:bg-[#1e293b]",children:"Cancel"})]})]})]})})}function lq({partner:e,category:t,onEdit:r,onSuspend:a,onReactivate:s,onDelete:i}){const o=Sf[t],d={active:{bg:"bg-[#22c55e]/10",text:"text-[#22c55e]",label:"Active"},pending:{bg:"bg-[#f59e0b]/10",text:"text-[#f59e0b]",label:"Pending"},suspended:{bg:"bg-[#ef4444]/10",text:"text-[#ef4444]",label:"Suspended"}}[e.status];return n.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-xl bg-[#111827] border border-[#1e293b] hover:border-[#1e293b80] transition-all",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-12 h-12 rounded-lg object-contain bg-white/5 p-1 flex-shrink-0"}):n.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${o.color}15`},children:n.jsx(o.icon,{className:"w-6 h-6",style:{color:o.color}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-semibold truncate",children:e.name}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold ${d.bg} ${d.text}`,children:d.label})]}),n.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#475569] mt-0.5",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Sn,{className:"w-3 h-3"}),e.email]}),(e.city||e.state)&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(wt,{className:"w-3 h-3"}),e.city?`${e.city}, `:"",e.state]})]}),n.jsx(XP,{partner:e,category:t})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[n.jsx("button",{onClick:r,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#00b4ff] hover:bg-[#00b4ff]/10 transition-colors",title:"Edit",children:n.jsx(qt,{className:"w-4 h-4"})}),e.status==="active"?n.jsx("button",{onClick:a,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#f59e0b] hover:bg-[#f59e0b]/10 transition-colors",title:"Suspend",children:n.jsx(Qh,{className:"w-4 h-4"})}):e.status==="suspended"?n.jsx("button",{onClick:s,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#22c55e] hover:bg-[#22c55e]/10 transition-colors",title:"Reactivate",children:n.jsx(ef,{className:"w-4 h-4"})}):null,n.jsx("button",{onClick:i,className:"p-2 rounded-lg text-[#94a3b8] hover:text-[#ef4444] hover:bg-[#ef4444]/10 transition-colors",title:"Delete",children:n.jsx(_n,{className:"w-4 h-4"})})]})]})}function gp({category:e}){const t=Sf[e],r=ie(e==="colleges"?F.partners.getAllColleges:e==="academies"?F.partners.getAllAcademies:F.partners.getAllBusinessContributors),a=ie(e==="colleges"?F.partners.getCollegeStats:e==="academies"?F.partners.getAcademyStats:F.partners.getBusinessStats),s=te(F.partners.createCollege),i=te(F.partners.createAcademy),o=te(F.partners.createBusinessContributor),c=te(F.partners.updateCollege),d=te(F.partners.updateAcademy),u=te(F.partners.updateBusinessContributor),h=te(F.partners.setCollegeStatus),m=te(F.partners.setAcademyStatus),p=te(F.partners.setBusinessStatus),b=te(F.partners.deleteCollege),w=te(F.partners.deleteAcademy),x=te(F.partners.deleteBusinessContributor),g=te(F.partners.uploadCollegeLogo),j=te(F.partners.uploadAcademyLogo),S=te(F.partners.uploadBusinessLogo),_=te(F.storage.generateUploadUrl),N=te(F.partners.compCollegeListing),C=te(F.sponsors.compSponsor),A=(r??[]).filter(J=>J.status==="pending"),[P,O]=y.useState(""),[E,$]=y.useState("all"),[M,R]=y.useState(null),[B,D]=y.useState(!1),U=(r??[]).filter(J=>{if(J.status==="pending"||E!=="all"&&J.status!==E)return!1;if(P){const ae=P.toLowerCase();
167return J.name.toLowerCase().includes(ae)||J.email.toLowerCase().includes(ae)||J.state?.toLowerCase().includes(ae)}return!0}),H=async J=>{const ae=await _(),ue=await fetch(ae,{method:"POST",headers:{"Content-Type":J.type},body:J});if(!ue.ok)throw new Error("Logo upload failed.");const{storageId:ee}=await ue.json();return ee},K=(J,ae)=>{const ue=J instanceof Error?J.message:"",ee=ue.match(/Uncaught Error: (.*?)(\n|$)/);return ee?ee[1]:ue&&!ue.includes("[CONVEX")?ue:ae},z=async(J,ae)=>{try{if(e==="colleges")await s(J);else if(e==="academies")await i(J);else{if(!ae)return W.error("A logo is required for every business."),!1;const ue=await H(ae);await o({...J,logoStorageId:ue})}return W.success(`${t.entityLabel} created.`),!0}catch(ue){return W.error(K(ue,"Failed to create.")),!1}},X=async(J,ae,ue)=>{try{if(e==="colleges")await c({id:J,...ae});else if(e==="academies")await d({id:J,...ae});else{if(ue){const ee=await H(ue);await S({id:J,storageId:ee})}await u({id:J,...ae})}return W.success(`${t.entityLabel} updated.`),!0}catch(ee){return W.error(K(ee,"Failed to update.")),!1}},G=async(J,ae)=>{try{const ue=await _(),ee=await fetch(ue,{method:"POST",headers:{"Content-Type":ae.type},body:ae}),{storageId:Y}=await ee.json();e==="colleges"?await g({id:J,storageId:Y}):e==="academies"?await j({id:J,storageId:Y}):await S({id:J,storageId:Y}),W.success("Logo updated.")}catch{W.error("Failed to upload logo.")}},Q=async J=>{try{e==="colleges"?await h({id:J,status:"suspended"}):e==="academies"?await m({id:J,status:"suspended"}):await p({id:J,status:"suspended"}),W.success("Suspended.")}catch{W.error("Failed.")}},re=async J=>{try{e==="colleges"?await h({id:J,status:"active"}):e==="academies"?await m({id:J,status:"active"}):await p({id:J,status:"active"}),W.success("Reactivated.")}catch{W.error("Failed.")}},ce=async J=>{try{e==="colleges"?await h({id:J,status:"active"}):await m({id:J,status:"active"}),W.success("Approved. The listing is live and the school was emailed.")}catch(ae){W.error(K(ae,"Failed to approve."))}},fe=async J=>{if(confirm(e==="business"?"List this sponsor for free, without the Stripe payment? Its logo goes live now.":"List this college for free, without the $47/yr payment?"))try{e==="business"?await C({id:J}):await N({id:J}),W.success("Approved as a free listing.")}catch(ae){W.error(K(ae,"Failed."))}},me=async J=>{if(confirm("Reject this listing? It stays hidden and moves to Suspended. You can delete it from there."))try{e==="colleges"?await h({id:J,status:"suspended"}):e==="business"?await p({id:J,status:"suspended"}):await m({id:J,status:"suspended"}),W.success("Rejected.")}catch(ae){W.error(K(ae,"Failed."))}},pe=async J=>{if(confirm(`Permanently delete this ${t.entityLabel.toLowerCase()}?`))try{e==="colleges"?await b({id:J}):e==="academies"?await w({id:J}):await x({id:J}),W.success("Deleted.")}catch{W.error("Failed.")}},Re=t.icon;return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(Re,{className:"w-6 h-6",style:{color:t.color}}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:t.title}),a&&n.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold",style:{backgroundColor:`${t.color}20`,color:t.color},children:[a.activeCount," active"]})]}),n.jsx("p",{className:"text-[#94a3b8]",children:t.subtitle})]}),n.jsxs(be,{onClick:()=>D(!0),className:"text-white font-semibold gap-2",style:{backgroundColor:t.color},children:[n.jsx(pt,{className:"w-4 h-4"}),"Add ",t.entityLabel]})]}),n.jsx(aq,{items:A,category:e,onApprove:ce,onComp:fe,onReject:me}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Dt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#475569]"}),n.jsx("input",{value:P,onChange:J=>O(J.target.value),placeholder:"Search by name, email, or state...",className:"w-full pl-10 pr-4 py-2.5 rounded-xl bg-[#111827] border border-[#1e293b] text-white text-sm focus:border-[#00b4ff] focus:outline-none placeholder-[#47
1675569]"})]}),n.jsx("div",{className:"flex rounded-xl overflow-hidden border border-[#1e293b]",children:["all","active","suspended"].map(J=>n.jsx("button",{onClick:()=>$(J),className:`px-4 py-2.5 text-xs font-semibold capitalize transition-colors ${E===J?"text-white":"bg-[#111827] text-[#94a3b8] hover:text-white"}`,style:E===J?{backgroundColor:`${t.color}25`,color:t.color}:{},children:J},J))})]}),U.length>0?n.jsx("div",{className:"space-y-2",children:U.map(J=>n.jsx(lq,{partner:J,category:e,onEdit:()=>R(J),onSuspend:()=>Q(J._id),onReactivate:()=>re(J._id),onDelete:()=>pe(J._id)},J._id))}):n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-10 text-center",children:[n.jsx(Re,{className:"w-10 h-10 mx-auto mb-3",style:{color:`${t.color}60`}}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:P?"No results match your search":`No ${t.title.toLowerCase()} yet`}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:P?"Try a different search term.":`Add your first ${t.entityLabel.toLowerCase()} using the button above.`})]}),M&&n.jsx(iq,{partner:M,category:e,onClose:()=>R(null),onSave:X,onUploadLogo:G}),B&&n.jsx(oq,{category:e,onClose:()=>D(!1),onCreate:z})]})}const Hu={agency:"Law Enforcement Agency",academy:"LE Academy",college:"College / University",business:"Business Contributor",other:"Other"},nT={agency:"#00b4ff",academy:"#8b5cf6",college:"#22c55e",business:"#f59e0b",other:"#94a3b8"},cq={scheduled:"Scheduled",completed:"Completed",cancelled:"Cancelled","no-show":"No Show"},dq={scheduled:"#00b4ff",completed:"#22c55e",cancelled:"#94a3b8","no-show":"#ef4444"},uq=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function hq(e,t){return new Date(e,t+1,0).getDate()}function fq(e,t){return new Date(e,t,1).getDay()}function rT(e){const[t,r,a]=e.split("-").map(Number);return new Date(t,r-1,a).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}function bp(e){const[t,r]=e.split(":").map(Number),a=t>=12?"PM":"AM";return`${t===0?12:t>12?t-12:t}:${r.toString().padStart(2,"0")} ${a}`}function mq({appointment:e,onClose:t,onSave:r}){const a=!!e,[s,i]=y.useState({title:e?.title??"",description:e?.description??"",organizationType:e?.organizationType??"agency",organizationName:e?.organizationName??"",contactName:e?.contactName??"",contactEmail:e?.contactEmail??"",contactPhone:e?.contactPhone??"",date:e?.date??new Date().toISOString().split("T")[0],startTime:e?.startTime??"09:00",endTime:e?.endTime??"09:30",location:e?.location??"",notes:e?.notes??""}),o=(d,u)=>{i(h=>({...h,[d]:u}))},c=d=>{d.preventDefault(),!(!s.title.trim()||!s.organizationName.trim())&&r(s)};return n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:n.jsxs("div",{className:"w-full max-w-xl bg-[#111827] border border-[#1e293b] rounded-2xl shadow-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b]",children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:a?"Edit Appointment":"New Appointment"}),n.jsx("button",{onClick:t,className:"p-1.5 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:c,className:"p-5 space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Appointment Title *"}),n.jsx("input",{type:"text",value:s.title,onChange:d=>o("title",d.target.value),placeholder:"e.g. Onboarding Call, Partnership Discussion",className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors",required:!0})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Organization Type"}),n.jsx("select",{value:s.organizationType,onChange:d=>o("organizationType",d.target.value),className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white focus:outline-none focus:border-[#00b4ff] transition-colors",children:Object.entries(Hu).map(([d,u])=>n.jsx("option",{value:d,children:u},d))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb
167-1 block",children:"Organization Name *"}),n.jsx("input",{type:"text",value:s.organizationName,onChange:d=>o("organizationName",d.target.value),placeholder:"Agency / school name",className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors",required:!0})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Date *"}),n.jsx("input",{type:"date",value:s.date,onChange:d=>{const u=d.target.value;if(u){const[h,m,p]=u.split("-").map(Number),b=new Date(h,m-1,p).getDay();if(b===0||b>=4){alert("Only Monday through Wednesday are available for scheduling.");return}}o("date",u)},className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white focus:outline-none focus:border-[#00b4ff] transition-colors [color-scheme:dark]",required:!0}),n.jsx("p",{className:"text-[10px] text-[#475569] mt-1",children:"Mon â Wed only"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:["Time Slot * ",n.jsx("span",{className:"text-[10px] text-[#475569] font-normal",children:"(Pacific)"})]}),n.jsx("select",{value:s.startTime,onChange:d=>{const u=d.target.value,[h,m]=u.split(":").map(Number);let p=m+30,b=h;p>=60&&(b++,p-=60);const w=`${String(b).padStart(2,"0")}:${String(p).padStart(2,"0")}`;o("startTime",u),o("endTime",w)},className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white focus:outline-none focus:border-[#00b4ff] transition-colors",required:!0,children:["09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00"].map(d=>{const[u,h]=d.split(":").map(Number),m=u>=12?"PM":"AM",p=u===0?12:u>12?u-12:u;return n.jsxs("option",{value:d,children:[p,":",String(h).padStart(2,"0")," ",m]},d)})}),n.jsx("p",{className:"text-[10px] text-[#475569] mt-1",children:"30-min slots, 9 AM â 4:30 PM PT"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Contact Name"}),n.jsx("input",{type:"text",value:s.contactName,onChange:d=>o("contactName",d.target.value),placeholder:"Contact person",className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Contact Email"}),n.jsx("input",{type:"email",value:s.contactEmail,onChange:d=>o("contactEmail",d.target.value),placeholder:"[email protected]",className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Contact Phone"}),n.jsx("input",{type:"tel",value:s.contactPhone,onChange:d=>o("contactPhone",d.target.value),placeholder:"(555) 555-5555",className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Location"}),n.jsx("input",{type:"text",value:s.location,onChange:d=>o("location",d.target.value),placeholder:"Virtual, office address, etc.",className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Description"}),n.jsx("textarea",{value:s.description,onChange:d=>o("description",d.target.value),placeholder:"Brief description of the meeting purpose...",rows:2,className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#47
1675569] focus:outline-none focus:border-[#00b4ff] transition-colors resize-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-[#94a3b8] mb-1 block",children:"Notes"}),n.jsx("textarea",{value:s.notes,onChange:d=>o("notes",d.target.value),placeholder:"Internal notes...",rows:2,className:"w-full px-3 py-2.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-white placeholder-[#475569] focus:outline-none focus:border-[#00b4ff] transition-colors resize-none"})]}),n.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[n.jsx("button",{type:"submit",className:"flex-1 px-4 py-2.5 rounded-lg bg-[#00b4ff] text-white font-semibold hover:bg-[#0090cc] transition-colors",children:a?"Save Changes":"Create Appointment"}),n.jsx("button",{type:"button",onClick:t,className:"px-4 py-2.5 rounded-lg border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#475569] transition-colors",children:"Cancel"})]})]})]})})}function zd({appt:e,onEdit:t,onStatusChange:r,onDelete:a,compact:s}){const i=!!e.isAutoBlocked,o=i?"#eab308":nT[e.organizationType]??"#94a3b8",c=dq[e.status]??"#94a3b8",d=i?"Blocked Out":e.title;return s?n.jsxs("button",{type:"button",onClick:t,className:"w-full text-left px-2 py-1 rounded text-xs truncate transition-colors hover:brightness-125",style:{backgroundColor:`${o}20`,color:o,borderLeft:`3px solid ${o}`},children:[n.jsx("span",{className:"font-medium",children:bp(e.startTime)})," ",d]}):n.jsx("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4 hover:border-[#1e293b80] transition-colors",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[n.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",style:{backgroundColor:`${o}20`,color:o},children:i?"Blocked Out":Hu[e.organizationType]??"Other"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider",style:{backgroundColor:`${c}20`,color:c},children:cq[e.status]??e.status})]}),n.jsx("h3",{className:"text-white font-semibold truncate cursor-pointer hover:text-[#00b4ff] transition-colors",onClick:t,children:d}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:i?"System-generated block":e.organizationName}),n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-2 text-xs text-[#94a3b8]",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Cr,{className:"w-3 h-3"}),rT(e.date)]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(At,{className:"w-3 h-3"}),bp(e.startTime)," - ",bp(e.endTime)]}),e.location&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(wt,{className:"w-3 h-3"}),e.location]})]}),(e.contactName||e.contactEmail||e.contactPhone)&&n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 mt-1.5 text-xs text-[#64748b]",children:[e.contactName&&n.jsx("span",{children:e.contactName}),e.contactEmail&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Sn,{className:"w-3 h-3"}),e.contactEmail]}),e.contactPhone&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(zo,{className:"w-3 h-3"}),e.contactPhone]})]})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.status==="scheduled"&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",onClick:()=>r("completed"),title:"Mark Completed",className:"p-1.5 rounded-lg hover:bg-[#22c55e]/10 text-[#475569] hover:text-[#22c55e] transition-colors",children:n.jsx(gn,{className:"w-4 h-4"})}),n.jsx("button",{type:"button",onClick:()=>r("cancelled"),title:"Cancel",className:"p-1.5 rounded-lg hover:bg-[#94a3b8]/10 text-[#475569] hover:text-[#94a3b8] transition-colors",children:n.jsx(Wo,{className:"w-4 h-4"})})]}),n.jsx("button",{type:"button",onClick:a,title:"Delete",className:"p-1.5 rounded-lg hover:bg-[#ef4444]/10 text-[#475569] hover:text-[#ef4444] transition-colors",children:n.jsx(_n,{className:"w-4 h-4"})})]})]})})}function pq(){const[e,t]=y.useState(new Date),[r,a]=y.useState(null),[s,i]=y.useState(!1),[o,c]=y.useState(null),[d,u]=y.useState("all"),[h,m]=y.useState("calendar"),p=e.getFullYear(),b=e.getMonth(),w=`${p}-${String(b+1).padStart(2,"0")}`,x=new Date().toISOString().split("T")[0],g=ie(F.calendar.listAppointments,{month:w,organizationType:d!=="all"?d:void 0}),j=ie(F.calendar.getCalendarStats),S=ie(F.calendar.getUpcomingAppointments,{limit:5}),_=te(F.calendar.createAppointment),N=te(F.calendar.updateAppointment),C=te(F.calendar.deleteAppointment),A=y.useMemo(()=>{const Q={};for(const re of g??[])Q[re.date]||(Q[re.date]=[]),Q[re.date].push(re);return Q},[g]),P=y.useCallback(()=>{t(new Date(p,b-1,1))},[p,b]),O=y.useCallback(()=>{t(new Date(p,b+1,1))},[p,b]),E=y.useCallback(()=>{t(new Date)},[]),$=async Q=>{o?await N({id:o._id,...Q}):await _(Q),i(!1),c(null)},M=Q=>{c(Q),i(!0)},R=async(Q,re)=>{await N({id:Q,status:re})},B=async Q=>{window.confirm("Delete this appointment?")&&await C({id:Q})},D=Q=>{a(Q===r?null:Q)},U=Q=>{c(null),i(!0),a(Q)},H=hq(p,b),K=fq(p,b),z=Math.ceil((K+H)/7)*7,X=e.toLocaleDateString("en-US",{month:"long",year:"numeric"}),G=r&&A[r]?A[r]:[];return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(Cr,{className:"w-6 h-6 text-[#00b4ff]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Calendar"})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"Schedule and manage appointments with agencies, academies, and partners."})]}),n.jsxs("button",{type:"button",onClick:()=>{c(null),i(!0)},className:"flex items-center gap-2 px-4 py-2.5 rounded-lg bg-[#00b4ff] text-white font-semibold hover:bg-[#0090cc] transition-colors shrink-0",children:[n.jsx(pt,{className:"w-4 h-4"}),"New Appointment"]})]}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:j?.todayCount??0}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:"Today"})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:j?.upcomingCount??0}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:"Upcoming"})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:j?.thisMonthCount??0}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:"This Month"})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:j?.completedCount??0}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:"Completed"})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:P,className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Xh,{className:"w-5 h-5"})}),n.jsx("h2",{className:"text-lg font-semibold text-white min-w-[180px] text-center",children:X}),n.jsx("button",{type:"button",onClick:O,className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-white transition-colors",children:n.jsx(Ya,{className:"w-5 h-5"})}),n.jsx("button",{type:"button",onClick:E,className:"px-3 py-1.5 rounded-lg text-xs font-medium border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#47
1675569] transition-colors ml-1",children:"Today"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex rounded-lg border border-[#1e293b] overflow-hidden",children:[n.jsx("button",{type:"button",onClick:()=>m("calendar"),className:`px-3 py-1.5 text-xs font-medium transition-colors ${h==="calendar"?"bg-[#00b4ff] text-white":"text-[#94a3b8] hover:text-white hover:bg-[#1e293b]"}`,children:"Calendar"}),n.jsx("button",{type:"button",onClick:()=>m("list"),className:`px-3 py-1.5 text-xs font-medium transition-colors ${h==="list"?"bg-[#00b4ff] text-white":"text-[#94a3b8] hover:text-white hover:bg-[#1e293b]"}`,children:"List"})]}),n.jsxs("select",{value:d,onChange:Q=>u(Q.target.value),className:"px-3 py-1.5 bg-[#0a0e17] border border-[#1e293b] rounded-lg text-sm text-[#94a3b8] focus:outline-none focus:border-[#00b4ff]",children:[n.jsx("option",{value:"all",children:"All Types"}),Object.entries(Hu).map(([Q,re])=>n.jsx("option",{value:Q,children:re},Q))]})]})]}),h==="calendar"?n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsx("div",{className:"lg:col-span-2",children:n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] overflow-hidden",children:[n.jsx("div",{className:"grid grid-cols-7 border-b border-[#1e293b]",children:uq.map(Q=>n.jsx("div",{className:"py-2.5 text-center text-xs font-semibold text-[#94a3b8] uppercase tracking-wider",children:Q},Q))}),n.jsx("div",{className:"grid grid-cols-7",children:Array.from({length:z},(Q,re)=>{const ce=re-K+1,fe=ce>=1&&ce<=H,me=fe?`${p}-${String(b+1).padStart(2,"0")}-${String(ce).padStart(2,"0")}`:"",pe=me===x,Re=me===r,J=fe?A[me]??[]:[],ae=fe?new Date(p,b,ce).getDay():-1,ue=fe&&(ae===0||ae>=4);return n.jsx("div",{className:`min-h-[90px] border-b border-r border-[#1e293b]/50 p-1.5 transition-colors ${fe?ue?"bg-[#0a0e17]/80 cursor-default":"cursor-pointer hover:bg-[#0a0e17]":"bg-[#0a0e17]/30"} ${Re?"bg-[#00b4ff]/5 ring-1 ring-inset ring-[#00b4ff]/30":""}`,onClick:()=>fe&&!ue&&D(me),onDoubleClick:()=>fe&&!ue&&U(me),children:fe&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:`text-xs font-medium w-6 h-6 flex items-center justify-center rounded-full ${pe?"bg-[#00b4ff] text-white":ue?"text-[#374151]":"text-[#94a3b8]"}`,children:ce}),ue&&n.jsx("span",{className:"text-[9px] text-[#374151] font-medium uppercase",children:"Closed"}),!ue&&J.length>0&&n.jsx("span",{className:"text-[10px] text-[#475569]",children:J.length})]}),!ue&&n.jsxs("div",{className:"space-y-0.5",children:[J.slice(0,3).map(ee=>n.jsx(zd,{appt:ee,onEdit:()=>M(ee),onStatusChange:Y=>R(ee._id,Y),onDelete:()=>B(ee._id),compact:!0},ee._id)),J.length>3&&n.jsxs("div",{className:"text-[10px] text-[#475569] pl-2",children:["+",J.length-3," more"]})]})]})},re)})})]})}),n.jsxs("div",{className:"space-y-4",children:[r&&n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-semibold text-white",children:rT(r)}),n.jsxs("button",{type:"button",onClick:()=>U(r),className:"flex items-center gap-1 px-2 py-1 rounded-md text-xs text-[#00b4ff] hover:bg-[#00b4ff]/10 transition-colors",children:[n.jsx(pt,{className:"w-3 h-3"})," Add"]})]}),G.length===0?n.jsx("p",{className:"text-[#475569] text-sm",children:"No appointments on this date."}):n.jsx("div",{className:"space-y-2",children:G.map(Q=>n.jsx(zd,{appt:Q,onEdit:()=>M(Q),onStatusChange:re=>R(Q._id,re),onDelete:()=>B(Q._id)},Q._id))})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Upcoming Appointments"}),!S||S.length===0?n.jsx("p",{className:"text-[#475569] text-sm",children:"No upcoming appointments."}):n.jsx("div",{className:"space-y-2",children:S.map(Q=>n.jsx(zd,{appt:Q,onEdit:()=>M(Q),onStatusChange:re=>R(Q._id,re),onDelete:()=>B(Q._id)},Q._id))})]}),n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Legend"}),n.jsxs("div",{className:"space-y-1.5",children:[Object.entries(Hu).map(([Q,re])=>n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:nT[Q]}}),n.jsx("span",{className:"text-xs text-[#94a3b8]",children:re})]},Q)),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:"#eab308"}}),n.jsx("span",{className:"text-xs text-[#94a3b8]",children:"Blocked Out (Auto)"})]})]})]})]})]}):n.jsx("div",{className:"space-y-3",children:!g||g.length===0?n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-8 text-center",children:[n.jsx(Cr,{className:"w-10 h-10 text-[#475569] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:"No appointments this month"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:'Click "New Appointment" to schedule one.'})]}):g.map(Q=>n.jsx(zd,{appt:Q,onEdit:()=>M(Q),onStatusChange:re=>R(Q._id,re),onDelete:()=>B(Q._id)},Q._id))}),s&&n.jsx(mq,{appointment:o??(r?{date:r}:void 0),onClose:()=>{i(!1),c(null)},onSave:$})]})}function xq(){const e=ie(F.admin.listAgenciesForCarousel)??[],t=te(F.admin.toggleCarousel),[r,a]=y.useState(""),[s,i]=y.useState("all"),o=[...new Set(e.map(m=>m.state))].sort(),c=e.filter(m=>{const p=m.name.toLowerCase().includes(r.toLowerCase()),b=s==="all"||m.state===s;return p&&b}),d=c.filter(m=>m.showInCarousel),u=c.filter(m=>!m.showInCarousel),h=async(m,p)=>{await t({agencyId:m,show:p})};return n.jsxs("div",{className:"p-6 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"mb-6",children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Logo Carousel Manager"}),n.jsx("p",{className:"text-gray-400 text-sm",children:"Control which agency logos appear in the homepage carousel. Toggle agencies on or off."})]}),n.jsxs("div",{className:"flex gap-4 mb-6",children:[n.jsxs("div",{className:"bg-gray-800 rounded-lg px-4 py-3 flex-1",children:[n.jsx("div",{className:"text-2xl font-bold text-green-400",children:e.filter(m=>m.showInCarousel).length}),n.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"In Carousel"})]}),n.jsxs("div",{className:"bg-gray-800 rounded-lg px-4 py-3 flex-1",children:[n.jsx("div",{className:"text-2xl font-bold text-gray-400",children:e.filter(m=>!m.showInCarousel).length}),n.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"Hidden"})]}),n.jsxs("div",{className:"bg-gray-800 rounded-lg px-4 py-3 flex-1",children:[n.jsx("div",{className:"text-2xl font-bold text-blue-400",children:e.length}),n.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"Total Active"})]})]}),n.jsxs("div",{className:"flex gap-3 mb-6",children:[n.jsx("input",{type:"text",placeholder:"Search agencies...",value:r,onChange:m=>a(m.target.value),className:"flex-1 bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-sm text-white placeholder-gray-500 focus:outline-none focus:border-blue-500"}),n.jsxs("select",{value:s,onChange:m=>i(m.target.value),className:"bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 text-sm text-white focus:outline-none focus:border-blue-500",children:[n.jsx("option",{value:"all",children:"All States"}),o.map(m=>n.jsx("option",{value:m,children:m},m))]})]}),n.jsxs("div",{className:"mb-8",children:[n.jsxs("h2",{className:"text-sm font-bold text-green-400 uppercase tracking-wider mb-3",children:["Showing in Carousel (",d.length,")"]}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 ga
167p-3",children:d.map(m=>n.jsx(MN,{agency:m,onToggle:()=>h(m._id,!1),active:!0},m._id))}),d.length===0&&n.jsx("p",{className:"text-gray-600 text-sm py-4",children:"No agencies match your filter."})]}),u.length>0&&n.jsxs("div",{children:[n.jsxs("h2",{className:"text-sm font-bold text-gray-500 uppercase tracking-wider mb-3",children:["Hidden from Carousel (",u.length,")"]}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:u.map(m=>n.jsx(MN,{agency:m,onToggle:()=>h(m._id,!0),active:!1},m._id))})]})]})}function MN({agency:e,onToggle:t,active:r}){return n.jsxs("div",{className:`relative rounded-xl p-4 flex flex-col items-center text-center transition-all ${r?"bg-gray-800 border border-gray-700":"bg-gray-900 border border-gray-800 opacity-60"}`,children:[n.jsx("div",{className:"w-14 h-14 flex items-center justify-center mb-2",children:e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"max-w-full max-h-full object-contain"}):n.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-700 flex items-center justify-center text-[10px] text-gray-500",children:"No Logo"})}),n.jsx("p",{className:"text-xs text-gray-300 font-medium leading-tight mb-1 line-clamp-2",children:e.name}),n.jsx("p",{className:"text-[10px] text-gray-600 mb-3",children:e.state}),n.jsx("button",{onClick:t,className:`w-full text-xs font-semibold py-1.5 rounded-lg transition-colors ${r?"bg-red-900/30 text-red-400 hover:bg-red-900/50 border border-red-900/50":"bg-green-900/30 text-green-400 hover:bg-green-900/50 border border-green-900/50"}`,children:r?"Remove":"Add"})]})}const da="#d4a843";function gq({status:e}){const t={active:"bg-green-500/20 text-green-400",expired:"bg-red-500/20 text-red-400",draft:"bg-gray-500/20 text-gray-400"},r={active:n.jsx(v0,{className:"w-3 h-3"}),expired:n.jsx(Wo,{className:"w-3 h-3"}),draft:n.jsx(At,{className:"w-3 h-3"})};return n.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${t[e]||t.draft}`,children:[r[e]," ",e]})}function bq({tier:e}){const t={platinum:"bg-purple-500/20 text-purple-300",member:"bg-[#d4a843]/20 text-[#d4a843]",participating:"bg-blue-500/20 text-blue-300"};return n.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium uppercase ${t[e]||t.participating}`,children:e})}function vq({open:e,onClose:t}){const r=ie(F.admin.getAllAgencies),a=te(F.admin.adminCreateJob),[s,i]=y.useState(!1),[o,c]=y.useState({agencyId:"",title:"",description:"",applicationUrl:"",salary:"",jobType:"",recruitmentType:"limited",expiresAt:"",featured:!1}),[d,u]=y.useState(""),[h,m]=y.useState(!1),p=r?.filter(g=>g.status==="active")??[],b=d?p.filter(g=>g.name.toLowerCase().includes(d.toLowerCase())||g.state.toLowerCase().includes(d.toLowerCase())):p,w=p.find(g=>g._id===o.agencyId),x=async g=>{if(g.preventDefault(),!o.agencyId||!o.title.trim()||!o.description.trim()){alert("Agency, title, and description are required.");return}i(!0);try{const j=o.recruitmentType==="limited"&&o.expiresAt?new Date(o.expiresAt).getTime():void 0;await a({agencyId:o.agencyId,title:o.title.trim(),description:o.description.trim(),applicationUrl:o.applicationUrl.trim()||void 0,salary:o.salary.trim()||void 0,jobType:o.jobType.trim()||void 0,recruitmentType:o.recruitmentType,expiresAt:j,featured:o.featured}),t()}catch(j){alert(j instanceof Error?j.message:"Failed to create job")}finally{i(!1)}};return e?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:n.jsxs("div",{className:"bg-[#111827] border border-[#1e293b] rounded-xl w-full max-w-lg max-h-[90vh] overflow-y-auto p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-5",children:[n.jsxs("h2",{className:"text-lg font-bold text-white flex items-center gap-2",children:[n.jsx(pt,{className:"w-5 h-5",style:{color:da}}),"Add Job Posting"]}),n.jsx("button",{onClick:t,className:"text-gray-500 hover:text-white",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("form",{onSubmit:x,className:"space-y-4",children:[n.jsxs("div",{className:"relative",children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Agency *"}),w?n.jsxs("div",{className:"flex items-center justify-between bg-[#0d1117] border border-[#1e293b] rounded-lg px-3 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[w.logoUrl?n.jsx("img",{src:w.logoUrl,alt:"",className:"w-5 h-5 rounded object-contain bg-white/10"}):n.jsx("div",{className:"w-5 h-5 rounded bg-[#1e293b] flex items-center justify-center text-[9px] text-gray-500",children:w.name[0]}),n.jsx("span",{className:"text-sm text-white",children:w.name}),n.jsx("span",{className:"text-xs text-gray-500",children:w.state})]}),n.jsx("button",{type:"button",onClick:()=>c(g=>({...g,agencyId:""})),className:"text-gray-500 hover:text-white",children:n.jsx(Me,{className:"w-4 h-4"})})]}):n.jsxs(n.Fragment,{children:[n.jsx("input",{type:"text",placeholder:"Search agencies...",value:d,onChange:g=>{u(g.target.value),m(!0)},onFocus:()=>m(!0),className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"}),h&&n.jsxs("div",{className:"absolute z-10 top-full left-0 right-0 mt-1 max-h-48 overflow-y-auto bg-[#0d1117] border border-[#1e293b] rounded-lg shadow-lg",children:[b.slice(0,20).map(g=>n.jsxs("button",{type:"button",className:"w-full text-left px-3 py-2 text-sm text-white hover:bg-[#1e293b] flex items-center gap-2",onClick:()=>{c(j=>({...j,agencyId:g._id})),m(!1),u("")},children:[g.logoUrl?n.jsx("img",{src:g.logoUrl,alt:"",className:"w-5 h-5 rounded object-contain bg-white/10"}):n.jsx("div",{className:"w-5 h-5 rounded bg-[#1e293b] flex items-center justify-center text-[9px] text-gray-500",children:g.name[0]}),n.jsx("span",{children:g.name}),n.jsxs("span",{className:"text-xs text-gray-500 ml-auto",children:[g.city?`${g.city}, `:"",g.state]})]},g._id)),b.length===0&&n.jsx("div",{className:"px-3 py-3 text-sm text-gray-500 text-center",children:"No agencies found"}),b.length>20&&n.jsxs("div",{className:"px-3 py-2 text-xs text-gray-600 text-center",children:["Type to narrow ",b.length," agencies..."]})]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Job Title *"}),n.jsx("input",{value:o.title,onChange:g=>c(j=>({...j,title:g.target.value})),placeholder:"e.g., Police Officer - Entry Level",className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Salary Range"}),n.jsx("input",{value:o.salary,onChange:g=>c(j=>({...j,salary:g.target.value})),placeholder:"e.g., $55,000 - $72,000",className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Job Type"}
167),n.jsx("input",{value:o.jobType,onChange:g=>c(j=>({...j,jobType:g.target.value})),placeholder:"e.g., Patrol, Detention",className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Application URL"}),n.jsx("input",{value:o.applicationUrl,onChange:g=>c(j=>({...j,applicationUrl:g.target.value})),placeholder:"https://apply.agency.gov/position",className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Recruitment Type"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>c(g=>({...g,recruitmentType:"limited"})),className:`flex-1 px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${o.recruitmentType==="limited"?"bg-[#d4a843]/15 border-[#d4a843]/40 text-[#d4a843]":"bg-[#0d1117] border-[#1e293b] text-gray-400 hover:border-[#334155]"}`,children:"Limited (End Date)"}),n.jsx("button",{type:"button",onClick:()=>c(g=>({...g,recruitmentType:"continuous"})),className:`flex-1 px-3 py-2 rounded-lg text-sm font-medium border transition-colors ${o.recruitmentType==="continuous"?"bg-[#d4a843]/15 border-[#d4a843]/40 text-[#d4a843]":"bg-[#0d1117] border-[#1e293b] text-gray-400 hover:border-[#334155]"}`,children:"Continuous"})]})]}),o.recruitmentType==="limited"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Closing Date"}),n.jsx("input",{type:"date",value:o.expiresAt,onChange:g=>c(j=>({...j,expiresAt:g.target.value})),min:new Date().toISOString().split("T")[0],className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm focus:outline-none focus:border-[#d4a843]/50"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-400 mb-1",children:"Description *"}),n.jsx("textarea",{value:o.description,onChange:g=>c(j=>({...j,description:g.target.value})),placeholder:"Describe the position, requirements, benefits...",rows:4,className:"w-full px-3 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50 resize-none"})]}),n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:o.featured,onChange:g=>c(j=>({...j,featured:g.target.checked})),className:"w-4 h-4 rounded accent-[#d4a843]"}),n.jsxs("span",{className:"text-sm text-gray-300",children:[n.jsx(Nn,{className:"w-3.5 h-3.5 inline mr-1",style:{color:da}}),"Mark as Featured"]})]}),n.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[n.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm text-gray-400 hover:text-white transition-colors",children:"Cancel"}),n.jsx("button",{type:"submit",disabled:s,className:"px-5 py-2 text-sm font-semibold rounded-lg transition-colors",style:{background:da,color:"#000"},children:s?"Creating...":"Create Job"})]})]})]})}):null}function yq(){const e=ie(F.admin.listAllJobs),t=te(F.admin.toggleJobFeatured),r=te(F.admin.adminDeleteJob),a=te(F.admin.adminSetJobStatus),[s,i]=y.useState(""),[o,c]=y.useState("all"),[d,u]=y.useState(null),[h,m]=y.useState(!1);if(!e)return n.jsx("div",{className:"p-8",children:n.jsxs("div",{className:"animate-pulse space-y-4",children:[n.jsx("div",{className:"h-8 bg-[#1e293b] rounded w-48"}),n.jsx("div",{className:"h-64 bg-[#1e293b] rounded"})]})});const p=e.filter(S=>{if(o!=="all"&&S.status!==o)return!1;if(s){const _=s.toLowerCase();return S.title.toLowerCase().includes(_)||S.agencyName.toLowerCase().includes(_)||S.agencyCity?.toLowerCase().includes(_)||S.agencyState.toLowerCase().includes(_)}return!0}),b=e.filter(S=>S.status==="active").length,w=e.filter(S=>S.status==="expired").length,x=e.filter(S=>S.status==="draft").length,g=e.filter(S=>S.featured).length,j=e.filter(S=>S.scannedFromUrl).length;return n.jsxs("div",{className:"p-6 md:p-8 space-y-6 max-w-[1400px]",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(ht,{className:"w-6 h-6",style:{color:da}}),"Job Board"]}),n.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"All jobs posted across agencies. Manage status, featured placement, and listings."})]}),n.jsxs("button",{onClick:()=>m(!0),className:"flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-semibold text-black transition-colors flex-shrink-0",style:{background:da},children:[n.jsx(pt,{className:"w-4 h-4"}),"Add Job"]})]}),n.jsx(vq,{open:h,onClose:()=>m(!1)}
167),n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 text-center",children:[n.jsx("p",{className:"text-2xl font-bold text-white",children:e.length}),n.jsx("p",{className:"text-xs text-gray-400",children:"Total Jobs"})]}),n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 text-center",children:[n.jsx("p",{className:"text-2xl font-bold text-green-400",children:b}),n.jsx("p",{className:"text-xs text-gray-400",children:"Active"})]}),n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 text-center",children:[n.jsx("p",{className:"text-2xl font-bold text-red-400",children:w}),n.jsx("p",{className:"text-xs text-gray-400",children:"Expired"})]}),n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 text-center",children:[n.jsx("p",{className:"text-2xl font-bold",style:{color:da},children:g}),n.jsx("p",{className:"text-xs text-gray-400",children:"Featured"})]}),n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 text-center",children:[n.jsx("p",{className:"text-2xl font-bold text-cyan-400",children:j}),n.jsx("p",{className:"text-xs text-gray-400",children:"Auto-Scanned"})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Dt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx("input",{type:"text",placeholder:"Search by title, agency, or location...",value:s,onChange:S=>i(S.target.value),className:"w-full pl-10 pr-4 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(y0,{className:"w-4 h-4 text-gray-500"}),n.jsxs("select",{value:o,onChange:S=>c(S.target.value),className:"bg-[#0d1117] border border-[#1e293b] rounded-lg px-3 py-2.5 text-white text-sm focus:outline-none focus:border-[#d4a843]/50",children:[n.jsxs("option",{value:"all",children:["All Status (",e.length,")"]}),n.jsxs("option",{value:"active",children:["Active (",b,")"]}),n.jsxs("option",{value:"expired",children:["Expired (",w,")"]}),n.jsxs("option",{value:"draft",children:["Draft (",x,")"]})]})]})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["Showing ",p.length," of ",e.length," jobs"]}),n.jsx("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[#1e293b]",children:[n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-400 font-medium uppercase tracking-wider",children:"Job"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-400 font-medium uppercase tracking-wider",children:"Agency"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-400 font-medium uppercase tracking-wider hidden md:table-cell",children:"Type"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-400 font-medium uppercase tracking-wider",children:"Status"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-400 font-medium uppercase tracking-wider hidden lg:table-cell",children:"Source"}),n.jsx("th",{className:"text-right px-4 py-3 text-xs text-gray-400 font-medium uppercase tracking-wider",children:"Actions"})]})}),n.jsxs("tbody",{className:"divide-y divide-[#1e293b]",children:[p.map(S=>n.jsxs("tr",{className:"hover:bg-[#1e293b]/50 transition-colors",children:[n.jsx("td",{className:"px-4 py-3",children:n.jsxs("div",{className:"flex items-start gap-2",children:[S.featured&&n.jsx(Nn,{className:"w-4 h-4 mt-0.5 flex-shrink-0",style:{color:da},fill:da}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:S.title}),S.salary&&n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:S.salary}),n.jsxs("p",{className:"text-xs text-gray-600 mt-0.5",children:[new Date(S._creationTime).toLocaleDateString(),S.expiresAt&&n.jsxs("span",{className:S.expiresAt<Date.now()?"text-red-500":"",children:[" ","· Expires ",new Date(S.expiresAt).toLocaleDateString()]})]})]})]})}),n.jsx("td",{className:"px-4 py-3",children:n.jsxs("div",{className:"flex items-center gap-2",children:[S.agencyLogoUrl?n.jsx("img",{src:S.agencyLogoUrl,alt:"",className:"w-6 h-6 rounded object-contain bg-white/10"}):n.jsx("div",{className:"w-6 h-6 rounded bg-[#1e293b] flex items-center justify-center text-[10px] text-gray-500",children:S.agencyName[0]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm text-white",children:S.agencyName}),n.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[n.jsxs("p",{className:"text-xs text-gray-500",children:[S.agencyCity?`${S.agencyCity}, `:"",S.agencyState]}),n.jsx(bq,{tier:S.agencyTier})]})]})]})}),n.jsx("td",{className:"px-4 py-3 hidden md:table-cell",children:n.jsx("span",{className:"text-xs text-gray-400",children:S.recruitmentType||"â"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(gq,{status:S.status})}),n.jsx("td",{className:"px-4 py-3 hidden lg:table-cell",children:S.scannedFromUrl?n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-cyan-400",children:[n.jsx(sI,{className:"w-3 h-3"})," Auto-scan"]}):n.jsx("span",{className:"text-xs text-gray-500",children:"Manual"})}),n.jsx("td",{className:"px-4 py-3",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[S.applicationUrl&&n.jsx("a",{href:S.applicationUrl,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded hover:bg-[#1e293b] text-gray-400 hover:text-white transition-colors",title:"Open application",children:n.jsx(nn,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>t({jobId:S._id,featured:!S.featured}),className:`p-1.5 rounded hover:bg-[#1e293b] transition-colors ${S.featured?"text-[#d4a843]":"text-gray-500 hover:text-[#d4a843]"}`,title:S.featured?"Remove from featured":"Set as featured",children:n.jsx(Nn,{className:"w-4 h-4",fill:S.featured?da:"none"})}),S.status==="active"?n.jsx("button",{onClick:()=>a({jobId:S._id,status:"expired"}),className:"p-1.5 rounded hover:bg-[#1e293b] text-gray-500 hover:text-red-400 transition-colors",title:"Expire job",children:n.jsx(Wo,{className:"w-4 h-4"})}):n.jsx("button",{onClick:()=>a({jobId:S._id,status:"active"}),className:"p-1.5 rounded hover:bg-[#1e293b] text-gray-500 hover:text-green-400 transition-colors",title:"Reactivate job",children:n.jsx(v0,{className:"w-4 h-4"})}),d===S._id?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>{r({jobId:S._id}),u(null)},className:"px-2 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700",children:"Confirm"}),n.jsx("button",{onClick:()=>u(null),className:"px-2 py-1 text-xs bg-[#1e293b] text-gray-300 rounded hover:bg-[#334155]",children:"Cancel"})]}):n.jsx("button",{onClick:()=>u(S._id),className:"p-1.5 rounded hover:bg-[#1e293b] text-gray-500 hover:text-red-400 transition-colors",title:"Delete job",children:n.jsx(_n,{className:"w-4 h-4"})})]})})]},S._id)),p.length===0&&n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-4 py-12 text-center text-gray-500",children:s||o!=="all"?"No jobs match your filters.":"No jobs have been posted yet."})})]})]})})})]})}const Xl="#d4a843";function jq(e){const t=Math.floor((Date.now()-e)/6e4);if(t<1)return"Just now";if(t<60)return`${t}m ago`;const r=Math.floor(t/60);if(r<24)return`${r}h ago`;const a=Math.floor(r/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString()}
167function aT(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function b1({type:e}){return e==="veteran"?n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-blue-500/20 text-blue-300",children:[n.jsx(qr,{className:"w-2.5 h-2.5"})," Veteran"]}):n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-[#d4a843]/20 text-[#d4a843]",children:[n.jsx(Be,{className:"w-2.5 h-2.5"})," Agency"]})}function wq({initialTo:e,onSent:t}){const r=ie(F.adminMessaging.listRecipients),a=te(F.adminMessaging.sendAdminMessage),s=ie(F.presence.veteranStatuses),i=ie(F.presence.agencyStatuses),o=pi(),c=y.useMemo(()=>{const le=new Map;for(const Ne of s??[])le.set(Ne.veteranId,Ne);for(const Ne of i??[])le.set(Ne.agencyId,Ne);return le},[s,i]),[d,u]=y.useState(e?.type??"veteran"),[h,m]=y.useState(""),[p,b]=y.useState(""),[w,x]=y.useState(""),[g,j]=y.useState(""),[S,_]=y.useState(new Map),[N,C]=y.useState(""),[A,P]=y.useState(""),[O,E]=y.useState(!0),[$,M]=y.useState([]),[R,B]=y.useState(""),[D,U]=y.useState(null),[H,K]=y.useState(!1),[z,X]=y.useState(!1),[G,Q]=y.useState(null),[re,ce]=y.useState(null),fe=y.useRef(!1),me=d==="veteran"?s!==void 0:i!==void 0;y.useEffect(()=>{if(!r||!e||fe.current)return;const Ne=(e.type==="veteran"?r.veterans:r.agencies).find(qe=>qe.id===e.id);if(Ne){const qe=new Map;qe.set(`${e.type}:${Ne.id}`,{type:e.type,id:Ne.id,name:Ne.name,hasAccount:Ne.hasAccount,email:Ne.email}),_(qe),u(e.type)}fe.current=!0},[r,e]);const pe=y.useMemo(()=>{if(!r)return[];const le=d==="veteran"?r.veterans:r.agencies,Ne=h.trim().toLowerCase();return le.filter(qe=>p&&qe.state!==p||d==="agency"&&w&&qe.tier!==w||g==="yes"&&!qe.hasAccount||g==="no"&&qe.hasAccount?!1:Ne?[qe.name,qe.email,qe.contactName,qe.state].some(dn=>(dn||"").toLowerCase().includes(Ne)):!0)},[r,d,h,p,w,g]),Re=y.useMemo(()=>{if(!r)return[];const le=d==="veteran"?r.veterans:r.agencies;return Array.from(new Set(le.map(Ne=>Ne.state).filter(Boolean))).sort()},[r,d]),J=le=>`${d}:${le.id}`,ae=le=>{const Ne=new Map(S),qe=J(le);Ne.has(qe)?Ne.delete(qe):Ne.set(qe,{type:d,id:le.id,name:le.name,hasAccount:le.hasAccount,email:le.email}),_(Ne)},ue=pe.length>0&&pe.every(le=>S.has(J(le))),ee=()=>{const le=new Map(S);ue?pe.forEach(Ne=>le.delete(J(Ne))):pe.forEach(Ne=>le.set(J(Ne),{type:d,id:Ne.id,name:Ne.name,hasAccount:Ne.hasAccount,email:Ne.email})),_(le)},Y=Array.from(S.values()),je=Y.filter(le=>!le.hasAccount).length,ke=Y.length-je,Le=O||$.length>0?Y.filter(le=>le.email).length:je,Ge=(le=R)=>{const Ne=le.split(/[\s,;]+/).map(kr=>kr.trim().toLowerCase()).filter(Boolean);if(!Ne.length)return $;const qe=Ne.filter(kr=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(kr));if(qe.length)return U(`"${qe[0]}" isn't a valid email.`),null;const dn=Array.from(new Set([...$,...Ne]));return dn.length>10?(U("Max 10 CC addresses."),null):(M(dn),B(""),U(null),dn)},at=async()=>{K(!0),ce(null);try{const le=await a({recipients:Y.map(qe=>({type:qe.type,id:qe.id})),subject:N,body:A,sendEmail:O,cc:$}),Ne=[];le.inApp&&Ne.push(`${le.inApp} in-app`),le.emails&&Ne.push(`${le.emails} email${le.emails===1?"":"s"} queued`),le.skipped&&Ne.push(`${le.skipped} skipped`),Q(`Sent: ${Ne.join(", ")}${$.length?`, CC ${$.join(", ")}`:""}.`),_(new Map),M([]),B(""),C(""),P(""),X(!1),t()}catch(le){ce(le?.message?.replace(/^.*Uncaught Error: /,"").split(` 168`)[0]||"Send failed")}finally{K(!1)}};if(!r)return n.jsx("div",{className:"h-40 bg-[#1e293b] rounded-lg animate-pulse"});const ot="bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm px-3 py-2 focus:outline-none focus:border-[#d4a843]/50";return n.jsxs("div",{className:"grid lg:grid-cols-[1fr_1fr] gap-5",children:[n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 flex flex-col min-w-0",children:[n.jsx("div",{className:"flex gap-1 mb-3",children:["veteran","agency"].map(le=>n.jsx("button",{onClick:()=>{u(le),b(""),x("")},className:`flex-1 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${d===le?"bg-[#d4a843] text-black":"bg-[#1e293b] text-gray-300 hover:bg-[#263349]"}`,children:le==="veteran"?`Veterans (${r.veterans.length})`:`Agencies (${r.agencies.length})`},le))}),n.jsxs("div",{className:"relative mb-2",children:[n.jsx(Dt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx("input",{value:h,onChange:le=>m(le.target.value),placeholder:"Search name, email, state...",className:`${ot} w-full pl-9`})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[n.jsxs("select",{value:p,onChange:le=>b(le.target.value),className:ot,children:[n.jsx("option",{value:"",children:"All states"}),Re.map(le=>n.jsx("option",{value:le,children:le},le))]}),d==="agency"&&n.jsxs("select",{value:w,onChange:le=>x(le.target.value),className:ot,children:[n.jsx("option",{value:"",children:"All tiers"}),n.jsx("option",{value:"participating",children:"Participating"}),n.jsx("option",{value:"member",children:"Member"}),n.jsx("option",{value:"platinum",children:"Platinum"})]}),n.jsxs("select",{value:g,onChange:le=>j(le.target.value),className:ot,children:[n.jsx("option",{value:"",children:"Any account"}),n.jsx("option",{value:"yes",children:"Has login"}),n.jsx("option",{value:"no",children:"No login (email only)"})]})]}),n.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400 mb-1 px-1",children:[n.jsxs("span",{children:[pe.length," shown"]}),n.jsx("button",{onClick:ee,className:"text-[#d4a843] hover:underline disabled:opacity-40",disabled:!pe.length,children:ue?"Unselect shown":"Select all shown"})]}),n.jsxs("div",{className:"overflow-y-auto max-h-[420px] divide-y divide-[#1e293b] border border-[#1e293b] rounded-lg",children:[pe.map(le=>{const Ne=S.has(J(le));return n.jsxs("button",{onClick:()=>ae(le),className:`w-full text-left px-3 py-2 flex items-center gap-3 hover:bg-[#1e293b]/60 ${Ne?"bg-[#d4a843]/10":""}`,children:[n.jsx("span",{className:`w-4 h-4 flex-shrink-0 rounded border flex items-center justify-center ${Ne?"bg-[#d4a843] border-[#d4a843]":"border-gray-600"}`,children:Ne&&n.jsx(xn,{className:"w-3 h-3 text-black"})}),le.imageUrl?n.jsx("img",{src:le.imageUrl,alt:"",loading:"lazy",className:`w-10 h-10 rounded-lg flex-shrink-0 border border-[#1e293b] ${d==="agency"?"object-contain bg-white/5 p-0.5":"object-cover"}`}):n.jsx("span",{className:`w-10 h-10 rounded-lg flex-shrink-0 flex items-center justify-center ${d==="agency"?"bg-[#1e293b]":"bg-[#00b4ff]/10"}`,children:d==="agency"?n.jsx(Be,{className:"w-5 h-5 text-[#475569]"}):n.jsx(Ze,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsxs("span",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"block text-sm text-white truncate",children:le.name}),n.jsx("span",{className:"block text-[11px] text-gray-500 truncate",children:[le.state,d==="agency"?le.tier:le.status,le.email].filter(
168Boolean).join(" · ")}),me&&n.jsx("span",{className:"block mt-0.5",children:n.jsx(xi,{status:c.get(le.id)??null,now:o,showLogin:!0})})]}),!le.hasAccount&&n.jsx("span",{className:"flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded bg-gray-500/20 text-gray-400",title:"No login, email only",children:"email only"})]},le.id)}),pe.length===0&&n.jsx("p",{className:"text-center text-sm text-gray-500 py-8",children:"Nobody matches."})]})]}),n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 flex flex-col gap-3 min-w-0",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-xs text-gray-400 mb-1.5",children:["To: ",Y.length===0?"nobody yet":`${Y.length} recipient${Y.length===1?"":"s"}`]}),Y.length>0&&n.jsxs("div",{className:"flex flex-wrap gap-1.5 max-h-24 overflow-y-auto",children:[Y.slice(0,40).map(le=>n.jsxs("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-[#1e293b] text-xs text-gray-200",children:[le.type==="veteran"?n.jsx(qr,{className:"w-3 h-3 text-blue-300"}):n.jsx(Be,{className:"w-3 h-3 text-[#d4a843]"}),n.jsx("span",{className:"max-w-[160px] truncate",children:le.name}),n.jsx("button",{onClick:()=>{const Ne=new Map(S);Ne.delete(`${le.type}:${le.id}`),_(Ne)},className:"p-0.5 rounded-full hover:bg-[#334155]",children:n.jsx(Me,{className:"w-3 h-3"})})]},`${le.type}:${le.id}`)),Y.length>40&&n.jsxs("span",{className:"text-xs text-gray-500 py-0.5",children:["+",Y.length-40," more"]})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:`${ot} flex flex-wrap items-center gap-1.5 py-1.5`,children:[n.jsx("span",{className:"text-xs text-gray-400 pr-1",children:"CC"}),$.map(le=>n.jsxs("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-0.5 rounded-full bg-[#1e293b] text-xs text-gray-200",children:[le,n.jsx("button",{onClick:()=>M($.filter(Ne=>Ne!==le)),className:"p-0.5 rounded-full hover:bg-[#334155]",title:"Remove",children:n.jsx(Me,{className:"w-3 h-3"})})]},le)),n.jsx("input",{value:R,onChange:le=>{B(le.target.value),U(null)},onKeyDown:le=>{le.key==="Enter"||le.key===","||le.key===";"?(le.preventDefault(),Ge()):le.key==="Backspace"&&!R&&$.length&&M($.slice(0,-1))},onBlur:()=>R.trim()&&Ge(),placeholder:$.length?"":"Add an email, like the agency head (optional)",className:"flex-1 min-w-[160px] bg-transparent text-sm text-white placeholder:text-gray-500 focus:outline-none py-0.5"})]}),D?n.jsx("p",{className:"text-[11px] text-red-400 mt-1",children:D}):$.length>0?n.jsxs("p",{className:"text-[11px] text-gray-500 mt-1",children:["CC'd people get the email copy, so email goes out to everyone picked.",Y.length>1?` Each CC gets ${Y.length} separate emails, one per recipient.`:""]}):null]}),n.jsx("input",{value:N,onChange:le=>C(le.target.value),placeholder:"Email subject (optional)",className:ot}),n.jsx("textarea",{value:A,onChange:le=>P(le.target.value),rows:10,placeholder:`Hi {name}, 169 170...`,className:`${ot} resize-y min-h-[180px]`}),n.jsxs("p",{className:"text-[11px] text-gray-500 -mt-1",children:[n.jsx("code",{className:"text-gray-400",children:"{name}"})," becomes the veteran's first name or the agency contact's first name."]}),n.jsxs("label",{className:"flex items-start gap-2 text-sm text-gray-300 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:O,onChange:le=>E(le.target.checked),className:"mt-1 accent-[#d4a843]"}),n.jsxs("span",{children:["Also email a copy to people who have a login",n.jsx("span",{className:"block text-[11px] text-gray-500",children:"Recipients without a login always get it by email, since they have no inbox. Email replies go to [email protected]."})]})]}),Y.length>0&&n.jsxs("div",{className:"text-xs text-gray-400 bg-[#0d1117] border border-[#1e293b] rounded-lg px-3 py-2",children:[ke," will get it in their VET-TO-LEO inbox. ",Le," email",Le===1?"":"s"," will go out",je>0?`, ${je} of them to recipients with no login`:"",".",$.length>0&&` CC: ${$.join(", ")}.`]}),re&&n.jsxs("p",{className:"text-sm text-red-400 flex items-center gap-1.5",children:[n.jsx(Dc,{className:"w-4 h-4"})," ",re]}),G&&!re&&n.jsxs("p",{className:"text-sm text-green-400 flex items-center gap-1.5",children:[n.jsx(gn,{className:"w-4 h-4"})," ",G]}),z?n.jsxs("div",{className:"flex flex-wrap items-center gap-2 bg-[#d4a843]/10 border border-[#d4a843]/40 rounded-lg p-3",children:[n.jsxs("span",{className:"text-sm text-white flex-1 min-w-[180px]",children:["Send to ",Y.length," recipient",Y.length===1?"":"s","? This can't be unsent."]}),n.jsx("button",{onClick:()=>X(!1),className:"px-3 py-1.5 rounded-lg text-sm bg-[#1e293b] text-gray-300",children:"Cancel"}),n.jsx("button",{onClick:at,disabled:H,className:"px-3 py-1.5 rounded-lg text-sm font-semibold text-black disabled:opacity-50",style:{background:Xl},children:H?"Sending...":"Yes, send"})]}):n.jsxs("button",{onClick:()=>{Q(null),ce(null),Ge()!==null&&X(!0)},disabled:!Y.length||!A.trim(),className:"self-end inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-semibold text-black disabled:opacity-40",style:{background:Xl},children:[n.jsx(si,{className:"w-4 h-4"})," Send message"]})]})]})}function Nq({otherUserId:e,name:t,role:r,onBack:a}){const s=ie(F.adminMessaging.getTeamThread,{otherUserId:e}),i=te(F.adminMessaging.replyAsTeam),o=te(F.adminMessaging.markTeamRead),[c,d]=y.useState(""),[u,h]=y.useState(!0),[m,p]=y.useState(!1),[b,w]=y.useState(null),x=y.useRef(null);y.useEffect(()=>{o({otherUserId:e}).catch(()=>{})},[e,s?.length]),y.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[s?.length]);const g=async()=>
170{if(!(!c.trim()||m)){p(!0),w(null);try{await i({otherUserId:e,body:c,sendEmail:u}),d("")}catch(j){w(j?.message?.split(` 171`)[0]||"Send failed")}finally{p(!1)}}};return n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:a,className:"p-2 rounded-lg hover:bg-[#1e293b] text-gray-400 hover:text-white",children:n.jsx(Zr,{className:"w-5 h-5"})}),n.jsx("span",{className:"text-white font-medium",children:t}),n.jsx(b1,{type:r})]}),n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 space-y-3 max-h-[520px] overflow-y-auto",children:[s?s.map(j=>n.jsx("div",{className:`flex ${j.fromTeam?"justify-end":"justify-start"}`,children:n.jsxs("div",{className:`max-w-[80%] rounded-xl px-3.5 py-2 ${j.fromTeam?"bg-[#d4a843]/15 border border-[#d4a843]/30":"bg-[#1e293b]"}`,children:[n.jsx("p",{className:"text-sm text-gray-100 whitespace-pre-wrap break-words",children:j.body}),n.jsxs("p",{className:"text-[10px] text-gray-500 mt-1",children:[aT(j._creationTime),j.fromTeam&&j.adminEmail?` · ${j.adminEmail}`:"",j.fromTeam&&j.readAt?" · Read":""]})]})},j._id)):n.jsx("div",{className:"h-24 bg-[#1e293b] rounded animate-pulse"}),n.jsx("div",{ref:x})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("textarea",{value:c,onChange:j=>d(j.target.value),rows:3,placeholder:`Reply to ${t}...`,className:"bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm px-3 py-2 focus:outline-none focus:border-[#d4a843]/50"}),n.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[n.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-400 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:u,onChange:j=>h(j.target.checked),className:"accent-[#d4a843]"}),"Email them a copy"]}),n.jsxs("button",{onClick:g,disabled:!c.trim()||m,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-semibold text-black disabled:opacity-40",style:{background:Xl},children:[n.jsx(si,{className:"w-4 h-4"})," ",m?"Sending...":"Reply"]})]}),b&&n.jsx("p",{className:"text-sm text-red-400",children:b})]})]})}function _q({onCompose:e}){const t=ie(F.adminMessaging.listTeamInbox),[r,a]=y.useState(null);return r?n.jsx(Nq,{otherUserId:r.id,name:r.name,role:r.role,onBack:()=>a(null)}):t?t.length===0?n.jsxs("div",{className:"text-center py-14 border border-dashed border-[#1e293b] rounded-lg",children:[n.jsx(VC,{className:"w-10 h-10 mx-auto text-gray-600 mb-2"}),n.jsx("p",{className:"text-gray-400 text-sm mb-3",children:"No conversations yet. Messages you send and their replies show up here."}),n.jsx("button",{onClick:e,className:"px-4 py-2 rounded-lg text-sm font-semibold text-black",style:{background:Xl},children:"Write a message"})]}):n.jsx("div",{className:"space-y-1",children:t.map(s=>n.jsxs("button",{onClick:()=>a({id:s.otherUserId,name:s.name,role:s.role}),className:"w-full text-left p-3 rounded-lg hover:bg-[#1e293b]/70 flex items-start gap-3",children:[s.photoUrl?n.jsx("img",{src:s.photoUrl,alt:"",className:"w-9 h-9 rounded-full object-cover flex-shrink-0"}):n.jsx("div",{className:"w-9 h-9 rounded-full bg-[#1e293b] flex items-center justify-center text-xs font-bold text-gray-400 flex-shrink-0",children:s.name[0]}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:`text-sm truncate ${s.unreadCount?"text-white font-semibold":"text-white"}`,children:s.name}),n.jsx(b1,{type:s.role})]}),s.subtitle&&n.jsx("p",{className:"text-[11px] text-gray-500 truncate",children:s.subtitle}),n.jsxs("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:[s.lastFromThem?"":"You: ",s.lastMessagePreview]})]}),n.jsxs("div",{className:"text-right flex-shrink-0",children:[n.jsx("p",{className:"text-[10px] text-gray-500",children:jq(s.lastMessageAt)}),s.unreadCount>0&&n.jsx("span",{className:"inline-block mt-1 text-[10px] font-bold px-2 py-0.5 rounded-full text-black",style:{background:Xl},children:s.unreadCount})]})]},s.otherUserId))}):n.jsx("div",{className:"h-40 bg-[#1e293b] rounded-lg animate-pulse"})}function Sq(){const e=ie(F.adminMessaging.listOutbox),[t,r]=y.useState(null);return e?e.length===0?n.jsx("p",{className:"text-center text-sm text-gray-500 py-12",children:"Nothing sent yet."}):n.jsx("div",{className:"space-y-2",children:e.map(a=>{const s=a.recipients.filter(u=>u.emailStatus==="sent").length,i=a.recipients.filter(u=>u.emailStatus==="failed").length,o=a.recipients.filter(u=>u.emailStatus==="pending").length,c=a.recipients.filter(u=>u.inApp).length,d=t===a.batchId;return n.jsxs("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg",children:[n.jsxs("button",{onClick:()=>r(d?null:a.batchId),className:"w-full text-left p-3",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsxs("p",{className:"text-sm text-white truncate",children:[a.recipients.length===1?a.recipients[0].name:`${a.recipients.length} recipients`,n.jsxs("span",{className:"text-gray-500",children:[" · ",a.subject]})]}),n.jsx("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:a.body})]}),n.jsxs("div",{className:"text-right flex-shrink-0 text-[10px] text-gray-500",children:[n.jsx("p",{children:aT(a.sentAt)}),n.jsx("p",{children:a.sentByEmail})]})]}),n.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-[11px]",children:[c>0&&n.jsxs("span",{className:"text-gray-400 inline-flex items-center gap-1",children:[n.jsx(tn,{className:"w-3 h-3"})," ",c," in-app"]}),s>0&&n.jsxs("span",{className:"text-green-400 inline-flex items-center gap-1",children:[n.jsx(Sn,{className:"w-3 h-3"})," ",s," emailed"]}),o>0&&n.jsxs("span",{className:"text-amber-400",children:[o," email pending"]}),i>0&&n.jsxs("span",{className:"text-red-400",children:[i," email failed"]})]})]}),d&&n.jsxs("div",{className:"border-t border-[#1e293b] p-3 space-y-3",children:[a.cc?.length>0&&n.jsxs("p",{className:"text-xs text-gray-400",children:["CC: ",a.cc.join(", ")
171]}),n.jsx("p",{className:"text-sm text-gray-300 whitespace-pre-wrap break-words",children:a.body}),n.jsx("div",{className:"divide-y divide-[#1e293b] text-xs",children:a.recipients.map((u,h)=>n.jsxs("div",{className:"py-1.5 flex items-center gap-2 flex-wrap",children:[n.jsx(b1,{type:u.type}),n.jsx("span",{className:"text-gray-200",children:u.name}),n.jsx("span",{className:"text-gray-500",children:u.email}),n.jsxs("span",{className:"ml-auto text-gray-400",children:[u.inApp?"in-app":"no login"," · ",u.emailStatus==="sent"?"emailed":u.emailStatus==="failed"?n.jsx("span",{className:"text-red-400",title:u.emailError,children:"email failed"}):u.emailStatus==="pending"?"email pending":"no email"]})]},h))})]})]},a.batchId)})}):n.jsx("div",{className:"h-40 bg-[#1e293b] rounded-lg animate-pulse"})}const Cq="#d4a843";function sT({role:e}){return e==="veteran"?n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-blue-500/20 text-blue-300",children:[n.jsx(qr,{className:"w-2.5 h-2.5"})," Veteran"]}):e==="agency"?n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-[#d4a843]/20 text-[#d4a843]",children:[n.jsx(Be,{className:"w-2.5 h-2.5"})," Agency"]}):n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-500/20 text-gray-400",children:[n.jsx(Ze,{className:"w-2.5 h-2.5"})," User"]})}function Aq({role:e}){return e==="veteran"?n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-blue-500/15 text-blue-400",children:"Veteran"}):e==="recruiter"?n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#d4a843]/15 text-[#d4a843]",children:"Agency"}):n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-green-500/15 text-green-400",children:"Admin"})}function kq(e){const t=new Date(e),a=new Date().getTime()-t.getTime(),s=Math.floor(a/6e4);if(s<1)return"Just now";if(s<60)return`${s}m ago`;const i=Math.floor(s/60);if(i<24)return`${i}h ago`;const o=Math.floor(i/24);return o<7?`${o}d ago`:t.toLocaleDateString()}function Pq(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Tq({onSelect:e}){const t=ie(F.admin.listAllConversations),[r,a]=y.useState("");if(!t)return n.jsx("div",{className:"p-6",children:n.jsxs("div",{className:"animate-pulse space-y-3",children:[n.jsx("div",{className:"h-8 bg-[#1e293b] rounded w-48"}),[1,2,3].map(i=>n.jsx("div",{className:"h-16 bg-[#1e293b] rounded"},i))]})});const s=r?t.filter(i=>i.participants.some(o=>o.name.toLowerCase().includes(r.toLowerCase()))):t;return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"relative",children:[n.jsx(Dt,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx("input",{type:"text",placeholder:"Search by name...",value:r,onChange:i=>a(i.target.value),className:"w-full pl-10 pr-4 py-2.5 bg-[#0d1117] border border-[#1e293b] rounded-lg text-white text-sm placeholder:text-gray-500 focus:outline-none focus:border-[#d4a843]/50"})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:[t.length," conversation",t.length!==1?"s":""]}),n.jsxs("div",{className:"space-y-1",children:[s.map(i=>n.jsx("button",{onClick:()=>e(i.conversationId,i.participants),className:"w-full text-left p-3 rounded-lg hover:bg-[#1e293b]/70 transition-colors group",children:n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:i.participants.map((o,c)=>n.jsxs("span",{className:"flex items-center gap-1",children:[c>0&&n.jsx("span",{className:"text-gray-600 text-xs mx-0.5",children:"â"}),n.jsx("span",{className:"text-sm text-white font-medium truncate",children:o.name}),n.jsx(sT,{role:o.role})]},o.userId))}),i.lastMessagePreview&&n.jsx("p",{className:"text-xs text-gray-500 mt-1 truncate",children:i.lastMessagePreview})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] text-gray-500",children:kq(i.lastMessageAt)}
171),n.jsxs("p",{className:"text-[10px] text-gray-600 mt-0.5",children:[i.messageCount," msg",i.messageCount!==1?"s":""]})]}),n.jsx(Ya,{className:"w-4 h-4 text-gray-600 group-hover:text-gray-400 transition-colors"})]})]})},i._id)),s.length===0&&n.jsx("div",{className:"text-center py-12 text-gray-500 text-sm",children:r?"No conversations match your search.":"No conversations yet."})]})]})}function Oq({conversationId:e,participants:t,onBack:r}){const a=ie(F.admin.getConversationMessages,{conversationId:e});return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:r,className:"p-2 rounded-lg hover:bg-[#1e293b] text-gray-400 hover:text-white transition-colors",children:n.jsx(Zr,{className:"w-5 h-5"})}),n.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:t.map((s,i)=>n.jsxs("span",{className:"flex items-center gap-1.5",children:[i>0&&n.jsx("span",{className:"text-gray-600 mx-1",children:"â"}),s.photoUrl?n.jsx("img",{src:s.photoUrl,alt:"",className:"w-6 h-6 rounded-full object-cover"}):n.jsx("div",{className:"w-6 h-6 rounded-full bg-[#1e293b] flex items-center justify-center text-[10px] text-gray-400 font-bold",children:s.name[0]}),n.jsx("span",{className:"text-sm text-white font-medium",children:s.name}),n.jsx(sT,{role:s.role})]},s.userId))})]}),n.jsx("div",{className:"bg-[#0f1729] border border-[#1e293b] rounded-lg p-4 space-y-3 max-h-[600px] overflow-y-auto",children:a?a.length===0?n.jsx("p",{className:"text-center text-gray-500 py-8 text-sm",children:"No messages in this conversation."}):a.map(s=>n.jsxs("div",{className:"flex gap-3 group",children:[n.jsx("div",{className:"flex-shrink-0 pt-1",children:n.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-bold ${s.senderRole==="veteran"?"bg-blue-500/20 text-blue-400":s.senderRole==="recruiter"?"bg-[#d4a843]/20 text-[#d4a843]":"bg-green-500/20 text-green-400"}`,children:s.senderName[0]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium text-white",children:s.senderName}),n.jsx(Aq,{role:s.senderRole}),n.jsx("span",{className:"text-[10px] text-gray-600",children:Pq(s._creationTime)}),s.readAt&&n.jsx("span",{className:"text-[10px] text-gray-700",children:"· Read"})]}),n.jsx("p",{className:"text-sm text-gray-300 mt-0.5 whitespace-pre-wrap break-words",children:s.body})]})]},s._id)):n.jsx("div",{className:"animate-pulse space-y-3",children:[1,2,3].map(s=>n.jsx("div",{className:"h-12 bg-[#1e293b] rounded"},s))})})]})}function Eq(){const[e,t]=$c(),r=e.get("to"),a=(()=>{if(!r)return null;const[h,m]=r.split(":");return(h==="veteran"||h==="agency")&&m?{type:h,id:m}:null})(),[s,i]=y.useState(a?"compose":"inbox"),o=ie(F.adminMessaging.getTeamUnreadCount)??0,[c,d]=y.useState(null),u=[{id:"inbox",label:o?`Inbox (${o})`:"Inbox"},{id:"compose",label:"New Message"},{id:"sent",label:"Sent"},{id:"all",label:"All Conversations"}];return n.jsxs("div",{className:"p-6 md:p-8 max-w-[1150px]",children:[n.jsxs("div",{className:"mb-5",children:[n.jsxs("h1",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(tn,{className:"w-6 h-6",style:{color:Cq}}),"Messages"]}),n.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Message veterans and agencies as the VET-TO-LEO Team. Replies land in the Inbox for every admin."})]}),n.jsx("div",{className:"flex gap-1 mb-5 border-b border-[#1e293b] overflow-x-auto",children:u.map(h=>n.jsx("button",{onClick:()=>{i(h.id),e.get("to")&&t({},{replace:!0})},className:`px-4 py-2 text-sm font-medium whitespace-nowrap border-b-2 -mb-px transition-colors ${s===h.id?"border-[#d4a843] text-white":"border-transparent text-gray-400 hover:text-white"}`,children:h.label},h.id))}),s==="inbox"&&n.jsx(_q,{onCompose:()=>i("compose")}),s==="compose"&&n.jsx(wq,{initialTo:a,onSent:()=>{}}),s==="sent"&&n.jsx(Sq,{}),s==="all"&&n.jsxs("div",{className:"max-w-[900px]",children:[n.jsx("p",{className:"text-xs text-gray-500 mb-3",children:"Read-only view of every conversation on the platform."}),c?n.jsx(Oq,{conversationId:c.conversationId,participants:c.participants,onBack:()=>d(null)}):n.jsx(Tq,{onSelect:(h,m)=>d({conversationId:h,participants:m})})]})]})}var vp,LN;function In(){if(LN)return vp;LN=1;var e=Array.isArray;return vp=e,vp}var yp,IN;
vendor: 6,115 bytes, line 171
171function iT(){if(IN)return yp;IN=1;var e=typeof Cd=="object"&&Cd&&Cd.Object===Object&&Cd;return yp=e,yp}var jp,RN;function ea(){if(RN)return jp;RN=1;var e=iT(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return jp=r,jp}var wp,DN;function Qc(){if(DN)return wp;DN=1;var e=ea(),t=e.Symbol;return wp=t,wp}var Np,$N;function Mq(){if($N)return Np;$N=1;var e=Qc(),t=Object.prototype,r=t.hasOwnProperty,a=t.toString,s=e?e.toStringTag:void 0;function i(o){var c=r.call(o,s),d=o[s];try{o[s]=void 0;var u=!0}catch{}var h=a.call(o);return u&&(c?o[s]=d:delete o[s]),h}return Np=i,Np}var _p,FN;function Lq(){if(FN)return _p;FN=1;var e=Object.prototype,t=e.toString;function r(a){return t.call(a)}return _p=r,_p}var Sp,BN;function Ta(){if(BN)return Sp;BN=1;var e=Qc(),t=Mq(),r=Lq(),a="[object Null]",s="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?s:a:i&&i in Object(c)?t(c):r(c)}return Sp=o,Sp}var Cp,UN;function Oa(){if(UN)return Cp;UN=1;function e(t){return t!=null&&typeof t=="object"}return Cp=e,Cp}var Ap,zN;function Xo(){if(zN)return Ap;zN=1;var e=Ta(),t=Oa(),r="[object Symbol]";function a(s){return typeof s=="symbol"||t(s)&&e(s)==r}return Ap=a,Ap}var kp,WN;function v1(){if(WN)return kp;WN=1;var e=In(),t=Xo(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function s(i,o){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:a.test(i)||!r.test(i)||o!=null&&i in Object(o)}return kp=s,kp}var Pp,qN;function ls(){if(qN)return Pp;qN=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Pp=e,Pp}var Tp,VN;function y1(){if(VN)return Tp;VN=1;var e=Ta(),t=ls(),r="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==a||d==s||d==r||d==i}return Tp=o,Tp}var Op,HN;function Iq(){if(HN)return Op;HN=1;var e=ea(),t=e["__core-js_shared__"];return Op=t,Op}var Ep,GN;function Rq(){if(GN)return Ep;GN=1;var e=Iq(),t=(function(){var a=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function r(a){return!!t&&t in a}return Ep=r,Ep}var Mp,KN;function oT(){if(KN)return Mp;KN=1;var e=Function.prototype,t=e.toString;function r(a){if(a!=null){try{return t.call(a)}catch{}try{return a+""}catch{}}return""}return Mp=r,Mp}var Lp,YN;function Dq(){if(YN)return Lp;YN=1;var e=y1(),t=Rq(),r=ls(),a=oT(),s=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,u=c.hasOwnProperty,h=RegExp("^"+d.call(u).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(p){if(!r(p)||t(p))return!1;var b=e(p)?h:i;return b.test(a(p))}return Lp=m,Lp}var Ip,ZN;function $q(){if(ZN)return Ip;ZN=1;function e(t,r){return t?.[r]}return Ip=e,Ip}var Rp,XN;function vi(){if(XN)return Rp;XN=1;var e=Dq(),t=$q();function r(a,s){var i=t(a,s);return e(i)?i:void 0}return Rp=r,Rp}var Dp,JN;function Cf(){if(JN)return Dp;JN=1;var e=vi(),t=e(Object,"create");return Dp=t,Dp}var $p,QN;function Fq(){if(QN)return $p;QN=1;var e=Cf();function t(){this.__data__=e?e(null):{},this.size=0}return $p=t,$p}var Fp,e2;function Bq(){if(e2)return Fp;e2=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Fp=e,Fp}var Bp,t2;function Uq(){if(t2)return Bp;t2=1;var e=Cf(),t="__lodash_hash_undefined__",r=Object.prototype,a=r.hasOwnProperty;function s(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return a.call(o,i)?o[i]:void 0}return Bp=s,Bp}var Up,n2;function zq(){if(n2)return Up;n2=1;var e=Cf(),t=Object.prototype,r=t.hasOwnProperty;function a(s){var i=this.__data__;return e?i[s]!==void 0:r.call(i,s)}return Up=a,Up}var zp,r2;function Wq(){if(r2)return zp;r2=1;var e=Cf(),t="__lodash_hash_undefined__";function r(a,s){var i=this.__data__;return this.size+=this.has(a)?0:1,i[a]=e&&s===void 0?t:s,this}return zp=r,zp}var Wp,a2;function qq(){if(a2)return Wp;a2=1;var e=Fq(),t=Bq(),r=Uq(),a=zq(),s=Wq();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var u=o[c];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=a,i.prototype.set=s,Wp=i,Wp}var qp,s2;function Vq(){if(s2)return qp;s2=1;function e(){this.__data__=[],this.size=0}return qp=e,qp}var Vp,i2;function j1(){if(i2)return Vp;i2=1;function e(t,r){return t===r||t!==t&&r!==r}return Vp=e,Vp}var Hp,o2;function Af(){if(o2)return Hp;o2=1;var e=j1();function t(r,a){for(var s=r.length;s--;)if(e(r[s][0],a))return s;return-1}return Hp=t,Hp}var Gp,l2;function Hq(){if(l2)return Gp;l2=1;var e=Af(),t=Array.prototype,r=t.splice;function a(s){var i=this.__data__,o=e(i,s);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():r.call(i,o,1),--this.size,!0}return Gp=a,Gp}var Kp,c2;function Gq(){if(c2)return Kp;c2=1;var e=Af();function t(r){var a=this.__data__,s=e(a,r);return s<0?void 0:a[s][1]}return Kp=t,Kp}var Yp,d2;function Kq(){if(d2)return Yp;d2=1;var e=Af();function t(r){return e(this.__data__,r)>-1}return Yp=t,Yp}var Zp,u2;function Yq(){if(u2)return Zp;u2=1;var e=Af();function t(r,a){var s=this.__data__,i=e(s,r);return i<0?(++this.size,s.push([r,a])):s[i][1]=a,this}return Zp=t,Zp}var Xp,h2;function kf(){if(h2)return Xp;h2=1;var e=Vq(),t=Hq(),r=Gq(),a=Kq(),s=Yq();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var u=o[c];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=a,i.prototype.set=s,Xp=i,Xp}var Jp,f2;function w1(){if(f2)return Jp;f2=1;var e=vi(),t=ea(),r=e(t,"Map");return Jp=r,Jp}var Qp,m2;function Zq(){if(m2)return Qp;m2=1;var e=qq(),t=kf(),r=w1();function a(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Qp=a,Qp}var ex,p2;function Xq(){if(p2)return ex;p2=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return ex=e,ex}var tx,x2;function Pf(){if(x2)return tx;x2=1;var e=Xq();function t(r,a){var s=r.__data__;
vendor: 8,754 bytes, line 171
171return e(a)?s[typeof a=="string"?"string":"hash"]:s.map}return tx=t,tx}var nx,g2;function Jq(){if(g2)return nx;g2=1;var e=Pf();function t(r){var a=e(this,r).delete(r);return this.size-=a?1:0,a}return nx=t,nx}var rx,b2;function Qq(){if(b2)return rx;b2=1;var e=Pf();function t(r){return e(this,r).get(r)}return rx=t,rx}var ax,v2;function eV(){if(v2)return ax;v2=1;var e=Pf();function t(r){return e(this,r).has(r)}return ax=t,ax}var sx,y2;function tV(){if(y2)return sx;y2=1;var e=Pf();function t(r,a){var s=e(this,r),i=s.size;return s.set(r,a),this.size+=s.size==i?0:1,this}return sx=t,sx}var ix,j2;function N1(){if(j2)return ix;j2=1;var e=Zq(),t=Jq(),r=Qq(),a=eV(),s=tV();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var u=o[c];this.set(u[0],u[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=r,i.prototype.has=a,i.prototype.set=s,ix=i,ix}var ox,w2;function lT(){if(w2)return ox;w2=1;var e=N1(),t="Expected a function";function r(a,s){if(typeof a!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var i=function(){var o=arguments,c=s?s.apply(this,o):o[0],d=i.cache;if(d.has(c))return d.get(c);var u=a.apply(this,o);return i.cache=d.set(c,u)||d,u};return i.cache=new(r.Cache||e),i}return r.Cache=e,ox=r,ox}var lx,N2;function nV(){if(N2)return lx;N2=1;var e=lT(),t=500;function r(a){var s=e(a,function(o){return i.size===t&&i.clear(),o}),i=s.cache;return s}return lx=r,lx}var cx,_2;function rV(){if(_2)return cx;_2=1;var e=nV(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=e(function(s){var i=[];return s.charCodeAt(0)===46&&i.push(""),s.replace(t,function(o,c,d,u){i.push(d?u.replace(r,"$1"):c||o)}),i});return cx=a,cx}var dx,S2;function _1(){if(S2)return dx;S2=1;function e(t,r){for(var a=-1,s=t==null?0:t.length,i=Array(s);++a<s;)i[a]=r(t[a],a,t);return i}return dx=e,dx}var ux,C2;function aV(){if(C2)return ux;C2=1;var e=Qc(),t=_1(),r=In(),a=Xo(),s=e?e.prototype:void 0,i=s?s.toString:void 0;function o(c){if(typeof c=="string")return c;if(r(c))return t(c,o)+"";if(a(c))return i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return ux=o,ux}var hx,A2;function cT(){if(A2)return hx;A2=1;var e=aV();function t(r){return r==null?"":e(r)}return hx=t,hx}var fx,k2;function dT(){if(k2)return fx;k2=1;var e=In(),t=v1(),r=rV(),a=cT();function s(i,o){return e(i)?i:t(i,o)?[i]:r(a(i))}return fx=s,fx}var mx,P2;function Tf(){if(P2)return mx;P2=1;var e=Xo();function t(r){if(typeof r=="string"||e(r))return r;var a=r+"";return a=="0"&&1/r==-1/0?"-0":a}return mx=t,mx}var px,T2;function S1(){if(T2)return px;T2=1;var e=dT(),t=Tf();function r(a,s){s=e(s,a);for(var i=0,o=s.length;a!=null&&i<o;)a=a[t(s[i++])];return i&&i==o?a:void 0}return px=r,px}var xx,O2;function uT(){if(O2)return xx;O2=1;var e=S1();function t(r,a,s){var i=r==null?void 0:e(r,a);return i===void 0?s:i}return xx=t,xx}var sV=uT();const zn=it(sV);var gx,E2;function iV(){if(E2)return gx;E2=1;function e(t){return t==null}return gx=e,gx}var oV=iV();const Ie=it(oV);var bx,M2;function lV(){if(M2)return bx;M2=1;var e=Ta(),t=In(),r=Oa(),a="[object String]";function s(i){return typeof i=="string"||!t(i)&&r(i)&&e(i)==a}return bx=s,bx}var cV=lV();const Js=it(cV);var dV=y1();const Oe=it(dV);var uV=ls();const Jo=it(uV);var vx={exports:{}},nt={};var L2;function hV(){if(L2)return nt;L2=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function x(g){if(typeof g=="object"&&g!==null){var j=g.$$typeof;switch(j){case e:switch(g=g.type,g){case r:case s:case a:case u:case h:return g;default:switch(g=g&&g.$$typeof,g){case c:case o:case d:case p:case m:case i:return g;default:return j}}case t:return j}}}return nt.ContextConsumer=o,nt.ContextProvider=i,nt.Element=e,nt.ForwardRef=d,nt.Fragment=r,nt.Lazy=p,nt.Memo=m,nt.Portal=t,nt.Profiler=s,nt.StrictMode=a,nt.Suspense=u,nt.SuspenseList=h,nt.isAsyncMode=function(){return!1},nt.isConcurrentMode=function(){return!1},nt.isContextConsumer=function(g){return x(g)===o},nt.isContextProvider=function(g){return x(g)===i},nt.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},nt.isForwardRef=function(g){return x(g)===d},nt.isFragment=function(g){return x(g)===r},nt.isLazy=function(g){return x(g)===p},nt.isMemo=function(g){return x(g)===m},nt.isPortal=function(g){return x(g)===t},nt.isProfiler=function(g){return x(g)===s},nt.isStrictMode=function(g){return x(g)===a},nt.isSuspense=function(g){return x(g)===u},nt.isSuspenseList=function(g){return x(g)===h},nt.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===s||g===a||g===u||g===h||g===b||typeof g=="object"&&g!==null&&(g.$$typeof===p||g.$$typeof===m||g.$$typeof===i||g.$$typeof===o||g.$$typeof===d||g.$$typeof===w||g.getModuleId!==void 0)},nt.typeOf=x,nt}var I2;function fV(){return I2||(I2=1,vx.exports=hV()),vx.exports}var mV=fV(),yx,R2;function hT(){if(R2)return yx;R2=1;var e=Ta(),t=Oa(),r="[object Number]";function a(s){return typeof s=="number"||t(s)&&e(s)==r}return yx=a,yx}var jx,D2;function pV(){if(D2)return jx;D2=1;var e=hT();function t(r){return e(r)&&r!=+r}return jx=t,jx}var xV=pV();const Qo=it(xV);var gV=hT();const bV=it(gV);var yn=function(t){return t===0?0:t>0?1:-1},$s=function(t){return Js(t)&&t.indexOf("%")===t.length-1},de=function(t){return bV(t)&&!Qo(t)},vV=function(t){return Ie(t)},zt=function(t){return de(t)||Js(t)},yV=0,el=function(t){var r=++yV;return"".concat(t||"").concat(r)},jn=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!de(t)&&!Js(t))return a;var i;if($s(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Qo(i)&&(i=a),s&&i>r&&(i=r),i},za=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},jV=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,a={},s=0;s<r;s++)if(!a[t[s]])a[t[s]]=!0;else return!0;return!1},An=function(t,r){return de(t)&&de(r)?function(a){return t+a*(r-t)}:function(){return r}};function Gu(e,t,r){return!e||!e.length?null:e.find(function(a){return a&&(typeof t=="function"?t(a):zn(a,t))===r})}var wV=function(t,r){return de(t)&&de(r)?t-r:Js(t)&&Js(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function lo(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var a in t)if({}.hasOwnProperty.call(t,a)&&!{}.hasOwnProperty.call(e,a))return!1;return!0}function Yv(e){"@babel/helpers - typeof";return Yv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yv(e)}var NV=["viewBox","children"],_V=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackgroun
171d","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],$2=["points","pathLength"],wx={svg:NV,polygon:$2,polyline:$2},C1=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Ku=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(y.isValidElement(t)&&(a=t.props),!Jo(a))return null;var s={};
vendor: 4,165 bytes, line 171
171return Object.keys(a).forEach(function(i){C1.includes(i)&&(s[i]=r||function(o){return a[i](a,o)})}),s},SV=function(t,r,a){return function(s){return t(r,a,s),null}},Qs=function(t,r,a){if(!Jo(t)||Yv(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(i){var o=t[i];C1.includes(i)&&typeof o=="function"&&(s||(s={}),s[i]=SV(o,r,a))}),s},CV=["children"],AV=["children"];function F2(e,t){if(e==null)return{};var r=kV(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function kV(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function Zv(e){"@babel/helpers - typeof";return Zv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zv(e)}var B2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ba=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},U2=null,Nx=null,A1=function e(t){if(t===U2&&Array.isArray(Nx))return Nx;var r=[];return y.Children.forEach(t,function(a){Ie(a)||(mV.isFragment(a)?r=r.concat(e(a.props.children)):r.push(a))}),Nx=r,U2=t,r};function nr(e,t){var r=[],a=[];return Array.isArray(t)?a=t.map(function(s){return ba(s)}):a=[ba(t)],A1(e).forEach(function(s){var i=zn(s,"type.displayName")||zn(s,"type.name");a.indexOf(i)!==-1&&r.push(s)}),r}function $n(e,t){var r=nr(e,t);return r&&r[0]}var z2=function(t){if(!t||!t.props)return!1;var r=t.props,a=r.width,s=r.height;return!(!de(a)||a<=0||!de(s)||s<=0)},PV=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],TV=function(t){return t&&t.type&&Js(t.type)&&PV.indexOf(t.type)>=0},OV=function(t){return t&&Zv(t)==="object"&&"clipDot"in t},EV=function(t,r,a,s){var i,o=(i=wx?.[s])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Oe(t)&&(s&&o.includes(r)||_V.includes(r))||a&&C1.includes(r)},Ce=function(t,r,a){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(y.isValidElement(t)&&(s=t.props),!Jo(s))return null;var i={};return Object.keys(s).forEach(function(o){var c;EV((c=s)===null||c===void 0?void 0:c[o],o,r,a)&&(i[o]=s[o])}),i},Xv=function e(t,r){if(t===r)return!0;var a=y.Children.count(t);if(a!==y.Children.count(r))return!1;if(a===0)return!0;if(a===1)return W2(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var s=0;s<a;s++){var i=t[s],o=r[s];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!W2(i,o))return!1}return!0},W2=function(t,r){if(Ie(t)&&Ie(r))return!0;if(!Ie(t)&&!Ie(r)){var a=t.props||{},s=a.children,i=F2(a,CV),o=r.props||{},c=o.children,d=F2(o,AV);return s&&c?lo(i,d)&&Xv(s,c):!s&&!c?lo(i,d):!1}return!1},q2=function(t,r){var a=[],s={};return A1(t).forEach(function(i,o){if(TV(i))a.push(i);else if(i){var c=ba(i.type),d=r[c]||{},u=d.handler,h=d.once;
171if(u&&(!h||!s[c])){var m=u(i,c,o);a.push(m),s[c]=!0}}}),a},MV=function(t){var r=t&&t.type;return r&&B2[r]?B2[r]:null},LV=function(t,r){return A1(r).indexOf(t)},IV=["children","width","height","viewBox","className","style","title","desc"];function Jv(){return Jv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Jv.apply(this,arguments)}function RV(e,t){if(e==null)return{};var r=DV(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function DV(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function Qv(e){var t=e.children,r=e.width,a=e.height,s=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,u=RV(e,IV),h=s||{width:r,height:a,x:0,y:0},m=$e("recharts-surface",i);return q.createElement("svg",Jv({},Ce(u,!0,"svg"),{className:m,width:r,height:a,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),q.createElement("title",null,c),q.createElement("desc",null,d),t)}var $V=["children","className"];function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ey.apply(this,arguments)}function FV(e,t){if(e==null)return{};var r=BV(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function BV(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}var He=q.forwardRef(function(e,t){var r=e.children,a=e.className,s=FV(e,$V),i=$e("recharts-layer",a);return q.createElement("g",ey({className:i},Ce(s,!0),{ref:t}),r)}),Sr=function(t,r){for(var a=arguments.length,s=new Array(a>2?a-2:0),i=2;i<a;i++)s[i-2]=arguments[i]},_x,V2;function UV(){if(V2)return _x;V2=1;function e(t,r,a){var s=-1,i=t.length;r<0&&(r=-r>i?0:i+r),a=a>i?i:a,a<0&&(a+=i),i=r>a?0:a-r>>>0,r>>>=0;for(var o=Array(i);++s<i;)o[s]=t[s+r];return o}return _x=e,_x}var Sx,H2;function zV(){if(H2)return Sx;H2=1;var e=UV();function t(r,a,s){var i=r.length;return s=s===void 0?i:s,!a&&s>=i?r:e(r,a,s)}return Sx=t,Sx}var Cx,G2;function fT(){if(G2)return Cx;G2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",s=t+r+a,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+s+i+"]");function d(u){return c.test(u)}return Cx=d,Cx}var Ax,K2;function WV(){if(K2)return Ax;K2=1;function e(t){return t.split("")}return Ax=e,Ax}var kx,Y2;function qV(){if(Y2)return kx;Y2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",s=t+r+a,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+s+"]",d="\\ud83c[\\udffb-\\udfff]",u="(?:"+c+"|"+d+")",h="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",w=u+"?",x="["+i+"]?",g="(?:"+b+"(?:"+[h,m,p].join("|")+")"+x+w+")*",j=x+w+g,S="(?:"+[h+c+"?",c,m,p,o].join("|")+")",_=RegExp(d+"(?="+d+")|"+S+j,"g");function N(C){return C.match(_)||[]}return kx=N,kx}var Px,Z2;function VV(){if(Z2)return Px;Z2=1;var e=WV(),t=fT(),r=qV();function a(s){return t(s)?r(s):e(s)}return Px=a,Px}var Tx,X2;function HV(){if(X2)return Tx;X2=1;var e=zV(),t=fT(),r=VV(),a=cT();function s(i){return function(o){o=a(o);var c=t(o)?r(o):void 0,d=c?c[0]:o.charAt(0),u=c?e(c,1).join(""):o.slice(1);return d[i]()+u}}return Tx=s,Tx}var Ox,J2;function GV(){if(J2)return Ox;J2=1;var e=HV(),t=e("toUpperCase");return Ox=t,Ox}var KV=GV();const Of=it(KV);function ut(e){return function(){return e}}const mT=Math.cos,Yu=Math.sin,Ar=Math.sqrt,Zu=Math.PI,Ef=2*Zu,ty=Math.PI,ny=2*ty,Ps=1e-6,YV=ny-Ps;function pT(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function ZV(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return pT;const r=10**t;return function(a){this._+=a[0];for(let s=1,i=a.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+a[s]}}class XV{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?pT:ZV(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,a,s){this._append`Q${+t},${+r},${this._x1=+a},${this._y1=+s}`}bezierCurveTo(t,r,a,s,i,o){this._append`C${+t},${+r},${+a},${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,a,s,i){if(t=+t,r=+r,a=+a,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=a-t,u=s-r,h=o-t,m=c-r,p=h*h+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>Ps)if(!(Math.abs(m*d-u*h)>Ps)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let b=a-o,w=s-c,x=d*d+u*u,g=b*b+w*w,j=Math.sqrt(x),S=Math.sqrt(p),_=i*Math.tan((ty-Math.acos((x+p-g)/(2*j*S)))/2),N=_/S,C=_/j;Math.abs(N-1)>Ps&&this._append`L${t+N*h},${r+N*m}`,this._append`A${i},${i},0,0,${+(m*b>h*w)},${this._x1=t+C*d},${this._y1=r+C*u}`}}arc(t,r,a,s,i,o){if(t=+t,r=+r,a=+a,o=!!o,a<0)throw new Error(`negative radius: ${a}`);let c=a*Math.cos(s),d=a*Math.sin(s),u=t+c,h=r+d,m=1^o,p=o?s-i:i-s;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>Ps||Math.abs(this._y1-h)>Ps)&&this._append`L${u},${h}`,a&&(p<0&&(p=p%ny+ny),p>YV?this._append`A${a},${a},0,1,${m},${t-c},${r-d}A${a},${a},0,1,${m},${this._x1=u},${this._y1=h}`:p>Ps&&this._append`A${a},${a},0,${+(p>=ty)},${m},${this._x1=t+a*Math.cos(i)},${this._y1=r+a*Math.sin(i)}`)}rect(t,r,a,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${a=+a}v${+s}h${-a}Z`}toString(){return this._}}function k1(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const a=Math.floor(r);if(!(a>=0))throw new RangeError(`invalid digits: ${r}`);t=a}return e},()=>new XV(t)}function P1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xT(e){this._context=e}xT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Mf(e){return new xT(e)}function gT(e){return e[0]}function bT(e){return e[1]}function vT(e,t){var r=ut(!0),a=null,s=Mf,i=null,o=k1(c);e=typeof e=="function"?e:e===void 0?gT:ut(e),t=typeof t=="function"?t:t===void 0?bT:ut(t);function c(d){var u,h=(d=P1(d)).length,m,p=!1,b;for(a==null&&(i=s(b=o())),u=0;u<=h;++u)!(u<h&&r(m=d[u],u,d))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+e(m,u,d),+t(m,u,d));if(b)return i=null,b+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ut(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ut(+d),c):t},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:ut(!!d),c):r},c.curve=function(d){return arguments.length?(s=d,a!=null&&(i=s(a)),c):s},c.context=function(d){return arguments.length?(d==null?a=i=null:i=s(a=d),c):a},c}function Wd(e,t,r){var a=null,s=ut(!0),i=null,o=Mf,c=null,d=k1(u);e=typeof e=="function"?e:e===void 0?gT:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?bT:ut(+r);function u(m){var p,b,w,x=(m=P1(m)).length,g,j=!1,S,_=new Array(x),N=new Array(x);for(i==null&&(c=o(S=d())),p=0;p<=x;++p){if(!(p<x&&s(g=m[p],p,m))===j)if(j=!j)b=p,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=p-1;w>=b;--w)c.point(_[w],N[w]);c.lineEnd(),c.areaEnd()}j&&(_[p]=+e(g,p,m),N[p]=+t(g,p,m),c.point(a?+a(g,p,m):_[p],r?+r(g,p,m):N[p]))}if(S)return c=null,S+""||null}function h(){return vT().defined(s).curve(o).context(i)}return u.x=function(m){return arguments.length?(e=typeof m=="function"?m:ut(+m),a=null,u):e},u.x0=function(m){return arguments.length?(e=typeof m=="function"?m:ut(+m),u):e},u.x1=function(m){return arguments.length?(a=m==null?null:typeof m=="function"?m:ut(+m),u):a},u.y=function(m){return arguments.length?(t=typeof m=="function"?m:ut(+m),r=null,u):t},u.y0=function(m){return arguments.length?(t=typeof m=="function"?m:ut(+m),u):t},u.y1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:ut(+m),u):r},u.lineX0=u.lineY0=function(){return h().x(e).y(t)},u.lineY1=function(){return h().x(e).y(r)},u.lineX1=function(){return h().x(a).y(t)},u.defined=function(m){return arguments.length?(s=typeof m=="function"?m:ut(!!m),u):s},u.curve=function(m){return arguments.length?(o=m,i!=null&&(c=o(i)),u):o},u.context=function(m){return arguments.length?(m==null?i=c=null:c=o(i=m),u):i},u}class yT{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function JV(e){return new yT(e,!0)}function QV(e){return new yT(e,!1)}const T1={draw(e,t){const r=Ar(t/Zu);e.moveTo(r,0),e.arc(0,0,r,0,Ef)}
171},eH={draw(e,t){const r=Ar(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},jT=Ar(1/3),tH=jT*2,nH={draw(e,t){const r=Ar(t/tH),a=r*jT;e.moveTo(0,-r),e.lineTo(a,0),e.lineTo(0,r),e.lineTo(-a,0),e.closePath()}},rH={draw(e,t){const r=Ar(t),a=-r/2;e.rect(a,a,r,r)}},aH=.8908130915292852,wT=Yu(Zu/10)/Yu(7*Zu/10),sH=Yu(Ef/10)*wT,iH=-mT(Ef/10)*wT,oH={draw(e,t){const r=Ar(t*aH),a=sH*r,s=iH*r;e.moveTo(0,-r),e.lineTo(a,s);for(let i=1;i<5;++i){const o=Ef*i/5,c=mT(o),d=Yu(o);e.lineTo(d*r,-c*r),e.lineTo(c*a-d*s,d*a+c*s)}e.closePath()}},Ex=Ar(3),lH={draw(e,t){const r=-Ar(t/(Ex*3));e.moveTo(0,r*2),e.lineTo(-Ex*r,-r),e.lineTo(Ex*r,-r),e.closePath()}},Yn=-.5,Zn=Ar(3)/2,ry=1/Ar(12),cH=(ry/2+1)*3,dH={draw(e,t){const r=Ar(t/cH),a=r/2,s=r*ry,i=a,o=r*ry+r,c=-i,d=o;e.moveTo(a,s),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(Yn*a-Zn*s,Zn*a+Yn*s),e.lineTo(Yn*i-Zn*o,Zn*i+Yn*o),e.lineTo(Yn*c-Zn*d,Zn*c+Yn*d),e.lineTo(Yn*a+Zn*s,Yn*s-Zn*a),e.lineTo(Yn*i+Zn*o,Yn*o-Zn*i),e.lineTo(Yn*c+Zn*d,Yn*d-Zn*c),e.closePath()}};function uH(e,t){let r=null,a=k1(s);e=typeof e=="function"?e:ut(e||T1),t=typeof t=="function"?t:ut(t===void 0?64:+t);function s(){let i;if(r||(r=i=a()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:ut(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:ut(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function Xu(){}function Ju(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function NT(e){this._context=e}NT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ju(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ju(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hH(e){return new NT(e)}function _T(e){this._context=e}_T.prototype={areaStart:Xu,areaEnd:Xu,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ju(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fH(e){return new _T(e)}function ST(e){this._context=e}ST.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,a):this._context.moveTo(r,a);break;case 3:this._point=4;default:Ju(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mH(e){return new ST(e)}function CT(e){this._context=e}CT.prototype={areaStart:Xu,areaEnd:Xu,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function pH(e){return new CT(e)}function Q2(e){return e<0?-1:1}function e_(e,t,r){var a=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(a||s<0&&-0),o=(r-e._y1)/(s||a<0&&-0),c=(i*s+o*a)/(a+s);return(Q2(i)+Q2(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function t_(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Mx(e,t,r){var a=e._x0,s=e._y0,i=e._x1,o=e._y1,c=(i-a)/3;e._context.bezierCurveTo(a+c,s+c*t,i-c,o-c*r,i,o)}function Qu(e){this._context=e}Qu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Mx(this,this._t0,t_(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Mx(this,t_(this,r=e_(this,e,t)),r);break;default:Mx(this,this._t0,r=e_(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function AT(e){this._context=new kT(e)}(AT.prototype=Object.create(Qu.prototype)).point=function(e,t){Qu.prototype.point.call(this,t,e)};function kT(e){this._context=e}kT.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,a,s,i){this._context.bezierCurveTo(t,e,a,r,i,s)}};function xH(e){return new Qu(e)}function gH(e){return new AT(e)}function PT(e){this._context=e}PT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var a=n_(e),s=n_(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(a[0][i],s[0][i],a[1][i],s[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function n_(e){var t,r=e.length-1,a,s=new Array(r),i=new Array(r),o=new Array(r);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)a=s[t]/i[t-1],i[t]-=a,o[t]-=a*o[t-1];for(s[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function bH(e){return new PT(e)}function Lf(e,t){this._context=e,this._t=t}Lf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 16,276 bytes, lines 171-174
171default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function vH(e){return new Lf(e,.5)}function yH(e){return new Lf(e,0)}function jH(e){return new Lf(e,1)}function xo(e,t){if((o=e.length)>1)for(var r=1,a,s,i=e[t[0]],o,c=i.length;r<o;++r)for(s=i,i=e[t[r]],a=0;a<c;++a)i[a][1]+=i[a][0]=isNaN(s[a][1])?s[a][0]:s[a][1]}function ay(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function wH(e,t){return e[t]}function NH(e){const t=[];return t.key=e,t}function _H(){var e=ut([]),t=ay,r=xo,a=wH;function s(i){var o=Array.from(e.apply(this,arguments),NH),c,d=o.length,u=-1,h;for(const m of i)for(c=0,++u;c<d;++c)(o[c][u]=[0,+a(m,o[c].key,u,i)]).data=m;for(c=0,h=P1(t(o));c<d;++c)o[h[c]].index=c;return r(o,h),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ut(Array.from(i)),s):e},s.value=function(i){return arguments.length?(a=typeof i=="function"?i:ut(+i),s):a},s.order=function(i){return arguments.length?(t=i==null?ay:typeof i=="function"?i:ut(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??xo,s):r},s}function SH(e,t){if((a=e.length)>0){for(var r,a,s=0,i=e[0].length,o;s<i;++s){for(o=r=0;r<a;++r)o+=e[r][s][1]||0;if(o)for(r=0;r<a;++r)e[r][s][1]/=o}xo(e,t)}}function CH(e,t){if((s=e.length)>0){for(var r=0,a=e[t[0]],s,i=a.length;r<i;++r){for(var o=0,c=0;o<s;++o)c+=e[o][r][1]||0;a[r][1]+=a[r][0]=-c/2}xo(e,t)}}function AH(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,a=1,s,i,o;a<i;++a){for(var c=0,d=0,u=0;c<o;++c){for(var h=e[t[c]],m=h[a][1]||0,p=h[a-1][1]||0,b=(m-p)/2,w=0;w<c;++w){var x=e[t[w]],g=x[a][1]||0,j=x[a-1][1]||0;b+=g-j}d+=m,u+=b*m}s[a-1][1]+=s[a-1][0]=r,d&&(r-=u/d)}s[a-1][1]+=s[a-1][0]=r,xo(e,t)}}function Jl(e){"@babel/helpers - typeof";return Jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jl(e)}var kH=["type","size","sizeType"];function sy(){return sy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},sy.apply(this,arguments)}function r_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function a_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r_(Object(r),!0).forEach(function(a){PH(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r_(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function PH(e,t,r){return t=TH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TH(e){var t=OH(e,"string");return Jl(t)=="symbol"?t:t+""}function OH(e,t){if(Jl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Jl(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EH(e,t){if(e==null)return{};var r=MH(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function MH(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}var TT={symbolCircle:T1,symbolCross:eH,symbolDiamond:nH,symbolSquare:rH,symbolStar:oH,symbolTriangle:lH,symbolWye:dH},LH=Math.PI/180,IH=function(t){var r="symbol".concat(Of(t));return TT[r]||T1},RH=function(t,r,a){if(r==="area")return t;switch(a){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var s=18*LH;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},DH=function(t,r){TT["symbol".concat(Of(t))]=r},O1=function(t){var r=t.type,a=r===void 0?"circle":r,s=t.size,i=s===void 0?64:s,o=t.sizeType,c=o===void 0?"area":o,d=EH(t,kH),u=a_(a_({},d),{},{type:a,size:i,sizeType:c}),h=function(){var g=IH(a),j=uH().type(g).size(RH(i,c,a));return j()},m=u.className,p=u.cx,b=u.cy,w=Ce(u,!0);return p===+p&&b===+b&&i===+i?q.createElement("path",sy({},w,{className:$e("recharts-symbols",m),transform:"translate(".concat(p,", ").concat(b,")"),d:h()})):null};O1.registerSymbol=DH;function go(e){"@babel/helpers - typeof";return go=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},go(e)}function iy(){return iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},iy.apply(this,arguments)}function s_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function $H(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s_(Object(r),!0).forEach(function(a){Ql(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s_(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function FH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BH(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ET(a.key),a)}}function UH(e,t,r){return t&&BH(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zH(e,t,r){return t=eh(t),WH(e,OT()?Reflect.construct(t,r||[],eh(e).constructor):t.apply(e,r))}function WH(e,t){if(t&&(go(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qH(e)}function qH(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OT=function(){return!!e})()}function eh(e){return eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},eh(e)}function VH(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oy(e,t)}function oy(e,t){return oy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},oy(e,t)}function Ql(e,t,r){return t=ET(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ET(e){var t=HH(e,"string");return go(t)=="symbol"?t:t+""}function HH(e,t){if(go(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(go(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Xn=32,E1=(function(e){function t(){return FH(this,t),zH(this,t,arguments)}return VH(t,e),UH(t,[{key:"renderIcon",value:function(a){var s=this.props.inactiveColor,i=Xn/2,o=Xn/6,c=Xn/3,d=a.inactive?s:a.color;if(a.type==="plainline")return q.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:a.payload.strokeDasharray,x1:0,y1:i,x2:Xn,y2:i,className:"recharts-legend-icon"});if(a.type==="line")return q.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,` 172 A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,` 173 H`).concat(Xn,"M").concat(2*c,",").concat(i,` 174 A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(a.type==="rect")return q.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Xn/8,"h").concat(Xn,"v").concat(Xn*3/4,"h").concat(-Xn,"z"),className:"recharts-legend-icon"});if(q.isValidElement(a.legendIcon)){var u=$H({},a);return delete u.legendIcon,q.cloneElement(a.legendIcon,u)}return q.createElement(O1,{fill:d,cx:i,cy:i,size:Xn,sizeType:"diameter",type:a.type})}},{key:"renderItems",value:function(){var a=this,s=this.props,i=s.payload,o=s.iconSize,c=s.layout,d=s.formatter,u=s.inactiveColor,h={x:0,y:0,width:Xn,height:Xn},m={display:c==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(b,w){var x=b.formatter||d,g=$e(Ql(Ql({"recharts-legend-item":!0},"legend-item-".concat(w),!0),"inactive",b.inactive));if(b.type==="none")return null;var j=Oe(b.value)?null:b.value;Sr(!Oe(b.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var S=b.inactive?u:b.color;return q.createElement("li",iy({className:g,style:m,key:"legend-item-".concat(w)},Qs(a.props,b,w)),q.createElement(Qv,{width:o,height:o,viewBox:h,style:p},a.renderIcon(b)),q.createElement("span",{className:"recharts-legend-item-text",style:{color:S}},x?x(j,b,w):j))})}},{key:"render",value:function(){var a=this.props,s=a.payload,i=a.layout,o=a.align;if(!s||!s.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(y.PureComponent);Ql(E1,"displayName","Legend");Ql(E1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Lx,i_;function GH(){if(i_)return Lx;i_=1;var e=kf();function t(){this.__data__=new e,this.size=0}return Lx=t,Lx}var Ix,o_;function KH(){if(o_)return Ix;o_=1;function e(t){var r=this.__data__,a=r.delete(t);return this.size=r.size,a}return Ix=e,Ix}var Rx,l_;function YH(){if(l_)return Rx;l_=1;function e(t){return this.__data__.get(t)}return Rx=e,Rx}var Dx,c_;function ZH(){if(c_)return Dx;c_=1;function e(t){return this.__data__.has(t)}return Dx=e,Dx}var $x,d_;function XH(){if(d_)return $x;d_=1;var e=kf(),t=w1(),r=N1(),a=200;function s(i,o){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<a-1)return d.push([i,o]),this.size=++c.size,this;c=this.__data__=new r(d)}return c.set(i,o),this.size=c.size,this}return $x=s,$x}var Fx,u_;function MT(){if(u_)return Fx;u_=1;var e=kf(),t=GH(),r=KH(),a=YH(),s=ZH(),i=XH();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=r,o.prototype.get=a,o.prototype.has=s,o.prototype.set=i,Fx=o,Fx}var Bx,h_;function JH(){if(h_)return Bx;h_=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Bx=t,Bx}var Ux,f_;function QH(){if(f_)return Ux;f_=1;function e(t){return this.__data__.has(t)}return Ux=e,Ux}var zx,m_;function LT(){if(m_)return zx;m_=1;var e=N1(),t=JH(),r=QH();function a(s){var i=-1,o=s==null?0:s.length;for(this.__data__=new e;++i<o;)this.add(s[i])}return a.prototype.add=a.prototype.push=t,a.prototype.has=r,zx=a,zx}var Wx,p_;function IT(){if(p_)return Wx;p_=1;function e(t,r){for(var a=-1,s=t==null?0:t.length;++a<s;)if(r(t[a],a,t))return!0;return!1}return Wx=e,Wx}var qx,x_;function RT(){if(x_)return qx;x_=1;function e(t,r){return t.has(r)}return qx=e,qx}var Vx,g_;function DT(){if(g_)return Vx;g_=1;var e=LT(),t=IT(),r=RT(),a=1,s=2;function i(o,c,d,u,h,m){var p=d&a,b=o.length,w=c.length;if(b!=w&&!(p&&w>b))return!1;var x=m.get(o),g=m.get(c);if(x&&g)return x==c&&g==o;var j=-1,S=!0,_=d&s?new e:void 0;for(m.set(o,c),m.set(c,o);++j<b;){var N=o[j],C=c[j];if(u)var A=p?u(C,N,j,c,o,m):u(N,C,j,o,c,m);if(A!==void 0){if(A)continue;S=!1;break}if(_){if(!t(c,function(P,O){if(!r(_,O)&&(N===P||h(N,P,d,u,m)))return _.push(O)})){S=!1;break}}else if(!(N===C||h(N,C,d,u,m))){S=!1;break}}return m.delete(o),m.delete(c),S}return Vx=i,Vx}var Hx,b_;function eG(){if(b_)return Hx;b_=1;var e=ea(),t=e.Uint8Array;return Hx=t,Hx}var Gx,v_;function tG(){if(v_)return Gx;v_=1;function e(t){var r=-1,a=Array(t.size);return t.forEach(function(s,i){a[++r]=[i,s]}),a}return Gx=e,Gx}var Kx,y_;function M1(){if(y_)return Kx;y_=1;function e(t){var r=-1,a=Array(t.size);return t.forEach(function(s){a[++r]=s}),a}return Kx=e,Kx}var Yx,j_;function nG(){if(j_)return Yx;j_=1;var e=Qc(),t=eG(),r=j1(),a=DT(),s=tG(),i=M1(),o=1,c=2,d="[object Boolean]",u="[object Date]",h="[object Error]",m="[object Map]",p="[object Number]",b="[object RegExp]",w="[object Set]",x="[object String]",g="[object Symbol]",j="[object ArrayBuffer]",S="[object DataView]",_=e?e.prototype:void 0,N=_?_.valueOf:void 0;function C(A,P,O,E,$,M,R){switch(O){case S:if(A.byteLength!=P.byteLength||A.byteOffset!=P.byteOffset)return!1;A=A.buffer,P=P.buffer;case j:return!(A.byteLength!=P.byteLength||!M(new t(A),new t(P)));case d:case u:case p:return r(+A,+P);case h:return A.name==P.name&&A.message==P.message;case b:case x:return A==P+"";case m:var B=s;case w:var D=E&o;if(B||(B=i),A.size!=P.size&&!D)return!1;var U=R.get(A);if(U)return U==P;E|=c,R.set(A,P);var H=a(B(A),B(P),E,$,M,R);return R.delete(A),H;case g:if(N)return N.call(A)==N.call(P)}return!1}return Yx=C,Yx}var Zx,w_;function $T(){if(w_)return Zx;w_=1;function e(t,r){for(var a=-1,s=r.length,i=t.length;++a<s;)t[i+a]=r[a];return t}return Zx=e,Zx}var Xx,N_;function rG(){if(N_)return Xx;N_=1;var e=$T(),t=In();function r(a,s,i){var o=s(a);return t(a)?o:e(o,i(a))}return Xx=r,Xx}var Jx,__;function aG(){if(__)return Jx;__=1;function e(t,r){for(var a=-1,s=t==null?0:t.length,i=0,o=[];++a<s;){var c=t[a];r(c,a,t)&&(o[i++]=c)}return o}return Jx=e,Jx}var Qx,S_;function sG(){if(S_)return Qx;S_=1;function e(){return[]}return Qx=e,Qx}var eg,C_;function iG(){if(C_)return eg;C_=1;var e=aG(),t=sG(),r=Object.prototype,a=r.propertyIsEnumerable,s=Object.getOwnPropertySymbols,i=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(c){return a.call(o,c)}))}:t;return eg=i,eg}var tg,A_;function oG(){if(A_)return tg;A_=1;function e(t,r){for(var a=-1,s=Array(t);++a<t;)s[a]=r(a);return s}return tg=e,tg}var ng,k_;function lG(){if(k_)return ng;k_=1;var e=Ta(),t=Oa(),r="[object Arguments]";function a(s){return t(s)&&e(s)==r}return ng=a,ng}var rg,P_;function L1(){if(P_)return rg;P_=1;var e=lG(),t=Oa(),r=Object.prototype,a=r.hasOwnProperty,s=r.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&a.call(o,"callee")&&!s.call(o,"callee")};return rg=i,rg}var Rl={exports:{}},ag,T_;function cG(){if(T_)return ag;T_=1;function e(){return!1}return ag=e,ag}Rl.exports;var O_;function FT(){return O_||(O_=1,(function(e,t){var r=ea(),a=cG(),s=t&&!t.nodeType&&t,i=s&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===s,c=o?r.Buffer:void 0,d=c?c.isBuffer:void 0,u=d||a;e.exports=u})(Rl,Rl.exports)),Rl.exports}var sg,E_;function I1(){if(E_)return sg;E_=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(a,s){var i=typeof a;return s=s??e,!!s&&(i=="number"||i!="symbol"&&t.test(a))&&a>-1&&a%1==0&&a<s}return sg=r,sg}var ig,M_;function R1(){if(M_)return ig;M_=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return ig=t,ig}var og,L_;function dG(){if(L_)return og;L_=1;var e=Ta(),t=R1(),r=Oa(),a="[object Arguments]",s="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",u="[object Map]",h="[object Number]",m="[object Object]",p="[object RegExp]",b="[object Set]",w="[object String]",x="[object WeakMap]",g="[object ArrayBuffer]",j="[object DataView]",S="[object Float32Array]",_="[object Float64Array
174]",N="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",P="[object Uint8Array]",O="[object Uint8ClampedArray]",E="[object Uint16Array]",$="[object Uint32Array]",M={};M[S]=M[_]=M[N]=M[C]=M[A]=M[P]=M[O]=M[E]=M[$]=!0,M[a]=M[s]=M[g]=M[i]=M[j]=M[o]=M[c]=M[d]=M[u]=M[h]=M[m]=M[p]=M[b]=M[w]=M[x]=!1;function R(B){return r(B)&&t(B.length)&&!!M[e(B)]}return og=R,og}var lg,I_;function BT(){if(I_)return lg;I_=1;function e(t){return function(r){return t(r)}}return lg=e,lg}var Dl={exports:{}};Dl.exports;var R_;function uG(){return R_||(R_=1,(function(e,t){var r=iT(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,i=s&&s.exports===a,o=i&&r.process,c=(function(){try{var d=s&&s.require&&s.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Dl,Dl.exports)),Dl.exports}var cg,D_;function UT(){if(D_)return cg;D_=1;var e=dG(),t=BT(),r=uG(),a=r&&r.isTypedArray,s=a?t(a):e;return cg=s,cg}var dg,$_;function hG(){if($_)return dg;$_=1;var e=oG(),t=L1(),r=In(),a=FT(),s=I1(),i=UT(),o=Object.prototype,c=o.hasOwnProperty;function d(u,h){var m=r(u),p=!m&&t(u),b=!m&&!p&&a(u),w=!m&&!p&&!b&&i(u),x=m||p||b||w,g=x?e(u.length,String):[],j=g.length;for(var S in u)(h||c.call(u,S))&&!(x&&(S=="length"||b&&(S=="offset"||S=="parent")||w&&(S=="buffer"||S=="byteLength"||S=="byteOffset")||s(S,j)))&&g.push(S);return g}return dg=d,dg}var ug,F_;function fG(){if(F_)return ug;F_=1;var e=Object.prototype;function t(r){var a=r&&r.constructor,s=typeof a=="function"&&a.prototype||e;return r===s}return ug=t,ug}var hg,B_;function zT(){if(B_)return hg;B_=1;function e(t,r){return function(a){return t(r(a))}}return hg=e,hg}var fg,U_;function mG(){if(U_)return fg;U_=1;var e=zT(),t=e(Object.keys,Object);return fg=t,fg}var mg,z_;function pG(){if(z_)return mg;z_=1;var e=fG(),t=mG(),r=Object.prototype,a=r.hasOwnProperty;function s(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))a.call(i,c)&&c!="constructor"&&o.push(c);return o}return mg=s,mg}var pg,W_;function ed(){if(W_)return pg;W_=1;var e=y1(),t=R1();function r(a){return a!=null&&t(a.length)&&!e(a)}return pg=r,pg}var xg,q_;function If(){if(q_)return xg;q_=1;var e=hG(),t=pG(),r=ed();function a(s){return r(s)?e(s):t(s)}return xg=a,xg}var gg,V_;function xG(){if(V_)return gg;V_=1;var e=rG(),t=iG(),r=If();function a(s){return e(s,r,t)}return gg=a,gg}var bg,H_;function gG(){if(H_)return bg;H_=1;var e=xG(),t=1,r=Object.prototype,a=r.hasOwnProperty;function s(i,o,c,d,u,h){var m=c&t,p=e(i),b=p.length,w=e(o),x=w.length;if(b!=x&&!m)return!1;for(var g=b;g--;){var j=p[g];if(!(m?j in o:a.call(o,j)))return!1}var S=h.get(i),_=h.get(o);if(S&&_)return S==o&&_==i;var N=!0;h.set(i,o),h.set(o,i);for(var C=m;++g<b;){j=p[g];var A=i[j],P=o[j];if(d)var O=m?d(P,A,j,o,i,h):d(A,P,j,i,o,h);if(!(O===void 0?A===P||u(A,P,c,d,h):O)){N=!1;break}C||(C=j=="constructor")}if(N&&!C){var E=i.constructor,$=o.constructor;E!=$&&"constructor"in i&&"constructor"in o&&!(typeof E=="function"&&E instanceof E&&typeof $=="function"&&$ instanceof $)&&(N=!1)}return h.delete(i),h.delete(o),N}return bg=s,bg}var vg,G_;function bG(){if(G_)return vg;G_=1;var e=vi(),t=ea(),r=e(t,"DataView");return vg=r,vg}var yg,K_;function vG(){if(K_)return yg;K_=1;var e=vi(),t=ea(),r=e(t,"Promise");return yg=r,yg}var jg,Y_;function WT(){if(Y_)return jg;Y_=1;var e=vi(),t=ea(),r=e(t,"Set");return jg=r,jg}var wg,Z_;function yG(){if(Z_)return wg;Z_=1;var e=vi(),t=ea(),r=e(t,"WeakMap");return wg=r,wg}var Ng,X_;function jG(){if(X_)return Ng;X_=1;var e=bG(),t=w1(),r=vG(),a=WT(),s=yG(),i=Ta(),o=oT(),c="[object Map]",d="[object Object]",u="[object Promise]",h="[object Set]",m="[object WeakMap]",p="[object DataView]",b=o(e),w=o(t),x=o(r),g=o(a),j=o(s),S=i;
vendor: 43,824 bytes, lines 174-181
174return(e&&S(new e(new ArrayBuffer(1)))!=p||t&&S(new t)!=c||r&&S(r.resolve())!=u||a&&S(new a)!=h||s&&S(new s)!=m)&&(S=function(_){var N=i(_),C=N==d?_.constructor:void 0,A=C?o(C):"";if(A)switch(A){case b:return p;case w:return c;case x:return u;case g:return h;case j:return m}return N}),Ng=S,Ng}var _g,J_;function wG(){if(J_)return _g;J_=1;var e=MT(),t=DT(),r=nG(),a=gG(),s=jG(),i=In(),o=FT(),c=UT(),d=1,u="[object Arguments]",h="[object Array]",m="[object Object]",p=Object.prototype,b=p.hasOwnProperty;function w(x,g,j,S,_,N){var C=i(x),A=i(g),P=C?h:s(x),O=A?h:s(g);P=P==u?m:P,O=O==u?m:O;var E=P==m,$=O==m,M=P==O;if(M&&o(x)){if(!o(g))return!1;C=!0,E=!1}if(M&&!E)return N||(N=new e),C||c(x)?t(x,g,j,S,_,N):r(x,g,P,j,S,_,N);if(!(j&d)){var R=E&&b.call(x,"__wrapped__"),B=$&&b.call(g,"__wrapped__");if(R||B){var D=R?x.value():x,U=B?g.value():g;return N||(N=new e),_(D,U,j,S,N)}}return M?(N||(N=new e),a(x,g,j,S,_,N)):!1}return _g=w,_g}var Sg,Q_;function D1(){if(Q_)return Sg;Q_=1;var e=wG(),t=Oa();function r(a,s,i,o,c){return a===s?!0:a==null||s==null||!t(a)&&!t(s)?a!==a&&s!==s:e(a,s,i,o,r,c)}return Sg=r,Sg}var Cg,eS;function NG(){if(eS)return Cg;eS=1;var e=MT(),t=D1(),r=1,a=2;function s(i,o,c,d){var u=c.length,h=u,m=!d;if(i==null)return!h;for(i=Object(i);u--;){var p=c[u];if(m&&p[2]?p[1]!==i[p[0]]:!(p[0]in i))return!1}for(;++u<h;){p=c[u];var b=p[0],w=i[b],x=p[1];if(m&&p[2]){if(w===void 0&&!(b in i))return!1}else{var g=new e;if(d)var j=d(w,x,b,i,o,g);if(!(j===void 0?t(x,w,r|a,d,g):j))return!1}}return!0}return Cg=s,Cg}var Ag,tS;function qT(){if(tS)return Ag;tS=1;var e=ls();function t(r){return r===r&&!e(r)}return Ag=t,Ag}var kg,nS;function _G(){if(nS)return kg;nS=1;var e=qT(),t=If();function r(a){for(var s=t(a),i=s.length;i--;){var o=s[i],c=a[o];s[i]=[o,c,e(c)]}return s}return kg=r,kg}var Pg,rS;function VT(){if(rS)return Pg;rS=1;function e(t,r){return function(a){return a==null?!1:a[t]===r&&(r!==void 0||t in Object(a))}}return Pg=e,Pg}var Tg,aS;function SG(){if(aS)return Tg;aS=1;var e=NG(),t=_G(),r=VT();function a(s){var i=t(s);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===s||e(o,s,i)}}return Tg=a,Tg}var Og,sS;function CG(){if(sS)return Og;sS=1;function e(t,r){return t!=null&&r in Object(t)}return Og=e,Og}var Eg,iS;function AG(){if(iS)return Eg;iS=1;var e=dT(),t=L1(),r=In(),a=I1(),s=R1(),i=Tf();function o(c,d,u){d=e(d,c);for(var h=-1,m=d.length,p=!1;++h<m;){var b=i(d[h]);if(!(p=c!=null&&u(c,b)))break;c=c[b]}return p||++h!=m?p:(m=c==null?0:c.length,!!m&&s(m)&&a(b,m)&&(r(c)||t(c)))}return Eg=o,Eg}var Mg,oS;function kG(){if(oS)return Mg;oS=1;var e=CG(),t=AG();function r(a,s){return a!=null&&t(a,s,e)}return Mg=r,Mg}var Lg,lS;function PG(){if(lS)return Lg;lS=1;var e=D1(),t=uT(),r=kG(),a=v1(),s=qT(),i=VT(),o=Tf(),c=1,d=2;function u(h,m){return a(h)&&s(m)?i(o(h),m):function(p){var b=t(p,h);return b===void 0&&b===m?r(p,h):e(m,b,c|d)}}return Lg=u,Lg}var Ig,cS;function tl(){if(cS)return Ig;cS=1;function e(t){return t}return Ig=e,Ig}var Rg,dS;function TG(){if(dS)return Rg;dS=1;function e(t){return function(r){return r?.[t]}}return Rg=e,Rg}var Dg,uS;function OG(){if(uS)return Dg;uS=1;var e=S1();function t(r){return function(a){return e(a,r)}}return Dg=t,Dg}var $g,hS;function EG(){if(hS)return $g;hS=1;var e=TG(),t=OG(),r=v1(),a=Tf();function s(i){return r(i)?e(a(i)):t(i)}return $g=s,$g}var Fg,fS;function ta(){if(fS)return Fg;fS=1;var e=SG(),t=PG(),r=tl(),a=In(),s=EG();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?a(o)?t(o[0],o[1]):e(o):s(o)}return Fg=i,Fg}var Bg,mS;function HT(){if(mS)return Bg;mS=1;function e(t,r,a,s){for(var i=t.length,o=a+(s?1:-1);s?o--:++o<i;)if(r(t[o],o,t))return o;return-1}return Bg=e,Bg}var Ug,pS;function MG(){if(pS)return Ug;pS=1;function e(t){return t!==t}return Ug=e,Ug}var zg,xS;function LG(){if(xS)return zg;xS=1;function e(t,r,a){for(var s=a-1,i=t.length;++s<i;)if(t[s]===r)return s;return-1}return zg=e,zg}var Wg,gS;function IG(){if(gS)return Wg;gS=1;var e=HT(),t=MG(),r=LG();function a(s,i,o){return i===i?r(s,i,o):e(s,t,o)}return Wg=a,Wg}var qg,bS;function RG(){if(bS)return qg;bS=1;var e=IG();function t(r,a){var s=r==null?0:r.length;return!!s&&e(r,a,0)>-1}return qg=t,qg}var Vg,vS;function DG(){if(vS)return Vg;vS=1;function e(t,r,a){for(var s=-1,i=t==null?0:t.length;++s<i;)if(a(r,t[s]))return!0;return!1}return Vg=e,Vg}var Hg,yS;function $G(){if(yS)return Hg;yS=1;function e(){}return Hg=e,Hg}var Gg,jS;function FG(){if(jS)return Gg;jS=1;var e=WT(),t=$G(),r=M1(),a=1/0,s=e&&1/r(new e([,-0]))[1]==a?function(i){return new e(i)}:t;return Gg=s,Gg}var Kg,wS;function BG(){if(wS)return Kg;wS=1;var e=LT(),t=RG(),r=DG(),a=RT(),s=FG(),i=M1(),o=200;function c(d,u,h){var m=-1,p=t,b=d.length,w=!0,x=[],g=x;if(h)w=!1,p=r;else if(b>=o){var j=u?null:s(d);if(j)return i(j);w=!1,p=a,g=new e}else g=u?[]:x;e:for(;++m<b;){var S=d[m],_=u?u(S):S;if(S=h||S!==0?S:0,w&&_===_){for(var N=g.length;N--;)if(g[N]===_)continue e;u&&g.push(_),x.push(S)}else p(g,_,h)||(g!==x&&g.push(_),x.push(S))}return x}return Kg=c,Kg}var Yg,NS;function UG(){if(NS)return Yg;NS=1;var e=ta(),t=BG();function r(a,s){return a&&a.length?t(a,e(s,2)):[]}return Yg=r,Yg}var zG=UG();const _S=it(zG);function GT(e,t,r){return t===!0?_S(e,r):Oe(t)?_S(e,t):e}function bo(e){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bo(e)}var WG=["ref"];function SS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SS(Object(r),!0).forEach(function(a){Rf(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function qG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CS(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,YT(a.key),a)}}function VG(e,t,r){return t&&CS(e.prototype,t),r&&CS(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function HG(e,t,r){return t=th(t),GG(e,KT()?Reflect.construct(t,r||[],th(e).constructor):t.apply(e,r))}function GG(e,t){if(t&&(bo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KG(e)}function KG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KT=function(){return!!e})()}function th(e){return th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},th(e)}function YG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ly(e,t)}function ly(e,t){return ly=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},ly(e,t)}function Rf(e,t,r){return t=YT(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YT(e){var t=ZG(e,"string");return bo(t)=="symbol"?t:t+""}function ZG(e,t){if(bo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(bo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XG(e,t){if(e==null)return{};var r=JG(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function JG(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function QG(e){return e.value}function eK(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var r=XG(t,WG);return q.createElement(E1,r)}var AS=1,co=(function(e){function t(){var r;qG(this,t);for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return r=HG(this,t,[].concat(s)),Rf(r,"lastBoundingBox",{width:-1,height:-1}),r}return YG(t,e),VG(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var a=this.wrapperNode.getBoundingClientRect();return a.height=this.wrapperNode.offsetHeight,a.width=this.wrapperNode.offsetWidth,a}return null}},{key:"updateBBox",value:function(){var a=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>AS||Math.abs(s.height-this.lastBoundingBox.height)>AS)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,a&&a(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,a&&a(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ia({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(a){var s=this.props,i=s.layout,o=s.align,c=s.verticalAlign,d=s.margin,u=s.chartWidth,h=s.chartHeight,m,p;if(!a||(a.left===void 0||a.left===null)&&(a.right===void 0||a.right===null))if(o==="center"&&i==="vertical"){var b=this.getBBoxSnapshot();m={left:((u||0)-b.width)/2}}else m=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!a||(a.top===void 0||a.top===null)&&(a.bottom===void 0||a.bottom===null))if(c==="middle"){var w=this.getBBoxSnapshot();p={top:((h||0)-w.height)/2}}else p=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return ia(ia({},m),p)}},{key:"render",value:function(){var a=this,s=this.props,i=s.content,o=s.width,c=s.height,d=s.wrapperStyle,u=s.payloadUniqBy,h=s.payload,m=ia(ia({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return q.createElement("div",{className:"recharts-legend-wrapper",style:m,ref:function(b){a.wrapperNode=b}},eK(i,ia(ia({},this.props),{},{payload:GT(h,u,QG)})))}}],[{key:"getWithHeight",value:function(a,s){var i=ia(ia({},this.defaultProps),a.props),o=i.layout;return o==="vertical"&&de(a.props.height)?{height:a.props.height}:o==="horizontal"?{width:a.props.width||s}:null}}])})(y.PureComponent);Rf(co,"displayName","Legend");Rf(co,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Zg,kS;function tK(){if(kS)return Zg;kS=1;var e=Qc(),t=L1(),r=In(),a=e?e.isConcatSpreadable:void 0;function s(i){return r(i)||t(i)||!!(a&&i&&i[a])}return Zg=s,Zg}var Xg,PS;function ZT(){if(PS)return Xg;PS=1;var e=$T(),t=tK();function r(a,s,i,o,c){var d=-1,u=a.length;for(i||(i=t),c||(c=[]);++d<u;){var h=a[d];s>0&&i(h)?s>1?r(h,s-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return Xg=r,Xg}var Jg,TS;function nK(){if(TS)return Jg;TS=1;function e(t){return function(r,a,s){for(var i=-1,o=Object(r),c=s(r),d=c.length;d--;){var u=c[t?d:++i];if(a(o[u],u,o)===!1)break}return r}}return Jg=e,Jg}var Qg,OS;function rK(){if(OS)return Qg;OS=1;var e=nK(),t=e();return Qg=t,Qg}var eb,ES;function XT(){if(ES)return eb;ES=1;var e=rK(),t=If();function r(a,s){return a&&e(a,s,t)}return eb=r,eb}var tb,MS;function aK(){if(MS)return tb;MS=1;var e=ed();function t(r,a){return function(s,i){if(s==null)return s;if(!e(s))return r(s,i);for(var o=s.length,c=a?o:-1,d=Object(s);(a?c--:++c<o)&&i(d[c],c,d)!==!1;);return s}}return tb=t,tb}var nb,LS;function $1(){if(LS)return nb;LS=1;var e=XT(),t=aK(),r=t(e);return nb=r,nb}var rb,IS;function JT(){if(IS)return rb;IS=1;var e=$1(),t=ed();function r(a,s){var i=-1,o=t(a)?Array(a.length):[];return e(a,function(c,d,u){o[++i]=s(c,d,u)}),o}return rb=r,rb}var ab,RS;function sK(){if(RS)return ab;RS=1;function e(t,r){var a=t.length;for(t.sort(r);a--;)t[a]=t[a].value;return t}return ab=e,ab}var sb,DS;function iK(){if(DS)return sb;DS=1;var e=Xo();function t(r,a){if(r!==a){var s=r!==void 0,i=r===null,o=r===r,c=e(r),d=a!==void 0,u=a===null,h=a===a,m=e(a);if(!u&&!m&&!c&&r>a||c&&d&&h&&!u&&!m||i&&d&&h||!s&&h||!o)return 1;if(!i&&!c&&!m&&r<a||m&&s&&o&&!i&&!c||u&&s&&o||!d&&o||!h)return-1}return 0}return sb=t,sb}var ib,$S;function oK(){if($S)return ib;$S=1;var e=iK();function t(r,a,s){for(var i=-1,o=r.criteria,c=a.criteria,d=o.length,u=s.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=u)return h;var m=s[i];return h*(m=="desc"?-1:1)}}return r.index-a.index}return ib=t,ib}var ob,FS;function lK(){if(FS)return ob;FS=1;var e=_1(),t=S1(),r=ta(),a=JT(),s=sK(),i=BT(),o=oK(),c=tl(),d=In();function u(h,m,p){m.length?m=e(m,function(x){return d(x)?function(g){return t(g,x.length===1?x[0]:x)}:x}):m=[c];var b=-1;m=e(m,i(r));var w=a(h,function(x,g,j){var S=e(m,function(_){return _(x)});return{criteria:S,index:++b,value:x}});return s(w,function(x,g){return o(x,g,p)})}return ob=u,ob}var lb,BS;function cK(){if(BS)return lb;BS=1;function e(t,r,a){switch(a.length){case 0:return t.call(r);case 1:return t.call(r,a[0]);case 2:return t.call(r,a[0],a[1]);case 3:return t.call(r,a[0],a[1],a[2])}return t.apply(r,a)}return lb=e,lb}var cb,US;function dK(){if(US)return cb;US=1;var e=cK(),t=Math.max;function r(a,s,i){return s=t(s===void 0?a.length-1:s,0),function(){for(var o=arguments,c=-1,d=t(o.length-s,0),u=Array(d);++c<d;)u[c]=o[s+c];c=-1;for(var h=Array(s+1);++c<s;)h[c]=o[c];return h[s]=i(u),e(a,this,h)}}return cb=r,cb}var db,zS;function uK(){if(zS)return db;zS=1;function e(t){return function(){return t}}return db=e,db}var ub,WS;function QT(){if(WS)return ub;WS=1;var e=vi(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return ub=t,ub}var hb,qS;function hK(){if(qS)return hb;qS=1;var e=uK(),t=QT(),r=tl(),a=t?function(s,i){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:r;return hb=a,hb}var fb,VS;function fK(){if(VS)return fb;VS=1;var e=800,t=16,r=Date.now;function a(s){var i=0,o=0;return function(){var c=r(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}return fb=a,fb}var mb,HS;function mK(){if(HS)return mb;HS=1;var e=hK(),t=fK(),r=t(e);return mb=r,mb}var pb,GS;function pK(){if(GS)return pb;GS=1;var e=tl(),t=dK(),r=mK();function a(s,i){return r(t(s,i,e),s+"")}return pb=a,pb}var xb,KS;function Df(){if(KS)return xb;KS=1;var e=j1(),t=ed(),r=I1(),a=ls();function s(i,o,c){if(!a(c))return!1;var d=typeof o;return(d=="number"?t(c)&&r(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return xb=s,xb}var gb,YS;function xK(){if(YS)return gb;YS=1;var e=ZT(),t=lK(),r=pK(),a=Df(),s=r(function(i,o){if(i==null)return[];var c=o.length;return c>1&&a(i,o[0],o[1])?o=[]:c>2&&a(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return gb=s,gb}var gK=xK();const F1=it(gK);function ec(e){"@babel/helpers - typeof";return ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(e)}function cy(){return cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},cy.apply(this,arguments)}function bK(e,t){return wK(e)||jK(e,t)||yK(e,t)||vK()}function vK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 175In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yK(e,t){if(e){if(typeof e=="string")return ZS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ZS(e,t)}}function ZS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function jK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function wK(e){if(Array.isArray(e))return e}function XS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function bb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XS(Object(r),!0).forEach(function(a){NK(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function NK(e,t,r){return t=_K(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _K(e){var t=SK(e,"string");return ec(t)=="symbol"?t:t+""}function SK(e,t){if(ec(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(ec(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CK(e){return Array.isArray(e)&&zt(e[0])&&zt(e[1])?e.join(" ~ "):e}var AK=function(t){var r=t.separator,a=r===void 0?" : ":r,s=t.contentStyle,i=s===void 0?{}:s,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,u=d===void 0?{}:d,h=t.payload,m=t.formatter,p=t.itemSorter,b=t.wrapperClassName,w=t.labelClassName,x=t.label,g=t.labelFormatter,j=t.accessibilityLayer,S=j===void 0?!1:j,_=function(){if(h&&h.length){var R={padding:0,margin:0},B=(p?F1(h,p):h).map(function(D,U){if(D.type==="none")return null;var H=bb({display:"block",paddingTop:4,paddingBottom:4,color:D.color||"#000"},c),K=D.formatter||m||CK,z=D.value,X=D.name,G=z,Q=X;if(K&&G!=null&&Q!=null){var re=K(z,X,D,U,h);if(Array.isArray(re)){var ce=bK(re,2);G=ce[0],Q=ce[1]}else G=re}return q.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:H},zt(Q)?q.createElement("span",{className:"recharts-tooltip-item-name"},Q):null,zt(Q)?q.createElement("span",{className:"recharts-tooltip-item-separator"},a):null,q.createElement("span",{className:"recharts-tooltip-item-value"},G),q.createElement("span",{className:"recharts-tooltip-item-unit"},D.unit||""))});return q.createElement("ul",{className:"recharts-tooltip-item-list",style:R},B)}return null},N=bb({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),C=bb({margin:0},u),A=!Ie(x),P=A?x:"",O=$e("recharts-default-tooltip",b),E=$e("recharts-tooltip-label",w);A&&g&&h!==void 0&&h!==null&&(P=g(x,h));var $=S?{role:"status","aria-live":"assertive"}:{};return q.createElement("div",cy({className:O,style:N},$),q.createElement("p",{className:E,style:C},q.isValidElement(P)?P:"".concat(P)),_())};function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function qd(e,t,r){return t=kK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kK(e){var t=PK(e,"string");return tc(t)=="symbol"?t:t+""}function PK(e,t){if(tc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(tc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nl="recharts-tooltip-wrapper",TK={visibility:"hidden"};function OK(e){var t=e.coordinate,r=e.translateX,a=e.translateY;return $e(Nl,qd(qd(qd(qd({},"".concat(Nl,"-right"),de(r)&&t&&de(t.x)&&r>=t.x),"".concat(Nl,"-left"),de(r)&&t&&de(t.x)&&r<t.x),"".concat(Nl,"-bottom"),de(a)&&t&&de(t.y)&&a>=t.y),"".concat(Nl,"-top"),de(a)&&t&&de(t.y)&&a<t.y))}function JS(e){var t=e.allowEscapeViewBox,r=e.coordinate,a=e.key,s=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,u=e.viewBoxDimension;if(i&&de(i[a]))return i[a];var h=r[a]-c-s,m=r[a]+s;if(t[a])return o[a]?h:m;if(o[a]){var p=h,b=d[a];return p<b?Math.max(m,d[a]):Math.max(h,d[a])}var w=m+c,x=d[a]+u;return w>x?Math.max(h,d[a]):Math.max(m,d[a])}function EK(e){var t=e.translateX,r=e.translateY,a=e.useTranslate3d;return{transform:a?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function MK(e){var t=e.allowEscapeViewBox,r=e.coordinate,a=e.offsetTopLeft,s=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,u,h,m;return o.height>0&&o.width>0&&r?(h=JS({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:a,position:s,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),m=JS({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:a,position:s,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),u=EK({translateX:h,translateY:m,useTranslate3d:c})):u=TK,{cssProperties:u,cssClasses:OK({translateX:h,translateY:m,coordinate:r})}}function vo(e){"@babel/helpers - typeof";return vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vo(e)}function QS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function e4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QS(Object(r),!0).forEach(function(a){uy(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function LK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IK(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,tO(a.key),a)}}function RK(e,t,r){return t&&IK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function DK(e,t,r){return t=nh(t),$K(e,eO()?Reflect.construct(t,r||[],nh(e).constructor):t.apply(e,r))}function $K(e,t){if(t&&(vo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FK(e)}function FK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eO=function(){return!!e})()}function nh(e){return nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nh(e)}function BK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dy(e,t)}function dy(e,t){return dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},dy(e,t)}function uy(e,t,r){return t=tO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tO(e){var t=UK(e,"string");return vo(t)=="symbol"?t:t+""}function UK(e,t){if(vo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(vo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var t4=1,zK=(function(e){function t(){var r;LK(this,t);for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return r=DK(this,t,[].concat(s)),uy(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),uy(r,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,u,h;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=r.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(u=(h=r.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&u!==void 0?u:0}})}}),r}return BK(t,e),RK(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var a=this.wrapperNode.getBoundingClientRect();(Math.abs(a.width-this.state.lastBoundingBox.width)>t4||Math.abs(a.height-this.state.lastBoundingBox.height)>t4)&&this.setState({lastBoundingBox:{width:a.width,height:a.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var a,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var a=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,u=s.children,h=s.coordinate,m=s.hasPayload,p=s.isAnimationActive,b=s.offset,w=s.position,x=s.reverseDirection,g=s.useTranslate3d,j=s.viewBox,S=s.wrapperStyle,_=MK({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:b,position:w,reverseDirection:x,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:j}),N=_.cssClasses,C=_.cssProperties,A=e4(e4({transition:p&&i?"transform ".concat(c,"ms ").concat(d):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&m?"visible":"hidden",position:"absolute",top:0,left:0},S);return q.createElement("div",{tabIndex:-1,className:N,style:A,ref:function(O){a.wrapperNode=O}},u)}}])})(y.PureComponent),WK=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},yi={isSsr:WK()};function yo(e){"@babel/helpers - typeof";return yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(e)}function n4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function r4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n4(Object(r),!0).forEach(function(a){B1(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n4(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function qK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VK(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,rO(a.key),a)}}function HK(e,t,r){return t&&VK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function GK(e,t,r){return t=rh(t),KK(e,nO()?Reflect.construct(t,r||[],rh(e).constructor):t.apply(e,r))}function KK(e,t){if(t&&(yo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YK(e)}function YK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nO=function(){return!!e})()}function rh(e){return rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rh(e)}function ZK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hy(e,t)}function hy(e,t){return hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},hy(e,t)}function B1(e,t,r){return t=rO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rO(e){var t=XK(e,"string");return yo(t)=="symbol"?t:t+""}function XK(e,t){if(yo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(yo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function JK(e){return e.dataKey}function QK(e,t){return q.isValidElement(e)?q.cloneElement(e,t):typeof e=="function"?q.createElement(e,t):q.createElement(AK,t)}var Lr=(function(e){function t(){return qK(this,t),GK(this,t,arguments)}return ZK(t,e),HK(t,[{key:"render",value:function(){var a=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,c=s.animationDuration,d=s.animationEasing,u=s.content,h=s.coordinate,m=s.filterNull,p=s.isAnimationActive,b=s.offset,w=s.payload,x=s.payloadUniqBy,g=s.position,j=s.reverseDirection,S=s.useTranslate3d,_=s.viewBox,N=s.wrapperStyle,C=w??[];m&&C.length&&(C=GT(w.filter(function(P){return P.value!=null&&(P.hide!==!0||a.props.includeHidden)}),x,JK));var A=C.length>0;return q.createElement(zK,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:p,active:i,coordinate:h,hasPayload:A,offset:b,position:g,reverseDirection:j,useTranslate3d:S,viewBox:_,wrapperStyle:N},QK(u,r4(r4({},this.props),{},{payload:C})))}}])})(y.PureComponent);B1(Lr,"displayName","Tooltip");B1(Lr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!yi.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var vb,a4;function eY(){if(a4)return vb;a4=1;var e=ea(),t=function(){return e.Date.now()};return vb=t,vb}var yb,s4;function tY(){if(s4)return yb;s4=1;var e=/\s/;function t(r){for(var a=r.length;a--&&e.test(r.charAt(a)););return a}return yb=t,yb}var jb,i4;function nY(){if(i4)return jb;i4=1;var e=tY(),t=/^\s+/;function r(a){return a&&a.slice(0,e(a)+1).replace(t,"")}return jb=r,jb}var wb,o4;function aO(){if(o4)return wb;o4=1;var e=nY(),t=ls(),r=Xo(),a=NaN,s=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(u){if(typeof u=="number")return u;if(r(u))return a;if(t(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=t(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=e(u);var m=i.test(u);return m||o.test(u)?c(u.slice(2),m?2:8):s.test(u)?a:+u}return wb=d,wb}var Nb,l4;function rY(){if(l4)return Nb;l4=1;var e=ls(),t=eY(),r=aO(),a="Expected a function",s=Math.max,i=Math.min;function o(c,d,u){var h,m,p,b,w,x,g=0,j=!1,S=!1,_=!0;if(typeof c!="function")throw new TypeError(a);d=r(d)||0,e(u)&&(j=!!u.leading,S="maxWait"in u,p=S?s(r(u.maxWait)||0,d):p,_="trailing"in u?!!u.trailing:_);function N(B){var D=h,U=m;return h=m=void 0,g=B,b=c.apply(U,D),b}function C(B){return g=B,w=setTimeout(O,d),j?N(B):b}function A(B){var D=B-x,U=B-g,H=d-D;return S?i(H,p-U):H}function P(B){var D=B-x,U=B-g;return x===void 0||D>=d||D<0||S&&U>=p}function O(){var B=t();if(P(B))return E(B);w=setTimeout(O,A(B))}function E(B){return w=void 0,_&&h?N(B):(h=m=void 0,b)}function $(){w!==void 0&&clearTimeout(w),g=0,h=x=m=w=void 0}function M(){return w===void 0?b:E(t())}function R(){var B=t(),D=P(B);if(h=arguments,m=this,x=B,D){if(w===void 0)return C(x);if(S)return clearTimeout(w),w=setTimeout(O,d),N(x)}return w===void 0&&(w=setTimeout(O,d)),b}return R.cancel=$,R.flush=M,R}return Nb=o,Nb}var _b,c4;function aY(){if(c4)return _b;c4=1;var e=rY(),t=ls(),r="Expected a function";function a(s,i,o){var c=!0,d=!0;if(typeof s!="function")throw new TypeError(r);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(s,i,{leading:c,maxWait:i,trailing:d})}return _b=a,_b}var sY=aY();const sO=it(sY);function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function d4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Vd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d4(Object(r),!0).forEach(function(a){iY(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d4(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function iY(e,t,r){return t=oY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oY(e){var t=lY(e,"string");return nc(t)=="symbol"?t:t+""}function lY(e,t){if(nc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(nc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cY(e,t){return fY(e)||hY(e,t)||uY(e,t)||dY()}function dY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 176In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uY(e,t){if(e){if(typeof e=="string")return u4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u4(e,t)}}function u4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function hY(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function fY(e){if(Array.isArray(e))return e}var mY=y.forwardRef(function(e,t){var r=e.aspect,a=e.initialDimension,s=a===void 0?{width:-1,height:-1}:a,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,u=e.minWidth,h=u===void 0?0:u,m=e.minHeight,p=e.maxHeight,b=e.children,w=e.debounce,x=w===void 0?0:w,g=e.id,j=e.className,S=e.onResize,_=e.style,N=_===void 0?{}:_,C=y.useRef(null),A=y.useRef();A.current=S,y.useImperativeHandle(t,function(){return Object.defineProperty(C.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),C.current},configurable:!0})});var P=y.useState({containerWidth:s.width,containerHeight:s.height}),O=cY(P,2),E=O[0],$=O[1],M=y.useCallback(function(B,D){$(function(U){var H=Math.round(B),K=Math.round(D);return U.containerWidth===H&&U.containerHeight===K?U:{containerWidth:H,containerHeight:K}})},[]);y.useEffect(function(){var B=function(X){var G,Q=X[0].contentRect,re=Q.width,ce=Q.height;M(re,ce),(G=A.current)===null||G===void 0||G.call(A,re,ce)};x>0&&(B=sO(B,x,{trailing:!0,leading:!1}));var D=new ResizeObserver(B),U=C.current.getBoundingClientRect(),H=U.width,K=U.height;return M(H,K),D.observe(C.current),function(){D.disconnect()}},[M,x]);var R=y.useMemo(function(){var B=E.containerWidth,D=E.containerHeight;if(B<0||D<0)return null;Sr($s(o)||$s(d),`The width(%s) and height(%s) are both fixed numbers, 177 maybe you don't need to use a ResponsiveContainer.`,o,d),Sr(!r||r>0,"The aspect(%s) must be greater than zero.",r);var U=$s(o)?B:o,H=$s(d)?D:d;r&&r>0&&(U?H=U/r:H&&(U=H*r),p&&H>p&&(H=p)),Sr(U>0||H>0,`The width(%s) and height(%s) of chart should be greater than 0, 178 please check the style of container, or the props width(%s) and height(%s), 179 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 180 height and width.`,U,H,o,d,h,m,r);var K=!Array.isArray(b)&&ba(b.type).endsWith("Chart");return q.Children.map(b,function(z){return q.isValidElement(z)?y.cloneElement(z,Vd({width:U,height:H},K?{style:Vd({height:"100%",width:"100%",maxHeight:H,maxWidth:U},z.props.style)}:{})):z})},[r,b,d,p,m,h,E,o]);return q.createElement("div",{id:g?"".concat(g):void 0,className:$e("recharts-responsive-container",j),style:Vd(Vd({},N),{},{width:o,height:d,minWidth:h,minHeight:m,maxHeight:p}),ref:C},R)}),$f=function(t){return null};$f.displayName="Cell";function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}function h4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function fy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h4(Object(r),!0).forEach(function(a){pY(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h4(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function pY(e,t,r){return t=xY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xY(e){var t=gY(e,"string");return rc(t)=="symbol"?t:t+""}function gY(e,t){if(rc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(rc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $i={widthCache:{},cacheCount:0},bY=2e3,vY={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},f4="recharts_measurement_span";function yY(e){var t=fy({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Fl=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||yi.isSsr)return{width:0,height:0};var a=yY(r),s=JSON.stringify({text:t,copyStyle:a});if($i.widthCache[s])return $i.widthCache[s];try{var i=document.getElementById(f4);i||(i=document.createElement("span"),i.setAttribute("id",f4),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=fy(fy({},vY),a);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return $i.widthCache[s]=d,++$i.cacheCount>bY&&($i.cacheCount=0,$i.widthCache={}),d}catch{return{width:0,height:0}}},jY=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function ah(e,t){return SY(e)||_Y(e,t)||NY(e,t)||wY()}function wY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 181In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NY(e,t){if(e){if(typeof e=="string")return m4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m4(e,t)}}function m4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _Y(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function SY(e){if(Array.isArray(e))return e}function CY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p4(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,kY(a.key),a)}}function AY(e,t,r){return t&&p4(e.prototype,t),r&&p4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function kY(e){var t=PY(e,"string");return ac(t)=="symbol"?t:t+""}function PY(e,t){if(ac(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(ac(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var x4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,g4=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,TY=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,OY=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,iO={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},EY=Object.keys(iO),Wi="NaN";function MY(e,t){return e*iO[t]}var Hd=(function(){function e(t,r){CY(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!TY.test(r)&&(this.num=NaN,this.unit=""),EY.includes(r)&&(this.num=MY(t,r),this.unit="px")}return AY(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var a,s=(a=OY.exec(r))!==null&&a!==void 0?a:[],i=ah(s,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function oO(e){if(e.includes(Wi))return Wi;for(var t=e;t.includes("*")||t.includes("/");){var r,a=(r=x4.exec(t))!==null&&r!==void 0?r:[],s=ah(a,4),i=s[1],o=s[2],
181c=s[3],d=Hd.parse(i??""),u=Hd.parse(c??""),h=o==="*"?d.multiply(u):d.divide(u);if(h.isNaN())return Wi;t=t.replace(x4,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var m,p=(m=g4.exec(t))!==null&&m!==void 0?m:[],b=ah(p,4),w=b[1],x=b[2],g=b[3],j=Hd.parse(w??""),S=Hd.parse(g??""),_=x==="+"?j.add(S):j.subtract(S);if(_.isNaN())return Wi;t=t.replace(g4,_.toString())}return t}var b4=/\(([^()]*)\)/;function LY(e){for(var t=e;t.includes("(");){var r=b4.exec(t),a=ah(r,2),s=a[1];t=t.replace(b4,oO(s))}return t}function IY(e){var t=e.replace(/\s+/g,"");return t=LY(t),t=oO(t),t}function RY(e){try{return IY(e)}catch{return Wi}}function Sb(e){var t=RY(e.slice(5,-1));return t===Wi?"":t}var DY=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],$Y=["dx","dy","angle","className","breakAll"];function my(){return my=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},my.apply(this,arguments)}function v4(e,t){if(e==null)return{};var r=FY(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function FY(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function y4(e,t){return WY(e)||zY(e,t)||UY(e,t)||BY()}function BY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 182In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UY(e,t){if(e){if(typeof e=="string")return j4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j4(e,t)}}function j4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function zY(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function WY(e){if(Array.isArray(e))return e}var lO=/[ \f\n\r\t\v\u2028\u2029]+/,cO=function(t){var r=t.children,a=t.breakAll,s=t.style;try{var i=[];Ie(r)||(a?i=r.toString().split(""):i=r.toString().split(lO));var o=i.map(function(d){return{word:d,width:Fl(d,s).width}}),c=a?0:Fl(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},qY=function(t,r,a,s,i){var o=t.maxLines,c=t.children,d=t.style,u=t.breakAll,h=de(o),m=c,p=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(H,K){var z=K.word,X=K.width,G=H[H.length-1];if(G&&(s==null||i||G.width+X+a<Number(s)))G.words.push(z),G.width+=X+a;else{var Q={words:[z],width:X};H.push(Q)}return H},[])},b=p(r),w=function(U){return U.reduce(function(H,K){return H.width>K.width?H:K})};if(!h)return b;for(var x="â¦",g=function(U){var H=m.slice(0,U),K=cO({breakAll:u,style:d,children:H+x}).wordsWithComputedWidth,z=p(K),X=z.length>o||w(z).width>Number(s);return[X,z]},j=0,S=m.length-1,_=0,N;j<=S&&_<=m.length-1;){var C=Math.floor((j+S)/2),A=C-1,P=g(A),O=y4(P,2),E=O[0],$=O[1],M=g(C),R=y4(M,1),B=R[0];if(!E&&!B&&(j=C+1),E&&B&&(S=C-1),!E&&B){N=$;break}_++}return N||b},w4=function(t){var r=Ie(t)?[]:t.toString().split(lO);return[{words:r}]},VY=function(t){var r=t.width,a=t.scaleToFit,s=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((r||a)&&!yi.isSsr){var d,u,h=cO({breakAll:o,children:s,style:i});if(h){var m=h.wordsWithComputedWidth,p=h.spaceWidth;d=m,u=p}else return w4(s);return qY({breakAll:o,children:s,maxLines:c,style:i},d,u,r,a)}return w4(s)},N4="#808080",ei=function(t){var r=t.x,a=r===void 0?0:r,s=t.y,i=s===void 0?0:s,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,u=d===void 0?"0.71em":d,h=t.scaleToFit,m=h===void 0?!1:h,p=t.textAnchor,b=p===void 0?"start":p,w=t.verticalAnchor,x=w===void 0?"end":w,g=t.fill,j=g===void 0?N4:g,S=v4(t,DY),_=y.useMemo(function(){return VY({breakAll:S.breakAll,children:S.children,maxLines:S.maxLines,scaleToFit:m,style:S.style,width:S.width})},[S.breakAll,S.children,S.maxLines,m,S.style,S.width]),N=S.dx,C=S.dy,A=S.angle,P=S.className,O=S.breakAll,E=v4(S,$Y);if(!zt(a)||!zt(i))return null;var $=a+(de(N)?N:0),M=i+(de(C)?C:0),R;switch(x){case"start":R=Sb("calc(".concat(u,")"));break;case"middle":R=Sb("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(u," / 2))"));break;default:R=Sb("calc(".concat(_.length-1," * -").concat(c,")"));break}var B=[];if(m){var D=_[0].width,U=S.width;B.push("scale(".concat((de(U)?U/D:1)/D,")"))}return A&&B.push("rotate(".concat(A,", ").concat($,", ").concat(M,")")),B.length&&(E.transform=B.join(" ")),q.createElement("text",my({},Ce(E,!0),{x:$,y:M,className:$e("recharts-text",P),textAnchor:b,fill:j.includes("url")?N4:j}),_.map(function(H,K){var z=H.words.join(O?"":" ");return q.createElement("tspan",{x:$,dy:K===0?R:c,key:"".concat(z,"-").concat(K)},z)}))};function Ka(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function HY(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function U1(e){let t,r,a;e.length!==2?(t=Ka,r=(c,d)=>Ka(e(c),d),a=(c,d)=>e(c)-d):(t=e===Ka||e===HY?e:GY,r=e,a=e);function s(c,d,u=0,h=c.length){if(u<h){if(t(d,d)!==0)return h;do{const m=u+h>>>1;r(c[m],d)<0?u=m+1:h=m}while(u<h)}return u}function i(c,d,u=0,h=c.length){if(u<h){if(t(d,d)!==0)return h;do{const m=u+h>>>1;r(c[m],d)<=0?u=m+1:h=m}while(u<h)}return u}function o(c,d,u=0,h=c.length){const m=s(c,d,u,h-1);return m>u&&a(c[m-1],d)>-a(c[m],d)?m-1:m}return{left:s,center:o,right:i}}function GY(){return 0}function dO(e){return e===null?NaN:+e}function*KY(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const YY=U1(Ka),td=YY.right;U1(dO).center;class _4 extends Map{constructor(t,r=JY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[a,s]of t)this.set(a,s)}get(t){return super.get(S4(this,t))}has(t){return super.has(S4(this,t))}set(t,r){return super.set(ZY(this,t),r)}delete(t){return super.delete(XY(this,t))}}function S4({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function ZY({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function XY({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function JY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QY(e=Ka){if(e===Ka)return uO;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const a=e(t,r);return a||a===0?a:(e(r,r)===0)-(e(t,t)===0)}}function uO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const eZ=Math.sqrt(50),tZ=Math.sqrt(10),nZ=Math.sqrt(2);function sh(e,t,r){const a=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(a)),i=a/Math.pow(10,s),o=i>=eZ?10:i>=tZ?5:i>=nZ?2:1;let c,d,u;return s<0?(u=Math.pow(10,-s)/o,c=Math.round(e*u),d=Math.round(t*u),c/u<e&&++c,d/u>t&&--d,u=-u):(u=Math.pow(10,s)*o,c=Math.round(e/u),d=Math.round(t/u),c*u<e&&++c,d*u>t&&--d),d<c&&.5<=r&&r<2?sh(e,t,r*2):[c,d,u]}function py(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const a=t<e,[s,i,o]=a?sh(t,e,r):sh(e,t,r);if(!(i>=s))return[];const c=i-s+1,d=new Array(c);if(a)if(o<0)for(let u=0;u<c;++u)d[u]=(i-u)/-o;else for(let u=0;u<c;++u)d[u]=(i-u)*o;else if(o<0)for(let u=0;u<c;++u)d[u]=(s+u)/-o;else for(let u=0;u<c;++u)d[u]=(s+u)*o;return d}function xy(e,t,r){return t=+t,e=+e,r=+r,sh(e,t,r)[2]}function gy(e,t,r){t=+t,e=+e,r=+r;const a=t<e,s=a?xy(t,e,r):xy(e,t,r);return(a?-1:1)*(s<0?1/-s:s)}function C4(e,t){let r;for(const a of e)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);return r}function A4(e,t){let r;for(const a of e)a!=null&&(r>a||r===void 0&&a>=a)&&(r=a);return r}function hO(e,t,r=0,a=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),a=Math.floor(Math.min(e.length-1,a)),!(r<=t&&t<=a))return e;for(s=s===void 0?uO:QY(s);a>r;){if(a-r>600){const d=a-r+1,u=t-r+1,h=Math.log(d),m=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*m*(d-m)/d)*(u-d/2<0?-1:1),b=Math.max(r,Math.floor(t-u*m/d+p)),w=Math.min(a,Math.floor(t+(d-u)*m/d+p));hO(e,t,b,w,s)}const i=e[t];let o=r,c=a;for(_l(e,r,t),s(e[a],i)>0&&_l(e,r,a);o<c;){for(_l(e,o,c),++o,--c;s(e[o],i)<0;)++o;for(;s(e[c],i)>0;)--c}s(e[r],i)===0?_l(e,r,c):(++c,_l(e,c,a)),c<=t&&(r=c+1),t<=c&&(a=c-1)}return e}function _l(e,t,r){const a=e[t];e[t]=e[r],e[r]=a}function rZ(e,t,r){if(e=Float64Array.from(KY(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return A4(e);if(t>=1)return C4(e);var a,s=(a-1)*t,i=Math.floor(s),o=C4(hO(e,i).subarray(0,i+1)),c=A4(e.subarray(i+1));return o+(c-o)*(s-i)}}function aZ(e,t,r=dO){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+r(e[0],0,e);if(t>=1)return+r(e[a-1],a-1,e);var a,s=(a-1)*t,i=Math.floor(s),o=+r(e[i],i,e),c=+r(e[i+1],i+1,e);return o+(c-o)*(s-i)}}function sZ(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var a=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++a<s;)i[a]=e+a*r;return i}function or(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ea(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}
vendor: 9,979 bytes, line 182
182const by=Symbol("implicit");function z1(){var e=new _4,t=[],r=[],a=by;function s(i){let o=e.get(i);if(o===void 0){if(a!==by)return a;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new _4;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return z1(t,r).unknown(a)},or.apply(s,arguments),s}function sc(){var e=z1().unknown(void 0),t=e.domain,r=e.range,a=0,s=1,i,o,c=!1,d=0,u=0,h=.5;delete e.unknown;function m(){var p=t().length,b=s<a,w=b?s:a,x=b?a:s;i=(x-w)/Math.max(1,p-d+u*2),c&&(i=Math.floor(i)),w+=(x-w-i*(p-d))*h,o=i*(1-d),c&&(w=Math.round(w),o=Math.round(o));var g=sZ(p).map(function(j){return w+i*j});return r(b?g.reverse():g)}return e.domain=function(p){return arguments.length?(t(p),m()):t()},e.range=function(p){return arguments.length?([a,s]=p,a=+a,s=+s,m()):[a,s]},e.rangeRound=function(p){return[a,s]=p,a=+a,s=+s,c=!0,m()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(p){return arguments.length?(c=!!p,m()):c},e.padding=function(p){return arguments.length?(d=Math.min(1,u=+p),m()):d},e.paddingInner=function(p){return arguments.length?(d=Math.min(1,p),m()):d},e.paddingOuter=function(p){return arguments.length?(u=+p,m()):u},e.align=function(p){return arguments.length?(h=Math.max(0,Math.min(1,p)),m()):h},e.copy=function(){return sc(t(),[a,s]).round(c).paddingInner(d).paddingOuter(u).align(h)},or.apply(m(),arguments)}function fO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return fO(t())},e}function Bl(){return fO(sc.apply(null,arguments).paddingInner(1))}function W1(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function mO(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function nd(){}var ic=.7,ih=1/ic,uo="\\s*([+-]?\\d+)\\s*",oc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iZ=/^#([0-9a-f]{3,8})$/,oZ=new RegExp(`^rgb\\(${uo},${uo},${uo}\\)$`),lZ=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),cZ=new RegExp(`^rgba\\(${uo},${uo},${uo},${oc}\\)$`),dZ=new RegExp(`^rgba\\(${zr},${zr},${zr},${oc}\\)$`),uZ=new RegExp(`^hsl\\(${oc},${zr},${zr}\\)$`),hZ=new RegExp(`^hsla\\(${oc},${zr},${zr},${oc}\\)$`),k4={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};W1(nd,lc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:P4,formatHex:P4,formatHex8:fZ,formatHsl:mZ,formatRgb:T4,toString:T4});function P4(){return this.rgb().formatHex()}function fZ(){return this.rgb().formatHex8()}function mZ(){return pO(this).formatHsl()}function T4(){return this.rgb().formatRgb()}function lc(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=iZ.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?O4(t):r===3?new kn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Gd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Gd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=oZ.exec(e))?new kn(t[1],t[2],t[3],1):(t=lZ.exec(e))?new kn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cZ.exec(e))?Gd(t[1],t[2],t[3],t[4]):(t=dZ.exec(e))?Gd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uZ.exec(e))?L4(t[1],t[2]/100,t[3]/100,1):(t=hZ.exec(e))?L4(t[1],t[2]/100,t[3]/100,t[4]):k4.hasOwnProperty(e)?O4(k4[e]):e==="transparent"?new kn(NaN,NaN,NaN,0):null}function O4(e){return new kn(e>>16&255,e>>8&255,e&255,1)}function Gd(e,t,r,a){return a<=0&&(e=t=r=NaN),new kn(e,t,r,a)}function pZ(e){return e instanceof nd||(e=lc(e)),e?(e=e.rgb(),new kn(e.r,e.g,e.b,e.opacity)):new kn}function vy(e,t,r,a){return arguments.length===1?pZ(e):new kn(e,t,r,a??1)}function kn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}W1(kn,vy,mO(nd,{brighter(e){return e=e==null?ih:Math.pow(ih,e),new kn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ic:Math.pow(ic,e),new kn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kn(qs(this.r),qs(this.g),qs(this.b),oh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:E4,formatHex:E4,formatHex8:xZ,formatRgb:M4,toString:M4}));function E4(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}`}function xZ(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}${Fs((isNaN(this.opacity)?1:this.opacity)*255)}`}function M4(){const e=oh(this.opacity);return`${e===1?"rgb(":"rgba("}${qs(this.r)}, ${qs(this.g)}, ${qs(this.b)}${e===1?")":`, ${e})`}`}function oh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fs(e){return e=qs(e),(e<16?"0":"")+e.toString(16)}function L4(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,r,a)}function pO(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof nd||(e=lc(e)),!e)return new _r;if(e instanceof _r)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,s=Math.min(t,r,a),i=Math.max(t,r,a),o=NaN,c=i-s,d=(i+s)/2;return c?(t===i?o=(r-a)/c+(r<a)*6:r===i?o=(a-t)/c+2:o=(t-r)/c+4,c/=d<.5?i+s:2-i-s,o*=60):c=d>0&&d<1?0:o,new _r(o,c,d,e.opacity)}function gZ(e,t,r,a){return arguments.length===1?pO(e):new _r(e,t,r,a??1)}function _r(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}W1(_r,gZ,mO(nd,{brighter(e){return e=e==null?ih:Math.pow(ih,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ic:Math.pow(ic,e),new _r(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,s=2*r-a;return new kn(Cb(e>=240?e-240:e+120,s,a),Cb(e,s,a),Cb(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new _r(I4(this.h),Kd(this.s),Kd(this.l),oh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=oh(this.opacity);return`${e===1?"hsl(":"hsla("}${I4(this.h)}, ${Kd(this.s)*100}%, ${Kd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function I4(e){return e=(e||0)%360,e<0?e+360:e}function Kd(e){return Math.max(0,Math.min(1,e||0))}function Cb(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const q1=e=>()=>e;function bZ(e,t){return function(r){return e+r*t}}function vZ(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function yZ(e){return(e=+e)==1?xO:function(t,r){return r-t?vZ(t,r,e):q1(isNaN(t)?r:t)}}function xO(e,t){var r=t-e;return r?bZ(e,r):q1(isNaN(e)?t:e)}const R4=(function e(t){var r=yZ(t);function a(s,i){var o=r((s=vy(s)).r,(i=vy(i)).r),c=r(s.g,i.g),d=r(s.b,i.b),u=xO(s.opacity,i.opacity);return function(h){return s.r=o(h),s.g=c(h),s.b=d(h),s.opacity=u(h),s+""}}return a.gamma=e,a})(1);function jZ(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),s;return function(i){for(s=0;s<r;++s)a[s]=e[s]*(1-i)+t[s]*i;return a}}function wZ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function NZ(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,s=new Array(a),i=new Array(r),o;for(o=0;o<a;++o)s[o]=nl(e[o],t[o]);for(;o<r;
vendor: 5,521 bytes, line 182
182++o)i[o]=t[o];return function(c){for(o=0;o<a;++o)i[o]=s[o](c);return i}}function _Z(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function lh(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function SZ(e,t){var r={},a={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=nl(e[s],t[s]):a[s]=t[s];return function(i){for(s in r)a[s]=r[s](i);return a}}var yy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ab=new RegExp(yy.source,"g");function CZ(e){return function(){return e}}function AZ(e){return function(t){return e(t)+""}}function kZ(e,t){var r=yy.lastIndex=Ab.lastIndex=0,a,s,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(a=yy.exec(e))&&(s=Ab.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),c[o]?c[o]+=i:c[++o]=i),(a=a[0])===(s=s[0])?c[o]?c[o]+=s:c[++o]=s:(c[++o]=null,d.push({i:o,x:lh(a,s)})),r=Ab.lastIndex;return r<t.length&&(i=t.slice(r),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?AZ(d[0].x):CZ(t):(t=d.length,function(u){for(var h=0,m;h<t;++h)c[(m=d[h]).i]=m.x(u);return c.join("")})}function nl(e,t){var r=typeof t,a;return t==null||r==="boolean"?q1(t):(r==="number"?lh:r==="string"?(a=lc(t))?(t=a,R4):kZ:t instanceof lc?R4:t instanceof Date?_Z:wZ(t)?jZ:Array.isArray(t)?NZ:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?SZ:lh)(e,t)}function V1(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function PZ(e,t){t===void 0&&(t=e,e=nl);for(var r=0,a=t.length-1,s=t[0],i=new Array(a<0?0:a);r<a;)i[r]=e(s,s=t[++r]);return function(o){var c=Math.max(0,Math.min(a-1,Math.floor(o*=a)));return i[c](o-c)}}function TZ(e){return function(){return e}}function ch(e){return+e}var D4=[0,1];function wn(e){return e}function jy(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:TZ(isNaN(t)?NaN:.5)}function OZ(e,t){var r;return e>t&&(r=e,e=t,t=r),function(a){return Math.max(e,Math.min(t,a))}}function EZ(e,t,r){var a=e[0],s=e[1],i=t[0],o=t[1];return s<a?(a=jy(s,a),i=r(o,i)):(a=jy(a,s),i=r(i,o)),function(c){return i(a(c))}}function MZ(e,t,r){var a=Math.min(e.length,t.length)-1,s=new Array(a),i=new Array(a),o=-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<a;)s[o]=jy(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(c){var d=td(e,c,1,a)-1;return i[d](s[d](c))}}function rd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ff(){var e=D4,t=D4,r=nl,a,s,i,o=wn,c,d,u;function h(){var p=Math.min(e.length,t.length);return o!==wn&&(o=OZ(e[0],e[p-1])),c=p>2?MZ:EZ,d=u=null,m}function m(p){return p==null||isNaN(p=+p)?i:(d||(d=c(e.map(a),t,r)))(a(o(p)))}return m.invert=function(p){return o(s((u||(u=c(t,e.map(a),lh)))(p)))},m.domain=function(p){return arguments.length?(e=Array.from(p,ch),h()):e.slice()},m.range=function(p){return arguments.length?(t=Array.from(p),h()):t.slice()},m.rangeRound=function(p){return t=Array.from(p),r=V1,h()},m.clamp=function(p){return arguments.length?(o=p?!0:wn,h()):o!==wn},m.interpolate=function(p){return arguments.length?(r=p,h()):r},m.unknown=function(p){return arguments.length?(i=p,m):i},function(p,b){return a=p,s=b,h()}}function H1(){return Ff()(wn,wn)}function LZ(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function dh(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,r);return[a.length>1?a[0]+a.slice(2):a,+e.slice(r+1)]}function jo(e){return e=dh(Math.abs(e)),e?e[1]:NaN}function IZ(e,t){return function(r,a){for(var s=r.length,i=[],o=0,c=e[0],d=0;s>0&&c>0&&(d+c+1>a&&(c=Math.max(1,a-d)),i.push(r.substring(s-=c,s+c)),!((d+=c+1)>a));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function RZ(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var DZ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cc(e){if(!(t=DZ.exec(e)))throw new Error("invalid format: "+e);var t;return new G1({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}cc.prototype=G1.prototype;function G1(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}G1.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $Z(e){e:for(var t=e.length,r=1,a=-1,s;r<t;++r)switch(e[r]){case".":a=s=r;break;case"0":a===0&&(a=r),s=r;break;default:if(!+e[r])break e;a>0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(s+1):e}var uh;function FZ(e,t){var r=dh(e,t);if(!r)return uh=void 0,e.toPrecision(t);var a=r[0],s=r[1],i=s-(uh=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=a.length;return i===o?a:i>o?a+new Array(i-o+1).join("0"):i>0?a.slice(0,i)+"."+a.slice(i):"0."+new Array(1-i).join("0")+dh(e,Math.max(0,t+i-1))[0]}function $4(e,t){var r=dh(e,t);if(!r)return e+"";var a=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+a:a.length>s+1?a.slice(0,s+1)+"."+a.slice(s+1):a+new Array(s-a.length+2).join("0")}const F4={"%":(e,t)=>
vendor: 4,966 bytes, line 182
182(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:LZ,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$4(e*100,t),r:$4,s:FZ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function B4(e){return e}var U4=Array.prototype.map,z4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function BZ(e){var t=e.grouping===void 0||e.thousands===void 0?B4:IZ(U4.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?B4:RZ(U4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"â":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function u(m,p){m=cc(m);var b=m.fill,w=m.align,x=m.sign,g=m.symbol,j=m.zero,S=m.width,_=m.comma,N=m.precision,C=m.trim,A=m.type;A==="n"?(_=!0,A="g"):F4[A]||(N===void 0&&(N=12),C=!0,A="g"),(j||b==="0"&&w==="=")&&(j=!0,b="0",w="=");var P=(p&&p.prefix!==void 0?p.prefix:"")+(g==="$"?r:g==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),O=(g==="$"?a:/[%p]/.test(A)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),E=F4[A],$=/[defgprs%]/.test(A);N=N===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function M(R){var B=P,D=O,U,H,K;if(A==="c")D=E(R)+D,R="";else{R=+R;var z=R<0||1/R<0;if(R=isNaN(R)?d:E(Math.abs(R),N),C&&(R=$Z(R)),z&&+R==0&&x!=="+"&&(z=!1),B=(z?x==="("?x:c:x==="-"||x==="("?"":x)+B,D=(A==="s"&&!isNaN(R)&&uh!==void 0?z4[8+uh/3]:"")+D+(z&&x==="("?")":""),$){for(U=-1,H=R.length;++U<H;)if(K=R.charCodeAt(U),48>K||K>57){D=(K===46?s+R.slice(U+1):R.slice(U))+D,R=R.slice(0,U);break}}}_&&!j&&(R=t(R,1/0));var X=B.length+R.length+D.length,G=X<S?new Array(S-X+1).join(b):"";switch(_&&j&&(R=t(G+R,G.length?S-D.length:1/0),G=""),w){case"<":R=B+R+D+G;break;case"=":R=B+G+R+D;break;case"^":R=G.slice(0,X=G.length>>1)+B+R+D+G.slice(X);break;default:R=G+B+R+D;break}return i(R)}return M.toString=function(){return m+""},M}function h(m,p){var b=Math.max(-8,Math.min(8,Math.floor(jo(p)/3)))*3,w=Math.pow(10,-b),x=u((m=cc(m),m.type="f",m),{suffix:z4[8+b/3]});return function(g){return x(w*g)}}return{format:u,formatPrefix:h}}var Yd,K1,gO;UZ({thousands:",",grouping:[3],currency:["$",""]});function UZ(e){return Yd=BZ(e),K1=Yd.format,gO=Yd.formatPrefix,Yd}function zZ(e){return Math.max(0,-jo(Math.abs(e)))}function WZ(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jo(t)/3)))*3-jo(Math.abs(e)))}function qZ(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jo(t)-jo(e))+1}function bO(e,t,r,a){var s=gy(e,t,r),i;switch(a=cc(a??",f"),a.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(i=WZ(s,o))&&(a.precision=i),gO(a,o)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=qZ(s,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=zZ(s))&&(a.precision=i-(a.type==="%")*2);break}}return K1(a)}function cs(e){var t=e.domain;return e.ticks=function(r){var a=t();return py(a[0],a[a.length-1],r??10)},e.tickFormat=function(r,a){var s=t();return bO(s[0],s[s.length-1],r??10,a)},e.nice=function(r){r==null&&(r=10);var a=t(),s=0,i=a.length-1,o=a[s],c=a[i],d,u,h=10;for(c<o&&(u=o,o=c,c=u,u=s,s=i,i=u);h-- >0;){if(u=xy(o,c,r),u===d)return a[s]=o,a[i]=c,t(a);if(u>0)o=Math.floor(o/u)*u,c=Math.ceil(c/u)*u;else if(u<0)o=Math.ceil(o*u)/u,c=Math.floor(c*u)/u;else break;d=u}return e},e}function hh(){var e=H1();return e.copy=function(){return rd(e,hh())},or.apply(e,arguments),cs(e)}function vO(e){var t;function r(a){return a==null||isNaN(a=+a)?t:a}return r.invert=r,r.domain=r.range=function(a){return arguments.length?(e=Array.from(a,ch),r):e.slice()},r.unknown=function(a){return arguments.length?(t=a,r):t},r.copy=function(){return vO(e).unknown(t)},e=arguments.length?Array.from(e,ch):[0,1],cs(r)}function yO(e,t){e=e.slice();var r=0,a=e.length-1,s=e[r],i=e[a],o;return i<s&&(o=r,r=a,a=o,o=s,s=i,i=o),e[r]=t.floor(s),e[a]=t.ceil(i),e}function W4(e){return Math.log(e)}function q4(e){return Math.exp(e)}function VZ(e){return-Math.log(-e)}function HZ(e){return-Math.exp(-e)}function GZ(e){return isFinite(e)?+("1e"+e):e<0?0:e}function KZ(e){return e===10?GZ:e===Math.E?Math.exp:t=>Math.pow(e,t)}function YZ(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function V4(e){return(t,r)=>-e(-t,r)}function Y1(e){const t=e(W4,q4),r=t.domain;let a=10,s,i;function o(){return s=YZ(a),i=KZ(a),r()[0]<0?(s=V4(s),i=V4(i),e(VZ,HZ)):e(W4,q4),t}return t.base=function(c){return arguments.length?(a=+c,o()):a},t.domain=function(c){return arguments.length?(r(c),o()):r()},t.ticks=c=>{const d=r();let u=d[0],h=d[d.length-1];const m=h<u;m&&([u,h]=[h,u]);let p=s(u),b=s(h),w,x;const g=c==null?10:+c;let j=[];if(!(a%1)&&b-p<g){if(p=Math.floor(p),b=Math.ceil(b),u>0){for(;p<=b;++p)for(w=1;w<a;
182++w)if(x=p<0?w/i(-p):w*i(p),!(x<u)){if(x>h)break;j.push(x)}}else for(;p<=b;++p)for(w=a-1;w>=1;--w)if(x=p>0?w/i(-p):w*i(p),!(x<u)){if(x>h)break;j.push(x)}j.length*2<g&&(j=py(u,h,g))}else j=py(p,b,Math.min(b-p,g)).map(i);return m?j.reverse():j},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=cc(d)).precision==null&&(d.trim=!0),d=K1(d)),c===1/0)return d;const u=Math.max(1,a*c/t.ticks().length);return h=>{let m=h/i(Math.round(s(h)));return m*a<a-.5&&(m*=a),m<=u?d(h):""}},t.nice=()=>r(yO(r(),{floor:c=>i(Math.floor(s(c))),ceil:c=>i(Math.ceil(s(c)))})),t}function jO(){const e=Y1(Ff()).domain([1,10]);return e.copy=()=>rd(e,jO()).base(e.base()),or.apply(e,arguments),e}function H4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function G4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Z1(e){var t=1,r=e(H4(t),G4(t));return r.constant=function(a){return arguments.length?e(H4(t=+a),G4(t)):t},cs(r)}function wO(){var e=Z1(Ff());return e.copy=function(){return rd(e,wO()).constant(e.constant())},or.apply(e,arguments)}function K4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ZZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XZ(e){return e<0?-e*e:e*e}function X1(e){var t=e(wn,wn),r=1;function a(){return r===1?e(wn,wn):r===.5?e(ZZ,XZ):e(K4(r),K4(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,a()):r},cs(t)}function J1(){var e=X1(Ff());return e.copy=function(){return rd(e,J1()).exponent(e.exponent())},or.apply(e,arguments),e}function JZ(){return J1.apply(null,arguments).exponent(.5)}function Y4(e){return Math.sign(e)*e*e}function QZ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function NO(){var e=H1(),t=[0,1],r=!1,a;function s(i){var o=QZ(e(i));return isNaN(o)?a:r?Math.round(o):o}return s.invert=function(i){return e.invert(Y4(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,ch)).map(Y4)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return NO(e.domain(),t).round(r).clamp(e.clamp()).unknown(a)},or.apply(s,arguments),cs(s)}function _O(){var e=[],t=[],r=[],a;function s(){var o=0,c=Math.max(1,t.length);for(r=new Array(c-1);++o<c;)r[o-1]=aZ(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?a:t[td(r,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?r[c-1]:e[0],c<r.length?r[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Ka),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(a=o,i):a},i.quantiles=function(){return r.slice()},i.copy=function(){return _O().domain(e).range(t).unknown(a)},or.apply(i,arguments)}function SO(){var e=0,t=1,r=1,a=[.5],s=[0,1],i;function o(d){return d!=null&&d<=d?s[td(a,d,0,r)]:i}function c(){var d=-1;for(a=new Array(r);++d<r;)a[d]=((d+1)*t-(d-r)*e)/(r+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(r=(s=Array.from(d)).length-1,c()):s.slice()},o.invertExtent=function(d){var u=s.indexOf(d);return u<0?[NaN,NaN]:u<1?[e,a[0]]:u>=r?[a[r-1],t]:[a[u-1],a[u]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return a.slice()},o.copy=function(){return SO().domain([e,t]).range(s).unknown(i)},or.apply(cs(o),arguments)}function CO(){var e=[.5],t=[0,1],r,a=1;function s(i){return i!=null&&i<=i?t[td(e,i,0,a)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),a=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),a=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return CO().domain(e).range(t).unknown(r)},or.apply(s,arguments)}const kb=new Date,Pb=new Date;function Vt(e,t,r,a){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),c=s.ceil(i);return i-o<c-i?o:c},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,c)=>{const d=[];if(i=s.ceil(i),c=c==null?1:Math.floor(c),!(i<o)||!(c>0))return d;let u;do d.push(u=new Date(+i)),t(i,c),e(i);while(u<i&&i<o);return d},s.filter=i=>Vt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!i(o););else for(;--c>=0;)for(;t(o,1),!i(o););}),r&&(s.count=(i,o)=>(kb.setTime(+i),Pb.setTime(+o),e(kb),e(Pb),Math.floor(r(kb,Pb))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(a?o=>a(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const fh=Vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);fh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):fh);fh.range;const ha=1e3,tr=ha*60,fa=tr*60,Ca=fa*24,Q1=Ca*7,Z4=Ca*30,Tb=Ca*365,Bs=Vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ha)},(e,t)=>(t-e)/ha,e=>e.getUTCSeconds());Bs.range;const ej=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ha)},(e,t)=>{e.setTime(+e+t*tr)},(e,t)=>(t-e)/tr,e=>e.getMinutes());ej.range;const tj=Vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*tr)},(e,t)=>(t-e)/tr,e=>e.getUTCMinutes());tj.range;const nj=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ha-e.getMinutes()*tr)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getHours());nj.range;const rj=Vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCHours());rj.range;const ad=Vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tr)/Ca,e=>e.getDate()-1);ad.range;const Bf=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ca,e=>e.getUTCDate()-1);Bf.range;const AO=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ca,e=>Math.floor(e/Ca));AO.range;function ji(e){return Vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*tr)/Q1)}const Uf=ji(0),mh=ji(1),eX=ji(2),tX=ji(3),wo=ji(4),nX=ji(5),rX=ji(6);Uf.range;mh.range;eX.range;tX.range;wo.range;nX.range;rX.range;function wi(e){return Vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Q1)}const zf=wi(0),ph=wi(1),aX=wi(2),sX=wi(3),No=wi(4),iX=wi(5),oX=wi(6);zf.range;ph.range;aX.range;sX.range;No.range;iX.range;oX.range;const aj=Vt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());aj.range;const sj=Vt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());sj.range;const Aa=Vt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Aa.every=e=>
vendor: 4,096 bytes, line 182
182!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Aa.range;const ka=Vt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ka.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ka.range;function kO(e,t,r,a,s,i){const o=[[Bs,1,ha],[Bs,5,5*ha],[Bs,15,15*ha],[Bs,30,30*ha],[i,1,tr],[i,5,5*tr],[i,15,15*tr],[i,30,30*tr],[s,1,fa],[s,3,3*fa],[s,6,6*fa],[s,12,12*fa],[a,1,Ca],[a,2,2*Ca],[r,1,Q1],[t,1,Z4],[t,3,3*Z4],[e,1,Tb]];function c(u,h,m){const p=h<u;p&&([u,h]=[h,u]);const b=m&&typeof m.range=="function"?m:d(u,h,m),w=b?b.range(u,+h+1):[];return p?w.reverse():w}function d(u,h,m){const p=Math.abs(h-u)/m,b=U1(([,,g])=>g).right(o,p);if(b===o.length)return e.every(gy(u/Tb,h/Tb,m));if(b===0)return fh.every(Math.max(gy(u,h,m),1));const[w,x]=o[p/o[b-1][2]<o[b][2]/p?b-1:b];return w.every(x)}return[c,d]}const[lX,cX]=kO(ka,sj,zf,AO,rj,tj),[dX,uX]=kO(Aa,aj,Uf,ad,nj,ej);function Ob(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Eb(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Sl(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function hX(e){var t=e.dateTime,r=e.date,a=e.time,s=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,u=Cl(s),h=Al(s),m=Cl(i),p=Al(i),b=Cl(o),w=Al(o),x=Cl(c),g=Al(c),j=Cl(d),S=Al(d),_={a:K,A:z,b:X,B:G,c:null,d:n3,e:n3,f:IX,g:VX,G:GX,H:EX,I:MX,j:LX,L:PO,m:RX,M:DX,p:Q,q:re,Q:s3,s:i3,S:$X,u:FX,U:BX,V:UX,w:zX,W:WX,x:null,X:null,y:qX,Y:HX,Z:KX,"%":a3},N={a:ce,A:fe,b:me,B:pe,c:null,d:r3,e:r3,f:JX,g:lJ,G:dJ,H:YX,I:ZX,j:XX,L:OO,m:QX,M:eJ,p:Re,q:J,Q:s3,s:i3,S:tJ,u:nJ,U:rJ,V:aJ,w:sJ,W:iJ,x:null,X:null,y:oJ,Y:cJ,Z:uJ,"%":a3},C={a:$,A:M,b:R,B,c:D,d:e3,e:e3,f:kX,g:Q4,G:J4,H:t3,I:t3,j:_X,L:AX,m:NX,M:SX,p:E,q:wX,Q:TX,s:OX,S:CX,u:gX,U:bX,V:vX,w:xX,W:yX,x:U,X:H,y:Q4,Y:J4,Z:jX,"%":PX};_.x=A(r,_),_.X=A(a,_),_.c=A(t,_),N.x=A(r,N),N.X=A(a,N),N.c=A(t,N);function A(ae,ue){return function(ee){var Y=[],je=-1,ke=0,Le=ae.length,Ge,at,ot;for(ee instanceof Date||(ee=new Date(+ee));++je<Le;)ae.charCodeAt(je)===37&&(Y.push(ae.slice(ke,je)),(at=X4[Ge=ae.charAt(++je)])!=null?Ge=ae.charAt(++je):at=Ge==="e"?" ":"0",(ot=ue[Ge])&&(Ge=ot(ee,at)),Y.push(Ge),ke=je+1);return Y.push(ae.slice(ke,je)),Y.join("")}}function P(ae,ue){return function(ee){var Y=Sl(1900,void 0,1),je=O(Y,ae,ee+="",0),ke,Le;if(je!=ee.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(ue&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(ke=Eb(Sl(Y.y,0,1)),Le=ke.getUTCDay(),ke=Le>4||Le===0?ph.ceil(ke):ph(ke),ke=Bf.offset(ke,(Y.V-1)*7),Y.y=ke.getUTCFullYear(),Y.m=ke.getUTCMonth(),Y.d=ke.getUTCDate()+(Y.w+6)%7):(ke=Ob(Sl(Y.y,0,1)),Le=ke.getDay(),ke=Le>4||Le===0?mh.ceil(ke):mh(ke),ke=ad.offset(ke,(Y.V-1)*7),Y.y=ke.getFullYear(),Y.m=ke.getMonth(),Y.d=ke.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),Le="Z"in Y?Eb(Sl(Y.y,0,1)).getUTCDay():Ob(Sl(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(Le+5)%7:Y.w+Y.U*7-(Le+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,Eb(Y)):Ob(Y)}}function O(ae,ue,ee,Y){for(var je=0,ke=ue.length,Le=ee.length,Ge,at;je<ke;){if(Y>=Le)return-1;if(Ge=ue.charCodeAt(je++),Ge===37){if(Ge=ue.charAt(je++),at=C[Ge in X4?ue.charAt(je++):Ge],!at||(Y=at(ae,ee,Y))<0)return-1}else if(Ge!=ee.charCodeAt(Y++))return-1}return Y}function E(ae,ue,ee){var Y=u.exec(ue.slice(ee));return Y?(ae.p=h.get(Y[0].toLowerCase()),ee+Y[0].length):-1}function $(ae,ue,ee){var Y=b.exec(ue.slice(ee));
vendor: 6,004 bytes, line 182
182return Y?(ae.w=w.get(Y[0].toLowerCase()),ee+Y[0].length):-1}function M(ae,ue,ee){var Y=m.exec(ue.slice(ee));return Y?(ae.w=p.get(Y[0].toLowerCase()),ee+Y[0].length):-1}function R(ae,ue,ee){var Y=j.exec(ue.slice(ee));return Y?(ae.m=S.get(Y[0].toLowerCase()),ee+Y[0].length):-1}function B(ae,ue,ee){var Y=x.exec(ue.slice(ee));return Y?(ae.m=g.get(Y[0].toLowerCase()),ee+Y[0].length):-1}function D(ae,ue,ee){return O(ae,t,ue,ee)}function U(ae,ue,ee){return O(ae,r,ue,ee)}function H(ae,ue,ee){return O(ae,a,ue,ee)}function K(ae){return o[ae.getDay()]}function z(ae){return i[ae.getDay()]}function X(ae){return d[ae.getMonth()]}function G(ae){return c[ae.getMonth()]}function Q(ae){return s[+(ae.getHours()>=12)]}function re(ae){return 1+~~(ae.getMonth()/3)}function ce(ae){return o[ae.getUTCDay()]}function fe(ae){return i[ae.getUTCDay()]}function me(ae){return d[ae.getUTCMonth()]}function pe(ae){return c[ae.getUTCMonth()]}function Re(ae){return s[+(ae.getUTCHours()>=12)]}function J(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var ue=A(ae+="",_);return ue.toString=function(){return ae},ue},parse:function(ae){var ue=P(ae+="",!1);return ue.toString=function(){return ae},ue},utcFormat:function(ae){var ue=A(ae+="",N);return ue.toString=function(){return ae},ue},utcParse:function(ae){var ue=P(ae+="",!0);return ue.toString=function(){return ae},ue}}}var X4={"-":"",_:" ",0:"0"},rn=/^\s*\d+/,fX=/^%/,mX=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,r){var a=e<0?"-":"",s=(a?-e:e)+"",i=s.length;return a+(i<r?new Array(r-i+1).join(t)+s:s)}function pX(e){return e.replace(mX,"\\$&")}function Cl(e){return new RegExp("^(?:"+e.map(pX).join("|")+")","i")}function Al(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function xX(e,t,r){var a=rn.exec(t.slice(r,r+1));return a?(e.w=+a[0],r+a[0].length):-1}function gX(e,t,r){var a=rn.exec(t.slice(r,r+1));return a?(e.u=+a[0],r+a[0].length):-1}function bX(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.U=+a[0],r+a[0].length):-1}function vX(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.V=+a[0],r+a[0].length):-1}function yX(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.W=+a[0],r+a[0].length):-1}function J4(e,t,r){var a=rn.exec(t.slice(r,r+4));return a?(e.y=+a[0],r+a[0].length):-1}function Q4(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),r+a[0].length):-1}function jX(e,t,r){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),r+a[0].length):-1}function wX(e,t,r){var a=rn.exec(t.slice(r,r+1));return a?(e.q=a[0]*3-3,r+a[0].length):-1}function NX(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.m=a[0]-1,r+a[0].length):-1}function e3(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.d=+a[0],r+a[0].length):-1}function _X(e,t,r){var a=rn.exec(t.slice(r,r+3));return a?(e.m=0,e.d=+a[0],r+a[0].length):-1}function t3(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.H=+a[0],r+a[0].length):-1}function SX(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.M=+a[0],r+a[0].length):-1}function CX(e,t,r){var a=rn.exec(t.slice(r,r+2));return a?(e.S=+a[0],r+a[0].length):-1}function AX(e,t,r){var a=rn.exec(t.slice(r,r+3));return a?(e.L=+a[0],r+a[0].length):-1}function kX(e,t,r){var a=rn.exec(t.slice(r,r+6));return a?(e.L=Math.floor(a[0]/1e3),r+a[0].length):-1}function PX(e,t,r){var a=fX.exec(t.slice(r,r+1));return a?r+a[0].length:-1}function TX(e,t,r){var a=rn.exec(t.slice(r));return a?(e.Q=+a[0],r+a[0].length):-1}function OX(e,t,r){var a=rn.exec(t.slice(r));return a?(e.s=+a[0],r+a[0].length):-1}function n3(e,t){return Qe(e.getDate(),t,2)}function EX(e,t){return Qe(e.getHours(),t,2)}function MX(e,t){return Qe(e.getHours()%12||12,t,2)}function LX(e,t){return Qe(1+ad.count(Aa(e),e),t,3)}function PO(e,t){return Qe(e.getMilliseconds(),t,3)}function IX(e,t){return PO(e,t)+"000"}function RX(e,t){return Qe(e.getMonth()+1,t,2)}function DX(e,t){return Qe(e.getMinutes(),t,2)}function $X(e,t){return Qe(e.getSeconds(),t,2)}function FX(e){var t=e.getDay();return t===0?7:t}function BX(e,t){return Qe(Uf.count(Aa(e)-1,e),t,2)}function TO(e){var t=e.getDay();return t>=4||t===0?wo(e):wo.ceil(e)}function UX(e,t){return e=TO(e),Qe(wo.count(Aa(e),e)+(Aa(e).getDay()===4),t,2)}function zX(e){return e.getDay()}function WX(e,t){return Qe(mh.count(Aa(e)-1,e),t,2)}function qX(e,t){return Qe(e.getFullYear()%100,t,2)}function VX(e,t){return e=TO(e),Qe(e.getFullYear()%100,t,2)}function HX(e,t){return Qe(e.getFullYear()%1e4,t,4)}function GX(e,t){var r=e.getDay();return e=r>=4||r===0?wo(e):wo.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function KX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function r3(e,t){return Qe(e.getUTCDate(),t,2)}function YX(e,t){return Qe(e.getUTCHours(),t,2)}function ZX(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function XX(e,t){return Qe(1+Bf.count(ka(e),e),t,3)}function OO(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function JX(e,t){return OO(e,t)+"000"}function QX(e,t){return Qe(e.getUTCMonth()+1,t,2)}function eJ(e,t){return Qe(e.getUTCMinutes(),t,2)}function tJ(e,t){return Qe(e.getUTCSeconds(),t,2)}function nJ(e){var t=e.getUTCDay();return t===0?7:t}function rJ(e,t){return Qe(zf.count(ka(e)-1,e),t,2)}function EO(e){var t=e.getUTCDay();return t>=4||t===0?No(e):No.ceil(e)}function aJ(e,t){return e=EO(e),Qe(No.count(ka(e),e)+(ka(e).getUTCDay()===4),t,2)}function sJ(e){return e.getUTCDay()}function iJ(e,t){return Qe(ph.count(ka(e)-1,e),t,2)}function oJ(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function lJ(e,t){return e=EO(e),Qe(e.getUTCFullYear()%100,t,2)}function cJ(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function dJ(e,t){var r=e.getUTCDay();return e=r>=4||r===0?No(e):No.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function uJ(){return"+0000"}function a3(){return"%"}function s3(e){return+e}function i3(e){return Math.floor(+e/1e3)}var Fi,MO,LO;hJ({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
182ay","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hJ(e){return Fi=hX(e),MO=Fi.format,Fi.parse,LO=Fi.utcFormat,Fi.utcParse,Fi}function fJ(e){return new Date(e)}function mJ(e){return e instanceof Date?+e:+new Date(+e)}function ij(e,t,r,a,s,i,o,c,d,u){var h=H1(),m=h.invert,p=h.domain,b=u(".%L"),w=u(":%S"),x=u("%I:%M"),g=u("%I %p"),j=u("%a %d"),S=u("%b %d"),_=u("%B"),N=u("%Y");function C(A){return(d(A)<A?b:c(A)<A?w:o(A)<A?x:i(A)<A?g:a(A)<A?s(A)<A?j:S:r(A)<A?_:N)(A)}return h.invert=function(A){return new Date(m(A))},h.domain=function(A){return arguments.length?p(Array.from(A,mJ)):p().map(fJ)},h.ticks=function(A){var P=p();return e(P[0],P[P.length-1],A??10)},h.tickFormat=function(A,P){return P==null?C:u(P)},h.nice=function(A){var P=p();return(!A||typeof A.range!="function")&&(A=t(P[0],P[P.length-1],A??10)),A?p(yO(P,A)):h},h.copy=function(){return rd(h,ij(e,t,r,a,s,i,o,c,d,u))},h}function pJ(){return or.apply(ij(dX,uX,Aa,aj,Uf,ad,nj,ej,Bs,MO).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function xJ(){return or.apply(ij(lX,cX,ka,sj,zf,Bf,rj,tj,Bs,LO).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wf(){var e=0,t=1,r,a,s,i,o=wn,c=!1,d;function u(m){return m==null||isNaN(m=+m)?d:o(s===0?.5:(m=(i(m)-r)*s,c?Math.max(0,Math.min(1,m)):m))}u.domain=function(m){return arguments.length?([e,t]=m,r=i(e=+e),a=i(t=+t),s=r===a?0:1/(a-r),u):[e,t]},u.clamp=function(m){return arguments.length?(c=!!m,u):c},u.interpolator=function(m){return arguments.length?(o=m,u):o};function h(m){return function(p){var b,w;return arguments.length?([b,w]=p,o=m(b,w),u):[o(0),o(1)]}}return u.range=h(nl),u.rangeRound=h(V1),u.unknown=function(m){return arguments.length?(d=m,u):d},function(m){return i=m,r=m(e),a=m(t),s=r===a?0:1/(a-r),u}}function ds(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function IO(){var e=cs(Wf()(wn));return e.copy=function(){return ds(e,IO())},Ea.apply(e,arguments)}function RO(){var e=Y1(Wf()).domain([1,10]);return e.copy=function(){return ds(e,RO()).base(e.base())},Ea.apply(e,arguments)}function DO(){var e=Z1(Wf());return e.copy=function(){return ds(e,DO()).constant(e.constant())},Ea.apply(e,arguments)}function oj(){var e=X1(Wf());return e.copy=function(){return ds(e,oj()).exponent(e.exponent())},Ea.apply(e,arguments)}function gJ(){return oj.apply(null,arguments).exponent(.5)}function $O(){var e=[],t=wn;function r(a){if(a!=null&&!isNaN(a=+a))return t((td(e,a,1)-1)/(e.length-1))}return r.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Ka),r},r.interpolator=function(a){return arguments.length?(t=a,r):t},r.range=function(){return e.map((a,s)=>t(s/(e.length-1)))},r.quantiles=function(a){return Array.from({length:a+1},(s,i)=>rZ(e,i/a))},r.copy=function(){return $O(t).domain(e)},Ea.apply(r,arguments)}function qf(){var e=0,t=.5,r=1,a=1,s,i,o,c,d,u=wn,h,m=!1,p;function b(x){return isNaN(x=+x)?p:(x=.5+((x=+h(x))-i)*(a*x<a*i?c:d),u(m?Math.max(0,Math.min(1,x)):x))}b.domain=function(x){return arguments.length?([e,t,r]=x,s=h(e=+e),i=h(t=+t),o=h(r=+r),c=s===i?0:.5/(i-s),d=i===o?0:.5/(o-i),a=i<s?-1:1,b):[e,t,r]},b.clamp=function(x){return arguments.length?(m=!!x,b):m},b.interpolator=function(x){return arguments.length?(u=x,b):u};function w(x){return function(g){var j,S,_;return arguments.length?([j,S,_]=g,u=PZ(x,[j,S,_]),b):[u(0),u(.5),u(1)]}}return b.range=w(nl),b.rangeRound=w(V1),b.unknown=function(x){return arguments.length?(p=x,b):p},function(x){return h=x,s=x(e),i=x(t),o=x(r),c=s===i?0:.5/(i-s),d=i===o?0:.5/(o-i),a=i<s?-1:1,b}}function FO(){var e=cs(qf()(wn));return e.copy=function(){return ds(e,FO())},Ea.apply(e,arguments)}function BO(){var e=Y1(qf()).domain([.1,1,10]);return e.copy=function(){return ds(e,BO()).base(e.base())},Ea.apply(e,arguments)}function UO(){var e=Z1(qf());return e.copy=function(){return ds(e,UO()).constant(e.constant())},Ea.apply(e,arguments)}function lj(){var e=X1(qf());return e.copy=function(){return ds(e,lj()).exponent(e.exponent())},Ea.apply(e,arguments)}function bJ(){return lj.apply(null,arguments).exponent(.5)}const o3=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:sc,scaleDiverging:FO,scaleDivergingLog:BO,scaleDivergingPow:lj,scaleDivergingSqrt:bJ,scaleDivergingSymlog:UO,scaleIdentity:vO,scaleImplicit:by,scaleLinear:hh,scaleLog:jO,scaleOrdinal:z1,scalePoint:Bl,scalePow:J1,scaleQuantile:_O,scaleQuantize:SO,scaleRadial:NO,scaleSequential:IO,scaleSequentialLog:RO,scaleSequentialPow:oj,scaleSequentialQuantile:$O,scaleSequentialSqrt:gJ,scaleSequentialSymlog:DO,scaleSqrt:JZ,scaleSymlog:wO,scaleThreshold:CO,scaleTime:pJ,scaleUtc:xJ,tickFormat:bO},Symbol.toStringTag,{value:"Module"}));var Mb,l3;function Vf(){if(l3)return Mb;l3=1;var e=Xo();function t(r,a,s){for(var i=-1,o=r.length;++i<o;){var c=r[i],d=a(c);if(d!=null&&(u===void 0?d===d&&!e(d):s(d,u)))var u=d,h=c}return h}return Mb=t,Mb}var Lb,c3;function zO(){if(c3)return Lb;c3=1;function e(t,r){return t>r}return Lb=e,Lb}var Ib,d3;function vJ(){if(d3)return Ib;d3=1;
vendor: 69,638 bytes, lines 182-209
182var e=Vf(),t=zO(),r=tl();function a(s){return s&&s.length?e(s,r,t):void 0}return Ib=a,Ib}var yJ=vJ();const Wa=it(yJ);var Rb,u3;function WO(){if(u3)return Rb;u3=1;function e(t,r){return t<r}return Rb=e,Rb}var Db,h3;function jJ(){if(h3)return Db;h3=1;var e=Vf(),t=WO(),r=tl();function a(s){return s&&s.length?e(s,r,t):void 0}return Db=a,Db}var wJ=jJ();const Hf=it(wJ);var $b,f3;function NJ(){if(f3)return $b;f3=1;var e=_1(),t=ta(),r=JT(),a=In();function s(i,o){var c=a(i)?e:r;return c(i,t(o,3))}return $b=s,$b}var Fb,m3;function _J(){if(m3)return Fb;m3=1;var e=ZT(),t=NJ();function r(a,s){return e(t(a,s),1)}return Fb=r,Fb}var SJ=_J();const CJ=it(SJ);var Bb,p3;function AJ(){if(p3)return Bb;p3=1;var e=D1();function t(r,a){return e(r,a)}return Bb=t,Bb}var kJ=AJ();const _o=it(kJ);var rl=1e9,PJ={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},dj,vt=!0,rr="[DecimalError] ",Vs=rr+"Invalid argument: ",cj=rr+"Exponent out of range: ",al=Math.floor,Ts=Math.pow,TJ=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Bn,Yt=1e7,xt=7,qO=9007199254740991,xh=al(qO/xt),ve={};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ve.comparedTo=ve.cmp=function(e){var t,r,a,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(a=i.d.length,s=e.d.length,t=0,r=a<s?a:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return a===s?0:a>s^i.s<0?1:-1};ve.decimalPlaces=ve.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ve.dividedBy=ve.div=function(e){return va(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,r=t.constructor;return lt(va(t,new r(e),0,1),r.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return Lt(this)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){return this.cmp(e)>=0};ve.isInteger=ve.isint=function(){return this.e>this.d.length-2};ve.isNegative=ve.isneg=function(){return this.s<0};ve.isPositive=ve.ispos=function(){return this.s>0};ve.isZero=function(){return this.s===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.log=function(e){var t,r=this,a=r.constructor,s=a.precision,i=s+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(Bn))throw Error(rr+"NaN");if(r.s<1)throw Error(rr+(r.s?"NaN":"-Infinity"));return r.eq(Bn)?new a(0):(vt=!1,t=va(dc(r,i),dc(e,i),i),vt=!0,lt(t,s))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?GO(t,e):VO(t,(e.s=-e.s,e))};ve.modulo=ve.mod=function(e){var t,r=this,a=r.constructor,s=a.precision;if(e=new a(e),!e.s)throw Error(rr+"NaN");return r.s?(vt=!1,t=va(r,e,0,1).times(e),vt=!0,r.minus(t)):lt(new a(r),s)};ve.naturalExponential=ve.exp=function(){return HO(this)};ve.naturalLogarithm=ve.ln=function(){return dc(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ve.plus=ve.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?VO(t,e):GO(t,(e.s=-e.s,e))};ve.precision=ve.sd=function(e){var t,r,a,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Vs+e);if(t=Lt(s)+1,a=s.d.length-1,r=a*xt+1,a=s.d[a],a){for(;a%10==0;a/=10)r--;for(a=s.d[0];a>=10;a/=10)r++}return e&&t>r?t:r};ve.squareRoot=ve.sqrt=function(){var e,t,r,a,s,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(rr+"NaN")}for(e=Lt(c),vt=!1,s=Math.sqrt(+c),s==0||s==1/0?(t=Dr(c.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=al((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(s.toString()),r=d.precision,s=o=r+3;;)if(i=a,a=i.plus(va(c,i,o+2)).times(.5),Dr(i.d).slice(0,o)===(t=Dr(a.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(lt(i,r+1,0),i.times(i).eq(c)){a=i;break}}else if(t!="9999")break;o+=4}return vt=!0,lt(a,r)};ve.times=ve.mul=function(e){var t,r,a,s,i,o,c,d,u,h=this,m=h.constructor,p=h.d,b=(e=new m(e)).d;if(!h.s||!e.s)return new m(0);for(e.s*=h.s,r=h.e+e.e,d=p.length,u=b.length,d<u&&(i=p,p=b,b=i,o=d,d=u,u=o),i=[],o=d+u,a=o;a--;)i.push(0);for(a=u;--a>=0;){for(t=0,s=d+a;s>a;)c=i[s]+b[a]*p[s-a-1]+t,i[s--]=c%Yt|0,t=c/Yt|0;i[s]=(i[s]+t)%Yt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,vt?lt(e,m.precision):e};ve.toDecimalPlaces=ve.todp=function(e,t){var r=this,a=r.constructor;return r=new a(r),e===void 0?r:(Gr(e,0,rl),t===void 0?t=a.rounding:Gr(t,0,8),lt(r,e+Lt(r)+1,t))};ve.toExponential=function(e,t){var r,a=this,s=a.constructor;return e===void 0?r=ti(a,!0):(Gr(e,0,rl),t===void 0?t=s.rounding:Gr(t,0,8),a=lt(new s(a),e+1,t),r=ti(a,!0,e+1)),r};ve.toFixed=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?ti(s):(Gr(e,0,rl),t===void 0?t=i.rounding:Gr(t,0,8),a=lt(new i(s),e+Lt(s)+1,t),r=ti(a.abs(),!1,e+Lt(a)+1),s.isneg()&&!s.isZero()?"-"+r:r)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return lt(new t(e),Lt(e)+1,t.rounding)};ve.toNumber=function(){return+this};ve.toPower=ve.pow=function(e){var t,r,a,s,i,o,c=this,d=c.constructor,u=12,h=+(e=new d(e));if(!e.s)return new d(Bn);if(c=new d(c),!c.s){if(e.s<1)throw Error(rr+"Infinity");return c}if(c.eq(Bn))return c;if(a=d.precision,e.eq(Bn))return lt(c,a);if(t=e.e,r=e.d.length-1,o=t>=r,i=c.s,o){if((r=h<0?-h:h)<=qO){for(s=new d(Bn),t=Math.ceil(a/xt+4),vt=!1;r%2&&(s=s.times(c),g3(s.d,t)),r=al(r/2),r!==0;)c=c.times(c),g3(c.d,t);return vt=!0,e.s<0?new d(Bn).div(s):lt(s,a)}}else if(i<0)throw Error(rr+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,c.s=1,vt=!1,s=e.times(dc(c,a+u)),vt=!0,s=HO(s),s.s=i,s};ve.toPrecision=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?(r=Lt(s),a=ti(s,r<=i.toExpNeg||r>=i.toExpPos)):(Gr(e,1,rl),t===void 0?t=i.rounding:Gr(t,0,8),s=lt(new i(s),e,t),r=Lt(s),a=ti(s,e<=r||r<=i.toExpNeg,e)),a};ve.toSignificantDigits=ve.tosd=function(e,t){var r=this,a=r.constructor;return e===void 0?(e=a.precision,t=a.rounding):(Gr(e,1,rl),t===void 0?t=a.rounding:Gr(t,0,8)),lt(new a(r),e,t)};ve.toString=ve.valueOf=ve.val=ve.toJSON=ve[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Lt(e),r=e.constructor;return ti(e,t<=r.toExpNeg||t>=r.toExpPos)};function VO(e,t){var r,a,s,i,o,c,d,u,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),vt?lt(t,m):t;if(d=e.d,u=t.d,o=e.e,s=t.e,d=d.slice(),i=o-s,i){for(i<0?(a=d,i=-i,c=u.length):(a=u,s=o,c=d.length),o=Math.ceil(m/xt),c=o>c?o+1:c+1,i>c&&(i=c,a.length=1),a.reverse();i--;)a.push(0);a.reverse()}for(c=d.length,i=u.length,c-i<0&&(i=c,a=u,u=d,d=a),r=0;i;)r=(d[--i]=d[i]+u[i]+r)/Yt|0,d[i]%=Yt;for(r&&(d.unshift(r),++s),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=s,vt?lt(t,m):t}function Gr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Vs+e)}function Dr(e){var t,r,a,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)a=e[t]+"",r=xt-a.length,r&&(i+=Ua(r)),i+=a;o=e[t],a=o+"",r=xt-a.length,r&&(i+=Ua(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var va=(function(){function e(a,s){var i,o=0,c=a.length;for(a=a.slice();c--;)i=a[c]*s+o,a[c]=i%Yt|0,o=i/Yt|0;return o&&a.unshift(o),a}function t(a,s,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(a[c]!=s[c]){d=a[c]>s[c]?1:-1;break}return d}function r(a,s,i){for(var o=0;i--;)a[i]-=o,o=a[i]<s[i]?1:0,a[i]=o*Yt+a[i]-s[i];for(;!a[0]&&a.length>1;)a.shift()}return function(a,s,i,o){var c,d,u,h,m,p,b,w,x,g,j,S,_,N,C,A,P,O,E=a.constructor,$=a.s==s.s?1:-1,M=a.d,R=s.d;if(!a.s)return new E(a);if(!s.s)throw Error(rr+"Division by zero");for(d=a.e-s.e,P=R.length,C=M.length,b=new E($),w=b.d=[],u=0;R[u]==(M[u]||0);)++u;if(R[u]>(M[u]||0)&&--d,i==null?S=i=E.precision:o?S=i+(Lt(a)-Lt(s))+1:S=i,S<0)return new E(0);if(S=S/xt+2|0,u=0,P==1)for(h=0,R=R[0],S++;(u<C||h)&&S--;u++)_=h*Yt+(M[u]||0),w[u]=_/R|0,h=_%R|0;else{for(h=Yt/(R[0]+1)|0,h>1&&(R=e(R,h),M=e(M,h),P=R.length,C=M.length),N=P,x=M.slice(0,P),g=x.length;g<P;)x[g++]=0;O=R.slice(),O.unshift(0),A=R[0],R[1]>=Yt/2&&++A;do h=0,c=t(R,x,P,g),c<0?(j=x[0],P!=g&&(j=j*Yt+(x[1]||0)),h=j/A|0,h>1?(h>=Yt&&(h=Yt-1),m=e(R,h),p=m.length,g=x.length,c=t(m,x,p,g),c==1&&(h--,r(m,P<p?O:R,p))):(h==0&&(c=h=1),m=R.slice()),p=m.length,p<g&&m.unshift(0),r(x,m,g),c==-1&&(g=x.length,c=t(R,x,P,g),c<1&&(h++,r(x,P<g?O:R,g))),g=x.length):c===0&&(h++,x=[0]),w[u++]=h,c&&x[0]?x[g++]=M[N]||0:(x=[M[N]],g=1);while((N++<C||x[0]!==void 0)&&S--)}return w[0]||w.shift(),b.e=d,lt(b,o?i+Lt(b)+1:i)}})();function HO(e,t){var r,a,s,i,o,c,d=0,u=0,h=e.constructor,m=h.precision;if(Lt(e)>16)throw Error(cj+Lt(e));if(!e.s)return new h(Bn);for(vt=!1,c=m,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(a=Math.log(Ts(2,u))/Math.LN10*2+5|0,c+=a,r=s=i=new h(Bn),h.precision=c;;){if(s=lt(s.times(e),c),r=r.times(++d),o=i.plus(va(s,r,c)),Dr(o.d).slice(0,c)===Dr(i.d).slice(0,c)){for(;u--;)i=lt(i.times(i),c);return h.precision=m,t==null?(vt=!0,lt(i,m)):i}i=o}}function Lt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Ub(e,t,r){if(t>e.LN10.sd())throw vt=!0,r&&(e.precision=r),Error(rr+"LN10 precision limit exceeded");return lt(new e(e.LN10),t)}function Ua(e){for(var t="";e--;)t+="0";return t}function dc(e,t){var r,a,s,i,o,c,d,u,h,m=1,p=10,b=e,w=b.d,x=b.constructor,g=x.precision;if(b.s<1)throw Error(rr+(b.s?"NaN":"-Infinity"));if(b.eq(Bn))return new x(0);if(t==null?(vt=!1,u=g):u=t,b.eq(10))return t==null&&(vt=!0),Ub(x,u);if(u+=p,x.precision=u,r=Dr(w),a=r.charAt(0),i=Lt(b),Math.abs(i)<15e14){for(;a<7&&a!=1||a==1&&r.charAt(1)>3;)b=b.times(e),r=Dr(b.d),a=r.charAt(0),m++;i=Lt(b),a>1?(b=new x("0."+r),i++):b=new x(a+"."+r.slice(1))}else return d=Ub(x,u+2,g).times(i+""),b=dc(new x(a+"."+r.slice(1)),u-p).plus(d),x.precision=g,t==null?(vt=!0,lt(b,g)):b;for(c=o=b=va(b.minus(Bn),b.plus(Bn),u),h=lt(b.times(b),u),s=3;;){if(o=lt(o.times(h),u),d=c.plus(va(o,new x(s),u)),Dr(d.d).slice(0,u)===Dr(c.d).slice(0,u))return c=c.times(2),i!==0&&(c=c.plus(Ub(x,u+2,g).times(i+""))),c=va(c,new x(m),u),x.precision=g,t==null?(vt=!0,lt(c,g)):c;c=d,s+=2}}function x3(e,t){var r,a,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(r<0&&(r=a),r+=+t.slice(a+1),t=t.substring(0,a)):r<0&&(r=t.length),a=0;t.charCodeAt(a)===48;)++a;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(a,s),t){if(s-=a,r=r-a-1,e.e=al(r/xt),e.d=[],a=(r+1)%xt,r<0&&(a+=xt),a<s){for(a&&e.d.push(+t.slice(0,a)),s-=xt;a<s;)e.d.push(+t.slice(a,a+=xt));t=t.slice(a),a=xt-t.length}else a-=s;for(;a--;)t+="0";if(e.d.push(+t),vt&&(e.e>xh||e.e<-xh))throw Error(cj+r)}else e.s=0,e.e=0,e.d=[0];return e}function lt(e,t,r){var a,s,i,o,c,d,u,h,m=e.d;for(o=1,i=m[0];i>=10;i/=10)o++;if(a=t-o,a<0)a+=xt,s=t,u=m[h=0];else{if(h=Math.ceil((a+1)/xt),i=m.length,h>=i)return e;for(u=i=m[h],o=1;i>=10;i/=10)o++;a%=xt,s=a-xt+o}if(r!==void 0&&(i=Ts(10,o-s-1),c=u/i%10|0,d=t<0||m[h+1]!==void 0||u%i,d=r<4?(c||d)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||d||r==6&&(a>0?s>0?u/Ts(10,o-s):0:m[h-1])%10&1||r==(e.s<0?8:7))),t<1||!m[0])return d?(i=Lt(e),m.length=1,t=t-i-1,m[0]=Ts(10,(xt-t%xt)%xt),e.e=al(-t/xt)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(a==0?(m.length=h,i=1,h--):(m.length=h+1,i=Ts(10,xt-a),m[h]=s>0?(u/Ts(10,o-s)%Ts(10,s)|0)*i:0),d)for(;;)if(h==0){(m[0]+=i)==Yt&&(m[0]=1,++e.e);break}else{if(m[h]+=i,m[h]!=Yt)break;m[h--]=0,i=1}for(a=m.length;m[--a]===0;)m.pop();if(vt&&(e.e>xh||e.e<-xh))throw Error(cj+Lt(e));return e}function GO(e,t){var r,a,s,i,o,c,d,u,h,m,p=e.constructor,b=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),vt?lt(t,b):t;if(d=e.d,m=t.d,a=t.e,u=e.e,d=d.slice(),o=u-a,o){for(h=o<0,h?(r=d,o=-o,c=m.length):(r=m,a=u,c=d.length),s=Math.max(Math.ceil(b/xt),c)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=d.length,c=m.length,h=s<c,h&&(c=s),s=0;s<c;s++)if(d[s]!=m[s]){h=d[s]<m[s];break}o=0}for(h&&(r=d,d=m,m=r,t.s=-t.s),c=d.length,s=m.length-c;s>0;--s)d[c++]=0;for(s=m.length;s>o;){if(d[--s]<m[s]){for(i=s;i&&d[--i]===0;)d[i]=Yt-1;--d[i],d[s]+=Yt}d[s]-=m[s]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--a;return d[0]?(t.d=d,t.e=a,vt?lt(t,b):t):new p(0)}function ti(e,t,r){var a,s=Lt(e),i=Dr(e.d),o=i.length;return t?(r&&(a=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ua(a):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Ua(-s-1)+i,r&&(a=r-o)>0&&(i+=Ua(a))):s>=o?(i+=Ua(s+1-o),r&&(a=r-s-1)>0&&(i=i+"."+Ua(a))):((a=s+1)<o&&(i=i.slice(0,a)+"."+i.slice(a)),r&&(a=r-o)>0&&(s+1===o&&(i+="."),i+=Ua(a))),e.s<0?"-"+i:i}function g3(e,t){if(e.length>t)return e.length=t,!0}function KO(e){var t,r,a;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Vs+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return x3(o,i.toString())}else if(typeof i!="string")throw Error(Vs+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,TJ.test(i))x3(o,i);else throw Error(Vs+i)}if(s.prototype=ve,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=KO,s.config=s.set=OJ,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<a.length;)e.hasOwnProperty(r=a[t++])||(e[r]=this[r]);return s.config(e),s}function OJ(e){if(!e||typeof e!="object")throw Error(rr+"Object expected");var t,r,a,s=["precision",1,rl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((a=e[r=s[t]])!==void 0)if(al(a)===a&&a>=s[t+1]&&a<=s[t+2])this[r]=a;else throw Error(Vs+r+": "+a);if((a=e[r="LN10"])!==void 0)if(a==Math.LN10)this[r]=new this(a);else throw Error(Vs+r+": "+a);return this}var dj=KO(PJ);Bn=new dj(1);const st=dj;function EJ(e){return RJ(e)||IJ(e)||LJ(e)||MJ()}function MJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 183In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LJ(e,t){if(e){if(typeof e=="string")return wy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wy(e,t)}}function IJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function RJ(e){if(Array.isArray(e))return wy(e)}function wy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var DJ=function(t){return t},YO={},ZO=function(t){return t===YO},b3=function(t){return function r(){return arguments.length===0||arguments.length===1&&ZO(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},$J=function e(t,r){return t===1?r:b3(function(){for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];var o=s.filter(function(c){return c!==YO}).length;return o>=t?r.apply(void 0,s):e(t-o,b3(function(){for(var c=arguments.length,d=new Array(c),u=0;u<c;u++)d[u]=arguments[u];var h=s.map(function(m){return ZO(m)?d.shift():m});return r.apply(void 0,EJ(h).concat(d))}))})},Gf=function(t){return $J(t.length,t)},Ny=function(t,r){for(var a=[],s=t;s<r;++s)a[s-t]=s;return a},FJ=Gf(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),BJ=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];if(!r.length)return DJ;var s=r.reverse(),i=s[0],o=s.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},_y=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},XO=function(t){var r=null,a=null;return function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return r&&i.every(function(c,d){return c===r[d]})||(r=i,a=t.apply(void 0,i)),a}};function UJ(e){var t;return e===0?t=1:t=Math.floor(new st(e).abs().log(10).toNumber())+1,t}function zJ(e,t,r){for(var a=new st(e),s=0,i=[];a.lt(t)&&s<1e5;)i.push(a.toNumber()),a=a.add(r),s++;return i}var WJ=Gf(function(e,t,r){var a=+e,s=+t;return a+r*(s-a)}),qJ=Gf(function(e,t,r){var a=t-+e;return a=a||1/0,(r-e)/a}),VJ=Gf(function(e,t,r){var a=t-+e;return a=a||1/0,Math.max(0,Math.min(1,(r-e)/a))});const Kf={rangeStep:zJ,getDigitCount:UJ,interpolateNumber:WJ,uninterpolateNumber:qJ,uninterpolateTruncation:VJ};function Sy(e){return KJ(e)||GJ(e)||JO(e)||HJ()}function HJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 184In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GJ(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function KJ(e){if(Array.isArray(e))return Cy(e)}function uc(e,t){return XJ(e)||ZJ(e,t)||JO(e,t)||YJ()}function YJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 185In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JO(e,t){if(e){if(typeof e=="string")return Cy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cy(e,t)}}function Cy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function ZJ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],a=!0,s=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(a=(c=o.next()).done)&&(r.push(c.value),!(t&&r.length===t));a=!0);}catch(d){s=!0,i=d}finally{try{!a&&o.return!=null&&o.return()}finally{if(s)throw i}}return r}}function XJ(e){if(Array.isArray(e))return e}function QO(e){var t=uc(e,2),r=t[0],a=t[1],s=r,i=a;return r>a&&(s=a,i=r),[s,i]}function eE(e,t,r){if(e.lte(0))return new st(0);var a=Kf.getDigitCount(e.toNumber()),s=new st(10).pow(a),i=e.div(s),o=a!==1?.05:.1,c=new st(Math.ceil(i.div(o).toNumber())).add(r).mul(o),d=c.mul(s);return t?d:new st(Math.ceil(d))}function JJ(e,t,r){var a=1,s=new st(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(a=new st(10).pow(Kf.getDigitCount(e)-1),s=new st(Math.floor(s.div(a).toNumber())).mul(a)):i>1&&(s=new st(Math.floor(e)))}else e===0?s=new st(Math.floor((t-1)/2)):r||(s=new st(Math.floor(e)));var o=Math.floor((t-1)/2),c=BJ(FJ(function(d){return s.add(new st(d-o).mul(a)).toNumber()}),Ny);return c(0,t)}function tE(e,t,r,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new st(0),tickMin:new st(0),tickMax:new st(0)};var i=eE(new st(t).sub(e).div(r-1),a,s),o;e<=0&&t>=0?o=new st(0):(o=new st(e).add(t).div(2),o=o.sub(new st(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new st(t).sub(o).div(i).toNumber()),u=c+d+1;return u>r?tE(e,t,r,a,s+1):(u<r&&(d=t>0?d+(r-u):d,c=t>0?c:c+(r-u)),{step:i,tickMin:o.sub(new st(c).mul(i)),tickMax:o.add(new st(d).mul(i))})}function QJ(e){var t=uc(e,2),r=t[0],a=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),c=QO([r,a]),d=uc(c,2),u=d[0],h=d[1];if(u===-1/0||h===1/0){var m=h===1/0?[u].concat(Sy(Ny(0,s-1).map(function(){return 1/0}))):[].concat(Sy(Ny(0,s-1).map(function(){return-1/0})),[h]);return r>a?_y(m):m}if(u===h)return JJ(u,s,i);var p=tE(u,h,o,i),b=p.step,w=p.tickMin,x=p.tickMax,g=Kf.rangeStep(w,x.add(new st(.1).mul(b)),b);return r>a?_y(g):g}function eQ(e,t){var r=uc(e,2),a=r[0],s=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=QO([a,s]),c=uc(o,2),d=c[0],u=c[1];if(d===-1/0||u===1/0)return[a,s];if(d===u)return[d];var h=Math.max(t,2),m=eE(new st(u).sub(d).div(h-1),i,0),p=[].concat(Sy(Kf.rangeStep(new st(d),new st(u).sub(new st(.99).mul(m)),m)),[u]);return a>s?_y(p):p}var tQ=XO(QJ),nQ=XO(eQ),rQ="Invariant failed";function ni(e,t){throw new Error(rQ)}var aQ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function So(e){"@babel/helpers - typeof";return So=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},So(e)}function gh(){return gh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},gh.apply(this,arguments)}function sQ(e,t){return cQ(e)||lQ(e,t)||oQ(e,t)||iQ()}function iQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 186In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oQ(e,t){if(e){if(typeof e=="string")return v3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v3(e,t)}}function v3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function lQ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function cQ(e){if(Array.isArray(e))return e}function dQ(e,t){if(e==null)return{};var r=uQ(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function uQ(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function hQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fQ(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,aE(a.key),a)}}function mQ(e,t,r){return t&&fQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pQ(e,t,r){return t=bh(t),xQ(e,nE()?Reflect.construct(t,r||[],bh(e).constructor):t.apply(e,r))}function xQ(e,t){if(t&&(So(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gQ(e)}function gQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nE=function(){return!!e})()}function bh(e){return bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bh(e)}function bQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ay(e,t)}function Ay(e,t){return Ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Ay(e,t)}function rE(e,t,r){return t=aE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aE(e){var t=vQ(e,"string");return So(t)=="symbol"?t:t+""}function vQ(e,t){if(So(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(So(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Yf=(function(e){function t(){return hQ(this,t),pQ(this,t,arguments)}return bQ(t,e),mQ(t,[{key:"render",value:function(){var a=this.props,s=a.offset,i=a.layout,o=a.width,c=a.dataKey,d=a.data,u=a.dataPointFormatter,h=a.xAxis,m=a.yAxis,p=dQ(a,aQ),b=Ce(p,!1);this.props.direction==="x"&&h.type!=="number"&&ni();var w=d.map(function(x){var g=u(x,c),j=g.x,S=g.y,_=g.value,N=g.errorVal;if(!N)return null;var C=[],A,P;if(Array.isArray(N)){var O=sQ(N,2);A=O[0],P=O[1]}else A=P=N;if(i==="vertical"){var E=h.scale,$=S+s,M=$+o,R=$-o,B=E(_-A),D=E(_+P);C.push({x1:D,y1:M,x2:D,y2:R}),C.push({x1:B,y1:$,x2:D,y2:$}),C.push({x1:B,y1:M,x2:B,y2:R})}else if(i==="horizontal"){var U=m.scale,H=j+s,K=H-o,z=H+o,X=U(_-A),G=U(_+P);C.push({x1:K,y1:G,x2:z,y2:G}),C.push({x1:H,y1:X,x2:H,y2:G}),C.push({x1:K,y1:X,x2:z,y2:X})}return q.createElement(He,gh({className:"recharts-errorBar",key:"bar-".concat(C.map(function(Q){return"".concat(Q.x1,"-").concat(Q.x2,"-").concat(Q.y1,"-").concat(Q.y2)}))},b),C.map(function(Q){return q.createElement("line",gh({},Q,{key:"line-".concat(Q.x1,"-").concat(Q.x2,"-").concat(Q.y1,"-").concat(Q.y2)}))}))});return q.createElement(He,{className:"recharts-errorBars"},w)}}])})(q.Component);rE(Yf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});rE(Yf,"displayName","ErrorBar");function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function y3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function vs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y3(Object(r),!0).forEach(function(a){yQ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function yQ(e,t,r){return t=jQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jQ(e){var t=wQ(e,"string");return hc(t)=="symbol"?t:t+""}function wQ(e,t){if(hc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(hc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sE=function(t){var r=t.children,a=t.formattedGraphicalItems,s=t.legendWidth,i=t.legendContent,o=$n(r,co);if(!o)return null;var c=co.defaultProps,d=c!==void 0?vs(vs({},c),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(a||[]).reduce(function(h,m){var p=m.item,b=m.props,w=b.sectors||b.data||[];return h.concat(w.map(function(x){return{type:o.props.iconType||p.props.legendType,value:x.name,color:x.fill,payload:x}}))},[]):u=(a||[]).map(function(h){var m=h.item,p=m.type.defaultProps,b=p!==void 0?vs(vs({},p),m.props):{},w=b.dataKey,x=b.name,g=b.legendType,j=b.hide;return{inactive:j,dataKey:w,type:d.iconType||g||"square",color:uj(m),value:x||w,payload:b}}),vs(vs(vs({},d),co.getWithHeight(o,s)),{},{payload:u,item:o})};function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}function j3(e){return CQ(e)||SQ(e)||_Q(e)||NQ()}function NQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 187In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Q(e,t){if(e){if(typeof e=="string")return ky(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ky(e,t)}}function SQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CQ(e){if(Array.isArray(e))return ky(e)}function ky(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function w3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w3(Object(r),!0).forEach(function(a){ho(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ho(e,t,r){return t=AQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AQ(e){var t=kQ(e,"string");return fc(t)=="symbol"?t:t+""}function kQ(e,t){if(fc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(fc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ut(e,t,r){return Ie(e)||Ie(t)?r:zt(t)?zn(e,t,r):Oe(t)?t(e):r}function Ul(e,t,r,a){var s=CJ(e,function(c){return Ut(c,t)});if(r==="number"){var i=s.filter(function(c){return de(c)||parseFloat(c)});return i.length?[Hf(i),Wa(i)]:[1/0,-1/0]}var o=a?s.filter(function(c){return!Ie(c)}):s;return o.map(function(c){return zt(c)||c instanceof Date?c:""})}var PQ=function(t){var r,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(r=a?.length)!==null&&r!==void 0?r:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,u=0;u<c;u++){var h=u>0?s[u-1].coordinate:s[c-1].coordinate,m=s[u].coordinate,p=u>=c-1?s[0].coordinate:s[u+1].coordinate,b=void 0;if(yn(m-h)!==yn(p-m)){var w=[];if(yn(p-m)===yn(d[1]-d[0])){b=p;var x=m+d[1]-d[0];w[0]=Math.min(x,(x+h)/2),w[1]=Math.max(x,(x+h)/2)}else{b=h;var g=p+d[1]-d[0];w[0]=Math.min(m,(g+m)/2),w[1]=Math.max(m,(g+m)/2)}var j=[Math.min(m,(b+m)/2),Math.max(m,(b+m)/2)];if(t>j[0]&&t<=j[1]||t>=w[0]&&t<=w[1]){o=s[u].index;break}}else{var S=Math.min(h,p),_=Math.max(h,p);if(t>(S+m)/2&&t<=(_+m)/2){o=s[u].index;break}}}else for(var N=0;N<c;N++)if(N===0&&t<=(a[N].coordinate+a[N+1].coordinate)/2||N>0&&N<c-1&&t>(a[N].coordinate+a[N-1].coordinate)/2&&t<=(a[N].coordinate+a[N+1].coordinate)/2||N===c-1&&t>(a[N].coordinate+a[N-1].coordinate)/2){o=a[N].index;break}return o},uj=function(t){var r,a=t,s=a.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Nt(Nt({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(s){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},TQ=function(t){var r=t.barSize,a=t.totalSize,s=t.stackGroups,i=s===void 0?{}:s;if(!i)return{};for(var o={},c=Object.keys(i),d=0,u=c.length;d<u;d++)for(var h=i[c[d]].stackGroups,m=Object.keys(h),p=0,b=m.length;p<b;p++){var w=h[m[p]],x=w.items,g=w.cateAxisId,j=x.filter(function(P){return ba(P.type).indexOf("Bar")>=0});if(j&&j.length){var S=j[0].type.defaultProps,_=S!==void 0?Nt(Nt({},S),j[0].props):j[0].props,N=_.barSize,C=_[g];o[C]||(o[C]=[]);var A=Ie(N)?r:N;o[C].push({item:j[0],stackList:j.slice(1),barSize:Ie(A)?void 0:jn(A,a,0)})}}return o},OQ=function(t){var r=t.barGap,a=t.barCategoryGap,s=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var u=jn(r,s,0,!0),h,m=[];if(o[0].barSize===+o[0].barSize){var p=!1,b=s/d,w=o.reduce(function(N,C){return N+C.barSize||0},0);w+=(d-1)*u,w>=s&&(w-=(d-1)*u,u=0),w>=s&&b>0&&(p=!0,b*=.9,w=d*b);var x=(s-w)/2>>0,g={offset:x-u,size:0};h=o.reduce(function(N,C){var A={item:C.item,position:{offset:g.offset+g.size+u,size:p?b:C.barSize}},P=[].concat(j3(N),[A]);return g=P[P.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(O){P.push({item:O,position:g})}),P},m)}else{var j=jn(a,s,0,!0);s-2*j-(d-1)*u<=0&&(u=0);var S=(s-2*j-(d-1)*u)/d;S>1&&(S>>=0);var _=c===+c?Math.min(S,c):S;h=o.reduce(function(N,C,A){var P=[].concat(j3(N),[{item:C.item,position:{offset:j+(S+u)*A+(S-_)/2,size:_}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(O){P.push({item:O,position:P[P.length-1].position})}),P},m)}return h},EQ=function(t,r,a,s){var i=a.children,o=a.width,c=a.margin,d=o-(c.left||0)-(c.right||0),u=sE({children:i,legendWidth:d});if(u){var h=s||{},m=h.width,p=h.height,b=u.align,w=u.verticalAlign,x=u.layout;if((x==="vertical"||x==="horizontal"&&w==="middle")&&b!=="center"&&de(t[b]))return Nt(Nt({},t),{},ho({},b,t[b]+(m||0)));if((x==="horizontal"||x==="vertical"&&b==="center")&&w!=="middle"&&de(t[w]))return Nt(Nt({},t),{},ho({},w,t[w]+(p||0)))}return t},MQ=function(t,r,a){return Ie(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||a==="x"?r==="xAxis":a==="y"?r==="yAxis":!0},iE=function(t,r,a,s,i){var o=r.props.children,c=nr(o,Yf).filter(function(u){return MQ(s,i,u.props.direction)});if(c&&c.length){var d=c.map(function(u){return u.props.dataKey});return t.reduce(function(u,h){var m=Ut(h,a);if(Ie(m))return u;var p=Array.isArray(m)?[Hf(m),Wa(m)]:[m,m],b=d.reduce(function(w,x){var g=Ut(h,x,0),j=p[0]-Math.abs(Array.isArray(g)?g[0]:g),S=p[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(j,w[0]),Math.max(S,w[1])]},[1/0,-1/0]);return[Math.min(b[0],u[0]),Math.max(b[1],u[1])]},[1/0,-1/0])}return null},LQ=function(t,r,a,s,i){var o=r.map(function(c){return iE(t,c,a,i,s)}).filter(function(c){return!Ie(c)});return o&&o.length?o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},oE=function(t,r,a,s,i){var o=r.map(function(d){var u=d.props.dataKey;return a==="number"&&u&&iE(t,d,u,s)||Ul(t,u,a,i)});if(a==="number")return o.reduce(function(d,u){return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0]);var c={};return o.reduce(function(d,u){for(var h=0,m=u.length;h<m;h++)c[u[h]]||(c[u[h]]=!0,d.push(u[h]));return d},[])},lE=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},cE=function(t,r,a,s){if(s)return t.map(function(d){return d.coordinate});var i,o,c=t.map(function(d){return d.coordinate===r&&(i=!0),d.coordinate===a&&(o=!0),d.coordinate});return i||c.push(r),o||c.push(a),c},ma=function(t,r,a){if(!t)return null;var s=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(r||a)&&o==="category"&&s.bandwidth?s.bandwidth()/d:0;if(u=t.axisType==="angleAxis"&&c?.length>=2?yn(c[0]-c[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(m){var p=i?i.indexOf(m):m;return{coordinate:s(p)+u,value:m,offset:u}});return h.filter(function(m){return!Qo(m.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(m,p){return{coordinate:s(m)+u,value:m,index:p,offset:u}}):s.ticks&&!a?s.ticks(t.tickCount).map(function(m){return{coordinate:s(m)+u,value:m,offset:u}}):s.domain().map(function(m,p){return{coordinate:s(m)+u,value:i?i[m]:m,index:p,offset:u}})},zb=new WeakMap,Zd=function(t,r){if(typeof r!="function")return t;zb.has(t)||zb.set(t,new WeakMap);var a=zb.get(t);if(a.has(r))return a.get(r);var s=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return a.set(r,s),s},dE=function(t,r,a){var s=t.scale,i=t.type,o=t.layout,c=t.axisType;if(s==="auto")return o==="radial"&&c==="radiusAxis"?{scale:sc(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:hh(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!a)?{scale:Bl(),realScaleType:"point"}:i==="category"?{scale:sc(),realScaleType:"band"}:{scale:hh(),realScaleType:"linear"};if(Js(s)){var d="scale".concat(Of(s));return{scale:(o3[d]||Bl)(),realScaleType:o3[d]?d:"point"}}return Oe(s)?{scale:s}:{scale:Bl(),realScaleType:"point"}},N3=1e-4,uE=function(t){var r=t.domain();if(!(!r||r.length<=2)){var a=r.length,s=t.range(),i=Math.min(s[0],s[1])-N3,o=Math.max(s[0],s[1])+N3,c=t(r[0]),d=t(r[a-1]);(c<i||c>o||d<i||d>o)&&t.domain([r[0],r[a-1]])}},IQ=function(t,r){if(!t)return null;for(var a=0,s=t.length;a<s;a++)if(t[a].item===r)return t[a].position;return null},RQ=function(t,r){if(!r||r.length!==2||!de(r[0])||!de(r[1]))return t;var a=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!de(t[0])||t[0]<a)&&(i[0]=a),(!de(t[1])||t[1]>s)&&(i[1]=s),i[0]>s&&(i[0]=s),i[1]<a&&(i[1]=a),i},DQ=function(t){var r=t.length;if(!(r<=0))for(var a=0,s=t[0].length;a<s;++a)for(var i=0,o=0,c=0;c<r;++c){var d=Qo(t[c][a][1])?t[c][a][0]:t[c][a][1];d>=0?(t[c][a][0]=i,t[c][a][1]=i+d,i=t[c][a][1]):(t[c][a][0]=o,t[c][a][1]=o+d,o=t[c][a][1])}},$Q=function(t){var r=t.length;if(!(r<=0))for(var a=0,s=t[0].length;a<s;++a)for(var i=0,o=0;o<r;++o){var c=Qo(t[o][a][1])?t[o][a][0]:t[o][a][1];c>=0?(t[o][a][0]=i,t[o][a][1]=i+c,i=t[o][a][1]):(t[o][a][0]=0,t[o][a][1]=0)}},FQ={sign:DQ,expand:SH,none:xo,silhouette:CH,wiggle:AH,positive:$Q},BQ=function(t,r,a){var s=r.map(function(c){return c.props.dataKey}),i=FQ[a],o=_H().keys(s).value(function(c,d){return+Ut(c,d,0)}).order(ay).offset(i);return o(t)},UQ=function(t,r,a,s,i,o){if(!t)return null;var c=o?r.reverse():r,d={},u=c.reduce(function(m,p){var b,w=(b=p.type)!==null&&b!==void 0&&b.defaultProps?Nt(Nt({},p.type.defaultProps),p.props):p.props,x=w.stackId,g=w.hide;if(g)return m;var j=w[a],S=m[j]||{hasStack:!1,stackGroups:{}};if(zt(x)){var _=S.stackGroups[x]||{numericAxisId:a,cateAxisId:s,items:[]};_.items.push(p),S.hasStack=!0,S.stackGroups[x]=_}else S.stackGroups[el("_stackId_")]={numericAxisId:a,cateAxisId:s,items:[p]};return Nt(Nt({},m),{},ho({},j,S))},d),h={};return Object.keys(u).reduce(function(m,p){var b=u[p];if(b.hasStack){var w={};b.stackGroups=Object.keys(b.stackGroups).reduce(function(x,g){var j=b.stackGroups[g];return Nt(Nt({},x),{},ho({},g,{numericAxisId:a,cateAxisId:s,items:j.items,stackedData:BQ(t,j.items,i)}))},w)}return Nt(Nt({},m),{},ho({},p,b))},h)},hE=function(t,r){var a=r.realScaleType,s=r.type,i=r.tickCount,o=r.originalDomain,c=r.allowDecimals,d=a||r.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var h=tQ(u,i,c);return t.domain([Hf(h),Wa(h)]),{niceTicks:h}}if(i&&s==="number"){var m=t.domain(),p=nQ(m,i,c);return{niceTicks:p}}return null};function _3(e){var t=e.axis,r=e.ticks,a=e.bandSize,s=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ie(s[t.dataKey])){var c=Gu(r,"value",s[t.dataKey]);if(c)return c.coordinate+a/2}return r[i]?r[i].coordinate+a/2:null}var d=Ut(s,Ie(o)?t.dataKey:o);return Ie(d)?null:t.scale(d)}var S3=function(t){var r=t.axis,a=t.ticks,s=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(r.type==="category")return a[c]?a[c].coordinate+s:null;var d=Ut(o,r.dataKey,r.domain[c]);return Ie(d)?null:r.scale(d)-i/2+s},zQ=function(t){var r=t.numericAxis,a=r.scale.domain();if(r.type==="number"){var s=Math.min(a[0],a[1]),i=Math.max(a[0],a[1]);return s<=0&&i>=0?0:i<0?i:s}return a[0]},WQ=function(t,r){var a,s=(a=t.type)!==null&&a!==void 0&&a.defaultProps?Nt(Nt({},t.type.defaultProps),t.props):t.props,i=s.stackId;if(zt(i)){var o=r[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},qQ=function(t){return t.reduce(function(r,a){return[Hf(a.concat([r[0]]).filter(de)),Wa(a.concat([r[1]]).filter(de))]},[1/0,-1/0])},fE=function(t,r,a){return Object.keys(t).reduce(function(s,i){var o=t[i],c=o.stackedData,d=c.reduce(function(u,h){var m=qQ(h.slice(r,a+1));return[Math.min(u[0],m[0]),Math.max(u[1],m[1])]},[1/0,-1/0]);return[Math.min(d[0],s[0]),Math.max(d[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},C3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,A3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Py=function(t,r,a){if(Oe(t))return t(r,a);if(!Array.isArray(t))return r;var s=[];if(de(t[0]))s[0]=a?t[0]:Math.min(t[0],r[0]);else if(C3.test(t[0])){var i=+C3.exec(t[0])[1];s[0]=r[0]-i}else Oe(t[0])?s[0]=t[0](r[0]):s[0]=r[0];if(de(t[1]))s[1]=a?t[1]:Math.max(t[1],r[1]);else if(A3.test(t[1])){var o=+A3.exec(t[1])[1];s[1]=r[1]+o}else Oe(t[1])?s[1]=t[1](r[1]):s[1]=r[1];return s},vh=function(t,r,a){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!a||s>0)return s}if(t&&r&&r.length>=2){for(var i=F1(r,function(m){return m.coordinate}),o=1/0,c=1,d=i.length;c<d;c++){var u=i[c],h=i[c-1];o=Math.min((u.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return a?void 0:0},k3=function(t,r,a){return!t||!t.length||_o(t,zn(a,"type.defaultProps.domain"))?r:t},mE=function(t,r){var a=t.type.defaultProps?Nt(Nt({},t.type.defaultProps),t.props):t.props,s=a.dataKey,i=a.name,o=a.unit,c=a.formatter,d=a.tooltipType,u=a.chartType,h=a.hide;return Nt(Nt({},Ce(t,!1)),{},{dataKey:s,unit:o,formatter:c,name:i||s,color:uj(t),value:Ut(r,s),type:d,payload:r,chartType:u,hide:h})};function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function P3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ca(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?P3(Object(r),!0).forEach(function(a){pE(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function pE(e,t,r){return t=VQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VQ(e){var t=HQ(e,"string");return mc(t)=="symbol"?t:t+""}function HQ(e,t){if(mc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(mc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GQ(e,t){return XQ(e)||ZQ(e,t)||YQ(e,t)||KQ()}function KQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 188In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YQ(e,t){if(e){if(typeof e=="string")return T3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T3(e,t)}}function T3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function ZQ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function XQ(e){if(Array.isArray(e))return e}var yh=Math.PI/180,JQ=function(t){return t*180/Math.PI},mt=function(t,r,a,s){return{x:t+Math.cos(-yh*s)*a,y:r+Math.sin(-yh*s)*a}},xE=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(r-(a.top||0)-(a.bottom||0)))/2},QQ=function(t,r,a,s,i){var o=t.width,c=t.height,d=t.startAngle,u=t.endAngle,h=jn(t.cx,o,o/2),m=jn(t.cy,c,c/2),p=xE(o,c,a),b=jn(t.innerRadius,p,0),w=jn(t.outerRadius,p,p*.8),x=Object.keys(r);return x.reduce(function(g,j){var S=r[j],_=S.domain,N=S.reversed,C;if(Ie(S.range))s==="angleAxis"?C=[d,u]:s==="radiusAxis"&&(C=[b,w]),N&&(C=[C[1],C[0]]);else{C=S.range;var A=C,P=GQ(A,2);d=P[0],u=P[1]}var O=dE(S,i),E=O.realScaleType,$=O.scale;$.domain(_).range(C),uE($);var M=hE($,ca(ca({},S),{},{realScaleType:E})),R=ca(ca(ca({},S),M),{},{range:C,radius:w,realScaleType:E,scale:$,cx:h,cy:m,innerRadius:b,outerRadius:w,startAngle:d,endAngle:u});return ca(ca({},g),{},pE({},j,R))},{})},eee=function(t,r){var a=t.x,s=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(a-i,2)+Math.pow(s-o,2))},tee=function(t,r){var a=t.x,s=t.y,i=r.cx,o=r.cy,c=eee({x:a,y:s},{x:i,y:o});if(c<=0)return{radius:c};var d=(a-i)/c,u=Math.acos(d);return s>o&&(u=2*Math.PI-u),{radius:c,angle:JQ(u),angleInRadian:u}},nee=function(t){var r=t.startAngle,a=t.endAngle,s=Math.floor(r/360),i=Math.floor(a/360),o=Math.min(s,i);return{startAngle:r-o*360,endAngle:a-o*360}},ree=function(t,r){var a=r.startAngle,s=r.endAngle,i=Math.floor(a/360),o=Math.floor(s/360),c=Math.min(i,o);return t+c*360},O3=function(t,r){var a=t.x,s=t.y,i=tee({x:a,y:s},r),o=i.radius,c=i.angle,d=r.innerRadius,u=r.outerRadius;if(o<d||o>u)return!1;if(o===0)return!0;var h=nee(r),m=h.startAngle,p=h.endAngle,b=c,w;if(m<=p){for(;b>p;)b-=360;for(;b<m;)b+=360;w=b>=m&&b<=p}else{for(;b>m;)b-=360;for(;b<p;)b+=360;w=b>=p&&b<=m}return w?ca(ca({},r),{},{radius:o,angle:ree(b,r)}):null},gE=function(t){return!y.isValidElement(t)&&!Oe(t)&&typeof t!="boolean"?t.className:""};function pc(e){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc(e)}var aee=["offset"];function see(e){return cee(e)||lee(e)||oee(e)||iee()}function iee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 189In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oee(e,t){if(e){if(typeof e=="string")return Ty(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ty(e,t)}}function lee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cee(e){if(Array.isArray(e))return Ty(e)}function Ty(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function dee(e,t){if(e==null)return{};var r=uee(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function uee(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function E3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ft(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E3(Object(r),!0).forEach(function(a){hee(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hee(e,t,r){return t=fee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fee(e){var t=mee(e,"string");return pc(t)=="symbol"?t:t+""}function mee(e,t){if(pc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(pc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xc(){return xc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},xc.apply(this,arguments)}var pee=function(t){var r=t.value,a=t.formatter,s=Ie(t.children)?r:t.children;return Oe(a)?a(s):s},xee=function(t,r){var a=yn(r-t),s=Math.min(Math.abs(r-t),360);return a*s},gee=function(t,r,a){var s=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,u=d.cx,h=d.cy,m=d.innerRadius,p=d.outerRadius,b=d.startAngle,w=d.endAngle,x=d.clockWise,g=(m+p)/2,j=xee(b,w),S=j>=0?1:-1,_,N;s==="insideStart"?(_=b+S*o,N=x):s==="insideEnd"?(_=w-S*o,N=!x):s==="end"&&(_=w+S*o,N=x),N=j<=0?N:!N;var C=mt(u,h,g,_),A=mt(u,h,g,_+(N?1:-1)*359),P="M".concat(C.x,",").concat(C.y,` 190 A`).concat(g,",").concat(g,",0,1,").concat(N?0:1,`, 191 `).concat(A.x,",").concat(A.y),O=Ie(t.id)?el("recharts-radial-line-"):t.id;return q.createElement("text",xc({},a,{dominantBaseline:"central",className:$e("recharts-radial-bar-label",c)}),q.createElement("defs",null,q.createElement("path",{id:O,d:P})),q.createElement("textPath",{xlinkHref:"#".concat(O)},r))},bee=function(t){var r=t.viewBox,a=t.offset,s=t.position,i=r,o=i.cx,c=i.cy,d=i.innerRadius,u=i.outerRadius,h=i.startAngle,m=i.endAngle,p=(h+m)/2;if(s==="outside"){var b=mt(o,c,u+a,p),w=b.x,x=b.y;return{x:w,y:x,textAnchor:w>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var g=(d+u)/2,j=mt(o,c,g,p),S=j.x,_=j.y;return{x:S,y:_,textAnchor:"middle",verticalAnchor:"middle"}},vee=function(t){var r=t.viewBox,a=t.parentViewBox,s=t.offset,i=t.position,o=r,c=o.x,d=o.y,u=o.width,h=o.height,m=h>=0?1:-1,p=m*s,b=m>0?"end":"start",w=m>0?"start":"end",x=u>=0?1:-1,g=x*s,j=x>0?"end":"start",S=x>0?"start":"end";if(i==="top"){var _={x:c+u/2,y:d-m*s,textAnchor:"middle",verticalAnchor:b};return Ft(Ft({},_),a?{height:Math.max(d-a.y,0),width:u}:{})}if(i==="bottom"){var N={x:c+u/2,y:d+h+p,textAnchor:"middle",verticalAnchor:w};return Ft(Ft({},N),a?{height:Math.max(a.y+a.height-(d+h),0),width:u}:{})}if(i==="left"){var C={x:c-g,y:d+h/2,textAnchor:j,verticalAnchor:"middle"};return Ft(Ft({},C),a?{width:Math.max(C.x-a.x,0),height:h}:{})}if(i==="right"){var A={x:c+u+g,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Ft(Ft({},A),a?{width:Math.max(a.x+a.width-A.x,0),height:h}:{})}var P=a?{width:u,height:h}:{};return i==="insideLeft"?Ft({x:c+g,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},P):i==="insideRight"?Ft({x:c+u-g,y:d+h/2,textAnchor:j,verticalAnchor:"middle"},P):i==="insideTop"?Ft({x:c+u/2,y:d+p,textAnchor:"middle",verticalAnchor:w},P):i==="insideBottom"?Ft({x:c+u/2,y:d+h-p,textAnchor:"middle",verticalAnchor:b},P):i==="insideTopLeft"?Ft({x:c+g,y:d+p,textAnchor:S,verticalAnchor:w},P):i==="insideTopRight"?Ft({x:c+u-g,y:d+p,textAnchor:j,verticalAnchor:w},P):i==="insideBottomLeft"?Ft({x:c+g,y:d+h-p,textAnchor:S,verticalAnchor:b},P):i==="insideBottomRight"?Ft({x:c+u-g,y:d+h-p,textAnchor:j,verticalAnchor:b},P):Jo(i)&&(de(i.x)||$s(i.x))&&(de(i.y)||$s(i.y))?Ft({x:c+jn(i.x,u),y:d+jn(i.y,h),textAnchor:"end",verticalAnchor:"end"},P):Ft({x:c+u/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},P)},yee=function(t){return"cx"in t&&de(t.cx)};function Jt(e){var t=e.offset,r=t===void 0?5:t,a=dee(e,aee),s=Ft({offset:r},a),i=s.viewBox,o=s.position,c=s.value,d=s.children,u=s.content,h=s.className,m=h===void 0?"":h,p=s.textBreakAll;if(!i||Ie(c)&&Ie(d)&&!y.isValidElement(u)&&!Oe(u))return null;if(y.isValidElement(u))return y.cloneElement(u,s);var b;if(Oe(u)){if(b=y.createElement(u,s),y.isValidElement(b))return b}else b=pee(s);var w=yee(i),x=Ce(s,!0);if(w&&(o==="insideStart"||o==="insideEnd"||o==="end"))return gee(s,b,x);var g=w?bee(s):vee(s);return q.createElement(ei,xc({className:$e("recharts-label",m)},x,g,{breakAll:p}),b)}Jt.displayName="Label";var bE=function(t){var r=t.cx,a=t.cy,s=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,u=t.innerRadius,h=t.outerRadius,m=t.x,p=t.y,b=t.top,w=t.left,x=t.width,g=t.height,j=t.clockWise,S=t.labelViewBox;if(S)return S;if(de(x)&&de(g)){if(de(m)&&de(p))return{x:m,y:p,width:x,height:g};if(de(b)&&de(w))return{x:b,y:w,width:x,height:g}}return de(m)&&de(p)?{x:m,y:p,width:0,height:0}:de(r)&&de(a)?{cx:r,cy:a,startAngle:i||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:h||d||c||0,clockWise:j}:t.viewBox?t.viewBox:{}},jee=function(t,r){return t?t===!0?q.createElement(Jt,{key:"label-implicit",viewBox:r}):zt(t)?q.createElement(Jt,{key:"label-implicit",viewBox:r,value:t}):y.isValidElement(t)?t.type===Jt?y.cloneElement(t,{key:"label-implicit",viewBox:r}):q.createElement(Jt,{key:"label-implicit",content:t,viewBox:r}):Oe(t)?q.createElement(Jt,{key:"label-implicit",content:t,viewBox:r}):Jo(t)?q.createElement(Jt,xc({viewBox:r},t,{key:"label-implicit"})):null:null},wee=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&a&&!t.label)return null;var s=t.children,i=bE(t),o=nr(s,Jt).map(function(d,u){return y.cloneElement(d,{viewBox:r||i,key:"label-".concat(u)})});if(!a)return o;var c=jee(t.label,r||i);return[c].concat(see(o))};Jt.parseViewBox=bE;Jt.renderCallByParent=wee;var Wb,M3;function Nee(){if(M3)return Wb;M3=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Wb=e,Wb}var _ee=Nee();const See=it(_ee);function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}var Cee=["valueAccessor"],Aee=["data","dataKey","clockWise","id","textBreakAll"];function kee(e){return Eee(e)||Oee(e)||Tee(e)||Pee()}function Pee(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 192In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tee(e,t){if(e){if(typeof e=="string")return Oy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oy(e,t)}}function Oee(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Eee(e){if(Array.isArray(e))return Oy(e)}function Oy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function jh(){return jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},jh.apply(this,arguments)}function L3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function I3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L3(Object(r),!0).forEach(function(a){Mee(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Mee(e,t,r){return t=Lee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lee(e){var t=Iee(e,"string");return gc(t)=="symbol"?t:t+""}function Iee(e,t){if(gc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(gc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R3(e,t){if(e==null)return{};var r=Ree(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Ree(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}var Dee=function(t){return Array.isArray(t.value)?See(t.value):t.value};function ya(e){var t=e.valueAccessor,r=t===void 0?Dee:t,a=R3(e,Cee),s=a.data,i=a.dataKey,o=a.clockWise,c=a.id,d=a.textBreakAll,u=R3(a,Aee);return!s||!s.length?null:q.createElement(He,{className:"recharts-label-list"},s.map(function(h,m){var p=Ie(i)?r(h,m):Ut(h&&h.payload,i),b=Ie(c)?{}:{id:"".concat(c,"-").concat(m)};return q.createElement(Jt,jh({},Ce(h,!0),u,b,{parentViewBox:h.parentViewBox,value:p,textBreakAll:d,viewBox:Jt.parseViewBox(Ie(o)?h:I3(I3({},h),{},{clockWise:o})),key:"label-".concat(m),index:m}))}))}ya.displayName="LabelList";function $ee(e,t){return e?e===!0?q.createElement(ya,{key:"labelList-implicit",data:t}):q.isValidElement(e)||Oe(e)?q.createElement(ya,{key:"labelList-implicit",data:t,content:e}):Jo(e)?q.createElement(ya,jh({data:t},e,{key:"labelList-implicit"})):null:null}function Fee(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var a=e.children,s=nr(a,ya).map(function(o,c){return y.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!r)return s;var i=$ee(e.label,t);return[i].concat(kee(s))}ya.renderCallByParent=Fee;function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function Ey(){return Ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ey.apply(this,arguments)}function D3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function $3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D3(Object(r),!0).forEach(function(a){Bee(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Bee(e,t,r){return t=Uee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uee(e){var t=zee(e,"string");return bc(t)=="symbol"?t:t+""}function zee(e,t){if(bc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(bc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wee=function(t,r){var a=yn(r-t),s=Math.min(Math.abs(r-t),359.999);return a*s},Xd=function(t){var r=t.cx,a=t.cy,s=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,u=t.cornerIsExternal,h=d*(c?1:-1)+s,m=Math.asin(d/h)/yh,p=u?i:i+o*m,b=mt(r,a,h,p),w=mt(r,a,s,p),x=u?i-o*m:i,g=mt(r,a,h*Math.cos(m*yh),x);return{center:b,circleTangency:w,lineTangency:g,theta:m}},vE=function(t){var r=t.cx,a=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=Wee(o,c),u=o+d,h=mt(r,a,i,o),m=mt(r,a,i,u),p="M ".concat(h.x,",").concat(h.y,` 193 A `).concat(i,",").concat(i,`,0, 194 `).concat(+(Math.abs(d)>180),",").concat(+(o>u),`, 195 `).concat(m.x,",").concat(m.y,` 196 `);if(s>0){var b=mt(r,a,s,o),w=mt(r,a,s,u);p+="L ".concat(w.x,",").concat(w.y,` 197 A `).concat(s,",").concat(s,`,0, 198 `).concat(+(Math.abs(d)>180),",").concat(+(o<=u),`, 199 `).concat(b.x,",").concat(b.y," Z")}else p+="L ".concat(r,",").concat(a," Z");return p},qee=function(t){var r=t.cx,a=t.cy,s=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,u=t.startAngle,h=t.endAngle,m=yn(h-u),p=Xd({cx:r,cy:a,radius:i,angle:u,sign:m,cornerRadius:o,cornerIsExternal:d}),b=p.circleTangency,w=p.lineTangency,x=p.theta,g=Xd({cx:r,cy:a,radius:i,angle:h,sign:-m,cornerRadius:o,cornerIsExternal:d}),j=g.circleTangency,S=g.lineTangency,_=g.theta,N=d?Math.abs(u-h):Math.abs(u-h)-x-_;if(N<0)return c?"M ".concat(w.x,",").concat(w.y,` 200 a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 201 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 202 `):vE({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:u,endAngle:h});var C="M ".concat(w.x,",").concat(w.y,` 203 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(b.x,",").concat(b.y,` 204 A`).concat(i,",").concat(i,",0,").concat(+(N>180),",").concat(+(m<0),",").concat(j.x,",").concat(j.y,` 205 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(S.x,",").concat(S.y,` 206 `);if(s>0){var A=Xd({cx:r,cy:a,radius:s,angle:u,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),P=A.circleTangency,O=A.lineTangency,E=A.theta,$=Xd({cx:r,cy:a,radius:s,angle:h,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),M=$.circleTangency,R=$.lineTangency,B=$.theta,D=d?Math.abs(u-h):Math.abs(u-h)-E-B;if(D<0&&o===0)return"".concat(C,"L").concat(r,",").concat(a,"Z");C+="L".concat(R.x,",").concat(R.y,` 207 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(M.x,",").concat(M.y,` 208 A`).concat(s,",").concat(s,",0,").concat(+(D>180),",").concat(+(m>0),",").concat(P.x,",").concat(P.y,` 209 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(O.x,",").concat(O.y,"Z")}else C+="L".concat(r,",").concat(a,"Z");return C},Vee={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yE=function(t){var r=$3($3({},Vee),t),a=r.cx,s=r.cy,i=r.innerRadius,o=r.outerRadius,c=r.cornerRadius,d=r.forceCornerRadius,u=r.cornerIsExternal,h=r.startAngle,m=r.endAngle,p=r.className;if(o<i||h===m)return null;var b=$e("recharts-sector",p),w=o-i,x=jn(c,w,0,!0),g;return x>0&&Math.abs(h-m)<360?g=qee({cx:a,cy:s,innerRadius:i,outerRadius:o,cornerRadius:Math.min(x,w/2),forceCornerRadius:d,cornerIsExternal:u,startAngle:h,endAngle:m}):g=vE({cx:a,cy:s,innerRadius:i,outerRadius:o,startAngle:h,endAngle:m}),q.createElement("path",Ey({},Ce(r,!0),{className:b,d:g,role:"img"}))};function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},My.apply(this,arguments)}function F3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function B3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?F3(Object(r),!0).forEach(function(a){Hee(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Hee(e,t,r){return t=Gee(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gee(e){var t=Kee(e,"string");return vc(t)=="symbol"?t:t+""}function Kee(e,t){if(vc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(vc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var U3={curveBasisClosed:fH,curveBasisOpen:mH,curveBasis:hH,curveBumpX:JV,curveBumpY:QV,curveLinearClosed:pH,curveLinear:Mf,curveMonotoneX:xH,curveMonotoneY:gH,curveNatural:bH,curveStep:vH,curveStepAfter:jH,curveStepBefore:yH},Jd=function(t){return t.x===+t.x&&t.y===+t.y},kl=function(t){return t.x},Pl=function(t){return t.y},Yee=function(t,r){if(Oe(t))return t;var a="curve".concat(Of(t));return(a==="curveMonotone"||a==="curveBump")&&r?U3["".concat(a).concat(r==="vertical"?"Y":"X")]:U3[a]||Mf},Zee=function(t){var r=t.type,a=r===void 0?"linear":r,s=t.points,i=s===void 0?[]:s,o=t.baseLine,c=t.layout,d=t.connectNulls,u=d===void 0?!1:d,h=Yee(a,c),m=u?i.filter(function(x){return Jd(x)}):i,p;if(Array.isArray(o)){var b=u?o.filter(function(x){return Jd(x)}):o,w=m.map(function(x,g){return B3(B3({},x),{},{base:b[g]})});return c==="vertical"?p=Wd().y(Pl).x1(kl).x0(function(x){return x.base.x}):p=Wd().x(kl).y1(Pl).y0(function(x){return x.base.y}),p.defined(Jd).curve(h),p(w)}return c==="vertical"&&de(o)?p=Wd().y(Pl).x1(kl).x0(o):de(o)?p=Wd().x(kl).y1(Pl).y0(o):p=vT().x(kl).y(Pl),p.defined(Jd).curve(h),p(m)},fo=function(t){var r=t.className,a=t.points,s=t.path,i=t.pathRef;if((!a||!a.length)&&!s)return null;var o=a&&a.length?Zee(t):s;return y.createElement("path",My({},Ce(t,!1),Ku(t),{className:$e("recharts-curve",r),d:o,ref:i}))},qb={exports:{}},Vb,z3;function Xee(){if(z3)return Vb;z3=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Vb=e,Vb}var Hb,W3;function Jee(){if(W3)return Hb;W3=1;var e=Xee();function t(){}function r(){}return r.resetWarningCache=t,Hb=function(){function a(o,c,d,u,h,m){if(m!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}a.isRequired=a;function s(){return a}var i={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:s,element:a,elementType:a,instanceOf:s,node:a,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i},Hb}var q3;function Qee(){return q3||(q3=1,qb.exports=Jee()()),qb.exports}var ete=Qee();const rt=it(ete),{getOwnPropertyNames:tte,getOwnPropertySymbols:nte}=Object,{hasOwnProperty:rte}=Object.prototype;function Gb(e,t){return function(a,s,i){return e(a,s,i)&&t(a,s,i)}}function Qd(e){return function(r,a,s){if(!r||!a||typeof r!="object"||typeof a!="object")return e(r,a,s);const{cache:i}=s,o=i.get(r),c=i.get(a);if(o&&c)return o===a&&c===r;i.set(r,a),i.set(a,r);const d=e(r,a,s);return i.delete(r),i.delete(a),d}}function ate(e){return e?.[Symbol.toStringTag]}function V3(e){return tte(e).concat(nte(e))}const ste=Object.hasOwn||((e,t)=>rte.call(e,t));function Ni(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ite="__v",ote="__o",lte="_owner",{getOwnPropertyDescriptor:H3,keys:G3}=Object;function cte(e,t){return e.byteLength===t.byteLength&&wh(new Uint8Array(e),new Uint8Array(t))}function dte(e,t,r){let a=e.length;if(t.length!==a)return!1;for(;a-- >0;)if(!r.equals(e[a],t[a],a,a,e,t,r))return!1;return!0}function ute(e,t){return e.byteLength===t.byteLength&&wh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function hte(e,t){return Ni(e.getTime(),t.getTime())}function fte(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function mte(e,t){return e===t}function K3(e,t,r){const a=e.size;if(a!==t.size)return!1;if(!a)return!0;const s=new Array(a),i=e.entries();let o,c,d=0;for(;(o=i.next())&&!o.done;){const u=t.entries();let h=!1,m=0;for(;(c=u.next())&&!c.done;){if(s[m]){m++;continue}const p=o.value,b=c.value;if(r.equals(p[0],b[0],d,m,e,t,r)&&r.equals(p[1],b[1],p[0],b[0],e,t,r)){h=s[m]=!0;break}m++}if(!h)return!1;d++}return!0}const pte=Ni;function xte(e,t,r){const a=G3(e);let s=a.length;if(G3(t).length!==s)return!1;for(;s-- >0;)if(!jE(e,t,r,a[s]))return!1;return!0}function Tl(e,t,r){const a=V3(e);let s=a.length;if(V3(t).length!==s)return!1;let i,o,c;for(;s-- >0;)if(i=a[s],!jE(e,t,r,i)||(o=H3(e,i),c=H3(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function gte(e,t){return Ni(e.valueOf(),t.valueOf())}function bte(e,t){return e.source===t.source&&e.flags===t.flags}function Y3(e,t,r){const a=e.size;if(a!==t.size)return!1;if(!a)return!0;const s=new Array(a),i=e.values();let o,c;for(;(o=i.next())&&!o.done;){const d=t.values();let u=!1,h=0;for(;(c=d.next())&&!c.done;){if(!s[h]&&r.equals(o.value,c.value,o.value,c.value,e,t,r)){u=s[h]=!0;break}h++}if(!u)return!1}return!0}function wh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function vte(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function jE(e,t,r,a){return(a===lte||a===ote||a===ite)&&(e.$$typeof||t.$$typeof)?!0:ste(t,a)&&r.equals(e[a],t[a],a,a,e,t,r)}const yte="[object ArrayBuffer]",jte="[object Arguments]",wte="[object Boolean]",Nte="[object DataView]",_te="[object Date]",Ste="[object Error]",Cte="[object Map]",Ate="[object Number]",kte="[object Object]",Pte="[object RegExp]",Tte="[object Set]",Ote="[object String]",Ete={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array
209]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Mte="[object URL]",Lte=Object.prototype.toString;function Ite({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:a,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:u,areRegExpsEqual:h,areSetsEqual:m,areTypedArraysEqual:p,areUrlsEqual:b,unknownTagComparators:w}){return function(g,j,S){if(g===j)return!0;if(g==null||j==null)return!1;const _=typeof g;if(_!==typeof j)return!1;if(_!=="object")return _==="number"?c(g,j,S):_==="function"?i(g,j,S):!1;const N=g.constructor;if(N!==j.constructor)return!1;if(N===Object)return d(g,j,S);if(Array.isArray(g))return t(g,j,S);if(N===Date)return a(g,j,S);if(N===RegExp)return h(g,j,S);if(N===Map)return o(g,j,S);if(N===Set)return m(g,j,S);const C=Lte.call(g);if(C===_te)return a(g,j,S);if(C===Pte)return h(g,j,S);if(C===Cte)return o(g,j,S);if(C===Tte)return m(g,j,S);if(C===kte)return typeof g.then!="function"&&typeof j.then!="function"&&d(g,j,S);if(C===Mte)return b(g,j,S);if(C===Ste)return s(g,j,S);if(C===jte)return d(g,j,S);if(Ete[C])return p(g,j,S);if(C===yte)return e(g,j,S);if(C===Nte)return r(g,j,S);if(C===wte||C===Ate||C===Ote)return u(g,j,S);if(w){let A=w[C];if(!A){const P=ate(g);P&&(A=w[P])}if(A)return A(g,j,S)}return!1}}function Rte({circular:e,createCustomConfig:t,strict:r}){let a={areArrayBuffersEqual:cte,areArraysEqual:r?Tl:dte,areDataViewsEqual:ute,areDatesEqual:hte,areErrorsEqual:fte,areFunctionsEqual:mte,areMapsEqual:r?Gb(K3,Tl):K3,areNumbersEqual:pte,areObjectsEqual:r?Tl:xte,arePrimitiveWrappersEqual:gte,areRegExpsEqual:bte,areSetsEqual:r?Gb(Y3,Tl):Y3,areTypedArraysEqual:r?Gb(wh,Tl):wh,areUrlsEqual:vte,unknownTagComparators:void 0};if(t&&(a=Object.assign({},a,t(a))),e){const s=Qd(a.areArraysEqual),i=Qd(a.areMapsEqual),o=Qd(a.areObjectsEqual),c=Qd(a.areSetsEqual);a=Object.assign({},a,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return a}function Dte(e){return function(t,r,a,s,i,o,c){return e(t,r,c)}}function $te({circular:e,comparator:t,createState:r,equals:a,strict:s}){if(r)return function(c,d){const{cache:u=e?new WeakMap:void 0,meta:h}=r();return t(c,d,{cache:u,equals:a,meta:h,strict:s})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:a,meta:void 0,strict:s})};const i={cache:void 0,equals:a,meta:void 0,strict:s};return function(c,d){return t(c,d,i)}}const Fte=us();us({strict:!0});us({circular:!0});us({circular:!0,strict:!0});us({createInternalComparator:()=>Ni});us({strict:!0,createInternalComparator:()=>Ni});us({circular:!0,createInternalComparator:()=>Ni});us({circular:!0,createInternalComparator:()=>Ni,strict:!0});function us(e={}){const{circular:t=!1,createInternalComparator:r,createState:a,strict:s=!1}=e,i=Rte(e),o=Ite(i),c=r?r(o):Dte(o);return $te({circular:t,comparator:o,createState:a,equals:c,strict:s})}function Bte(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Z3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,a=function s(i){r<0&&(r=i),i-r>t?(e(i),r=-1):Bte(s)};requestAnimationFrame(a)}function Ly(e){"@babel/helpers - typeof";return Ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ly(e)}function Ute(e){return Vte(e)||qte(e)||Wte(e)||zte()}function zte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 210In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wte(e,t){if(e){if(typeof e=="string")return X3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X3(e,t)}}function X3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function qte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vte(e){if(Array.isArray(e))return e}function Hte(){var e={},t=function(){return null},r=!1,a=function s(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Ute(o),d=c[0],u=c.slice(1);if(typeof d=="number"){Z3(s.bind(null,u),d);return}s(d),Z3(s.bind(null,u));return}Ly(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,a(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function J3(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Q3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 58,775 bytes, lines 210-228
210t%2?J3(Object(r),!0).forEach(function(a){wE(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J3(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function wE(e,t,r){return t=Gte(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gte(e){var t=Kte(e,"string");return yc(t)==="symbol"?t:String(t)}function Kte(e,t){if(yc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(yc(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yte=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(a,s){return a.filter(function(i){return s.includes(i)})})},Zte=function(t){return t},Xte=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},zl=function(t,r){return Object.keys(r).reduce(function(a,s){return Q3(Q3({},a),{},wE({},s,t(s,r[s])))},{})},e5=function(t,r,a){return t.map(function(s){return"".concat(Xte(s)," ").concat(r,"ms ").concat(a)}).join(",")};function Jte(e,t){return tne(e)||ene(e,t)||NE(e,t)||Qte()}function Qte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 211In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ene(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function tne(e){if(Array.isArray(e))return e}function nne(e){return sne(e)||ane(e)||NE(e)||rne()}function rne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 212In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NE(e,t){if(e){if(typeof e=="string")return Iy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Iy(e,t)}}function ane(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sne(e){if(Array.isArray(e))return Iy(e)}function Iy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var Nh=1e-4,_E=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},SE=function(t,r){return t.map(function(a,s){return a*Math.pow(r,s)}).reduce(function(a,s){return a+s})},t5=function(t,r){return function(a){var s=_E(t,r);return SE(s,a)}},ine=function(t,r){return function(a){var s=_E(t,r),i=[].concat(nne(s.map(function(o,c){return o*c}).slice(1)),[0]);return SE(i,a)}},n5=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var s=r[0],i=r[1],o=r[2],c=r[3];if(r.length===1)switch(r[0]){case"linear":s=0,i=0,o=1,c=1;break;case"ease":s=.25,i=.1,o=.25,c=1;break;case"ease-in":s=.42,i=0,o=1,c=1;break;case"ease-out":s=.42,i=0,o=.58,c=1;break;case"ease-in-out":s=0,i=0,o=.58,c=1;break;default:{var d=r[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var u=d[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),h=Jte(u,4);s=h[0],i=h[1],o=h[2],c=h[3]}}}var m=t5(s,o),p=t5(i,c),b=ine(s,o),w=function(j){return j>1?1:j<0?0:j},x=function(j){for(var S=j>1?1:j,_=S,N=0;N<8;++N){var C=m(_)-S,A=b(_);if(Math.abs(C-S)<Nh||A<Nh)return p(_);_=w(_-C/A)}return p(_)};return x.isStepper=!1,x},one=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,a=r===void 0?100:r,s=t.damping,i=s===void 0?8:s,o=t.dt,c=o===void 0?17:o,d=function(h,m,p){var b=-(h-m)*a,w=p*i,x=p+(b-w)*c/1e3,g=p*c/1e3+h;return Math.abs(g-m)<Nh&&Math.abs(x)<Nh?[m,0]:[g,x]};return d.isStepper=!0,d.dt=c,d},lne=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var s=r[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return n5(s);case"spring":return one();default:if(s.split("(")[0]==="cubic-bezier")return n5(s)}return typeof s=="function"?s:null};function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function r5(e){return une(e)||dne(e)||CE(e)||cne()}function cne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 213In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function une(e){if(Array.isArray(e))return Dy(e)}function a5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function sn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a5(Object(r),!0).forEach(function(a){Ry(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ry(e,t,r){return t=hne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hne(e){var t=fne(e,"string");return jc(t)==="symbol"?t:String(t)}function fne(e,t){if(jc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(jc(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mne(e,t){return gne(e)||xne(e,t)||CE(e,t)||pne()}function pne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 214In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CE(e,t){if(e){if(typeof e=="string")return Dy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dy(e,t)}}function Dy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function xne(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function gne(e){if(Array.isArray(e))return e}var _h=function(t,r,a){return t+(r-t)*a},$y=function(t){var r=t.from,a=t.to;return r!==a},bne=function e(t,r,a){var s=zl(function(i,o){if($y(o)){var c=t(o.from,o.to,o.velocity),d=mne(c,2),u=d[0],h=d[1];return sn(sn({},o),{},{from:u,velocity:h})}return o},r);return a<1?zl(function(i,o){return $y(o)?sn(sn({},o),{},{velocity:_h(o.velocity,s[i].velocity,a),from:_h(o.from,s[i].from,a)}):o},r):e(t,s,a-1)};const vne=(function(e,t,r,a,s){var i=Yte(e,t),o=i.reduce(function(g,j){return sn(sn({},g),{},Ry({},j,[e[j],t[j]]))},{}),c=i.reduce(function(g,j){return sn(sn({},g),{},Ry({},j,{from:e[j],velocity:0,to:t[j]}))},{}),d=-1,u,h,m=function(){return null},p=function(){return zl(function(j,S){return S.from},c)},b=function(){return!Object.values(c).filter($y).length},w=function(j){u||(u=j);var S=j-u,_=S/r.dt;c=bne(r,c,_),s(sn(sn(sn({},e),t),p())),u=j,b()||(d=requestAnimationFrame(m))},x=function(j){h||(h=j);var S=(j-h)/a,_=zl(function(C,A){return _h.apply(void 0,r5(A).concat([r(S)]))},o);if(s(sn(sn(sn({},e),t),_)),S<1)d=requestAnimationFrame(m);else{var N=zl(function(C,A){return _h.apply(void 0,r5(A).concat([r(1)]))},o);s(sn(sn(sn({},e),t),N))}};return m=r.isStepper?w:x,function(){return requestAnimationFrame(m),function(){cancelAnimationFrame(d)}}});function Co(e){"@babel/helpers - typeof";return Co=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Co(e)}var yne=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function jne(e,t){if(e==null)return{};var r=wne(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function wne(e,t){if(e==null)return{};var r={},a=Object.keys(e),s,i;for(i=0;i<a.length;i++)s=a[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function Kb(e){return Cne(e)||Sne(e)||_ne(e)||Nne()}function Nne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 215In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ne(e,t){if(e){if(typeof e=="string")return Fy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fy(e,t)}}function Sne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cne(e){if(Array.isArray(e))return Fy(e)}function Fy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function s5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function vr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s5(Object(r),!0).forEach(function(a){$l(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function $l(e,t,r){return t=AE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ane(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kne(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,AE(a.key),a)}}function Pne(e,t,r){return t&&kne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function AE(e){var t=Tne(e,"string");return Co(t)==="symbol"?t:String(t)}function Tne(e,t){if(Co(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Co(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function One(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&By(e,t)}function By(e,t){return By=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},By(e,t)}function Ene(e){var t=Mne();return function(){var a=Sh(e),s;if(t){var i=Sh(this).constructor;s=Reflect.construct(a,arguments,i)}else s=a.apply(this,arguments);return Uy(this,s)}}function Uy(e,t){if(t&&(Co(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zy(e)}function zy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mne(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sh(e)}var Kr=(function(e){One(r,e);var t=Ene(r);function r(a,s){var i;Ane(this,r),i=t.call(this,a,s);var o=i.props,c=o.isActive,d=o.attributeName,u=o.from,h=o.to,m=o.steps,p=o.children,b=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(zy(i)),i.changeStyle=i.changeStyle.bind(zy(i)),!c||b<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:h}),Uy(i);if(m&&m.length)i.state={style:m[0].style};else if(u){if(typeof p=="function")return i.state={style:u},Uy(i);i.state={style:d?$l({},d,u):u}}else i.state={style:{}};return i}return Pne(r,[{key:"componentDidMount",value:function(){var s=this.props,i=s.isActive,o=s.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,u=i.shouldReAnimate,h=i.to,m=i.from,p=this.state.style;if(c){if(!o){var b={style:d?$l({},d,h):h};this.state&&p&&(d&&p[d]!==h||!d&&p!==h)&&this.setState(b);return}if(!(Fte(s.to,h)&&s.canBegin&&s.isActive)){var w=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var x=w||u?m:s.to;if(this.state&&p){var g={style:d?$l({},d,x):x};(d&&p[d]!==x||!d&&p!==x)&&this.setState(g)}this.runAnimation(vr(vr({},this.props),{},{from:x,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var i=this,o=s.from,c=s.to,d=s.duration,u=s.easing,h=s.begin,m=s.onAnimationEnd,p=s.onAnimationStart,b=vne(o,c,lne(u),d,this.changeStyle),w=function(){i.stopJSAnimation=b()};this.manager.start([p,h,w,d,m])}},{key:"runStepAnimation",value:function(s){var i=this,o=s.steps,c=s.begin,d=s.onAnimationStart,u=o[0],h=u.style,m=u.duration,p=m===void 0?0:m,b=function(x,g,j){if(j===0)return x;var S=g.duration,_=g.easing,N=_===void 0?"ease":_,C=g.style,A=g.properties,P=g.onAnimationEnd,O=j>0?o[j-1]:g,E=A||Object.keys(C);if(typeof N=="function"||N==="spring")return[].concat(Kb(x),[i.runJSAnimation.bind(i,{from:O.style,to:C,duration:S,easing:N}),S]);var $=e5(E,S,N),M=vr(vr(vr({},O.style),C),{},{transition:$});return[].concat(Kb(x),[M,S,P]).filter(Zte)};return this.manager.start([d].concat(Kb(o.reduce(b,[h,Math.max(p,c)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=Hte());var i=s.begin,o=s.duration,c=s.attributeName,d=s.to,u=s.easing,h=s.onAnimationStart,m=s.onAnimationEnd,p=s.steps,b=s.children,w=this.manager;if(this.unSubscribe=w.subscribe(this.handleStyleChange),typeof u=="function"||typeof b=="function"||u==="spring"){this.runJSAnimation(s);return}if(p.length>1){this.runStepAnimation(s);return}var x=c?$l({},c,d):d,g=e5(Object.keys(x),o,u);w.start([h,i,vr(vr({},x),{},{transition:g}),o,m])}},{key:"render",value:function(){var s=this.props,i=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var c=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var d=jne(s,yne),u=y.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||u===0||o<=0)return i;var m=function(b){var w=b.props,x=w.style,g=x===void 0?{}:x,j=w.className,S=y.cloneElement(b,vr(vr({},d),{},{style:vr(vr({},g),h),className:j}));return S};return u===1?m(y.Children.only(i)):q.createElement("div",null,y.Children.map(i,function(p){return m(p)}))}}]),r})(y.PureComponent);Kr.displayName="Animate";Kr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Kr.propTypes={from:rt.oneOfType([rt.object,rt.string]),to:rt.oneOfType([rt.object,rt.string]),attributeName:rt.string,duration:rt.number,begin:rt.number,easing:rt.oneOfType([rt.string,rt.func]),steps:rt.arrayOf(rt.shape({duration:rt.number.isRequired,style:rt.object.isRequired,easing:rt.oneOfType([rt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),rt.func]),properties:rt.arrayOf("string"),onAnimationEnd:rt.func})),children:rt.oneOfType([rt.node,rt.func]),isActive:rt.bool,canBegin:rt.bool,onAnimationEnd:rt.func,shouldReAnimate:rt.bool,onAnimationStart:rt.func,onAnimationReStart:rt.func};function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ch.apply(this,arguments)}function Lne(e,t){return $ne(e)||Dne(e,t)||Rne(e,t)||Ine()}function Ine(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 216In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rne(e,t){if(e){if(typeof e=="string")return i5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i5(e,t)}}function i5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function Dne(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function $ne(e){if(Array.isArray(e))return e}function o5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function l5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(r),!0).forEach(function(a){Fne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Fne(e,t,r){return t=Bne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bne(e){var t=Une(e,"string");return wc(t)=="symbol"?t:t+""}function Une(e,t){if(wc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(wc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c5=function(t,r,a,s,i){var o=Math.min(Math.abs(a)/2,Math.abs(s)/2),c=s>=0?1:-1,d=a>=0?1:-1,u=s>=0&&a>=0||s<0&&a<0?1:0,h;if(o>0&&i instanceof Array){for(var m=[0,0,0,0],p=0,b=4;p<b;p++)m[p]=i[p]>o?o:i[p];h="M".concat(t,",").concat(r+c*m[0]),m[0]>0&&(h+="A ".concat(m[0],",").concat(m[0],",0,0,").concat(u,",").concat(t+d*m[0],",").concat(r)),h+="L ".concat(t+a-d*m[1],",").concat(r),m[1]>0&&(h+="A ".concat(m[1],",").concat(m[1],",0,0,").concat(u,`, 217 `).concat(t+a,",").concat(r+c*m[1])),h+="L ".concat(t+a,",").concat(r+s-c*m[2]),m[2]>0&&(h+="A ".concat(m[2],",").concat(m[2],",0,0,").concat(u,`, 218 `).concat(t+a-d*m[2],",").concat(r+s)),h+="L ".concat(t+d*m[3],",").concat(r+s),m[3]>0&&(h+="A ".concat(m[3],",").concat(m[3],",0,0,").concat(u,`, 219 `).concat(t,",").concat(r+s-c*m[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var w=Math.min(o,i);h="M ".concat(t,",").concat(r+c*w,` 220 A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+d*w,",").concat(r,` 221 L `).concat(t+a-d*w,",").concat(r,` 222 A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+a,",").concat(r+c*w,` 223 L `).concat(t+a,",").concat(r+s-c*w,` 224 A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+a-d*w,",").concat(r+s,` 225 L `).concat(t+d*w,",").concat(r+s,` 226 A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t,",").concat(r+s-c*w," Z")}else h="M ".concat(t,",").concat(r," h ").concat(a," v ").concat(s," h ").concat(-a," Z");return h},zne=function(t,r){if(!t||!r)return!1;var a=t.x,s=t.y,i=r.x,o=r.y,c=r.width,d=r.height;if(Math.abs(c)>0&&Math.abs(d)>0){var u=Math.min(i,i+c),h=Math.max(i,i+c),m=Math.min(o,o+d),p=Math.max(o,o+d);return a>=u&&a<=h&&s>=m&&s<=p}return!1},Wne={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hj=function(t){var r=l5(l5({},Wne),t),a=y.useRef(),s=y.useState(-1),i=Lne(s,2),o=i[0],c=i[1];y.useEffect(function(){if(a.current&&a.current.getTotalLength)try{var N=a.current.getTotalLength();N&&c(N)}catch{}},[]);var d=r.x,u=r.y,h=r.width,m=r.height,p=r.radius,b=r.className,w=r.animationEasing,x=r.animationDuration,g=r.animationBegin,j=r.isAnimationActive,S=r.isUpdateAnimationActive;if(d!==+d||u!==+u||h!==+h||m!==+m||h===0||m===0)return null;var _=$e("recharts-rectangle",b);return S?q.createElement(Kr,{canBegin:o>0,from:{width:h,height:m,x:d,y:u},to:{width:h,height:m,x:d,y:u},duration:x,animationEasing:w,isActive:S},function(N){var C=N.width,A=N.height,P=N.x,O=N.y;return q.createElement(Kr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:x,isActive:j,easing:w},q.createElement("path",Ch({},Ce(r,!0),{className:_,d:c5(P,O,C,A,p),ref:a})))}):q.createElement("path",Ch({},Ce(r,!0),{className:_,d:c5(d,u,h,m,p)}))},qne=["points","className","baseLinePoints","connectNulls"];function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},qi.apply(this,arguments)}function Vne(e,t){if(e==null)return{};var r=Hne(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Hne(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function d5(e){return Zne(e)||Yne(e)||Kne(e)||Gne()}function Gne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 227In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kne(e,t){if(e){if(typeof e=="string")return Wy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wy(e,t)}}function Yne(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Zne(e){if(Array.isArray(e))return Wy(e)}function Wy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var u5=function(t){return t&&t.x===+t.x&&t.y===+t.y},Xne=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(a){u5(a)?r[r.length-1].push(a):r[r.length-1].length>0&&r.push([])}),u5(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Wl=function(t,r){var a=Xne(t);r&&(a=[a.reduce(function(i,o){return[].concat(d5(i),d5(o))},[])]);var s=a.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return a.length===1?"".concat(s,"Z"):s},Jne=function(t,r,a){var s=Wl(t,a);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(Wl(r.reverse(),a).slice(1))},Qne=function(t){var r=t.points,a=t.className,s=t.baseLinePoints,i=t.connectNulls,o=Vne(t,qne);if(!r||!r.length)return null;var c=$e("recharts-polygon",a);if(s&&s.length){var d=o.stroke&&o.stroke!=="none",u=Jne(r,s,i);return q.createElement("g",{className:c},q.createElement("path",qi({},Ce(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),d?q.createElement("path",qi({},Ce(o,!0),{fill:"none",d:Wl(r,i)})):null,d?q.createElement("path",qi({},Ce(o,!0),{fill:"none",d:Wl(s,i)})):null)}var h=Wl(r,i);return q.createElement("path",qi({},Ce(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function qy(){return qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},qy.apply(this,arguments)}var Zf=function(t){var r=t.cx,a=t.cy,s=t.r,i=t.className,o=$e("recharts-dot",i);return r===+r&&a===+a&&s===+s?y.createElement("circle",qy({},Ce(t,!1),Ku(t),{className:o,cx:r,cy:a,r:s})):null};function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}var ere=["x","y","top","left","width","height","className"];function Vy(){return Vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Vy.apply(this,arguments)}function h5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function tre(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h5(Object(r),!0).forEach(function(a){nre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function nre(e,t,r){return t=rre(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rre(e){var t=are(e,"string");return Nc(t)=="symbol"?t:t+""}function are(e,t){if(Nc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Nc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sre(e,t){if(e==null)return{};var r=ire(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function ire(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}var ore=function(t,r,a,s,i,o){return"M".concat(t,",").concat(i,"v").concat(s,"M").concat(o,",").concat(r,"h").concat(a)},lre=function(t){var r=t.x,a=r===void 0?0:r,s=t.y,i=s===void 0?0:s,o=t.top,c=o===void 0?0:o,d=t.left,u=d===void 0?0:d,h=t.width,m=h===void 0?0:h,p=t.height,b=p===void 0?0:p,w=t.className,x=sre(t,ere),g=tre({x:a,y:i,top:c,left:u,width:m,height:b},x);return!de(a)||!de(i)||!de(m)||!de(b)||!de(c)||!de(u)?null:q.createElement("path",Vy({},Ce(g,!0),{className:$e("recharts-cross",w),d:ore(a,i,m,b,c,u)}))},Yb,f5;function cre(){if(f5)return Yb;f5=1;var e=Vf(),t=zO(),r=ta();function a(s,i){return s&&s.length?e(s,r(i,2),t):void 0}return Yb=a,Yb}var dre=cre();const ure=it(dre);var Zb,m5;function hre(){if(m5)return Zb;m5=1;var e=Vf(),t=ta(),r=WO();function a(s,i){return s&&s.length?e(s,t(i,2),r):void 0}return Zb=a,Zb}var fre=hre();const mre=it(fre);var pre=["cx","cy","angle","ticks","axisLine"],xre=["ticks","tick","angle","tickFormatter","stroke"];function Ao(e){"@babel/helpers - typeof";return Ao=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(e)}function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ql.apply(this,arguments)}function p5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ys(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(r),!0).forEach(function(a){Xf(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function x5(e,t){if(e==null)return{};var r=gre(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function gre(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function bre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g5(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,PE(a.key),a)}}function vre(e,t,r){return t&&g5(e.prototype,t),r&&g5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function yre(e,t,r){return t=Ah(t),jre(e,kE()?Reflect.construct(t,r||[],Ah(e).constructor):t.apply(e,r))}function jre(e,t){if(t&&(Ao(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wre(e)}function wre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kE=function(){return!!e})()}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ah(e)}function Nre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hy(e,t)}function Hy(e,t){return Hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Hy(e,t)}function Xf(e,t,r){return t=PE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PE(e){var t=_re(e,"string");return Ao(t)=="symbol"?t:t+""}function _re(e,t){if(Ao(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Ao(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jf=(function(e){function t(){return bre(this,t),yre(this,t,arguments)}return Nre(t,e),vre(t,[{key:"getTickValueCoord",value:function(a){var s=a.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return mt(c,d,s,o)}},{key:"getTickTextAnchor",value:function(){var a=this.props.orientation,s;switch(a){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var a=this.props,s=a.cx,i=a.cy,o=a.angle,c=a.ticks,d=ure(c,function(h){return h.coordinate||0}),u=mre(c,function(h){return h.coordinate||0});return{cx:s,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var a=this.props,s=a.cx,i=a.cy,o=a.angle,c=a.ticks,d=a.axisLine,u=x5(a,pre),h=c.reduce(function(w,x){return[Math.min(w[0],x.coordinate),Math.max(w[1],x.coordinate)]},[1/0,-1/0]),m=mt(s,i,h[0],o),p=mt(s,i,h[1],o),b=ys(ys(ys({},Ce(u,!1)),{},{fill:"none"},Ce(d,!1)),{},{x1:m.x,y1:m.y,x2:p.x,y2:p.y});return q.createElement("line",ql({className:"recharts-polar-radius-axis-line"},b))}},{key:"renderTicks",value:function(){var a=this,s=this.props,i=s.ticks,o=s.tick,c=s.angle,d=s.tickFormatter,u=s.stroke,h=x5(s,xre),m=this.getTickTextAnchor(),p=Ce(h,!1),b=Ce(o,!1),w=i.map(function(x,g){var j=a.getTickValueCoord(x),S=ys(ys(ys(ys({textAnchor:m,transform:"rotate(".concat(90-c,", ").concat(j.x,", ").concat(j.y,")")},p),{},{stroke:"none",fill:u},b),{},{index:g},j),{},{payload:x});return q.createElement(He,ql({className:$e("recharts-polar-radius-axis-tick",gE(o)),key:"tick-".concat(x.coordinate)},Qs(a.props,x,g)),t.renderTickItem(o,S,d?d(x.value,g):x.value))});return q.createElement(He,{className:"recharts-polar-radius-axis-ticks"},w)}},{key:"render",value:function(){var a=this.props,s=a.ticks,i=a.axisLine,o=a.tick;return!s||!s.length?null:q.createElement(He,{className:$e("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Jt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(a,s,i){var o;return q.isValidElement(a)?o=q.cloneElement(a,s):Oe(a)?o=a(s):o=q.createElement(ei,ql({},s,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(y.PureComponent);Xf(Jf,"displayName","PolarRadiusAxis");Xf(Jf,"axisType","radiusAxis");Xf(Jf,"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 ko(e){"@babel/helpers - typeof";return ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ko(e)}function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Os.apply(this,arguments)}function b5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function js(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(r),!0).forEach(function(a){Qf(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Sre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v5(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,OE(a.key),a)}}function Cre(e,t,r){return t&&v5(e.prototype,t),r&&v5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Are(e,t,r){return t=kh(t),kre(e,TE()?Reflect.construct(t,r||[],kh(e).constructor):t.apply(e,r))}function kre(e,t){if(t&&(ko(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pre(e)}function Pre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(TE=function(){return!!e})()}function kh(e){return kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kh(e)}function Tre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gy(e,t)}function Gy(e,t){return Gy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Gy(e,t)}function Qf(e,t,r){return t=OE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OE(e){var t=Ore(e,"string");return ko(t)=="symbol"?t:t+""}function Ore(e,t){if(ko(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(ko(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ere=Math.PI/180,y5=1e-5,em=(function(e){function t(){return Sre(this,t),Are(this,t,arguments)}return Tre(t,e),Cre(t,[{key:"getTickLineCoord",value:function(a){var s=this.props,i=s.cx,o=s.cy,c=s.radius,d=s.orientation,u=s.tickSize,h=u||8,m=mt(i,o,c,a.coordinate),p=mt(i,o,c+(d==="inner"?-1:1)*h,a.coordinate);return{x1:m.x,y1:m.y,x2:p.x,y2:p.y}}},{key:"getTickTextAnchor",value:function(a){var s=this.props.orientation,i=Math.cos(-a.coordinate*Ere),o;return i>y5?o=s==="outer"?"start":"end":i<-y5?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var a=this.props,s=a.cx,i=a.cy,o=a.radius,c=a.axisLine,d=a.axisLineType,u=js(js({},Ce(this.props,!1)),{},{fill:"none"},Ce(c,!1));if(d==="circle")return q.createElement(Zf,Os({className:"recharts-polar-angle-axis-line"},u,{cx:s,cy:i,r:o}));var h=this.props.ticks,m=h.map(function(p){return mt(s,i,o,p.coordinate)});return q.createElement(Qne,Os({className:"recharts-polar-angle-axis-line"},u,{points:m}))}},{key:"renderTicks",value:function(){var a=this,s=this.props,i=s.ticks,o=s.tick,c=s.tickLine,d=s.tickFormatter,u=s.stroke,h=Ce(this.props,!1),m=Ce(o,!1),p=js(js({},h),{},{fill:"none"},Ce(c,!1)),b=i.map(function(w,x){var g=a.getTickLineCoord(w),j=a.getTickTextAnchor(w),S=js(js(js({textAnchor:j},h),{},{stroke:"none",fill:u},m),{},{index:x,payload:w,x:g.x2,y:g.y2});return q.createElement(He,Os({className:$e("recharts-polar-angle-axis-tick",gE(o)),key:"tick-".concat(w.coordinate)},Qs(a.props,w,x)),c&&q.createElement("line",Os({className:"recharts-polar-angle-axis-tick-line"},p,g)),o&&t.renderTickItem(o,S,d?d(w.value,x):w.value))});return q.createElement(He,{className:"recharts-polar-angle-axis-ticks"},b)}},{key:"render",value:function(){var a=this.props,s=a.ticks,i=a.radius,o=a.axisLine;return i<=0||!s||!s.length?null:q.createElement(He,{className:$e("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(a,s,i){var o;return q.isValidElement(a)?o=q.cloneElement(a,s):Oe(a)?o=a(s):o=q.createElement(ei,Os({},s,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(y.PureComponent);Qf(em,"displayName","PolarAngleAxis");Qf(em,"axisType","angleAxis");Qf(em,"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 Xb,j5;function Mre(){if(j5)return Xb;j5=1;var e=zT(),t=e(Object.getPrototypeOf,Object);return Xb=t,Xb}var Jb,w5;function Lre(){if(w5)return Jb;w5=1;var e=Ta(),t=Mre(),r=Oa(),a="[object Object]",s=Function.prototype,i=Object.prototype,o=s.toString,c=i.hasOwnProperty,d=o.call(Object);function u(h){if(!r(h)||e(h)!=a)return!1;var m=t(h);if(m===null)return!0;var p=c.call(m,"constructor")&&m.constructor;return typeof p=="function"&&p instanceof p&&o.call(p)==d}return Jb=u,Jb}var Ire=Lre();const Rre=it(Ire);var Qb,N5;function Dre(){if(N5)return Qb;N5=1;var e=Ta(),t=Oa(),r="[object Boolean]";function a(s){return s===!0||s===!1||t(s)&&e(s)==r}return Qb=a,Qb}var $re=Dre();const Fre=it($re);function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ph.apply(this,arguments)}function Bre(e,t){return qre(e)||Wre(e,t)||zre(e,t)||Ure()}function Ure(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 228In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zre(e,t){if(e){if(typeof e=="string")return _5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _5(e,t)}}function _5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function Wre(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function qre(e){if(Array.isArray(e))return e}function S5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function C5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?S5(Object(r),!0).forEach(function(a){Vre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Vre(e,t,r){return t=Hre(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hre(e){var t=Gre(e,"string");return _c(t)=="symbol"?t:t+""}function Gre(e,t){if(_c(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(_c(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A5=function(t,r,a,s,i){var o=a-s,c;return c="M ".concat(t,",").concat(r),c+="L ".concat(t+a,",").concat(r),c+="L ".concat(t+a-o/2,",").concat(r+i),c+="L ".concat(t+a-o/2-s,",").concat(r+i),c+="L ".concat(t,",").concat(r," Z"),c},Kre={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Yre=function(t){var r=C5(C5({},Kre),t),a=y.useRef(),s=y.useState(-1),i=Bre(s,2),o=i[0],c=i[1];y.useEffect(function(){if(a.current&&a.current.getTotalLength)try{var _=a.current.getTotalLength();_&&c(_)}catch{}},[]);var d=r.x,u=r.y,h=r.upperWidth,m=r.lowerWidth,p=r.height,b=r.className,w=r.animationEasing,x=r.animationDuration,g=r.animationBegin,j=r.isUpdateAnimationActive;if(d!==+d||u!==+u||h!==+h||m!==+m||p!==+p||h===0&&m===0||p===0)return null;var S=$e("recharts-trapezoid",b);return j?q.createElement(Kr,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:p,x:d,y:u},to:{upperWidth:h,lowerWidth:m,height:p,x:d,y:u},duration:x,animationEasing:w,isActive:j},function(_){var N=_.upperWidth,C=_.lowerWidth,A=_.height,P=_.x,O=_.y;return q.createElement(Kr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:x,easing:w},q.createElement("path",Ph({},Ce(r,!0),{className:S,d:A5(P,O,N,C,A),ref:a})))}):q.createElement("g",null,q.createElement("path",Ph({},Ce(r,!0),{className:S,d:A5(d,u,h,m,p)})))},Zre=["option","shapeType","propTransformer","activeClassName","isActive"];function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function Xre(e,t){if(e==null)return{};var r=Jre(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Jre(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function k5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Th(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k5(Object(r),!0).forEach(function(a){Qre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Qre(e,t,r){return t=eae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eae(e){var t=tae(e,"string");return Sc(t)=="symbol"?t:t+""}function tae(e,t){if(Sc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Sc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nae(e,t){return Th(Th({},t),e)}function rae(e,t){return e==="symbols"}function P5(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return q.createElement(hj,r);case"trapezoid":return q.createElement(Yre,r);case"sector":return q.createElement(yE,r);case"symbols":if(rae(t))return q.createElement(O1,r);break;default:return null}}function aae(e){return y.isValidElement(e)?e.props:e}function EE(e){var t=e.option,r=e.shapeType,a=e.propTransformer,s=a===void 0?nae:a,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Xre(e,Zre),u;if(y.isValidElement(t))u=y.cloneElement(t,Th(Th({},d),aae(t)));else if(Oe(t))u=t(d);else if(Rre(t)&&!Fre(t)){var h=s(t,d);u=q.createElement(P5,{shapeType:r,elementProps:h})}else{var m=d;u=q.createElement(P5,{shapeType:r,elementProps:m})}return c?q.createElement(He,{className:o},u):u}function tm(e,t){return t!=null&&"trapezoids"in e.props}function nm(e,t){return t!=null&&"sectors"in e.props}function Cc(e,t){return t!=null&&"points"in e.props}function sae(e,t){var r,a,s=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(a=t.labelViewBox)===null||a===void 0?void 0:a.y)||e.y===t.y;return s&&i}function iae(e,t){var r=e.endAngle===t.endAngle,a=e.startAngle===t.startAngle;return r&&a}function oae(e,t){var r=e.x===t.x,a=e.y===t.y,s=e.z===t.z;return r&&a&&s}function lae(e,t){var r;return tm(e,t)?r=sae:nm(e,t)?r=iae:Cc(e,t)&&(r=oae),r}function cae(e,t){var r;return tm(e,t)?r="trapezoids":nm(e,t)?r="sectors":Cc(e,t)&&(r="points"),r}function dae(e,t){if(tm(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(nm(e,t)){var a;return(a=t.tooltipPayload)===null||a===void 0||(a=a[0])===null||a===void 0||(a=a.payload)===null||a===void 0?void 0:a.payload}return Cc(e,t)?t.payload:{}}function uae(e){var t=e.activeTooltipItem,r=e.graphicalItem,a=e.itemData,s=cae(r,t),i=dae(r,t),o=a.filter(function(d,u){var h=_o(i,d),m=r.props[s].filter(function(w){var x=lae(r,t);return x(w,t)}),p=r.props[s].indexOf(m[m.length-1]),b=u===p;return h&&b}),c=a.indexOf(o[o.length-1]);return c}var uu;function Po(e){"@babel/helpers - typeof";return Po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(e)}function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Vi.apply(this,arguments)}function T5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function dt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T5(Object(r),!0).forEach(function(a){Qn(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O5(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,LE(a.key),a)}}function fae(e,t,r){return t&&O5(e.prototype,t),r&&O5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mae(e,t,r){return t=Oh(t),pae(e,ME()?Reflect.construct(t,r||[],Oh(e).constructor):t.apply(e,r))}function pae(e,t){if(t&&(Po(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xae(e)}function xae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ME(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ME=function(){return!!e})()}function Oh(e){return Oh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Oh(e)}function gae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ky(e,t)}function Ky(e,t){return Ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Ky(e,t)}function Qn(e,t,r){return t=LE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LE(e){var t=bae(e,"string");return Po(t)=="symbol"?t:t+""}function bae(e,t){if(Po(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Po(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ma=(function(e){function t(r){var a;return hae(this,t),a=mae(this,t,[r]),Qn(a,"pieRef",null),Qn(a,"sectorRefs",[]),Qn(a,"id",el("recharts-pie-")),Qn(a,"handleAnimationEnd",function(){var s=a.props.onAnimationEnd;a.setState({isAnimationFinished:!0}),Oe(s)&&s()}),Qn(a,"handleAnimationStart",function(){var s=a.props.onAnimationStart;a.setState({isAnimationFinished:!1}),Oe(s)&&s()}),a.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},a}return gae(t,e),fae(t,[{key:"isActiveIndex",value:function(a){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(a)!==-1:a===s}},{key:"hasActiveIndex",value:function(){var a=this.props.activeIndex;return Array.isArray(a)?a.length!==0:a||a===0}},{key:"renderLabels",value:function(a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,u=i.valueKey,h=Ce(this.props,!1),m=Ce(o,!1),p=Ce(c,!1),b=o&&o.offsetRadius||20,w=a.map(function(x,g){var j=(x.startAngle+x.endAngle)/2,S=mt(x.cx,x.cy,x.outerRadius+b,j),_=dt(dt(dt(dt({},h),x),{},{stroke:"none"},m),{},{index:g,textAnchor:t.getTextAnchor(S.x,x.cx)},S),N=dt(dt(dt(dt({},h),x),{},{fill:"none",stroke:x.fill},p),{},{index:g,points:[mt(x.cx,x.cy,x.outerRadius,j),S]}),C=d;return Ie(d)&&Ie(u)?C="value":Ie(d)&&(C=u),q.createElement(He,{key:"label-".concat(x.startAngle,"-").concat(x.endAngle,"-").concat(x.midAngle,"-").concat(g)},c&&t.renderLabelLineItem(c,N,"line"),t.renderLabelItem(o,_,Ut(x,C)))});return q.createElement(He,{className:"recharts-pie-labels"},w)}},{key:"renderSectorsStatically",value:function(a){var s=this,i=this.props,o=i.activeShape,c=i.blendStroke,d=i.inactiveShape;return a.map(function(u,h){if(u?.startAngle===0&&u?.endAngle===0&&a.length!==1)return null;var m=s.isActiveIndex(h),p=d&&s.hasActiveIndex()?d:null,b=m?o:p,w=dt(dt({},u),{},{stroke:c?u.fill:u.stroke,tabIndex:-1});return q.createElement(He,Vi({ref:function(g){g&&!s.sectorRefs.includes(g)&&s.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},Qs(s.props,u,h),{key:"sector-".concat(u?.startAngle,"-").concat(u?.endAngle,"-").concat(u.midAngle,"-").concat(h)}),q.createElement(EE,Vi({option:b,isActive:m,shapeType:"sector"},w)))})}},{key:"renderSectorsWithAnimation",value:function(){var a=this,s=this.props,i=s.sectors,o=s.isAnimationActive,c=s.animationBegin,d=s.animationDuration,u=s.animationEasing,h=s.animationId,m=this.state,p=m.prevSectors,b=m.prevIsAnimationActive;return q.createElement(Kr,{begin:c,duration:d,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(b),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(w){var x=w.t,g=[],j=i&&i[0],S=j.startAngle;return i.forEach(function(_,N){var C=p&&p[N],A=N>0?zn(_,"paddingAngle",0):0;if(C){var P=An(C.endAngle-C.startAngle,_.endAngle-_.startAngle),O=dt(dt({},_),{},{startAngle:S+A,endAngle:S+P(x)+A});g.push(O),S=O.endAngle}else{var E=_.endAngle,$=_.startAngle,M=An(0,E-$),R=M(x),B=dt(dt({},_),{},{startAngle:S+A,endAngle:S+R+A});g.push(B),S=B.endAngle}}),q.createElement(He,null,a.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(a){var s=this;a.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[c].focus(),s.setState({sectorToFocus:c});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var a=this.props,s=a.sectors,i=a.isAnimationActive,o=this.state.prevSectors;return i&&s&&s.length&&(!o||!_o(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var a=this,s=this.props,i=s.hide,o=s.sectors,c=s.className,d=s.label,u=s.cx,h=s.cy,m=s.innerRadius,p=s.outerRadius,b=s.isAnimationActive,w=this.state.isAnimationFinished;if(i||!o||!o.length||!de(u)||!de(h)||!de(m)||!de(p))return null;var x=$e("recharts-pie",c);return q.createElement(He,{tabIndex:this.props.rootTabIndex,className:x,ref:function(j){a.pieRef=j}},this.renderSectors(),d&&this.renderLabels(o),Jt.renderCallByParent(this.props,null,!1),(!b||w)&&ya.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(a,s){return s.prevIsAnimationActive!==a.isAnimationActive?{prevIsAnimationActive:a.isAnimationActive,prevAnimationId:a.animationId,curSectors:a.sectors,prevSectors:[],isAnimationFinished:!0}:a.isAnimationActive&&a.animationId!==s.prevAnimationId?{prevAnimationId:a.animationId,curSectors:a.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:a.sectors!==s.curSectors?{curSectors:a.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(a,s){return a>s?"start":a<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(a,s,i){if(q.isValidElement(a))return q.cloneElement(a,s);if(Oe(a))return a(s);var o=$e("recharts-pie-label-line",typeof a!="boolean"?a.className:"");return q.createElement(fo,Vi({},s,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(a,s,i){if(q.isValidElement(a))return q.cloneElement(a,s);var o=i;if(Oe(a)&&(o=a(s),q.isValidElement(o)))return o;var c=$e("recharts-pie-label-text",typeof a!="boolean"&&!Oe(a)?a.className:"");return q.createElement(ei,Vi({},s,{alignmentBaseline:"middle",className:c}),o)}}])})(y.PureComponent);uu=Ma;Qn(Ma,"displayName","Pie");Qn(Ma,"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:!yi.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Qn(Ma,"parseDeltaAngle",function(e,t){var r=yn(t-e),a=Math.min(Math.abs(t-e),360);return r*a});Qn(Ma,"getRealPieData",function(e){var t=e.data,r=e.children,a=Ce(e,!1),s=nr(r,$f);return t&&t.length?t.map(function(i,o){return dt(dt(dt({payload:i},a),i),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(i){return dt(dt({},a),i.props)}):[]});Qn(Ma,"parseCoordinateOfPie",function(e,t){var r=t.top,a=t.left,s=t.width,i=t.height,o=xE(s,i),c=a+jn(e.cx,s,s/2),d=r+jn(e.cy,i,i/2),u=jn(e.innerRadius,o,0),h=jn(e.outerRadius,o,o*.8),m=e.maxRadius||Math.sqrt(s*s+i*i)/2;return{cx:c,cy:d,innerRadius:u,outerRadius:h,maxRadius:m}});Qn(Ma,"getComposedData",function(e){var t=e.item,r=e.offset,a=t.type.defaultProps!==void 0?dt(dt({},t.type.defaultProps),t.props):t.props,s=uu.getRealPieData(a);if(!s||!s.length)return null;var i=a.cornerRadius,o=a.startAngle,c=a.endAngle,d=a.paddingAngle,u=a.dataKey,h=a.nameKey,m=a.valueKey,p=a.tooltipType,b=Math.abs(a.minAngle),w=uu.parseCoordinateOfPie(a,r),x=uu.parseDeltaAngle(o,c),g=Math.abs(x),j=u;Ie(u)&&Ie(m)?(Sr(!1,`Use "dataKey" to specify the value of pie,
229 the props "valueKey" will be deprecated in 1.1.0`),j="value"):Ie(u)&&(Sr(!1,`Use "dataKey" to specify the value of pie, 230 the props "valueKey" will be deprecated in 1.1.0`),j=m);var S=s.filter(function(O){return Ut(O,j,0)!==0}).length,_=(g>=360?S:S-1)*d,N=g-S*b-_,C=s.reduce(function(O,E){var $=Ut(E,j,0);return O+(de($)?$:0)},0),A;if(C>0){var P;A=s.map(function(O,E){var $=Ut(O,j,0),M=Ut(O,h,E),R=(de($)?$:0)/C,B;E?B=P.endAngle+yn(x)*d*($!==0?1:0):B=o;var D=B+yn(x)*(($!==0?b:0)+R*N),U=(B+D)/2,H=(w.innerRadius+w.outerRadius)/2,K=[{name:M,value:$,payload:O,dataKey:j,type:p}],z=mt(w.cx,w.cy,H,U);return P=dt(dt(dt({percent:R,cornerRadius:i,name:M,tooltipPayload:K,midAngle:U,middleRadius:H,tooltipPosition:z},O),w),{},{value:Ut(O,j),startAngle:B,endAngle:D,payload:O,paddingAngle:yn(x)*d}),P})}return dt(dt({},w),{},{sectors:A,data:s})});var ev,E5;function vae(){if(E5)return ev;E5=1;var e=Math.ceil,t=Math.max;function r(a,s,i,o){for(var c=-1,d=t(e((s-a)/(i||1)),0),u=Array(d);d--;)u[o?d:++c]=a,a+=i;return u}return ev=r,ev}var tv,M5;function IE(){if(M5)return tv;M5=1;var e=aO(),t=1/0,r=17976931348623157e292;function a(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var i=s<0?-1:1;return i*r}return s===s?s:0}return tv=a,tv}var nv,L5;function yae(){if(L5)return nv;L5=1;var e=vae(),t=Df(),r=IE();function a(s){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),c=c===void 0?i<o?1:-1:r(c),e(i,o,c,s)}}return nv=a,nv}var rv,I5;function jae(){if(I5)return rv;I5=1;var e=yae(),t=e();return rv=t,rv}var wae=jae();const Eh=it(wae);function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function R5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function D5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R5(Object(r),!0).forEach(function(a){RE(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function RE(e,t,r){return t=Nae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nae(e){var t=_ae(e,"string");return Ac(t)=="symbol"?t:t+""}function _ae(e,t){if(Ac(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Ac(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sae=["Webkit","Moz","O","ms"],Cae=function(t,r){var a=t.replace(/(\w)/,function(i){return i.toUpperCase()}),s=Sae.reduce(function(i,o){return D5(D5({},i),{},RE({},o+a,r))},{});return s[t]=r,s};function To(e){"@babel/helpers - typeof";return To=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},To(e)}function Mh(){return Mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Mh.apply(this,arguments)}function $5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function av(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(r),!0).forEach(function(a){Dn(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Aae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F5(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,$E(a.key),a)}}function kae(e,t,r){return t&&F5(e.prototype,t),r&&F5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pae(e,t,r){return t=Lh(t),Tae(e,DE()?Reflect.construct(t,r||[],Lh(e).constructor):t.apply(e,r))}function Tae(e,t){if(t&&(To(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oae(e)}function Oae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DE=function(){return!!e})()}
vendor: 41,008 bytes, lines 230-231
230function Lh(e){return Lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lh(e)}function Eae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yy(e,t)}function Yy(e,t){return Yy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Yy(e,t)}function Dn(e,t,r){return t=$E(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $E(e){var t=Mae(e,"string");return To(t)=="symbol"?t:t+""}function Mae(e,t){if(To(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(To(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lae=function(t){var r=t.data,a=t.startIndex,s=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!r||!r.length)return{};var d=r.length,u=Bl().domain(Eh(0,d)).range([i,i+o-c]),h=u.domain().map(function(m){return u(m)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(a),endX:u(s),scale:u,scaleValues:h}},B5=function(t){return t.changedTouches&&!!t.changedTouches.length},Oo=(function(e){function t(r){var a;return Aae(this,t),a=Pae(this,t,[r]),Dn(a,"handleDrag",function(s){a.leaveTimer&&(clearTimeout(a.leaveTimer),a.leaveTimer=null),a.state.isTravellerMoving?a.handleTravellerMove(s):a.state.isSlideMoving&&a.handleSlideDrag(s)}),Dn(a,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&a.handleDrag(s.changedTouches[0])}),Dn(a,"handleDragEnd",function(){a.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=a.props,i=s.endIndex,o=s.onDragEnd,c=s.startIndex;o?.({endIndex:i,startIndex:c})}),a.detachDragEndListener()}),Dn(a,"handleLeaveWrapper",function(){(a.state.isTravellerMoving||a.state.isSlideMoving)&&(a.leaveTimer=window.setTimeout(a.handleDragEnd,a.props.leaveTimeOut))}),Dn(a,"handleEnterSlideOrTraveller",function(){a.setState({isTextActive:!0})}),Dn(a,"handleLeaveSlideOrTraveller",function(){a.setState({isTextActive:!1})}),Dn(a,"handleSlideDragStart",function(s){var i=B5(s)?s.changedTouches[0]:s;a.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),a.attachDragEndListener()}),a.travellerDragStartHandlers={startX:a.handleTravellerDragStart.bind(a,"startX"),endX:a.handleTravellerDragStart.bind(a,"endX")},a.state={},a}return Eae(t,e),kae(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(a){var s=a.startX,i=a.endX,o=this.state.scaleValues,c=this.props,d=c.gap,u=c.data,h=u.length-1,m=Math.min(s,i),p=Math.max(s,i),b=t.getIndexInRange(o,m),w=t.getIndexInRange(o,p);return{startIndex:b-b%d,endIndex:w===h?h:w-w%d}}},{key:"getTextOfTick",value:function(a){var s=this.props,i=s.data,o=s.tickFormatter,c=s.dataKey,d=Ut(i[a],c,a);return Oe(o)?o(d,a):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(a){var s=this.state,i=s.slideMoveStartX,o=s.startX,c=s.endX,d=this.props,u=d.x,h=d.width,m=d.travellerWidth,p=d.startIndex,b=d.endIndex,w=d.onChange,x=a.pageX-i;x>0?x=Math.min(x,u+h-m-c,u+h-m-o):x<0&&(x=Math.max(x,u-o,u-c));var g=this.getIndex({startX:o+x,endX:c+x});(g.startIndex!==p||g.endIndex!==b)&&w&&w(g),this.setState({startX:o+x,endX:c+x,slideMoveStartX:a.pageX})}},{key:"handleTravellerDragStart",value:function(a,s){var i=B5(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:a,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(a){var s=this.state,i=s.brushMoveStartX,o=s.movingTravellerId,c=s.endX,d=s.startX,u=this.state[o],h=this.props,m=h.x,p=h.width,b=h.travellerWidth,w=h.onChange,x=h.gap,g=h.data,j={startX:this.state.startX,endX:this.state.endX},S=a.pageX-i;S>0?S=Math.min(S,m+p-b-u):S<0&&(S=Math.max(S,m-u)),j[o]=u+S;var _=this.getIndex(j),N=_.startIndex,C=_.endIndex,A=function(){var O=g.length-1;return o==="startX"&&(c>d?N%x===0:C%x===0)||c<d&&C===O||o==="endX"&&(c>d?C%x===0:N%x===0)||c>d&&C===O};this.setState(Dn(Dn({},o,u+S),"brushMoveStartX",a.pageX),function(){w&&A()&&w(_)})}},{key:"handleTravellerMoveKeyboard",value:function(a,s){var i=this,o=this.state,c=o.scaleValues,d=o.startX,u=o.endX,h=this.state[s],m=c.indexOf(h);if(m!==-1){var p=m+a;if(!(p===-1||p>=c.length)){var b=c[p];s==="startX"&&b>=u||s==="endX"&&b<=d||this.setState(Dn({},s,b),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var a=this.props,s=a.x,i=a.y,o=a.width,c=a.height,d=a.fill,u=a.stroke;return q.createElement("rect",{stroke:u,fill:d,x:s,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var a=this.props,s=a.x,i=a.y,o=a.width,c=a.height,d=a.data,u=a.children,h=a.padding,m=y.Children.only(u);return m?q.cloneElement(m,{x:s,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(a,s){var i,o,c=this,d=this.props,u=d.y,h=d.travellerWidth,m=d.height,p=d.traveller,b=d.ariaLabel,w=d.data,x=d.startIndex,g=d.endIndex,j=Math.max(a,this.props.x),S=av(av({},Ce(this.props,!1)),{},{x:j,y:u,width:h,height:m}),_=b||"Min value: ".concat((i=w[x])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=w[g])===null||o===void 0?void 0:o.name);return q.createElement(He,{tabIndex:0,role:"slider","aria-label":_,"aria-valuenow":a,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),c.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,s))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,S))}},{key:"renderSlide",value:function(a,s){var i=this.props,o=i.y,c=i.height,d=i.stroke,u=i.travellerWidth,h=Math.min(a,s)+u,m=Math.max(Math.abs(s-a)-u,0);return q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:m,height:c})}},{key:"renderText",value:function(){var a=this.props,s=a.startIndex,i=a.endIndex,o=a.y,c=a.height,d=a.travellerWidth,u=a.stroke,h=this.state,m=h.startX,p=h.endX,b=5,w={pointerEvents:"none",fill:u};return q.createElement(He,{className:"recharts-brush-texts"},q.createElement(ei,Mh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(m,p)-b,y:o+c/2},w),this.getTextOfTick(s)),q.createElement(ei,Mh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(m,p)+d+b,y:o+c/2},w),this.getTextOfTick(i)))}},{key:"render",value:function(){var a=this.props,s=a.data,i=a.className,o=a.children,c=a.x,d=a.y,u=a.width,h=a.height,m=a.alwaysShowText,p=this.state,b=p.startX,w=p.endX,x=p.isTextActive,g=p.isSlideMoving,j=p.isTravellerMoving,S=p.isTravellerFocused;if(!s||!s.length||!de(c)||!de(d)||!de(u)||!de(h)||u<=0||h<=0)return null;var _=$e("recharts-brush",i),N=q.Children.count(o)===1,C=Cae("userSelect","none");return q.createElement(He,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(b,w),this.renderTravellerLayer(b,"startX"),this.renderTravellerLayer(w,"endX"),(x||g||j||S||m)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(a){var s=a.x,i=a.y,o=a.width,c=a.height,d=a.stroke,u=Math.floor(i+c/2)-1;return q.createElement(q.Fragment,null,q.createElement("rect",{x:s,y:i,width:o,height:c,fill:d,stroke:"none"}),q.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),q.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(a,s){var i;return q.isValidElement(a)?i=q.cloneElement(a,s):Oe(a)?i=a(s):i=t.renderDefaultTraveller(s),i}},{key:"getDerivedStateFromProps",value:function(a,s){var i=a.data,o=a.width,c=a.x,d=a.travellerWidth,u=a.updateId,h=a.startIndex,m=a.endIndex;if(i!==s.prevData||u!==s.prevUpdateId)return av({prevData:i,prevTravellerWidth:d,prevUpdateId:u,prevX:c,prevWidth:o},i&&i.length?Lae({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:m}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||c!==s.prevX||d!==s.prevTravellerWidth)){s.scale.range([c,c+o-d]);var p=s.scale.domain().map(function(b){return s.scale(b)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:u,prevX:c,prevWidth:o,startX:s.scale(a.startIndex),endX:s.scale(a.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(a,s){for(var i=a.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);a[d]>s?c=d:o=d}return s>=a[c]?c:o}}])})(y.PureComponent);Dn(Oo,"displayName","Brush");Dn(Oo,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var sv,U5;function Iae(){if(U5)return sv;U5=1;var e=$1();function t(r,a){var s;return e(r,function(i,o,c){return s=a(i,o,c),!s}),!!s}return sv=t,sv}var iv,z5;function Rae(){if(z5)return iv;z5=1;var e=IT(),t=ta(),r=Iae(),a=In(),s=Df();function i(o,c,d){var u=a(o)?e:r;return d&&s(o,c,d)&&(c=void 0),u(o,t(c,3))}return iv=i,iv}var Dae=Rae();const $ae=it(Dae);var Wr=function(t,r){var a=t.alwaysShow,s=t.ifOverflow;return a&&(s="extendDomain"),s===r},ov,W5;function Fae(){if(W5)return ov;W5=1;var e=QT();function t(r,a,s){a=="__proto__"&&e?e(r,a,{configurable:!0,enumerable:!0,value:s,writable:!0}):r[a]=s}return ov=t,ov}var lv,q5;function Bae(){if(q5)return lv;q5=1;var e=Fae(),t=XT(),r=ta();function a(s,i){var o={};return i=r(i,3),t(s,function(c,d,u){e(o,d,i(c,d,u))}),o}return lv=a,lv}var Uae=Bae();const zae=it(Uae);var cv,V5;function Wae(){if(V5)return cv;V5=1;function e(t,r){for(var a=-1,s=t==null?0:t.length;++a<s;)if(!r(t[a],a,t))return!1;return!0}return cv=e,cv}var dv,H5;function qae(){if(H5)return dv;H5=1;var e=$1();function t(r,a){var s=!0;return e(r,function(i,o,c){return s=!!a(i,o,c),s}),s}return dv=t,dv}var uv,G5;function Vae(){if(G5)return uv;G5=1;var e=Wae(),t=qae(),r=ta(),a=In(),s=Df();function i(o,c,d){var u=a(o)?e:t;return d&&s(o,c,d)&&(c=void 0),u(o,r(c,3))}return uv=i,uv}var Hae=Vae();const FE=it(Hae);var Gae=["x","y"];function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}function Zy(){return Zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Zy.apply(this,arguments)}function K5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ol(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K5(Object(r),!0).forEach(function(a){Kae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Kae(e,t,r){return t=Yae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yae(e){var t=Zae(e,"string");return kc(t)=="symbol"?t:t+""}function Zae(e,t){if(kc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(kc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xae(e,t){if(e==null)return{};var r=Jae(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Jae(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function Qae(e,t){var r=e.x,a=e.y,s=Xae(e,Gae),i="".concat(r),o=parseInt(i,10),c="".concat(a),d=parseInt(c,10),u="".concat(t.height||s.height),h=parseInt(u,10),m="".concat(t.width||s.width),p=parseInt(m,10);return Ol(Ol(Ol(Ol(Ol({},t),s),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:p,name:t.name,radius:t.radius})}function Y5(e){return q.createElement(EE,Zy({shapeType:"rectangle",propTransformer:Qae,activeClassName:"recharts-active-bar"},e))}var ese=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(a,s){if(typeof t=="number")return t;var i=de(a)||vV(a);return i?t(a,s):(i||ni(),r)}},tse=["value","background"],BE;function Eo(e){"@babel/helpers - typeof";return Eo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eo(e)}function nse(e,t){if(e==null)return{};var r=rse(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function rse(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ih.apply(this,arguments)}function Z5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z5(Object(r),!0).forEach(function(a){qa(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ase(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X5(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,zE(a.key),a)}}function sse(e,t,r){return t&&X5(e.prototype,t),r&&X5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ise(e,t,r){return t=Rh(t),ose(e,UE()?Reflect.construct(t,r||[],Rh(e).constructor):t.apply(e,r))}function ose(e,t){if(t&&(Eo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lse(e)}function lse(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UE=function(){return!!e})()}function Rh(e){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rh(e)}function cse(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xy(e,t)}function Xy(e,t){return Xy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Xy(e,t)}function qa(e,t,r){return t=zE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zE(e){var t=dse(e,"string");return Eo(t)=="symbol"?t:t+""}function dse(e,t){if(Eo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Eo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sd=(function(e){function t(){var r;ase(this,t);for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return r=ise(this,t,[].concat(s)),qa(r,"state",{isAnimationFinished:!1}),qa(r,"id",el("recharts-bar-")),qa(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),qa(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return cse(t,e),sse(t,[{key:"renderRectanglesStatically",value:function(a){var s=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,u=i.activeBar,h=Ce(this.props,!1);return a&&a.map(function(m,p){var b=p===d,w=b?u:o,x=Ot(Ot(Ot({},h),m),{},{isActive:b,option:w,index:p,dataKey:c,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return q.createElement(He,Ih({className:"recharts-bar-rectangle"},Qs(s.props,m,p),{key:"rectangle-".concat(m?.x,"-").concat(m?.y,"-").concat(m?.value,"-").concat(p)}),q.createElement(Y5,x))})}},{key:"renderRectanglesWithAnimation",value:function(){var a=this,s=this.props,i=s.data,o=s.layout,c=s.isAnimationActive,d=s.animationBegin,u=s.animationDuration,h=s.animationEasing,m=s.animationId,p=this.state.prevData;return q.createElement(Kr,{begin:d,duration:u,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var w=b.t,x=i.map(function(g,j){var S=p&&p[j];if(S){var _=An(S.x,g.x),N=An(S.y,g.y),C=An(S.width,g.width),A=An(S.height,g.height);return Ot(Ot({},g),{},{x:_(w),y:N(w),width:C(w),height:A(w)})}if(o==="horizontal"){var P=An(0,g.height),O=P(w);return Ot(Ot({},g),{},{y:g.y+g.height-O,height:O})}var E=An(0,g.width),$=E(w);return Ot(Ot({},g),{},{width:$})});return q.createElement(He,null,a.renderRectanglesStatically(x))})}},{key:"renderRectangles",value:function(){var a=this.props,s=a.data,i=a.isAnimationActive,o=this.state.prevData;return i&&s&&s.length&&(!o||!_o(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var a=this,s=this.props,i=s.data,o=s.dataKey,c=s.activeIndex,d=Ce(this.props.background,!1);return i.map(function(u,h){u.value;var m=u.background,p=nse(u,tse);if(!m)return null;var b=Ot(Ot(Ot(Ot(Ot({},p),{},{fill:"#eee"},m),d),Qs(a.props,u,h)),{},{onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return q.createElement(Y5,Ih({key:"background-bar-".concat(h),option:a.props.background,isActive:h===c},b))})}},{key:"renderErrorBar",value:function(a,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,c=i.xAxis,d=i.yAxis,u=i.layout,h=i.children,m=nr(h,Yf);if(!m)return null;var p=u==="vertical"?o[0].height/2:o[0].width/2,b=function(g,j){var S=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:S,errorVal:Ut(g,j)}},w={clipPath:a?"url(#clipPath-".concat(s,")"):null};return q.createElement(He,w,m.map(function(x){return q.cloneElement(x,{key:"error-bar-".concat(s,"-").concat(x.props.dataKey),data:o,xAxis:c,yAxis:d,layout:u,offset:p,dataPointFormatter:b})}))}},{key:"render",value:function(){var a=this.props,s=a.hide,i=a.data,o=a.className,c=a.xAxis,d=a.yAxis,u=a.left,h=a.top,m=a.width,p=a.height,b=a.isAnimationActive,w=a.background,x=a.id;if(s||!i||!i.length)return null;var g=this.state.isAnimationFinished,j=$e("recharts-bar",o),S=c&&c.allowDataOverflow,_=d&&d.allowDataOverflow,N=S||_,C=Ie(x)?this.id:x;return q.createElement(He,{className:j},S||_?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(C)},q.createElement("rect",{x:S?u:u-m/2,y:_?h:h-p/2,width:S?m:m*2,height:_?p:p*2}))):null,q.createElement(He,{className:"recharts-bar-rectangles",clipPath:N?"url(#clipPath-".concat(C,")"):null},w?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(N,C),(!b||g)&&ya.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(a,s){return a.animationId!==s.prevAnimationId?{prevAnimationId:a.animationId,curData:a.data,prevData:s.curData}:a.data!==s.curData?{curData:a.data}:null}}])})(y.PureComponent);BE=sd;qa(sd,"displayName","Bar");qa(sd,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!yi.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});qa(sd,"getComposedData",function(e){var t=e.props,r=e.item,a=e.barPosition,s=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,u=e.stackedData,h=e.dataStartIndex,m=e.displayedData,p=e.offset,b=IQ(a,r);if(!b)return null;var w=t.layout,x=r.type.defaultProps,g=x!==void 0?Ot(Ot({},x),r.props):r.props,j=g.dataKey,S=g.children,_=g.minPointSize,N=w==="horizontal"?o:i,C=u?N.scale.domain():null,A=zQ({numericAxis:N}),P=nr(S,$f),O=m.map(function(E,$){var M,R,B,D,U,H;u?M=RQ(u[h+$],C):(M=Ut(E,j),Array.isArray(M)||(M=[A,M]));var K=ese(_,BE.defaultProps.minPointSize)(M[1],$);if(w==="horizontal"){var z,X=[o.scale(M[0]),o.scale(M[1])],G=X[0],Q=X[1];R=S3({axis:i,ticks:c,bandSize:s,offset:b.offset,entry:E,index:$}),B=(z=Q??G)!==null&&z!==void 0?z:void 0,D=b.size;var re=G-Q;if(U=Number.isNaN(re)?0:re,H={x:R,y:o.y,width:D,height:o.height},Math.abs(K)>0&&Math.abs(U)<Math.abs(K)){var ce=yn(U||K)*(Math.abs(K)-Math.abs(U));B-=ce,U+=ce}}else{var fe=[i.scale(M[0]),i.scale(M[1])],me=fe[0],pe=fe[1];if(R=me,B=S3({axis:o,ticks:d,bandSize:s,offset:b.offset,entry:E,index:$}),D=pe-me,U=b.size,H={x:i.x,y:B,width:i.width,height:U},Math.abs(K)>0&&Math.abs(D)<Math.abs(K)){var Re=yn(D||K)*(Math.abs(K)-Math.abs(D));D+=Re}}return Ot(Ot(Ot({},E),{},{x:R,y:B,width:D,height:U,value:u?M:M[1],payload:E,background:H},P&&P[$]&&P[$].props),{},{tooltipPayload:[mE(r,E)],tooltipPosition:{x:R+D/2,y:B+U/2}})});return Ot({data:O,layout:w},p)});function Pc(e){"@babel/helpers - typeof";return Pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(e)}function use(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J5(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,WE(a.key),a)}}function hse(e,t,r){return t&&J5(e.prototype,t),r&&J5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function wr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q5(Object(r),!0).forEach(function(a){rm(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function rm(e,t,r){return t=WE(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WE(e){var t=fse(e,"string");return Pc(t)=="symbol"?t:t+""}function fse(e,t){if(Pc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Pc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mse=function(t,r,a,s,i){var o=t.width,c=t.height,d=t.layout,u=t.children,h=Object.keys(r),m={left:a.left,leftMirror:a.left,right:o-a.right,rightMirror:o-a.right,top:a.top,topMirror:a.top,bottom:c-a.bottom,bottomMirror:c-a.bottom},p=!!$n(u,sd);return h.reduce(function(b,w){var x=r[w],g=x.orientation,j=x.domain,S=x.padding,_=S===void 0?{}:S,N=x.mirror,C=x.reversed,A="".concat(g).concat(N?"Mirror":""),P,O,E,$,M;if(x.type==="number"&&(x.padding==="gap"||x.padding==="no-gap")){var R=j[1]-j[0],B=1/0,D=x.categoricalDomain.sort(wV);if(D.forEach(function(fe,me){me>0&&(B=Math.min((fe||0)-(D[me-1]||0),B))}),Number.isFinite(B)){var U=B/R,H=x.layout==="vertical"?a.height:a.width;if(x.padding==="gap"&&(P=U*H/2),x.padding==="no-gap"){var K=jn(t.barCategoryGap,U*H),z=U*H/2;P=z-K-(z-K)/H*K}}}s==="xAxis"?O=[a.left+(_.left||0)+(P||0),a.left+a.width-(_.right||0)-(P||0)]:s==="yAxis"?O=d==="horizontal"?[a.top+a.height-(_.bottom||0),a.top+(_.top||0)]:[a.top+(_.top||0)+(P||0),a.top+a.height-(_.bottom||0)-(P||0)]:O=x.range,C&&(O=[O[1],O[0]]);var X=dE(x,i,p),G=X.scale,Q=X.realScaleType;G.domain(j).range(O),uE(G);var re=hE(G,wr(wr({},x),{},{realScaleType:Q}));s==="xAxis"?(M=g==="top"&&!N||g==="bottom"&&N,E=a.left,$=m[A]-M*x.height):s==="yAxis"&&(M=g==="left"&&!N||g==="right"&&N,E=m[A]-M*x.width,$=a.top);var ce=wr(wr(wr({},x),re),{},{realScaleType:Q,x:E,y:$,scale:G,width:s==="xAxis"?a.width:x.width,height:s==="yAxis"?a.height:x.height});return ce.bandSize=vh(ce,re),!x.hide&&s==="xAxis"?m[A]+=(M?-1:1)*ce.height:x.hide||(m[A]+=(M?-1:1)*ce.width),wr(wr({},b),{},rm({},w,ce))},{})},qE=function(t,r){var a=t.x,s=t.y,i=r.x,o=r.y;return{x:Math.min(a,i),y:Math.min(s,o),width:Math.abs(i-a),height:Math.abs(o-s)}},pse=function(t){var r=t.x1,a=t.y1,s=t.x2,i=t.y2;return qE({x:r,y:a},{x:s,y:i})},VE=(function(){function e(t){use(this,e),this.scale=t}return hse(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,i=a.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(r)+c}default:return this.scale(r)}if(s){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+d}return this.scale(r)}}},{key:"isInRange",value:function(r){var a=this.range(),s=a[0],i=a[a.length-1];return s<=i?r>=s&&r<=i:r>=i&&r<=s}}],[{key:"create",value:function(r){return new e(r)}}])})();rm(VE,"EPS",1e-4);var fj=function(t){var r=Object.keys(t).reduce(function(a,s){return wr(wr({},a),{},rm({},s,VE.create(t[s])))},{});return wr(wr({},r),{},{apply:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return zae(s,function(d,u){return r[u].apply(d,{bandAware:o,position:c})})},isInRange:function(s){return FE(s,function(i,o){return r[o].isInRange(i)})}})};function xse(e){return(e%180+180)%180}var gse=function(t){var r=t.width,a=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=xse(s),o=i*Math.PI/180,c=Math.atan(a/r),d=o>c&&o<Math.PI-c?a/Math.sin(o):r/Math.cos(o);return Math.abs(d)},hv,eC;function bse(){if(eC)return hv;eC=1;var e=ta(),t=ed(),r=If();function a(s){return function(i,o,c){var d=Object(i);if(!t(i)){var u=e(o,3);i=r(i),o=function(m){return u(d[m],m,d)}}var h=s(i,o,c);return h>-1?d[u?i[h]:h]:void 0}}return hv=a,hv}var fv,tC;function vse(){if(tC)return fv;tC=1;var e=IE();function t(r){var a=e(r),s=a%1;return a===a?s?a-s:a:0}return fv=t,fv}var mv,nC;function yse(){if(nC)return mv;nC=1;var e=HT(),t=ta(),r=vse(),a=Math.max;function s(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var u=c==null?0:r(c);return u<0&&(u=a(d+u,0)),e(i,t(o,3),u)}return mv=s,mv}var pv,rC;function jse(){if(rC)return pv;rC=1;var e=bse(),t=yse(),r=e(t);return pv=r,pv}var wse=jse();const Nse=it(wse);var _se=lT();const Sse=it(_se);var Cse=Sse(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),mj=y.createContext(void 0),pj=y.createContext(void 0),HE=y.createContext(void 0),GE=y.createContext({}),KE=y.createContext(void 0),YE=y.createContext(0),ZE=y.createContext(0),aC=function(t){var r=t.state,a=r.xAxisMap,s=r.yAxisMap,i=r.offset,o=t.clipPathId,c=t.children,d=t.width,u=t.height,h=Cse(i);return q.createElement(mj.Provider,{value:a},q.createElement(pj.Provider,{value:s},q.createElement(GE.Provider,{value:i},q.createElement(HE.Provider,{value:h},q.createElement(KE.Provider,{value:o},q.createElement(YE.Provider,{value:u},q.createElement(ZE.Provider,{value:d},c)))))))},Ase=function(){return y.useContext(KE)},XE=function(t){var r=y.useContext(mj);r==null&&ni();var a=r[t];return a==null&&ni(),a},kse=function(){var t=y.useContext(mj);return za(t)},Pse=function(){var t=y.useContext(pj),r=Nse(t,function(a){return FE(a.domain,Number.isFinite)});return r||za(t)},JE=function(t){var r=y.useContext(pj);r==null&&ni();var a=r[t];return a==null&&ni(),a},Tse=function(){var t=y.useContext(HE);return t},Ose=function(){return y.useContext(GE)},xj=function(){return y.useContext(ZE)},gj=function(){return y.useContext(YE)};function Mo(e){"@babel/helpers - typeof";return Mo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mo(e)}function Ese(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mse(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,eM(a.key),a)}}function Lse(e,t,r){return t&&Mse(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ise(e,t,r){return t=Dh(t),Rse(e,QE()?Reflect.construct(t,r||[],Dh(e).constructor):t.apply(e,r))}function Rse(e,t){if(t&&(Mo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dse(e)}function Dse(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QE=function(){return!!e})()}function Dh(e){return Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dh(e)}function $se(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jy(e,t)}function Jy(e,t){return Jy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},Jy(e,t)}function sC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function iC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sC(Object(r),!0).forEach(function(a){bj(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function bj(e,t,r){return t=eM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eM(e){var t=Fse(e,"string");return Mo(t)=="symbol"?t:t+""}function Fse(e,t){if(Mo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Mo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Bse(e,t){return qse(e)||Wse(e,t)||zse(e,t)||Use()}function Use(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 231In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zse(e,t){if(e){if(typeof e=="string")return oC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oC(e,t)}}function oC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function Wse(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function qse(e){if(Array.isArray(e))return e}function Qy(){return Qy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Qy.apply(this,arguments)}var Vse=function(t,r){var a;return q.isValidElement(t)?a=q.cloneElement(t,r):Oe(t)?a=t(r):a=q.createElement("line",Qy({},r,{className:"recharts-reference-line-line"})),a},Hse=function(t,r,a,s,i,o,c,d,u){var h=i.x,m=i.y,p=i.width,b=i.height;if(a){var w=u.y,x=t.y.apply(w,{position:o});if(Wr(u,"discard")&&!t.y.isInRange(x))return null;var g=[{x:h+p,y:x},{x:h,y:x}];return d==="left"?g.reverse():g}if(r){var j=u.x,S=t.x.apply(j,{position:o});if(Wr(u,"discard")&&!t.x.isInRange(S))return null;var _=[{x:S,y:m+b},{x:S,y:m}];return c==="top"?_.reverse():_}if(s){var N=u.segment,C=N.map(function(A){return t.apply(A,{position:o})});return Wr(u,"discard")&&$ae(C,function(A){return!t.isInRange(A)})?null:C}return null};function Gse(e){var t=e.x,r=e.y,a=e.segment,s=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,u=Ase(),h=XE(s),m=JE(i),p=Tse();if(!u||!p)return null;Sr(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var b=fj({x:h.scale,y:m.scale}),w=zt(t),x=zt(r),g=a&&a.length===2,j=Hse(b,w,x,g,p,e.position,h.orientation,m.orientation,e);if(!j)return null;var S=Bse(j,2),_=S[0],N=_.x,C=_.y,A=S[1],P=A.x,O=A.y,E=Wr(e,"hidden")?"url(#".concat(u,")"):void 0,$=iC(iC({clipPath:E},Ce(e,!0)),{},{x1:N,y1:C,x2:P,y2:O});return q.createElement(He,{className:$e("recharts-reference-line",c)},Vse(o,$),Jt.renderCallByParent(e,pse({x1:N,y1:C,x2:P,y2:O})))}var vj=(function(e){function t(){return Ese(this,t),Ise(this,t,arguments)}return $se(t,e),Lse(t,[{key:"render",value:function(){return q.createElement(Gse,this.props)}}])})(q.Component);bj(vj,"displayName","ReferenceLine");bj(vj,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function e0(){return e0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},e0.apply(this,arguments)}function Lo(e){"@babel/helpers - typeof";return Lo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lo(e)}function lC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function cC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lC(Object(r),!0).forEach(function(a){am(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Kse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yse(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,nM(a.key),a)}}function Zse(e,t,r){return t&&Yse(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xse(e,t,r){return t=$h(t),Jse(e,tM()?Reflect.construct(t,r||[],$h(e).constructor):t.apply(e,r))}function Jse(e,t){if(t&&(Lo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qse(e)}function Qse(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tM=function(){return!!e})()}function $h(e){return $h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$h(e)}function eie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&t0(e,t)}function t0(e,t){return t0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},t0(e,t)}function am(e,t,r){return t=nM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nM(e){var t=tie(e,"string");return Lo(t)=="symbol"?t:t+""}function tie(e,t){if(Lo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Lo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nie=function(t){var r=t.x,a=t.y,s=t.xAxis,i=t.yAxis,o=fj({x:s.scale,y:i.scale}),c=o.apply({x:r,y:a},{bandAware:!0});return Wr(t,"discard")&&!o.isInRange(c)?null:c},sm=(function(e){function t(){return Kse(this,t),Xse(this,t,arguments)}return eie(t,e),Zse(t,[{key:"render",value:function(){var a=this.props,s=a.x,i=a.y,o=a.r,c=a.alwaysShow,d=a.clipPathId,u=zt(s),h=zt(i);if(Sr(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!h)return null;var m=nie(this.props);if(!m)return null;var p=m.x,b=m.y,w=this.props,x=w.shape,g=w.className,j=Wr(this.props,"hidden")?"url(#".concat(d,")"):void 0,S=cC(cC({clipPath:j},Ce(this.props,!0)),{},{cx:p,cy:b});return q.createElement(He,{className:$e("recharts-reference-dot",g)},t.renderDot(x,S),Jt.renderCallByParent(this.props,{x:p-o,y:b-o,width:2*o,height:2*o}))}}])})(q.Component);am(sm,"displayName","ReferenceDot");am(sm,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});am(sm,"renderDot",function(e,t){var r;return q.isValidElement(e)?r=q.cloneElement(e,t):Oe(e)?r=e(t):r=q.createElement(Zf,e0({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function n0(){return n0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},n0.apply(this,arguments)}function Io(e){"@babel/helpers - typeof";return Io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(e)}function dC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function uC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
231t%2?dC(Object(r),!0).forEach(function(a){im(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function rie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aie(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,aM(a.key),a)}}function sie(e,t,r){return t&&aie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function iie(e,t,r){return t=Fh(t),oie(e,rM()?Reflect.construct(t,r||[],Fh(e).constructor):t.apply(e,r))}function oie(e,t){if(t&&(Io(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lie(e)}function lie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rM=function(){return!!e})()}
vendor: 77,873 bytes, lines 231-234
231function Fh(e){return Fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fh(e)}function cie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r0(e,t)}function r0(e,t){return r0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},r0(e,t)}function im(e,t,r){return t=aM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aM(e){var t=die(e,"string");return Io(t)=="symbol"?t:t+""}function die(e,t){if(Io(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Io(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uie=function(t,r,a,s,i){var o=i.x1,c=i.x2,d=i.y1,u=i.y2,h=i.xAxis,m=i.yAxis;if(!h||!m)return null;var p=fj({x:h.scale,y:m.scale}),b={x:t?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:a?p.y.apply(d,{position:"start"}):p.y.rangeMin},w={x:r?p.x.apply(c,{position:"end"}):p.x.rangeMax,y:s?p.y.apply(u,{position:"end"}):p.y.rangeMax};return Wr(i,"discard")&&(!p.isInRange(b)||!p.isInRange(w))?null:qE(b,w)},om=(function(e){function t(){return rie(this,t),iie(this,t,arguments)}return cie(t,e),sie(t,[{key:"render",value:function(){var a=this.props,s=a.x1,i=a.x2,o=a.y1,c=a.y2,d=a.className,u=a.alwaysShow,h=a.clipPathId;Sr(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=zt(s),p=zt(i),b=zt(o),w=zt(c),x=this.props.shape;if(!m&&!p&&!b&&!w&&!x)return null;var g=uie(m,p,b,w,this.props);if(!g&&!x)return null;var j=Wr(this.props,"hidden")?"url(#".concat(h,")"):void 0;return q.createElement(He,{className:$e("recharts-reference-area",d)},t.renderRect(x,uC(uC({clipPath:j},Ce(this.props,!0)),g)),Jt.renderCallByParent(this.props,g))}}])})(q.Component);im(om,"displayName","ReferenceArea");im(om,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});im(om,"renderRect",function(e,t){var r;return q.isValidElement(e)?r=q.cloneElement(e,t):Oe(e)?r=e(t):r=q.createElement(hj,n0({},t,{className:"recharts-reference-area-rect"})),r});function sM(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var a=[],s=0;s<e.length;s+=t)a.push(e[s]);return a}function hie(e,t,r){var a={width:e.width+t.width,height:e.height+t.height};return gse(a,r)}function fie(e,t,r){var a=r==="width",s=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:a?s:i,end:a?s+o:i+c}:{start:a?s+o:i+c,end:a?s:i}}function Bh(e,t,r,a,s){if(e*t<e*a||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-a)>=0&&e*(t+e*i/2-s)<=0}function mie(e,t){return sM(e,t+1)}function pie(e,t,r,a,s){for(var i=(a||[]).slice(),o=t.start,c=t.end,d=0,u=1,h=o,m=function(){var w=a?.[d];if(w===void 0)return{v:sM(a,u)};var x=d,g,j=function(){return g===void 0&&(g=r(w,x)),g},S=w.coordinate,_=d===0||Bh(e,S,j,h,c);_||(d=0,h=o,u+=1),_&&(h=S+e*(j()/2+s),d+=u)},p;u<=i.length;)if(p=m(),p)return p.v;return[]}function Tc(e){"@babel/helpers - typeof";return Tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(e)}function hC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hC(Object(r),!0).forEach(function(a){xie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function xie(e,t,r){return t=gie(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gie(e){var t=bie(e,"string");return Tc(t)=="symbol"?t:t+""}function bie(e,t){if(Tc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Tc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vie(e,t,r,a,s){for(var i=(a||[]).slice(),o=i.length,c=t.start,d=t.end,u=function(p){var b=i[p],w,x=function(){return w===void 0&&(w=r(b,p)),w};if(p===o-1){var g=e*(b.coordinate+e*x()/2-d);i[p]=b=hn(hn({},b),{},{tickCoord:g>0?b.coordinate-g*e:b.coordinate})}else i[p]=b=hn(hn({},b),{},{tickCoord:b.coordinate});var j=Bh(e,b.tickCoord,x,c,d);j&&(d=b.tickCoord-e*(x()/2+s),i[p]=hn(hn({},b),{},{isShow:!0}))},h=o-1;h>=0;h--)u(h);return i}function yie(e,t,r,a,s,i){var o=(a||[]).slice(),c=o.length,d=t.start,u=t.end;if(i){var h=a[c-1],m=r(h,c-1),p=e*(h.coordinate+e*m/2-u);o[c-1]=h=hn(hn({},h),{},{tickCoord:p>0?h.coordinate-p*e:h.coordinate});var b=Bh(e,h.tickCoord,function(){return m},d,u);b&&(u=h.tickCoord-e*(m/2+s),o[c-1]=hn(hn({},h),{},{isShow:!0}))}for(var w=i?c-1:c,x=function(S){var _=o[S],N,C=function(){return N===void 0&&(N=r(_,S)),N};if(S===0){var A=e*(_.coordinate-e*C()/2-d);o[S]=_=hn(hn({},_),{},{tickCoord:A<0?_.coordinate-A*e:_.coordinate})}else o[S]=_=hn(hn({},_),{},{tickCoord:_.coordinate});var P=Bh(e,_.tickCoord,C,d,u);P&&(d=_.tickCoord+e*(C()/2+s),o[S]=hn(hn({},_),{},{isShow:!0}))},g=0;g<w;g++)x(g);return o}function yj(e,t,r){var a=e.tick,s=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,u=e.tickFormatter,h=e.unit,m=e.angle;if(!s||!s.length||!a)return[];if(de(d)||yi.isSsr)return mie(s,typeof d=="number"&&de(d)?d:0);var p=[],b=c==="top"||c==="bottom"?"width":"height",w=h&&b==="width"?Fl(h,{fontSize:t,letterSpacing:r}):{width:0,height:0},x=function(_,N){var C=Oe(u)?u(_.value,N):_.value;return b==="width"?hie(Fl(C,{fontSize:t,letterSpacing:r}),w,m):Fl(C,{fontSize:t,letterSpacing:r})[b]},g=s.length>=2?yn(s[1].coordinate-s[0].coordinate):1,j=fie(i,g,b);return d==="equidistantPreserveStart"?pie(g,j,x,s,o):(d==="preserveStart"||d==="preserveStartEnd"?p=yie(g,j,x,s,o,d==="preserveStartEnd"):p=vie(g,j,x,s,o),p.filter(function(S){return S.isShow}))}var jie=["viewBox"],wie=["viewBox"],Nie=["ticks"];function Ro(e){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ro(e)}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Hi.apply(this,arguments)}function fC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function $t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fC(Object(r),!0).forEach(function(a){jj(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function xv(e,t){if(e==null)return{};var r=_ie(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function _ie(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function Sie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mC(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,oM(a.key),a)}}function Cie(e,t,r){return t&&mC(e.prototype,t),r&&mC(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aie(e,t,r){return t=Uh(t),kie(e,iM()?Reflect.construct(t,r||[],Uh(e).constructor):t.apply(e,r))}function kie(e,t){if(t&&(Ro(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pie(e)}function Pie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iM=function(){return!!e})()}function Uh(e){return Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uh(e)}function Tie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a0(e,t)}function a0(e,t){return a0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},a0(e,t)}function jj(e,t,r){return t=oM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oM(e){var t=Oie(e,"string");return Ro(t)=="symbol"?t:t+""}function Oie(e,t){if(Ro(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Ro(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sl=(function(e){function t(r){var a;return Sie(this,t),a=Aie(this,t,[r]),a.state={fontSize:"",letterSpacing:""},a}return Tie(t,e),Cie(t,[{key:"shouldComponentUpdate",value:function(a,s){var i=a.viewBox,o=xv(a,jie),c=this.props,d=c.viewBox,u=xv(c,wie);return!lo(i,d)||!lo(o,u)||!lo(s,this.state)}},{key:"componentDidMount",value:function(){var a=this.layerReference;if(a){var s=a.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(a){var s=this.props,i=s.x,o=s.y,c=s.width,d=s.height,u=s.orientation,h=s.tickSize,m=s.mirror,p=s.tickMargin,b,w,x,g,j,S,_=m?-1:1,N=a.tickSize||h,C=de(a.tickCoord)?a.tickCoord:a.coordinate;switch(u){case"top":b=w=a.coordinate,g=o+ +!m*d,x=g-_*N,S=x-_*p,j=C;break;case"left":x=g=a.coordinate,w=i+ +!m*c,b=w-_*N,j=b-_*p,S=C;break;case"right":x=g=a.coordinate,w=i+ +m*c,b=w+_*N,j=b+_*p,S=C;break;default:b=w=a.coordinate,g=o+ +m*d,x=g+_*N,S=x+_*p,j=C;break}return{line:{x1:b,y1:x,x2:w,y2:g},tick:{x:j,y:S}}}},{key:"getTickTextAnchor",value:function(){var a=this.props,s=a.orientation,i=a.mirror,o;switch(s){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var a=this.props,s=a.orientation,i=a.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var a=this.props,s=a.x,i=a.y,o=a.width,c=a.height,d=a.orientation,u=a.mirror,h=a.axisLine,m=$t($t($t({},Ce(this.props,!1)),Ce(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var p=+(d==="top"&&!u||d==="bottom"&&u);m=$t($t({},m),{},{x1:s,y1:i+p*c,x2:s+o,y2:i+p*c})}else{var b=+(d==="left"&&!u||d==="right"&&u);m=$t($t({},m),{},{x1:s+b*o,y1:i,x2:s+b*o,y2:i+c})}return q.createElement("line",Hi({},m,{className:$e("recharts-cartesian-axis-line",zn(h,"className"))}))}},{key:"renderTicks",value:function(a,s,i){var o=this,c=this.props,d=c.tickLine,u=c.stroke,h=c.tick,m=c.tickFormatter,p=c.unit,b=yj($t($t({},this.props),{},{ticks:a}),s,i),w=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),g=Ce(this.props,!1),j=Ce(h,!1),S=$t($t({},g),{},{fill:"none"},Ce(d,!1)),_=b.map(function(N,C){var A=o.getTickLineCoord(N),P=A.line,O=A.tick,E=$t($t($t($t({textAnchor:w,verticalAnchor:x},g),{},{stroke:"none",fill:u},j),O),{},{index:C,payload:N,visibleTicksCount:b.length,tickFormatter:m});return q.createElement(He,Hi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},Qs(o.props,N,C)),d&&q.createElement("line",Hi({},S,P,{className:$e("recharts-cartesian-axis-tick-line",zn(d,"className"))})),h&&t.renderTickItem(h,E,"".concat(Oe(m)?m(N.value,C):N.value).concat(p||"")))});return q.createElement("g",{className:"recharts-cartesian-axis-ticks"},_)}},{key:"render",value:function(){var a=this,s=this.props,i=s.axisLine,o=s.width,c=s.height,d=s.ticksGenerator,u=s.className,h=s.hide;if(h)return null;var m=this.props,p=m.ticks,b=xv(m,Nie),w=p;return Oe(d)&&(w=p&&p.length>0?d(this.props):d(b)),o<=0||c<=0||!w||!w.length?null:q.createElement(He,{className:$e("recharts-cartesian-axis",u),ref:function(g){a.layerReference=g}},i&&this.renderAxisLine(),this.renderTicks(w,this.state.fontSize,this.state.letterSpacing),Jt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(a,s,i){var o,c=$e(s.className,"recharts-cartesian-axis-tick-value");return q.isValidElement(a)?o=q.cloneElement(a,$t($t({},s),{},{className:c})):Oe(a)?o=a($t($t({},s),{},{className:c})):o=q.createElement(ei,Hi({},s,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(y.Component);jj(sl,"displayName","CartesianAxis");jj(sl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Eie=["x1","y1","x2","y2","key"],Mie=["offset"];function ri(e){"@babel/helpers - typeof";return ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ri(e)}function pC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pC(Object(r),!0).forEach(function(a){Lie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Lie(e,t,r){return t=Iie(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Iie(e){var t=Rie(e,"string");return ri(t)=="symbol"?t:t+""}function Rie(e,t){if(ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(ri(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Us.apply(this,arguments)}function xC(e,t){if(e==null)return{};var r=Die(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Die(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}var $ie=function(t){var r=t.fill;if(!r||r==="none")return null;var a=t.fillOpacity,s=t.x,i=t.y,o=t.width,c=t.height,d=t.ry;return q.createElement("rect",{x:s,y:i,ry:d,width:o,height:c,stroke:"none",fill:r,fillOpacity:a,className:"recharts-cartesian-grid-bg"})};function lM(e,t){var r;if(q.isValidElement(e))r=q.cloneElement(e,t);else if(Oe(e))r=e(t);else{var a=t.x1,s=t.y1,i=t.x2,o=t.y2,c=t.key,d=xC(t,Eie),u=Ce(d,!1);u.offset;var h=xC(u,Mie);r=q.createElement("line",Us({},h,{x1:a,y1:s,x2:i,y2:o,fill:"none",key:c}))}return r}function Fie(e){var t=e.x,r=e.width,a=e.horizontal,s=a===void 0?!0:a,i=e.horizontalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(c,d){var u=fn(fn({},e),{},{x1:t,y1:c,x2:t+r,y2:c,key:"line-".concat(d),index:d});return lM(s,u)});return q.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Bie(e){var t=e.y,r=e.height,a=e.vertical,s=a===void 0?!0:a,i=e.verticalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(c,d){var u=fn(fn({},e),{},{x1:c,y1:t,x2:c,y2:t+r,key:"line-".concat(d),index:d});return lM(s,u)});return q.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Uie(e){var t=e.horizontalFill,r=e.fillOpacity,a=e.x,s=e.y,i=e.width,o=e.height,c=e.horizontalPoints,d=e.horizontal,u=d===void 0?!0:d;if(!u||!t||!t.length)return null;var h=c.map(function(p){return Math.round(p+s-s)}).sort(function(p,b){return p-b});s!==h[0]&&h.unshift(0);var m=h.map(function(p,b){var w=!h[b+1],x=w?s+o-p:h[b+1]-p;if(x<=0)return null;var g=b%t.length;return q.createElement("rect",{key:"react-".concat(b),y:p,x:a,height:x,width:i,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return q.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function zie(e){var t=e.vertical,r=t===void 0?!0:t,a=e.verticalFill,s=e.fillOpacity,i=e.x,o=e.y,c=e.width,d=e.height,u=e.verticalPoints;if(!r||!a||!a.length)return null;var h=u.map(function(p){return Math.round(p+i-i)}).sort(function(p,b){return p-b});i!==h[0]&&h.unshift(0);var m=h.map(function(p,b){var w=!h[b+1],x=w?i+c-p:h[b+1]-p;if(x<=0)return null;var g=b%a.length;return q.createElement("rect",{key:"react-".concat(b),x:p,y:o,width:x,height:d,stroke:"none",fill:a[g],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return q.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var Wie=function(t,r){var a=t.xAxis,s=t.width,i=t.height,o=t.offset;return cE(yj(fn(fn(fn({},sl.defaultProps),a),{},{ticks:ma(a,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.left,o.left+o.width,r)},qie=function(t,r){var a=t.yAxis,s=t.width,i=t.height,o=t.offset;return cE(yj(fn(fn(fn({},sl.defaultProps),a),{},{ticks:ma(a,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.top,o.top+o.height,r)},Bi={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function cM(e){var t,r,a,s,i,o,c=xj(),d=gj(),u=Ose(),h=fn(fn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Bi.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Bi.fill,horizontal:(a=e.horizontal)!==null&&a!==void 0?a:Bi.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:Bi.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Bi.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Bi.verticalFill,x:de(e.x)?e.x:u.left,y:de(e.y)?e.y:u.top,width:de(e.width)?e.width:u.width,height:de(e.height)?e.height:u.height}),m=h.x,p=h.y,b=h.width,w=h.height,x=h.syncWithTicks,g=h.horizontalValues,j=h.verticalValues,S=kse(),_=Pse();if(!de(b)||b<=0||!de(w)||w<=0||!de(m)||m!==+m||!de(p)||p!==+p)return null;var N=h.verticalCoordinatesGenerator||Wie,C=h.horizontalCoordinatesGenerator||qie,A=h.horizontalPoints,P=h.verticalPoints;if((!A||!A.length)&&Oe(C)){var O=g&&g.length,E=C({yAxis:_?fn(fn({},_),{},{ticks:O?g:_.ticks}):void 0,width:c,height:d,offset:u},O?!0:x);Sr(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ri(E),"]")),Array.isArray(E)&&(A=E)}if((!P||!P.length)&&Oe(N)){var $=j&&j.length,M=N({xAxis:S?fn(fn({},S),{},{ticks:$?j:S.ticks}):void 0,width:c,height:d,offset:u},$?!0:x);Sr(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ri(M),"]")),Array.isArray(M)&&(P=M)}return q.createElement("g",{className:"recharts-cartesian-grid"},q.createElement($ie,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),q.createElement(Fie,Us({},h,{offset:u,horizontalPoints:A,xAxis:S,yAxis:_})),q.createElement(Bie,Us({},h,{offset:u,verticalPoints:P,xAxis:S,yAxis:_})),q.createElement(Uie,Us({},h,{horizontalPoints:A})),q.createElement(zie,Us({},h,{verticalPoints:P})))}cM.displayName="CartesianGrid";var Vie=["layout","type","stroke","connectNulls","isRange","ref"],Hie=["key"],dM;function Do(e){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(e)}function uM(e,t){if(e==null)return{};var r=Gie(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Gie(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function zs(){return zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},zs.apply(this,arguments)}function gC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ba(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gC(Object(r),!0).forEach(function(a){$r(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Kie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bC(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,fM(a.key),a)}}function Yie(e,t,r){return t&&bC(e.prototype,t),r&&bC(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zie(e,t,r){return t=zh(t),Xie(e,hM()?Reflect.construct(t,r||[],zh(e).constructor):t.apply(e,r))}function Xie(e,t){if(t&&(Do(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jie(e)}function Jie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hM=function(){return!!e})()}function zh(e){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zh(e)}function Qie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s0(e,t)}function s0(e,t){return s0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},s0(e,t)}function $r(e,t,r){return t=fM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fM(e){var t=eoe(e,"string");return Do(t)=="symbol"?t:t+""}function eoe(e,t){if(Do(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Do(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hs=(function(e){function t(){var r;Kie(this,t);for(var a=arguments.length,s=new Array(a),i=0;i<a;i++)s[i]=arguments[i];return r=Zie(this,t,[].concat(s)),$r(r,"state",{isAnimationFinished:!0}),$r(r,"id",el("recharts-area-")),$r(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Oe(o)&&o()}),$r(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Oe(o)&&o()}),r}return Qie(t,e),Yie(t,[{key:"renderDots",value:function(a,s,i){var o=this.props.isAnimationActive,c=this.state.isAnimationFinished;if(o&&!c)return null;var d=this.props,u=d.dot,h=d.points,m=d.dataKey,p=Ce(this.props,!1),b=Ce(u,!0),w=h.map(function(g,j){var S=Ba(Ba(Ba({key:"dot-".concat(j),r:3},p),b),{},{index:j,cx:g.x,cy:g.y,dataKey:m,value:g.value,payload:g.payload,points:h});return t.renderDotItem(u,S)}),x={clipPath:a?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return q.createElement(He,zs({className:"recharts-area-dots"},x),w)}},{key:"renderHorizontalRect",value:function(a){var s=this.props,i=s.baseLine,o=s.points,c=s.strokeWidth,d=o[0].x,u=o[o.length-1].x,h=a*Math.abs(d-u),m=Wa(o.map(function(p){return p.y||0}));return de(i)&&typeof i=="number"?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(Wa(i.map(function(p){return p.y||0})),m)),de(m)?q.createElement("rect",{x:d<u?d:d-h,y:0,width:h,height:Math.floor(m+(c?parseInt("".concat(c),10):1))}):null}},{key:"renderVerticalRect",value:function(a){var s=this.props,i=s.baseLine,o=s.points,c=s.strokeWidth,d=o[0].y,u=o[o.length-1].y,h=a*Math.abs(d-u),m=Wa(o.map(function(p){return p.x||0}));return de(i)&&typeof i=="number"?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(Wa(i.map(function(p){return p.x||0})),m)),de(m)?q.createElement("rect",{x:0,y:d<u?d:d-h,width:m+(c?parseInt("".concat(c),10):1),height:Math.floor(h)}):null}},{key:"renderClipRect",value:function(a){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(a):this.renderHorizontalRect(a)}},{key:"renderAreaStatically",value:function(a,s,i,o){var c=this.props,d=c.layout,u=c.type,h=c.stroke,m=c.connectNulls,p=c.isRange;c.ref;var b=uM(c,Vie);return q.createElement(He,{clipPath:i?"url(#clipPath-".concat(o,")"):null},q.createElement(fo,zs({},Ce(b,!0),{points:a,connectNulls:m,type:u,baseLine:s,layout:d,stroke:"none",className:"recharts-area-area"})),h!=="none"&&q.createElement(fo,zs({},Ce(this.props,!1),{className:"recharts-area-curve",layout:d,type:u,connectNulls:m,fill:"none",points:a})),h!=="none"&&p&&q.createElement(fo,zs({},Ce(this.props,!1),{className:"recharts-area-curve",layout:d,type:u,connectNulls:m,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(a,s){var i=this,o=this.props,c=o.points,d=o.baseLine,u=o.isAnimationActive,h=o.animationBegin,m=o.animationDuration,p=o.animationEasing,b=o.animationId,w=this.state,x=w.prevPoints,g=w.prevBaseLine;return q.createElement(Kr,{begin:h,duration:m,isActive:u,easing:p,from:{t:0},to:{t:1},key:"area-".concat(b),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var S=j.t;if(x){var _=x.length/c.length,N=c.map(function(O,E){var $=Math.floor(E*_);if(x[$]){var M=x[$],R=An(M.x,O.x),B=An(M.y,O.y);return Ba(Ba({},O),{},{x:R(S),y:B(S)})}return O}),C;if(de(d)&&typeof d=="number"){var A=An(g,d);C=A(S)}else if(Ie(d)||Qo(d)){var P=An(g,0);C=P(S)}else C=d.map(function(O,E){var $=Math.floor(E*_);if(g[$]){var M=g[$],R=An(M.x,O.x),B=An(M.y,O.y);return Ba(Ba({},O),{},{x:R(S),y:B(S)})}return O});return i.renderAreaStatically(N,C,a,s)}return q.createElement(He,null,q.createElement("defs",null,q.createElement("clipPath",{id:"animationClipPath-".concat(s)},i.renderClipRect(S))),q.createElement(He,{clipPath:"url(#animationClipPath-".concat(s,")")},i.renderAreaStatically(c,d,a,s)))})}},{key:"renderArea",value:function(a,s){var i=this.props,o=i.points,c=i.baseLine,d=i.isAnimationActive,u=this.state,h=u.prevPoints,m=u.prevBaseLine,p=u.totalLength;return d&&o&&o.length&&(!h&&p>0||!_o(h,o)||!_o(m,c))?this.renderAreaWithAnimation(a,s):this.renderAreaStatically(o,c,a,s)}},{key:"render",value:function(){var a,s=this.props,i=s.hide,o=s.dot,c=s.points,d=s.className,u=s.top,h=s.left,m=s.xAxis,p=s.yAxis,b=s.width,w=s.height,x=s.isAnimationActive,g=s.id;if(i||!c||!c.length)return null;var j=this.state.isAnimationFinished,S=c.length===1,_=$e("recharts-area",d),N=m&&m.allowDataOverflow,C=p&&p.allowDataOverflow,A=N||C,P=Ie(g)?this.id:g,O=(a=Ce(o,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},E=O.r,$=E===void 0?3:E,M=O.strokeWidth,R=M===void 0?2:M,B=OV(o)?o:{},D=B.clipDot,U=D===void 0?!0:D,H=$*2+R;return q.createElement(He,{className:_},N||C?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(P)},q.createElement("rect",{x:N?h:h-b/2,y:C?u:u-w/2,width:N?b:b*2,height:C?w:w*2})),!U&&q.createElement("clipPath",{id:"clipPath-dots-".concat(P)},q.createElement("rect",{x:h-H/2,y:u-H/2,width:b+H,height:w+H}))):null,S?null:this.renderArea(A,P),(o||S)&&this.renderDots(A,U,P),(!x||j)&&ya.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(a,s){return a.animationId!==s.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,curBaseLine:a.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:a.points!==s.curPoints||a.baseLine!==s.curBaseLine?{curPoints:a.points,curBaseLine:a.baseLine}:null}}])})(y.PureComponent);dM=hs;$r(hs,"displayName","Area");$r(hs,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!yi.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});$r(hs,"getBaseValue",function(e,t,r,a){var s=e.layout,i=e.baseValue,o=t.props.baseValue,c=o??i;if(de(c)&&typeof c=="number")return c;var d=s==="horizontal"?a:r,u=d.scale.domain();if(d.type==="number"){var h=Math.max(u[0],u[1]),m=Math.min(u[0],u[1]);return c==="dataMin"?m:c==="dataMax"||h<0?h:Math.max(Math.min(u[0],u[1]),0)}return c==="dataMin"?u[0]:c==="dataMax"?u[1]:u[0]});$r(hs,"getComposedData",function(e){var t=e.props,r=e.item,a=e.xAxis,s=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,c=e.bandSize,d=e.dataKey,u=e.stackedData,h=e.dataStartIndex,m=e.displayedData,p=e.offset,b=t.layout,w=u&&u.length,x=dM.getBaseValue(t,r,a,s),g=b==="horizontal",j=!1,S=m.map(function(N,C){var A;w?A=u[h+C]:(A=Ut(N,d),Array.isArray(A)?j=!0:A=[x,A]);var P=A[1]==null||w&&Ut(N,d)==null;return g?{x:_3({axis:a,ticks:i,bandSize:c,entry:N,index:C}),y:P?null:s.scale(A[1]),value:A,payload:N}:{x:P?null:a.scale(A[1]),y:_3({axis:s,ticks:o,bandSize:c,entry:N,index:C}),value:A,payload:N}}),_;return w||j?_=S.map(function(N){var C=Array.isArray(N.value)?N.value[0]:null;return g?{x:N.x,y:C!=null&&N.y!=null?s.scale(C):null}:{x:C!=null?a.scale(C):null,y:N.y}}):_=g?s.scale(x):a.scale(x),Ba({points:S,baseLine:_,layout:b,isRange:j},p)});$r(hs,"renderDotItem",function(e,t){var r;if(q.isValidElement(e))r=q.cloneElement(e,t);else if(Oe(e))r=e(t);else{var a=$e("recharts-area-dot",typeof e!="boolean"?e.className:""),s=t.key,i=uM(t,Hie);r=q.createElement(Zf,zs({},i,{key:s,className:a}))}return r});function $o(e){"@babel/helpers - typeof";return $o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$o(e)}function toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function noe(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,xM(a.key),a)}}function roe(e,t,r){return t&&noe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aoe(e,t,r){return t=Wh(t),soe(e,mM()?Reflect.construct(t,r||[],Wh(e).constructor):t.apply(e,r))}function soe(e,t){if(t&&($o(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ioe(e)}function ioe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mM=function(){return!!e})()}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wh(e)}function ooe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i0(e,t)}function i0(e,t){return i0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},i0(e,t)}function pM(e,t,r){return t=xM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xM(e){var t=loe(e,"string");return $o(t)=="symbol"?t:t+""}function loe(e,t){if($o(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if($o(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function o0(){return o0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},o0.apply(this,arguments)}function coe(e){var t=e.xAxisId,r=xj(),a=gj(),s=XE(t);return s==null?null:y.createElement(sl,o0({},s,{className:$e("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(o){return ma(o,!0)}}))}var lm=(function(e){function t(){return toe(this,t),aoe(this,t,arguments)}return ooe(t,e),roe(t,[{key:"render",value:function(){return y.createElement(coe,this.props)}}])})(y.Component);pM(lm,"displayName","XAxis");pM(lm,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Fo(e){"@babel/helpers - typeof";return Fo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(e)}function doe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uoe(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,vM(a.key),a)}}function hoe(e,t,r){return t&&uoe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function foe(e,t,r){return t=qh(t),moe(e,gM()?Reflect.construct(t,r||[],qh(e).constructor):t.apply(e,r))}function moe(e,t){if(t&&(Fo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return poe(e)}function poe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gM=function(){return!!e})()}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qh(e)}function xoe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l0(e,t)}function l0(e,t){return l0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},l0(e,t)}function bM(e,t,r){return t=vM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vM(e){var t=goe(e,"string");return Fo(t)=="symbol"?t:t+""}function goe(e,t){if(Fo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Fo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},c0.apply(this,arguments)}var boe=function(t){var r=t.yAxisId,a=xj(),s=gj(),i=JE(r);return i==null?null:y.createElement(sl,c0({},i,{className:$e("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:a,height:s},ticksGenerator:function(c){return ma(c,!0)}}))},cm=(function(e){function t(){return doe(this,t),foe(this,t,arguments)}return xoe(t,e),hoe(t,[{key:"render",value:function(){return y.createElement(boe,this.props)}}])})(y.Component);bM(cm,"displayName","YAxis");bM(cm,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function vC(e){return woe(e)||joe(e)||yoe(e)||voe()}function voe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 232In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yoe(e,t){if(e){if(typeof e=="string")return d0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d0(e,t)}}function joe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function woe(e){if(Array.isArray(e))return d0(e)}function d0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var u0=function(t,r,a,s,i){var o=nr(t,vj),c=nr(t,sm),d=[].concat(vC(o),vC(c)),u=nr(t,om),h="".concat(s,"Id"),m=s[0],p=r;if(d.length&&(p=d.reduce(function(x,g){if(g.props[h]===a&&Wr(g.props,"extendDomain")&&de(g.props[m])){var j=g.props[m];return[Math.min(x[0],j),Math.max(x[1],j)]}return x},p)),u.length){var b="".concat(m,"1"),w="".concat(m,"2");p=u.reduce(function(x,g){if(g.props[h]===a&&Wr(g.props,"extendDomain")&&de(g.props[b])&&de(g.props[w])){var j=g.props[b],S=g.props[w];return[Math.min(x[0],j,S),Math.max(x[1],j,S)]}return x},p)}return i&&i.length&&(p=i.reduce(function(x,g){return de(g)?[Math.min(x[0],g),Math.max(x[1],g)]:x},p)),p},gv={exports:{}},yC;function Noe(){return yC||(yC=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function s(d,u,h){this.fn=d,this.context=u,this.once=h||!1}function i(d,u,h,m,p){if(typeof h!="function")throw new TypeError("The listener must be a function");var b=new s(h,m||d,p),w=r?r+u:u;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],b]:d._events[w].push(b):(d._events[w]=b,d._eventsCount++),d}function o(d,u){--d._eventsCount===0?d._events=new a:delete d._events[u]}function c(){this._events=new a,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],h,m;if(this._eventsCount===0)return u;for(m in h=this._events)t.call(h,m)&&u.push(r?m.slice(1):m);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},c.prototype.listeners=function(u){var h=r?r+u:u,m=this._events[h];if(!m)return[];if(m.fn)return[m.fn];for(var p=0,b=m.length,w=new Array(b);p<b;p++)w[p]=m[p].fn;return w},c.prototype.listenerCount=function(u){var h=r?r+u:u,m=this._events[h];return m?m.fn?1:m.length:0},c.prototype.emit=function(u,h,m,p,b,w){var x=r?r+u:u;if(!this._events[x])return!1;var g=this._events[x],j=arguments.length,S,_;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),j){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,h),!0;case 3:return g.fn.call(g.context,h,m),!0;case 4:return g.fn.call(g.context,h,m,p),!0;case 5:return g.fn.call(g.context,h,m,p,b),!0;case 6:return g.fn.call(g.context,h,m,p,b,w),!0}for(_=1,S=new Array(j-1);_<j;_++)S[_-1]=arguments[_];g.fn.apply(g.context,S)}else{var N=g.length,C;for(_=0;_<N;_++)switch(g[_].once&&this.removeListener(u,g[_].fn,void 0,!0),j){case 1:g[_].fn.call(g[_].context);break;case 2:g[_].fn.call(g[_].context,h);break;case 3:g[_].fn.call(g[_].context,h,m);break;case 4:g[_].fn.call(g[_].context,h,m,p);break;default:if(!S)for(C=1,S=new Array(j-1);C<j;C++)S[C-1]=arguments[C];g[_].fn.apply(g[_].context,S)}}return!0},c.prototype.on=function(u,h,m){return i(this,u,h,m,!1)},c.prototype.once=function(u,h,m){return i(this,u,h,m,!0)},c.prototype.removeListener=function(u,h,m,p){var b=r?r+u:u;if(!this._events[b])return this;if(!h)return o(this,b),this;var w=this._events[b];if(w.fn)w.fn===h&&(!p||w.once)&&(!m||w.context===m)&&o(this,b);else{for(var x=0,g=[],j=w.length;x<j;x++)(w[x].fn!==h||p&&!w[x].once||m&&w[x].context!==m)&&g.push(w[x]);g.length?this._events[b]=g.length===1?g[0]:g:o(this,b)}return this},c.prototype.removeAllListeners=function(u){var h;return u?(h=r?r+u:u,this._events[h]&&o(this,h)):(this._events=new a,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c})(gv)),gv.exports}var _oe=Noe();const Soe=it(_oe);var bv=new Soe,vv="recharts.syncMouseEvents";function Oc(e){"@babel/helpers - typeof";return Oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(e)}function Coe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Aoe(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,yM(a.key),a)}}function koe(e,t,r){return t&&Aoe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yv(e,t,r){return t=yM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yM(e){var t=Poe(e,"string");return Oc(t)=="symbol"?t:t+""}function Poe(e,t){if(Oc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Oc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Toe=(function(){function e(){Coe(this,e),yv(this,"activeIndex",0),yv(this,"coordinateList",[]),yv(this,"layout","horizontal")}return koe(e,[{key:"setDetails",value:function(r){var a,s=r.coordinateList,i=s===void 0?null:s,o=r.container,c=o===void 0?null:o,d=r.layout,u=d===void 0?null:d,h=r.offset,m=h===void 0?null:h,p=r.mouseHandlerCallback,b=p===void 0?null:p;this.coordinateList=(a=i??this.coordinateList)!==null&&a!==void 0?a:[],this.container=c??this.container,this.layout=u??this.layout,this.offset=m??this.offset,this.mouseHandlerCallback=b??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,a;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),i=s.x,o=s.y,c=s.height,d=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,h=((a=window)===null||a===void 0?void 0:a.scrollY)||0,m=i+d+u,p=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:m,pageY:p})}}}])})();function Ooe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var a=e?.[0],s=e?.[1];if(a&&s&&de(a)&&de(s))return!0}return!1}function Eoe(e,t,r,a){var s=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?a:r.width-1,height:e==="horizontal"?r.height-1:a}}function jM(e){var t=e.cx,r=e.cy,a=e.radius,s=e.startAngle,i=e.endAngle,o=mt(t,r,a,s),c=mt(t,r,a,i);return{points:[o,c],cx:t,cy:r,radius:a,startAngle:s,endAngle:i}}function Moe(e,t,r){var a,s,i,o;if(e==="horizontal")a=t.x,i=a,s=r.top,o=r.top+r.height;else if(e==="vertical")s=t.y,o=s,a=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,u=t.innerRadius,h=t.outerRadius,m=t.angle,p=mt(c,d,u,m),b=mt(c,d,h,m);a=p.x,s=p.y,i=b.x,o=b.y}else return jM(t);return[{x:a,y:s},{x:i,y:o}]}function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function jC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function eu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jC(Object(r),!0).forEach(function(a){Loe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Loe(e,t,r){return t=Ioe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ioe(e){var t=Roe(e,"string");return Ec(t)=="symbol"?t:t+""}function Roe(e,t){if(Ec(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Ec(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Doe(e){var t,r,a=e.element,s=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,u=e.activeTooltipIndex,h=e.tooltipAxisBandSize,m=e.layout,p=e.chartName,b=(t=a.props.cursor)!==null&&t!==void 0?t:(r=a.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!a||!b||!i||!o||p!=="ScatterChart"&&s!=="axis")return null;var w,x=fo;if(p==="ScatterChart")w=o,x=lre;else if(p==="BarChart")w=Eoe(m,o,d,h),x=hj;else if(m==="radial"){var g=jM(o),j=g.cx,S=g.cy,_=g.radius,N=g.startAngle,C=g.endAngle;w={cx:j,cy:S,startAngle:N,endAngle:C,innerRadius:_,outerRadius:_},x=yE}else w={points:Moe(m,o,d)},x=fo;var A=eu(eu(eu(eu({stroke:"#ccc",pointerEvents:"none"},d),w),Ce(b,!1)),{},{payload:c,payloadIndex:u,className:$e("recharts-tooltip-cursor",b.className)});return y.isValidElement(b)?y.cloneElement(b,A):y.createElement(x,A)}var $oe=["item"],Foe=["children","className","width","height","style","compact","title","desc"];function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(e)}function Gi(){return Gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Gi.apply(this,arguments)}function wC(e,t){return zoe(e)||Uoe(e,t)||NM(e,t)||Boe()}function Boe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 233In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uoe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a,s,i,o,c=[],d=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(d=(a=i.call(r)).done)&&(c.push(a.value),c.length!==t);d=!0);}catch(h){u=!0,s=h}finally{try{if(!d&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return c}}function zoe(e){if(Array.isArray(e))return e}function NC(e,t){if(e==null)return{};var r=Woe(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Woe(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function qoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Voe(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,_M(a.key),a)}}function Hoe(e,t,r){return t&&Voe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Goe(e,t,r){return t=Vh(t),Koe(e,wM()?Reflect.construct(t,r||[],Vh(e).constructor):t.apply(e,r))}function Koe(e,t){if(t&&(Bo(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yoe(e)}function Yoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wM=function(){return!!e})()}function Vh(e){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vh(e)}function Zoe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h0(e,t)}function h0(e,t){return h0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,s){return a.__proto__=s,a},h0(e,t)}function Uo(e){return Qoe(e)||Joe(e)||NM(e)||Xoe()}function Xoe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 234In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NM(e,t){if(e){if(typeof e=="string")return f0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f0(e,t)}}function Joe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qoe(e){if(Array.isArray(e))return f0(e)}function f0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(r),!0).forEach(function(a){Pe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_C(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Pe(e,t,r){return t=_M(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _M(e){var t=ele(e,"string");return Bo(t)=="symbol"?t:t+""}function ele(e,t){if(Bo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Bo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tle={xAxis:["bottom","top"],yAxis:["left","right"]},nle={width:"100%",height:"100%"},SM={x:0,y:0};function tu(e){return e}var rle=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},ale=function(t,r,a,s){var i=r.find(function(h){return h&&h.index===a});if(i){if(t==="horizontal")return{x:i.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=s.radius;return se(se(se({},s),mt(s.cx,s.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,u=s.angle;return se(se(se({},s),mt(s.cx,s.cy,d,u)),{},{angle:u,radius:d})}return SM},dm=function(t,r){var a=r.graphicalItems,s=r.dataStartIndex,i=r.dataEndIndex,o=(a??[]).reduce(function(c,d){var u=d.props.data;return u&&u.length?[].concat(Uo(c),Uo(u)):c},[]);return o.length>0?o:t&&t.length&&de(s)&&de(i)?t.slice(s,i+1):[]};function CM(e){return e==="number"?[0,"auto"]:void 0}var m0=function(t,r,a,s){var i=t.graphicalItems,o=t.tooltipAxis,c=dm(r,t);return a<0||!i||!i.length||a>=c.length?null:i.reduce(function(d,u){var h,m=(h=u.props.data)!==null&&h!==void 0?h:r;m&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=a&&(m=m.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var b=m===void 0?c:m;p=Gu(b,o.dataKey,s)}else p=m&&m[a]||c[a];return p?[].concat(Uo(d),[mE(u,p)]):d},[])},SC=function(t,r,a,s){var i=s||{x:t.chartX,y:t.chartY},o=rle(i,a),c=t.orderedTooltipTicks,d=t.tooltipAxis,u=t.tooltipTicks,h=PQ(o,c,u,d);if(h>=0&&u){var m=u[h]&&u[h].value,p=m0(t,r,h,m),b=ale(a,c,h,i);return{activeTooltipIndex:h,activeLabel:m,activePayload:p,activeCoordinate:b}}return null},sle=function(t,r){var a=r.axes,s=r.graphicalItems,i=r.axisType,o=r.axisIdKey,c=r.stackGroups,d=r.dataStartIndex,u=r.dataEndIndex,h=t.layout,m=t.children,p=t.stackOffset,b=lE(h,i);return a.reduce(function(w,x){var g,j=x.type.defaultProps!==void 0?se(se({},x.type.defaultProps),x.props):x.props,S=j.type,_=j.dataKey,N=j.allowDataOverflow,C=j.allowDuplicatedCategory,A=j.scale,P=j.ticks,O=j.includeHidden,E=j[o];if(w[E])return w;var $=dm(t.data,{graphicalItems:s.filter(function(re){var ce,fe=o in re.props?re.props[o]:(ce=re.type.defaultProps)===null||ce===void 0?void 0:ce[o];return fe===E}),dataStartIndex:d,dataEndIndex:u}),M=$.length,R,B,D;Ooe(j.domain,N,S)&&(R=Py(j.domain,null,N),b&&(S==="number"||A!=="auto")&&(D=Ul($,_,"category")));var U=CM(S);if(!R||R.length===0){var H,K=(H=j.domain)!==null&&H!==void 0?H:U;if(_){if(R=Ul($,_,S),S==="category"&&b){var z=jV(R);C&&z?(B=R,R=Eh(0,M)):C||(R=k3(K,R,x).reduce(function(re,ce){return re.indexOf(ce)>=0?re:[].concat(Uo(re),[ce])},[]))}else if(S==="category")C?R=R.filter(function(re){return re!==""&&!Ie(re)}):R=k3(K,R,x).reduce(function(re,ce){return re.indexOf(ce)>=0||ce===""||Ie(ce)?re:[].concat(Uo(re),[ce])},[]);else if(S==="number"){var X=LQ($,s.filter(function(re){var ce,fe,me=o in re.props?re.props[o]:(ce=re.type.defaultProps)===null||ce===void 0?void 0:ce[o],pe="hide"in re.props?re.props.hide:(fe=re.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return me===E&&(O||!pe)}),_,i,h);X&&(R=X)}b&&(S==="number"||A!=="auto")&&(D=Ul($,_,"category"))}else b?R=Eh(0,M):c&&c[E]&&c[E].hasStack&&S==="number"?R=p==="expand"?[0,1]:fE(c[E].stackGroups,d,u):R=oE($,s.filter(function(re){var ce=o in re.props?re.props[o]:re.type.defaultProps[o],fe="hide"in re.props?re.props.hide:re.type.defaultProps.hide;return ce===E&&(O||!fe)}),S,h,!0);if(S==="number")R=u0(m,R,E,i,P),K&&(R=Py(K,R,N));else if(S==="category"&&K){var G=K,Q=R.every(function(re){return G.indexOf(re)>=0});Q&&(R=G)}}return se(se({},w),{},Pe({},E,se(se({},j),{},{axisType:i,domain:R,categoricalDomain:D,duplicateDomain:B,originalDomain:(g=j.domain)!==null&&g!==void 0?g:U,isCategorical:b,layout:h})))},{})},ile=function(t,r){var a=r.graphicalItems,s=r.Axis,i=r.axisType,o=r.axisIdKey,c=r.stackGroups,d=r.dataStartIndex,u=r.dataEndIndex,h=t.layout,m=t.children,p=dm(t.data,{graphicalItems:a,dataStartIndex:d,dataEndIndex:u}),b=p.length,w=lE(h,i),x=-1;return a.reduce(function(g,j){var S=j.type.defaultProps!==void 0?se(se({},j.type.defaultProps),j.props):j.props,_=S[o],N=CM("number");if(!g[_]){x++;var C;return w?C=Eh(0,b):c&&c[_]&&c[_].hasStack?(C=fE(c[_].stackGroups,d,u),C=u0(m,C,_,i)):(C=Py(N,oE(p,a.filter(function(A){var P,O,E=o in A.props?A.props[o]:(P=A.type.defaultProps)===null||P===void 0?void 0:P[o],$="hide"in A.props?A.props.hide:(O=A.type.defaultProps)===null||O===void 0?void 0:O.hide;return E===_&&!$}),"number",h),s.defaultProps.allowDataOverflow),C=u0(m,C,_,i)),se(se({},g),{},Pe({},_,se(se({axisType:i},s.defaultProps),{},{hide:!0,orientation:zn(tle,"".concat(i,".").concat(x%2),null),domain:C,originalDomain:N,isCategorical:w,layout:h})))}return g},{})},ole=function(t,r){var a=r.axisType,s=a===void 0?"xAxis":a,i=r.AxisComp,o=r.graphicalItems,c=r.stackGroups,d=r.dataStartIndex,u=r.dataEndIndex,h=t.children,m="".concat(s,"Id"),p=nr(h,i),b={};return p&&p.length?b=sle(t,{axes:p,graphicalItems:o,axisType:s,axisIdKey:m,stackGroups:c,dataStartIndex:d,dataEndIndex:u}):o&&o.length&&(b=ile(t,{Axis:i,graphicalItems:o,axisType:s,axisIdKey:m,stackGroups:c,dataStartIndex:d,dataEndIndex:u})),b},lle=function(t){var r=za(t),a=ma(r,!1,!0);return{tooltipTicks:a,orderedTooltipTicks:F1(a,function(s){return s.coordinate}),tooltipAxis:r,tooltipAxisBandSize:vh(r,a)}},CC=function(t){var r=t.children,a=t.defaultShowTooltip,s=$n(r,Oo),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(i=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!a}},cle=function(t){return!t||!t.length?!1:t.some(function(r){var a=ba(r&&r.type);return a&&a.indexOf("Bar")>=0})},AC=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},dle=function(t,r){var a=t.props,s=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,u=a.width,h=a.height,m=a.children,p=a.margin||{},b=$n(m,Oo),w=$n(m,co),x=Object.keys(d).reduce(function(C,A){var P=d[A],O=P.orientation;return!P.mirror&&!P.hide?se(se({},C),{},Pe({},O,C[O]+P.width)):C},{left:p.left||0,right:p.right||0}),g=Object.keys(o).reduce(function(C,A){var P=o[A],O=P.orientation;return!P.mirror&&!P.hide?se(se({},C),{},Pe({},O,zn(C,"".concat(O))+P.height)):C},{top:p.top||0,bottom:p.bottom||0}),j=se(se({},g),x),S=j.bottom;b&&(j.bottom+=b.props.height||Oo.defaultProps.height),w&&r&&(j=EQ(j,s,a,r));var _=u-j.left-j.right,N=h-j.top-j.bottom;return se(se({brushBottom:S},j),{},{width:Math.max(_,0),height:Math.max(N,0)})},ule=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},AM=function(t){var r=t.chartName,a=t.GraphicalChild,s=t.defaultTooltipEventType,i=s===void 0?"axis":s,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,u=t.legendContent,h=t.formatAxisMap,m=t.defaultProps,p=function(j,S){var _=S.graphicalItems,N=S.stackGroups,C=S.offset,A=S.updateId,P=S.dataStartIndex,O=S.dataEndIndex,E=j.barSize,$=j.layout,M=j.barGap,R=j.barCategoryGap,B=j.maxBarSize,D=AC($),U=D.numericAxisName,H=D.cateAxisName,K=cle(_),z=[];return _.forEach(function(X,G){var Q=dm(j.data,{graphicalItems:[X],dataStartIndex:P,dataEndIndex:O}),re=X.type.defaultProps!==void 0?se(se({},X.type.defaultProps),X.props):X.props,ce=re.dataKey,fe=re.maxBarSize,me=re["".concat(U,"Id")],pe=re["".concat(H,"Id")],Re={},J=d.reduce(function(qe,dn){var kr=S["".concat(dn.axisType,"Map")],id=re["".concat(dn.axisType,"Id")];kr&&kr[id]||dn.axisType==="zAxis"||ni();var od=kr[id];return se(se({},qe),{},Pe(Pe({},dn.axisType,od),"".concat(dn.axisType,"Ticks"),ma(od)))},Re),ae=J[H],ue=J["".concat(H,"Ticks")],ee=N&&N[me]&&N[me].hasStack&&WQ(X,N[me].stackGroups),Y=ba(X.type).indexOf("Bar")>=0,je=vh(ae,ue),ke=[],Le=K&&TQ({barSize:E,stackGroups:N,totalSize:ule(J,H)});if(Y){var Ge,at,ot=Ie(fe)?B:fe,le=(Ge=(at=vh(ae,ue,!0))!==null&&at!==void 0?at:ot)!==null&&Ge!==void 0?Ge:0;ke=OQ({barGap:M,barCategoryGap:R,bandSize:le!==je?le:je,sizeList:Le[pe],maxBarSize:ot}),le!==je&&(ke=ke.map(function(qe){return se(se({},qe),{},{position:se(se({},qe.position),{},{offset:qe.position.offset-le/2})})}))}var Ne=X&&X.type&&X.type.getComposedData;Ne&&z.push({props:se(se({},Ne(se(se({},J),{},{displayedData:Q,props:j,dataKey:ce,item:X,bandSize:je,barPosition:ke,offset:C,stackedData:ee,layout:$,dataStartIndex:P,dataEndIndex:O}))),{},Pe(Pe(Pe({key:X.key||"item-".concat(G)},U,J[U]),H,J[H]),"animationId",A)),childIndex:LV(X,j.children),item:X})}),z},b=function(j,S){var _=j.props,N=j.dataStartIndex,C=j.dataEndIndex,A=j.updateId;if(!z2({props:_}))return null;var P=_.children,O=_.layout,E=_.stackOffset,$=_.data,M=_.reverseStackOrder,R=AC(O),B=R.numericAxisName,D=R.cateAxisName,U=nr(P,a),H=UQ($,U,"".concat(B,"Id"),"".concat(D,"Id"),E,M),K=d.reduce(function(re,ce){var fe="".concat(ce.axisType,"Map");return se(se({},re),{},Pe({},fe,ole(_,se(se({},ce),{},{graphicalItems:U,stackGroups:ce.axisType===B&&H,dataStartIndex:N,dataEndIndex:C}))))},{}),z=dle(se(se({},K),{},{props:_,graphicalItems:U}),S?.legendBBox);Object.keys(K).forEach(function(re){K[re]=h(_,K[re],z,re.replace("Map",""),r)});var X=K["".concat(D,"Map")],G=lle(X),Q=p(_,se(se({},K),{},{dataStartIndex:N,dataEndIndex:C,updateId:A,graphicalItems:U,stackGroups:H,offset:z}));return se(se({formattedGraphicalItems:Q,graphicalItems:U,offset:z,stackGroups:H},G),K)},w=(function(g){function j(S){var _,N,C;return qoe(this,j),C=Goe(this,j,[S]),Pe(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pe(C,"accessibilityManager",new Toe),Pe(C,"handleLegendBBoxUpdate",function(A){if(A){var P=C.state,O=P.dataStartIndex,E=P.dataEndIndex,$=P.updateId;C.setState(se({legendBBox:A},b({props:C.props,dataStartIndex:O,dataEndIndex:E,updateId:$},se(se({},C.state),{},{legendBBox:A}))))}}),Pe(C,"handleReceiveSyncEvent",function(A,P,O){if(C.props.syncId===A){if(O===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(P)}}),Pe(C,"handleBrushChange",function(A){var P=A.startIndex,O=A.endIndex;if(P!==C.state.dataStartIndex||O!==C.state.dataEndIndex){var E=C.state.updateId;C.setState(function(){return se({dataStartIndex:P,dataEndIndex:O},b({props:C.props,dataStartIndex:P,dataEndIndex:O,updateId:E},C.state))}),C.triggerSyncEvent({dataStartIndex:P,dataEndIndex:O})}}),Pe(C,"handleMouseEnter",function(A){var P=C.getMouseInfo(A);if(P){var O=se(se({},P),{},{isTooltipActive:!0});C.setState(O),C.triggerSyncEvent(O);var E=C.props.onMouseEnter;Oe(E)&&E(O,A)}}),Pe(C,"triggeredAfterMouseMove",function(A){var P=C.getMouseInfo(A),O=P?se(se({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(O),C.triggerSyncEvent(O);var E=C.props.onMouseMove;Oe(E)&&E(O,A)}),Pe(C,"handleItemMouseEnter",function(A){C.setState(function(){return{isTooltipActive:!0,activeItem:A,activePayload:A.tooltipPayload,activeCoordinate:A.tooltipPosition||{x:A.cx,y:A.cy}}})}),Pe(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),Pe(C,"handleMouseMove",function(A){A.persist(),C.throttleTriggeredAfterMouseMove(A)}),Pe(C,"handleMouseLeave",function(A){C.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};C.setState(P),C.triggerSyncEvent(P);var O=C.props.onMouseLeave;Oe(O)&&O(P,A)}),Pe(C,"handleOuterEvent",function(A){var P=MV(A),O=zn(C.props,"".concat(P));if(P&&Oe(O)){var E,$;/.*touch.*/i.test(P)?$=C.getMouseInfo(A.changedTouches[0]):$=C.getMouseInfo(A),O((E=$)!==null&&E!==void 0?E:{},A)}}),Pe(C,"handleClick",function(A){var P=C.getMouseInfo(A);if(P){var O=se(se({},P),{},{isTooltipActive:!0});C.setState(O),C.triggerSyncEvent(O);var E=C.props.onClick;Oe(E)&&E(O,A)}}),Pe(C,"handleMouseDown",function(A){var P=C.props.onMouseDown;if(Oe(P)){var O=C.getMouseInfo(A);P(O,A)}}),Pe(C,"handleMouseUp",function(A){var P=C.props.onMouseUp;if(Oe(P)){var O=C.getMouseInfo(A);P(O,A)}}),Pe(C,"handleTouchMove",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(A.changedTouches[0])}),Pe(C,"handleTouchStart",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&C.handleMouseDown(A.changedTouches[0])}),Pe(C,"handleTouchEnd",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&C.handleMouseUp(A.changedTouches[0])}),Pe(C,"handleDoubleClick",function(A){var P=C.props.onDoubleClick;if(Oe(P)){var O=C.getMouseInfo(A);P(O,A)}}),Pe(C,"handleContextMenu",function(A){var P=C.props.onContextMenu;if(Oe(P)){var O=C.getMouseInfo(A);P(O,A)}}),Pe(C,"triggerSyncEvent",function(A){C.props.syncId!==void 0&&bv.emit(vv,C.props.syncId,A,C.eventEmitterSymbol)}),Pe(C,"applySyncEvent",function(A){var P=C.props,O=P.layout,E=P.syncMethod,$=C.state.updateId,M=A.dataStartIndex,R=A.dataEndIndex;if(A.dataStartIndex!==void 0||A.dataEndIndex!==void 0)C.setState(se({dataStartIndex:M,dataEndIndex:R},b({props:C.props,dataStartIndex:M,dataEndIndex:R,updateId:$},C.state)));else if(A.activeTooltipIndex!==void 0){var B=A.chartX,D=A.chartY,U=A.activeTooltipIndex,H=C.state,K=H.offset,z=H.tooltipTicks;if(!K)return;if(typeof E=="function")U=E(z,A);else if(E==="value"){U=-1;for(var X=0;X<z.length;X++)if(z[X].value===A.activeLabel){U=X;break}}var G=se(se({},K),{},{x:K.left,y:K.top}),Q=Math.min(B,G.x+G.width),re=Math.min(D,G.y+G.height),ce=z[U]&&z[U].value,fe=m0(C.state,C.props.data,U),me=z[U]?{x:O==="horizontal"?z[U].coordinate:Q,y:O==="horizontal"?re:z[U].coordinate}:SM;C.setState(se(se({},A),{},{activeLabel:ce,activeCoordinate:me,activePayload:fe,activeTooltipIndex:U}))}else C.setState(A)}),Pe(C,"renderCursor",function(A){var P,O=C.state,E=O.isTooltipActive,$=O.activeCoordinate,M=O.activePayload,R=O.offset,B=O.activeTooltipIndex,D=O.tooltipAxisBandSize,U=C.getTooltipEventType(),H=(P=A.props.active)!==null&&P!==void 0?P:E,K=C.props.layout,z=A.key||"_recharts-cursor";return q.createElement(Doe,{key:z,activeCoordinate:$,activePayload:M,activeTooltipIndex:B,chartName:r,element:A,isActive:H,layout:K,offset:R,tooltipAxisBandSize:D,tooltipEventType:U})}),Pe(C,"renderPolarAxis",function(A,P,O){var E=zn(A,"type.axisType"),$=zn(C.state,"".concat(E,"Map")),M=A.type.defaultProps,R=M!==void 0?se(se({},M),A.props):A.props,B=$&&$[R["".concat(E,"Id")]];return y.cloneElement(A,se(se({},B),{},{className:$e(E,B.className),key:A.key||"".concat(P,"-").concat(O),ticks:ma(B,!0)}))}),Pe(C,"renderPolarGrid",function(A){var P=A.props,O=P.radialLines,E=P.polarAngles,$=P.polarRadius,M=C.state,R=M.radiusAxisMap,B=M.angleAxisMap,D=za(R),U=za(B),H=U.cx,K=U.cy,z=U.innerRadius,X=U.outerRadius;return y.cloneElement(A,{polarAngles:Array.isArray(E)?E:ma(U,!0).map(function(G){return G.coordinate}),polarRadius:Array.isArray($)?$:ma(D,!0).map(function(G){return G.coordinate}),cx:H,cy:K,innerRadius:z,outerRadius:X,key:A.key||"polar-grid",radialLines:O})}),Pe(C,"renderLegend",function(){var A=C.state.formattedGraphicalItems,P=C.props,O=P.children,E=P.width,$=P.height,M=C.props.margin||{},R=E-(M.left||0)-(M.right||0),B=sE({children:O,formattedGraphicalItems:A,legendWidth:R,legendContent:u});if(!B)return null;var D=B.item,U=NC(B,$oe);return y.cloneElement(D,se(se({},U),{},{chartWidth:E,chartHeight:$,margin:M,onBBoxUpdate:C.handleLegendBBoxUpdate}))}),Pe(C,"renderTooltip",function(){var A,P=C.props,O=P.children,E=P.accessibilityLayer,$=$n(O,Lr);if(!$)return null;var M=C.state,R=M.isTooltipActive,B=M.activeCoordinate,D=M.activePayload,U=M.activeLabel,H=M.offset,K=(A=$.props.active)!==null&&A!==void 0?A:R;return y.cloneElement($,{viewBox:se(se({},H),{},{x:H.left,y:H.top}),active:K,label:U,payload:K?D:[],coordinate:B,accessibilityLayer:E})}),Pe(C,"renderBrush",function(A){var P=C.props,O=P.margin,E=P.data,$=C.state,M=$.offset,R=$.dataStartIndex,B=$.dataEndIndex,D=$.updateId;return y.cloneElement(A,{key:A.key||"_recharts-brush",onChange:Zd(C.handleBrushChange,A.props.onChange),data:E,x:de(A.props.x)?A.props.x:M.left,y:de(A.props.y)?A.props.y:M.top+M.height+M.brushBottom-(O.bottom||0),width:de(A.props.width)?A.props.width:M.width,startIndex:R,endIndex:B,updateId:"brush-".concat(D)})}),Pe(C,"renderReferenceElement",function(A,P,O){if(!A)return null;var E=C,$=E.clipPathId,M=C.state,R=M.xAxisMap,B=M.yAxisMap,D=M.offset,U=A.type.defaultProps||{},H=A.props,K=H.xAxisId,z=K===void 0?U.xAxisId:K,X=H.yAxisId,G=X===void 0?U.yAxisId:X;return y.cloneElement(A,{key:A.key||"".concat(P,"-").concat(O),xAxis:R[z],yAxis:B[G],viewBox:{x:D.left,y:D.top,width:D.width,height:D.height},clipPathId:$})}),Pe(C,"renderActivePoints",function(A){var P=A.item,O=A.activePoint,E=A.basePoint,$=A.childIndex,M=A.isRange,R=[],B=P.props.key,D=P.item.type.defaultProps!==void 0?se(se({},P.item.type.defaultProps),P.item.props):P.item.props,U=D.activeDot,H=D.dataKey,K=se(se({index:$,dataKey:H,cx:O.x,cy:O.y,r:4,fill:uj(P.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},Ce(U,!1)),Ku(U));return R.push(j.renderActiveDot(U,K,"".concat(B,"-activePoint-").concat($))),E?R.push(j.renderActiveDot(U,se(se({},K),{},{cx:E.x,cy:E.y}),"".concat(B,"-basePoint-").concat($))):M&&R.push(null),R}),Pe(C,"renderGraphicChild",function(A,P,O){var E=C.filterFormatItem(A,P,O);if(!E)return null;var $=C.getTooltipEventType(),M=C.state,R=M.isTooltipActive,B=M.tooltipAxis,D=M.activeTooltipIndex,U=M.activeLabel,H=C.props.children,K=$n(H,Lr),z=E.props,X=z.points,G=z.isRange,Q=z.baseLine,re=E.item.type.defaultProps!==void 0?se(se({},E.item.type.defaultProps),E.item.props):E.item.props,ce=re.activeDot,fe=re.hide,me=re.activeBar,pe=re.activeShape,Re=!!(!fe&&R&&K&&(ce||me||pe)),J={};$!=="axis"&&K&&K.props.trigger==="click"?J={onClick:Zd(C.handleItemMouseEnter,A.props.onClick)}:$!=="axis"&&(J={onMouseLeave:Zd(C.handleItemMouseLeave,A.props.onMouseLeave),onMouseEnter:Zd(C.handleItemMouseEnter,A.props.onMouseEnter)});var ae=y.cloneElement(A,se(se({},E.props),J));function ue(dn){return typeof B.dataKey=="function"?B.dataKey(dn.payload):null}if(Re)if(D>=0){var ee,Y;if(B.dataKey&&!B.allowDuplicatedCategory){var je=typeof B.dataKey=="function"?ue:"payload.".concat(B.dataKey.toString());ee=Gu(X,je,U),Y=G&&Q&&Gu(Q,je,U)}else ee=X?.[D],Y=G&&Q&&Q[D];if(pe||me){var ke=A.props.activeIndex!==void 0?A.props.activeIndex:D;return[y.cloneElement(A,se(se(se({},E.props),J),{},{activeIndex:ke})),null,null]}if(!Ie(ee))return[ae].concat(Uo(C.renderActivePoints({item:E,activePoint:ee,basePoint:Y,childIndex:D,isRange:G})))}else{var Le,Ge=(Le=C.getItemByXY(C.state.activeCoordinate))!==null&&Le!==void 0?Le:{graphicalItem:ae},at=Ge.graphicalItem,ot=at.item,le=ot===void 0?A:ot,Ne=at.childIndex,qe=se(se(se({},E.props),J),{},{activeIndex:Ne});return[y.cloneElement(le,qe),null,null]}return G?[ae,null,null]:[ae,null]}),Pe(C,"renderCustomized",function(A,P,O){return y.cloneElement(A,se(se({key:"recharts-customized-".concat(O)},C.props),C.state))}),Pe(C,"renderMap",{CartesianGrid:{handler:tu,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:tu},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:tu},YAxis:{handler:tu},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((_=S.id)!==null&&_!==void 0?_:el("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=sO(C.triggeredAfterMouseMove,(N=S.throttleDelay)!==null&&N!==void 0?N:1e3/60),C.state={},C}return Zoe(j,g),Hoe(j,[{key:"componentDidMount",value:function(){var _,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,N=_.children,C=_.data,A=_.height,P=_.layout,O=$n(N,Lr);if(O){var E=O.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var $=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,M=m0(this.state,C,E,$),R=this.state.tooltipTicks[E].coordinate,B=(this.state.offset.top+A)/2,D=P==="horizontal",U=D?{x:R,y:B}:{y:R,x:B},H=this.state.formattedGraphicalItems.find(function(z){var X=z.item;return X.type.name==="Scatter"});H&&(U=se(se({},U),H.props.points[E].tooltipPosition),M=H.props.points[E].tooltipPayload);var K={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:$,activePayload:M,activeCoordinate:U};this.setState(K),this.renderCursor(O),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var C,A;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0}})}return null}},{key:"componentDidUpdate",value:function(_){Xv([$n(_.children,Lr)],[$n(this.props.children,Lr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=$n(this.props.children,Lr);if(_&&typeof _.props.shared=="boolean"){var N=_.props.shared?"axis":"item";return c.indexOf(N)>=0?N:i}return i}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var N=this.container,C=N.getBoundingClientRect(),A=jY(C),P={chartX:Math.round(_.pageX-A.left),chartY:Math.round(_.pageY-A.top)},O=C.width/N.offsetWidth||1,E=this.inRange(P.chartX,P.chartY,O);if(!E)return null;var $=this.state,M=$.xAxisMap,R=$.yAxisMap,B=this.getTooltipEventType(),D=SC(this.state,this.props.data,this.props.layout,E);if(B!=="axis"&&M&&R){var U=za(M).scale,H=za(R).scale,K=U&&U.invert?U.invert(P.chartX):null,z=H&&H.invert?H.invert(P.chartY):null;return se(se({},P),{},{xValue:K,yValue:z},D)}return D?se(se({},P),D):null}},{key:"inRange",value:function(_,N){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,A=this.props.layout,P=_/C,O=N/C;if(A==="horizontal"||A==="vertical"){var E=this.state.offset,$=P>=E.left&&P<=E.left+E.width&&O>=E.top&&O<=E.top+E.height;return $?{x:P,y:O}:null}var M=this.state,R=M.angleAxisMap,B=M.radiusAxisMap;if(R&&B){var D=za(R);return O3({x:P,y:O},D)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,N=this.getTooltipEventType(),C=$n(_,Lr),A={};C&&N==="axis"&&(C.props.trigger==="click"?A={onClick:this.handleClick}:A={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Ku(this.props,this.handleOuterEvent);return se(se({},P),A)}},{key:"addListener",value:function(){bv.on(vv,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){bv.removeListener(vv,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,N,C){for(var A=this.state.formattedGraphicalItems,P=0,O=A.length;P<O;P++){var E=A[P];if(E.item===_||E.props.key===_.key||N===ba(E.item.type)&&C===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,N=this.state.offset,C=N.left,A=N.top,P=N.height,O=N.width;return q.createElement("defs",null,q.createElement("clipPath",{id:_},q.createElement("rect",{x:C,y:A,height:P,width:O})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(N,C){var A=wC(C,2),P=A[0],O=A[1];return se(se({},N),{},Pe({},P,O.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(N,C){var A=wC(C,2),P=A[0],O=A[1];return se(se({},N),{},Pe({},P,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[_])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(_){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[_])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(_){var N=this.state,C=N.formattedGraphicalItems,A=N.activeItem;if(C&&C.length)for(var P=0,O=C.length;P<O;P++){var E=C[P],$=E.props,M=E.item,R=M.type.defaultProps!==void 0?se(se({},M.type.defaultProps),M.props):M.props,B=ba(M.type);if(B==="Bar"){var D=($.data||[]).find(function(z){return zne(_,z)});if(D)return{graphicalItem:E,payload:D}}else if(B==="RadialBar"){var U=($.data||[]).find(function(z){return O3(_,z)});if(U)return{graphicalItem:E,payload:U}}else if(tm(E,A)||nm(E,A)||Cc(E,A)){var H=uae({graphicalItem:E,activeTooltipItem:A,itemData:R.data}),K=R.activeIndex===void 0?H:R.activeIndex;return{graphicalItem:se(se({},E),{},{childIndex:K}
234),payload:Cc(E,A)?R.data[H]:E.props.data[H]}}}return null}},{key:"render",value:function(){var _=this;if(!z2(this))return null;var N=this.props,C=N.children,A=N.className,P=N.width,O=N.height,E=N.style,$=N.compact,M=N.title,R=N.desc,B=NC(N,Foe),D=Ce(B,!1);if($)return q.createElement(aC,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement(Qv,Gi({},D,{width:P,height:O,title:M,desc:R}),this.renderClipPath(),q2(C,this.renderMap)));if(this.props.accessibilityLayer){var U,H;D.tabIndex=(U=this.props.tabIndex)!==null&&U!==void 0?U:0,D.role=(H=this.props.role)!==null&&H!==void 0?H:"application",D.onKeyDown=function(z){_.accessibilityManager.keyboardEvent(z)},D.onFocus=function(){_.accessibilityManager.focus()}}var K=this.parseEventsOfWrapper();return q.createElement(aC,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement("div",Gi({className:$e("recharts-wrapper",A),style:se({position:"relative",cursor:"default",width:P,height:O},E)},K,{ref:function(X){_.container=X}}),q.createElement(Qv,Gi({},D,{width:P,height:O,title:M,desc:R,style:nle}),this.renderClipPath(),q2(C,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(y.Component);Pe(w,"displayName",r),Pe(w,"defaultProps",se({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},m)),Pe(w,"getDerivedStateFromProps",function(g,j){var S=g.dataKey,_=g.data,N=g.children,C=g.width,A=g.height,P=g.layout,O=g.stackOffset,E=g.margin,$=j.dataStartIndex,M=j.dataEndIndex;if(j.updateId===void 0){var R=CC(g);return se(se(se({},R),{},{updateId:0},b(se(se({props:g},R),{},{updateId:0}),j)),{},{prevDataKey:S,prevData:_,prevWidth:C,prevHeight:A,prevLayout:P,prevStackOffset:O,prevMargin:E,prevChildren:N})}if(S!==j.prevDataKey||_!==j.prevData||C!==j.prevWidth||A!==j.prevHeight||P!==j.prevLayout||O!==j.prevStackOffset||!lo(E,j.prevMargin)){var B=CC(g),D={chartX:j.chartX,chartY:j.chartY,isTooltipActive:j.isTooltipActive},U=se(se({},SC(j,_,P)),{},{updateId:j.updateId+1}),H=se(se(se({},B),D),U);return se(se(se({},H),b(se({props:g},H),j)),{},{prevDataKey:S,prevData:_,prevWidth:C,prevHeight:A,prevLayout:P,prevStackOffset:O,prevMargin:E,prevChildren:N})}if(!Xv(N,j.prevChildren)){var K,z,X,G,Q=$n(N,Oo),re=Q&&(K=(z=Q.props)===null||z===void 0?void 0:z.startIndex)!==null&&K!==void 0?K:$,ce=Q&&(X=(G=Q.props)===null||G===void 0?void 0:G.endIndex)!==null&&X!==void 0?X:M,fe=re!==$||ce!==M,me=!Ie(_),pe=me&&!fe?j.updateId:j.updateId+1;return se(se({updateId:pe},b(se(se({props:g},j),{},{updateId:pe,dataStartIndex:re,dataEndIndex:ce}),j)),{},{prevChildren:N,dataStartIndex:re,dataEndIndex:ce})}return null}),Pe(w,"renderActiveDot",function(g,j,S){var _;return y.isValidElement(g)?_=y.cloneElement(g,j):Oe(g)?_=g(j):_=q.createElement(Zf,j),q.createElement(He,{className:"recharts-active-dot",key:S},_)});var x=y.forwardRef(function(j,S){return q.createElement(w,Gi({},j,{ref:S}))});return x.displayName=w.displayName,x},hle=AM({chartName:"PieChart",GraphicalChild:Ma,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:em},{axisType:"radiusAxis",AxisComp:Jf}],formatAxisMap:QQ,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),fle=AM({chartName:"AreaChart",GraphicalChild:hs,axisComponents:[{axisType:"xAxis",AxisComp:lm},{axisType:"yAxis",AxisComp:cm}],formatAxisMap:mse});const mle=[{key:"today",label:"Today"},{key:"7d",label:"7 Days"},{key:"30d",label:"30 Days"},{key:"90d",label:"90 Days"}],kC={mobile:"#00b4ff",desktop:"#8b5cf6",tablet:"#f59e0b"},ple={mobile:xI,desktop:RC,tablet:wI},nu=["#00b4ff","#8b5cf6","#22c55e","#f59e0b","#ef4444","#ec4899","#94a3b8"];function xle(e){if(e<60)return`${Math.round(e)}s`;const t=Math.floor(e/60),r=Math.round(e%60);return`${t}m ${r.toString().padStart(2,"0")}s`}function gle(e){const t=Math.floor(e/60),r=Math.round(e%60);return`${t}:${r.toString().padStart(2,"0")}`}function ble(e,t){if(t===0)return{value:0,direction:"flat"};const r=(e-t)/t*100;return{value:Math.abs(r),direction:r>.5?"up":r<-.5?"down":"flat"}}function El({label:e,value:t,formattedValue:r,priorValue:a,invertDirection:s}
234){const i=r??t.toLocaleString(),o=a!==void 0?ble(t,a):null,c=o?s?o.direction==="down":o.direction==="up":!1;return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-4 lg:p-5",children:[n.jsx("div",{className:"text-xs text-[#94a3b8] uppercase tracking-wider font-medium mb-2",children:e}),n.jsx("div",{className:"text-2xl lg:text-3xl font-bold text-white",children:i}),o&&o.direction!=="flat"&&n.jsxs("div",{className:`text-xs mt-1.5 flex items-center gap-1 ${c?"text-[#22c55e]":"text-[#ef4444]"}`,children:[o.direction==="up"?n.jsx(ii,{className:"w-3.5 h-3.5"}):n.jsx(AI,{className:"w-3.5 h-3.5"}),o.value.toFixed(1),"% vs prior period"]})]})}function vle({dailyData:e,metric:t,onMetricChange:r}){const a={users:"Users",sessions:"Sessions",pageViews:"Page Views"},s=e.map(i=>{const o=new Date(i.date+"T12:00:00");return{...i,label:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})}});return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-[15px] font-semibold text-white flex items-center gap-2",children:[n.jsx("span",{className:"w-2 h-2 rounded-full bg-[#00b4ff]"}),"Traffic Over Time"]}),n.jsx("div",{className:"flex gap-0.5 bg-[#0a0e17] rounded-lg p-0.5",children:Object.keys(a).map(i=>n.jsx("button",{type:"button",onClick:()=>r(i),className:`px-3 py-1 rounded-md text-xs font-medium transition-colors ${t===i?"bg-[#1e293b] text-white":"text-[#64748b] hover:text-[#94a3b8]"}`,children:a[i]},i))})]}),n.jsx("div",{className:"h-[240px]",children:n.jsx(mY,{width:"100%",height:"100%",children:n.jsxs(fle,{data:s,margin:{top:8,right:8,left:-16,bottom:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"areaGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"0%",stopColor:"#00b4ff",stopOpacity:.25}),n.jsx("stop",{offset:"100%",stopColor:"#00b4ff",stopOpacity:.02})]})}),n.jsx(cM,{stroke:"#1e293b40",vertical:!1}),n.jsx(lm,{dataKey:"label",tick:{fill:"#475569",fontSize:11},axisLine:!1,tickLine:!1}),n.jsx(cm,{tick:{fill:"#475569",fontSize:11},axisLine:!1,tickLine:!1}),n.jsx(Lr,{contentStyle:{background:"#1e293b",border:"1px solid #334155",borderRadius:8,fontSize:13,color:"#fff"},labelStyle:{color:"#94a3b8"}}),n.jsx(hs,{type:"monotone",dataKey:t,stroke:"#00b4ff",strokeWidth:2.5,fill:"url(#areaGrad)",dot:{r:3,fill:"#00b4ff",stroke:"#0b1120",strokeWidth:2},activeDot:{r:5,fill:"#00b4ff",stroke:"#0b1120",strokeWidth:2}})]})})})]})}function yle({sources:e}){const t=e.reduce((r,a)=>r+a.sessions,0);return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsx("h3",{className:"text-[15px] font-semibold text-white mb-4",children:"Traffic Sources"}),n.jsxs("div",{className:"space-y-0.5",children:[e.map((r,a)=>n.jsxs("div",{className:"flex items-center justify-between py-2.5 border-b border-[#1e293b30] last:border-0",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:nu[a%nu.length]}}),n.jsx("span",{className:"text-[13px] text-[#e2e8f0]",children:r.source})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-[13px] font-semibold text-white min-w-[50px] text-right",children:r.sessions.toLocaleString()}),n.jsxs("span",{className:"text-xs text-[#94a3b8] min-w-[36px] text-right",children:[t>0?Math.round(r.sessions/t*100):0,"%"]}),n.jsx("div",{className:"w-20 h-1.5 bg-[#1e293b] rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${t>0?r.sessions/t*100:0}%`,background:nu[a%nu.length]}})})]})]},r.source)),e.length===0&&n.jsx("p",{className:"text-sm text-[#94a3b8] py-4 text-center",children:"No source data available yet."})]})]})}function jle({pages:e}){return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsx("h3",{className:"text-[15px] font-semibold text-white mb-4",children:"Top Pages"}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[#1e293b]",children:[n.jsx("th",{className:"text-left text-[11px] text-[#64748b] uppercase tracking-wider font-semibold py-2 px-3",children:"Page"}),n.jsx("th",{className:"text-right text-[11px] text-[#64748b] uppercase tracking-wider font-semibold py-2 px-3",children:"Views"}),n.jsx("th",{className:"text-right text-[11px] text-[#64748b] uppercase tracking-wider font-semibold py-2 px-3",children:"Avg Time"})]})}),n.jsxs("tbody",{children:[e.map(t=>n.jsxs("tr",{className:"border-b border-[#1e293b30] hover:bg-[#0a0e1780]",children:[n.jsx("td",{className:"py-2.5 px-3 text-[13px] text-[#00b4ff] font-medium truncate max-w-[200px]",children:t.path}),n.jsx("td",{className:"py-2.5 px-3 text-[13px] text-[#94a3b8] text-right",children:t.views.toLocaleStr
234ing()}),n.jsx("td",{className:"py-2.5 px-3 text-[13px] text-[#94a3b8] text-right",children:gle(t.avgTime)})]},t.path)),e.length===0&&n.jsx("tr",{children:n.jsx("td",{colSpan:3,className:"py-6 text-center text-sm text-[#94a3b8]",children:"No page data yet."})})]})]})})]})}function wle({devices:e}){const t=e.reduce((a,s)=>a+s.sessions,0),r=e.map(a=>({name:a.device,value:a.sessions,color:kC[a.device.toLowerCase()]||"#94a3b8"}));return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsx("h3",{className:"text-[15px] font-semibold text-white mb-4",children:"Devices"}),t>0?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex justify-center py-2",children:n.jsxs(hle,{width:160,height:160,children:[n.jsx(Ma,{data:r,cx:80,cy:80,innerRadius:40,outerRadius:65,dataKey:"value",stroke:"#111827",strokeWidth:2,children:r.map((a,s)=>n.jsx($f,{fill:a.color},s))}),n.jsx("text",{x:80,y:76,textAnchor:"middle",fill:"#fff",fontSize:20,fontWeight:700,children:t.toLocaleString()}),n.jsx("text",{x:80,y:94,textAnchor:"middle",fill:"#94a3b8",fontSize:11,children:"sessions"})]})}),n.jsx("div",{className:"space-y-2 mt-2",children:e.map(a=>{const s=ple[a.device.toLowerCase()],i=kC[a.device.toLowerCase()]||"#94a3b8";return n.jsxs("div",{className:"flex items-center gap-2.5",children:[s&&n.jsx("span",{style:{color:i},children:n.jsx(s,{className:"w-4 h-4"})}),!s&&n.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:i}}),n.jsx("span",{className:"text-xs text-[#94a3b8] flex-1 capitalize",children:a.device}),n.jsxs("span",{className:"text-xs font-semibold text-white",children:[t>0?Math.round(a.sessions/t*100):0,"%"]})]},a.device)})})]}):n.jsx("p",{className:"text-sm text-[#94a3b8] py-8 text-center",children:"No device data yet."})]})}function Nle({regions:e}){return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsx("h3",{className:"text-[15px] font-semibold text-white mb-4",children:"Top States"}),n.jsxs("div",{className:"space-y-0",children:[e.map((t,r)=>n.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-[#1e293b30] last:border-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"w-5 text-xs text-[#475569] font-semibold",children:r+1}),n.jsx("span",{className:"text-[13px] text-[#e2e8f0]",children:t.state})]}),n.jsx("span",{className:"text-[13px] font-semibold text-white",children:t.sessions.toLocaleString()})]},t.state)),e.length===0&&n.jsx("p",{className:"text-sm text-[#94a3b8] py-4 text-center",children:"No regional data yet."})]})]})}function _le(){const e=ie(F.realtime.getActiveUsers),[t,r]=y.useState(!0);y.useEffect(()=>{const s=setInterval(()=>r(i=>!i),1500);return()=>clearInterval(s)},[]);const a=e?.activeUsers??0;return n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-gradient-to-r from-[#111827] to-[#0f172a] p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:`w-3 h-3 rounded-full bg-emerald-400 ${t?"opacity-100":"opacity-40"} transition-opacity duration-700`}),n.jsx("div",{className:"absolute inset-0 w-3 h-3 rounded-full bg-emerald-400 animate-ping opacity-20"})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-3xl font-bold text-white",children:a}),n.jsxs("span",{className:"text-sm text-[#94a3b8]",children:["active ",a===1?"user":"users"," right now"]})]}),n.jsx("p",{className:"text-xs text-[#475569] mt-0.5",children:"Visitors in the last 5 minutes"})]})]}),e&&e.topPages.length>0&&n.jsx("div",{className:"hidden md:flex items-center gap-4",children:n.jsxs("div",{className:"text-xs text-[#475569] border-l border-[#1e293b] pl-4",children:[n.jsx("span",{className:"text-[#94a3b8] font-medium",children:"Top pages now:"}),n.jsx("div",{className:"flex gap-3 mt-1",children:e.topPages.slice(0,3).map(s=>n.jsxs("span",{className:"text-[#64748b]",children:[s.page==="/"?"Home":s.page.replace(/^\//,"")," ",n.jsx("span",{className:"text-white font-medium",children:s.count})]},s.page))})]})})]})})}function Sle(){return n.jsxs("div",{className:"rounded-xl border border-dashed border-[#1e293b] bg-[#111827]/50 p-12 text-center",children:[n.jsx(Fr,{className:"w-12 h-12 text-[#475569] mx-auto mb-4"}),n.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Analytics data loading"}),n.jsx("p",{className:"text-[#94a3b8] text-sm max-w-md mx-auto",children:"Site analytics data is synced from Google Analytics periodically. Data will appear here once the first sync completes."})]})}function Cle(){const[e,t]=y.useState("7d"),[r,a]=y.useState("users"),s=ie(F.siteAnalytics.getAnalytics,{period:e}),i=s?.data??null;return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(Hl,{className:"w-6 h-6 text-[#00b4ff]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"Site Analytics"})]}),n.jsx("p",{className:"text-[#94a3b8]",children:"Website traffic and visitor behavior from Google Analytics."})]}),n.jsx(_le,{}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex gap-1 bg-[#111827] border border-[#1e293b] rounded-xl p-1",children:mle.map(o=>n.jsx("button",{type:"button",onClick:()=>t(o.key),className:`px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ${e===o.key?"bg-[#00b4ff] text-white":"text-[#94a3b8] hover:text-white"}`,children:o.label},o.key))}),s?.fetchedAt&&n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-[#475569]",children:[n.jsx(At,{className:"w-3.5 h-3.5"}
234),"Updated ",new Date(s.fetchedAt).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})]})]}),i?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3",children:[n.jsx(El,{label:"Users",value:i.metrics.users,priorValue:i.priorMetrics?.users}),n.jsx(El,{label:"Sessions",value:i.metrics.sessions,priorValue:i.priorMetrics?.sessions}),n.jsx(El,{label:"Page Views",value:i.metrics.pageViews,priorValue:i.priorMetrics?.pageViews}),n.jsx(El,{label:"Bounce Rate",value:i.metrics.bounceRate,formattedValue:`${i.metrics.bounceRate.toFixed(1)}%`,priorValue:i.priorMetrics?.bounceRate,invertDirection:!0}),n.jsx(El,{label:"Avg Duration",value:i.metrics.avgDuration,formattedValue:xle(i.metrics.avgDuration),priorValue:i.priorMetrics?.avgDuration})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[n.jsx("div",{className:"lg:col-span-2",children:n.jsx(vle,{dailyData:i.dailyData,metric:r,onMetricChange:a})}),n.jsx(yle,{sources:i.sources})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsx(jle,{pages:i.topPages}),n.jsx(wle,{devices:i.devices}),n.jsx(Nle,{regions:i.regions})]})]}):n.jsx(Sle,{})]})}function ru({icon:e,label:t,value:r,color:a="#00b4ff"}){return n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsxs("div",{className:"flex items-start justify-between mb-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:`${a}15`},children:n.jsx("span",{style:{color:a},children:n.jsx(e,{className:"w-5 h-5"})})}),n.jsx(ii,{className:"w-4 h-4 text-[#22c55e]"})]}),n.jsx("div",{className:"text-2xl font-bold text-white mb-0.5",children:r}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:t})]})}function Ale({agencyId:e,credits:t}){const r=te(F.stripeBilling.setJobPostCredits),[a,s]=y.useState(String(t)),[i,o]=y.useState(!1),c=a!==String(t);return n.jsxs("div",{className:"flex items-center gap-3 py-2 border-b border-[#1e293b] last:border-0",children:[n.jsx("span",{className:"text-[#64748b] text-sm min-w-[140px] shrink-0",children:"Paid Job Slots"}),n.jsx("input",{type:"number",min:0,value:a,onChange:d=>s(d.target.value),className:"w-20 bg-[#0d1117] border border-[#1e293b] rounded-md px-2 py-1 text-sm text-white"}),n.jsx("span",{className:"text-xs text-[#64748b]",children:"extra active postings on top of the tier allowance"}),c&&n.jsx("button",{disabled:i,onClick:async()=>{o(!0);try{await r({agencyId:e,credits:Number(a)||0}),W.success("Job slots updated.")}catch{W.error("Could not update job slots.")}finally{o(!1)}},className:"px-3 py-1 rounded-full text-xs font-medium bg-[#00b4ff] text-black",children:"Save"})]})}function St({label:e,value:t,href:r}){return!t&&t!==0?null:n.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-[#1e293b] last:border-0",children:[n.jsx("span",{className:"text-[#64748b] text-sm min-w-[140px] shrink-0",children:e}),r?n.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-[#00b4ff] text-sm hover:underline flex items-center gap-1",children:[t,n.jsx(nn,{className:"w-3 h-3"})]}):n.jsx("span",{className:"text-white text-sm",children:t})]})}function $a({icon:e,title:t,color:r="#00b4ff"}){return n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${r}15`},children:n.jsx("span",{style:{color:r},children:n.jsx(e,{className:"w-4 h-4"})})}),n.jsx("h3",{className:"text-lg font-bold text-white",children:t})]})}function kle(e){switch(e){case"platinum":return"State-Level Featured";case"member":return"Agency Member";default:return"Participating Agency"}}function Ple(e){switch(e){case"platinum":return{bg:"bg-[#d4a843]/20",text:"text-[#d4a843]",border:"border-[#d4a843]/30"};case"member":return{bg:"bg-[#d4a843]/20",text:"text-[#d4a843]",border:"border-[#d4a843]/30"};default:return{bg:"bg-[#00b4ff]/10",text:"text-[#00b4ff]",border:"border-[#00b4ff]/20"}}}function Tle(e){switch(e){case"active":return"bg-[#22c55e]/10 text-[#22c55e] border-[#22c55e]/20";
234case"pending":return"bg-[#f59e0b]/10 text-[#f59e0b] border-[#f59e0b]/20";case"suspended":return"bg-[#ef4444]/10 text-[#ef4444] border-[#ef4444]/20";default:return"bg-[#475569]/10 text-[#475569] border-[#475569]/20"}}function jv(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function Ole(e,t){if(!e&&!t)return;const r=a=>`$${a.toLocaleString()}`;if(e&&t)return`${r(e)} - ${r(t)}`;if(e)return`${r(e)}+`;if(t)return`Up to ${r(t)}`}function Ele(e){switch(e){case"small":return"Small (<100 sworn)";case"medium":return"Medium (100-300 sworn)";case"large":return"Large (300+ sworn)";default:return e}}function Mle(e){switch(e){case"profile_view":return"Profile View";case"job_click":return"Job Click";case"website_click":return"Website Click";default:return e}}function Lle(e){const t=Date.now()-e,r=Math.floor(t/6e4);if(r<60)return`${r}m ago`;const a=Math.floor(r/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Ile(){const{id:e}=x0(),t=ie(F.admin.getAgencyDashboard,e?{agencyId:e}:"skip"),r=ie(F.presence.agencyStatus,e?{agencyId:e}:"skip"),a=pi();if(t===void 0)return n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsx("div",{className:"w-8 h-8 border-2 border-[#d4a843] border-t-transparent rounded-full animate-spin"})});if(t===null)return n.jsxs("div",{className:"text-center py-20",children:[n.jsx(Be,{className:"w-12 h-12 text-[#475569] mx-auto mb-4"}),n.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Agency Not Found"}),n.jsx("p",{className:"text-[#94a3b8] mb-6",children:"This agency doesn't exist or you don't have access."}),n.jsx(ye,{to:"/admin/all-agencies",className:"text-[#00b4ff] hover:underline text-sm",children:"Back to All Agencies"})]});const s=Ple(t.tier),i=t.jobs.filter(c=>c.status==="active"),o=[{label:"Facebook",url:t.socialFacebook},{label:"Instagram",url:t.socialInstagram},{label:"LinkedIn",url:t.socialLinkedin},{label:"Twitter/X",url:t.socialTwitter},{label:"YouTube",url:t.socialYoutube},{label:"TikTok",url:t.socialTiktok}].filter(c=>c.url);return n.jsxs("div",{className:"space-y-6 max-w-6xl",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs(ye,{to:"/admin/all-agencies",className:"inline-flex items-center gap-2 text-[#94a3b8] hover:text-white text-sm transition-colors",children:[n.jsx(Zr,{className:"w-4 h-4"}),"Back to All Agencies"]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs(ye,{to:`/admin/agency/${e}/preview?tab=profile`,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#00b4ff]/10 border border-[#00b4ff]/30 text-[#00b4ff] text-sm font-semibold hover:bg-[#00b4ff]/20 transition-colors",children:[n.jsx(qt,{className:"w-4 h-4"}),"Edit Agency Details"]}),n.jsxs(ye,{to:`/admin/agency/${e}/preview`,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#d4a843]/10 border border-[#d4a843]/30 text-[#d4a843] text-sm font-semibold hover:bg-[#d4a843]/20 transition-colors",children:[n.jsx(Wn,{className:"w-4 h-4"}),"View as Agency"]})]})]}),n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:n.jsxs("div",{className:"flex items-start gap-5",children:[t.logoUrl?n.jsx("img",{src:t.logoUrl,alt:t.name,className:"w-20 h-20 rounded-xl object-contain bg-white/5 p-1 border border-[#1e293b]"}):n.jsx("div",{className:"w-20 h-20 rounded-xl bg-[#00b4ff10] flex items-center justify-center border border-[#1e293b]",children:n.jsx(Be,{className:"w-10 h-10 text-[#00b4ff]"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1 flex-wrap",children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:t.name}),t.isHonorary&&n.jsx(Vl,{size:"md"}),n.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-medium ${s.bg} ${s.text} border ${s.border}`,children:kle(t.tier)}),n.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-medium border ${Tle(t.status)}`,children:t.status.charAt(0).toUpperCase()+t.status.slice(1)})]}),n.jsx("div",{className:"mb-1",children:n.jsx(xi,{status:r,now:a,showLogin:!0})}),n.jsxs("div",{className:"flex items-center gap-4 text-sm text-[#94a3b8] mt-1 flex-wrap",children:[(t.city||t.state)&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(wt,{className:"w-3.5 h-3.5"}),t.city?`${t.city}, `:"",t.state]}),t.email&&n.jsxs("a",{href:`mailto:${t.email}`,className:"flex items-center gap-1 hover:text-[#00b4ff]",children:[n.jsx(Sn,{className:"w-3.5 h-3.5"}),t.email]}),t.phone&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(zo,{className:"w-3.5 h-3.5"}),t.phone]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs text-[#64748b] mt-2",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Cr,{className:"w-3 h-3"}),"Joined ",jv(t._creationTime)]}),t.ownerEmail&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Ze,{className:"w-3 h-3"}),"Account: ",t.ownerEmail]})]})]})]})}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[n.jsx(ru,{icon:Wn,label:"Profile Views",value:t.analytics.profileViews}),n.jsx(ru,{icon:ht,label:"Active Jobs",value:i.length,color:"#22c55e"}),n.jsx(ru,{icon:Vc,label:"Job Clicks",value:t.analytics.jobClicks,color:"#a85
2345f7"}),n.jsx(ru,{icon:Pn,label:"Website Clicks",value:t.analytics.websiteClicks,color:"#f59e0b"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:Ze,title:"Contact & Account"}),n.jsx(St,{label:"Contact Name",value:t.contactName}),n.jsx(St,{label:"Contact Title",value:t.contactTitle}),n.jsx(St,{label:"Agency Email",value:t.email,href:`mailto:${t.email}`}),n.jsx(St,{label:"Phone",value:t.phone}),n.jsx(St,{label:"Website",value:t.website,href:t.website?.startsWith("http")?t.website:`https://${t.website}`}),n.jsx(St,{label:"Address",value:t.address}),t.stripeCustomerId&&n.jsx(St,{label:"Stripe Customer",value:t.stripeCustomerId,href:`https://dashboard.stripe.com/customers/${t.stripeCustomerId}`}),t.stripeSubscriptionId&&n.jsx(St,{label:"Stripe Subscription",value:t.stripeSubscriptionId,href:`https://dashboard.stripe.com/subscriptions/${t.stripeSubscriptionId}`}),n.jsx(Ale,{agencyId:t._id,credits:t.jobPostCredits??0})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:Be,title:"Department Details"}),n.jsx(St,{label:"Agency Type",value:t.agencyType}),n.jsx(St,{label:"Department Size",value:Ele(t.departmentSize)}),n.jsx(St,{label:"Officer Count",value:t.officerCount}),n.jsx(St,{label:"Salary Range",value:Ole(t.salaryMin,t.salaryMax)}
234),n.jsx(St,{label:"Signing Bonus",value:t.signingBonus}),n.jsx(St,{label:"Education Incentive",value:t.educationIncentive}),n.jsx(St,{label:"Retirement Plan",value:t.retirementPlanType}),n.jsx(St,{label:"Retirement Details",value:t.retirementDetails}),t.benefits&&t.benefits.length>0&&n.jsxs("div",{className:"pt-2",children:[n.jsx("span",{className:"text-[#64748b] text-sm",children:"Benefits"}),n.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:t.benefits.map(c=>n.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#22c55e]/10 text-[#22c55e] text-xs border border-[#22c55e]/20",children:c},c))})]}),t.description&&n.jsxs("div",{className:"pt-3 mt-2 border-t border-[#1e293b]",children:[n.jsx("span",{className:"text-[#64748b] text-sm block mb-1",children:"Description"}),n.jsx("p",{className:"text-[#94a3b8] text-sm leading-relaxed",children:t.description})]})]}),o.length>0&&n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:Pn,title:"Social Media"}),o.map(c=>n.jsx(St,{label:c.label,value:c.url,href:c.url?.startsWith("http")?c.url:`https://${c.url}`}
234,c.label))]}),t.careersUrl&&n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:Pn,title:"Job Scanning",color:"#06b6d4"}),n.jsx(St,{label:"Careers URL",value:t.careersUrl,href:t.careersUrl}),n.jsx(St,{label:"Auto-Scan",value:t.autoScanEnabled?"Enabled":"Disabled"}),n.jsx(St,{label:"Auto-Publish",value:t.autoPublishJobs?"Enabled":"Disabled"}),t.lastScannedAt&&n.jsx(St,{label:"Last Scanned",value:jv(t.lastScannedAt)})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:ht,title:`Job Postings (${t.jobs.length})`,color:"#22c55e"}),t.jobs.length===0?n.jsx("p",{className:"text-[#64748b] text-sm",children:"No job postings yet."}):n.jsx("div",{className:"space-y-3",children:p0(t.jobs).map(c=>n.jsxs("div",{className:"p-3 rounded-lg bg-[#0a0e17] border border-[#1e293b]",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("h4",{className:"text-white text-sm font-medium truncate",children:c.title}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[n.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium ${c.status==="active"?"bg-[#22c55e]/10 text-[#22c55e]":c.status==="expired"?"bg-[#ef4444]/10 text-[#ef4444]":"bg-[#475569]/10 text-[#475569]"}`,children:c.status.toUpperCase()}),c.featured&&n.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-[#d4a843]/10 text-[#d4a843]",children:"FEATURED"}),c.salary&&n.jsx("span",{className:"text-[#94a3b8] text-xs",children:c.salary}),c.jobType&&n.jsx("span",{className:"text-[#64748b] text-xs",children:c.jobType})]})]}),n.jsx("span",{className:"text-[#64748b] text-xs shrink-0",children:jv(c._creationTime)})]}),c.applicationUrl&&n.jsxs("a",{href:c.applicationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[#00b4ff] text-xs hover:underline flex items-center gap-1 mt-1.5",children:["Application Link ",n.jsx(nn,{className:"w-3 h-3"})]})]},c._id))})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:en,title:`Recruiters (${t.recruiters.length})`,color:"#06b6d4"}),t.recruiters.length===0?n.jsx("p",{className:"text-[#64748b] text-sm",children:"No recruiters added."}):n.jsx("div",{className:"space-y-3",children:t.recruiters.map(c=>n.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-[#0a0e17] border border-[#1e293b]",children:[c.photoUrl?n.jsx("img",{src:c.photoUrl,alt:`${c.firstName} ${c.lastName}`,className:"w-10 h-10 rounded-full object-cover"}):n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#06b6d4]/10 flex items-center justify-center",children:n.jsx(Ze,{className:"w-5 h-5 text-[#06b6d4]"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"text-white text-sm font-medium",children:[c.firstName," ",c.lastName]}),n.jsx("div",{className:"text-[#94a3b8] text-xs",children:c.title||"Recruiter"}),c.email&&n.jsx("div",{className:"text-[#64748b] text-xs",children:c.email})]})]},c._id))})]}),t.applications.total>0&&n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:Nn,title:`Applications (${t.applications.total})`,color:"#f59e0b"}),n.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{label:"Submitted",count:t.applications.submitted,color:"#00b4ff"},{label:"Under Review",count:t.applications.underReview,color:"#f59e0b"},{label:"Interview",count:t.applications.interview,color:"#a855f7"},{label:"Offered",count:t.applications.offered,color:"#22c55e"},{label:"Accepted",count:t.applications.accepted,color:"#22c55e"},{label:"Rejected",count:t.applications.rejected,color:"#ef4444"}].filter(c=>c.count>0).map(c=>n.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg bg-[#0a0e17]",children:[n.jsx("span",{className:"text-[#94a3b8] text-sm",children:c.label}),n.jsx("span",{className:"text-white text-sm font-bold",style:{color:c.color},children:c.count})]},c.label))})]}),t.analytics.recentEvents.length>0&&n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx($a,{icon:ii,title:"Recent Activity",color:"#a85
2345f7"}),n.jsx("div",{className:"space-y-2",children:t.analytics.recentEvents.map((c,d)=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-[#1e293b] last:border-0",children:[n.jsx("span",{className:"text-[#94a3b8] text-sm",children:Mle(c.event)}),n.jsx("span",{className:"text-[#64748b] text-xs",children:Lle(c.timestamp)})]},d))})]})]})]})]})}function ze({label:e,value:t,onChange:r,type:a="text",placeholder:s,textarea:i,disabled:o}){const c="w-full bg-[#0a0e17] border border-[#1e293b] rounded-lg px-3 py-2 text-white text-sm placeholder:text-[#475569] focus:border-[#00b4ff] focus:ring-1 focus:ring-[#00b4ff40] outline-none disabled:opacity-50";return n.jsxs("div",{children:[n.jsx("label",{className:"block text-[#94a3b8] text-xs font-medium mb-1",children:e}),i?n.jsx("textarea",{value:t,onChange:d=>r(d.target.value),placeholder:s,disabled:o,rows:3,className:c+" resize-none"}):n.jsx("input",{type:a,value:t,onChange:d=>r(d.target.value),placeholder:s,disabled:o,className:c})]})}function kM({label:e,value:t,onChange:r,options:a}){return n.jsxs("div",{children:[n.jsx("label",{className:"block text-[#94a3b8] text-xs font-medium mb-1",children:e}),n.jsxs("select",{value:t,onChange:s=>r(s.target.value),className:"w-full bg-[#0a0e17] border border-[#1e293b] rounded-lg px-3 py-2 text-white text-sm focus:border-[#00b4ff] outline-none",children:[n.jsx("option",{value:"",children:"Select..."}),a.map(s=>n.jsx("option",{value:s.value,children:s.label},s.value))]})]})}const Rle=[{id:"dashboard",label:"Dashboard",icon:HC},{id:"profile",label:"Agency Profile",icon:Rt},{id:"jobs",label:"Job Postings",icon:ht},{id:"recruiters",label:"Recruiters",icon:Wc},{id:"analytics",label:"Analytics",icon:Fr},{id:"leads",label:"Veteran Leads",icon:en},{id:"messages",label:"Messages",icon:tn}],Dle=[{id:"subscription",label:"Subscription",icon:It},{id:"settings",label:"Settings",icon:qo}];function $le({d:e,onNavigate:t}){const r=e.tier==="member"||e.tier==="platinum",a=e.jobs.filter(s=>s.status==="active");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Dashboard"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Welcome to your VET-TO-LEO agency dashboard."})]}),!r&&n.jsx("div",{className:"rounded-xl bg-gradient-to-r from-[#0d1a2e] to-[#162032] border border-[#00b4ff20] p-6",children:n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:"Upgrade to Agency Member"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full bg-[#d4a843] text-black text-xs font-bold",children:"50% OFF"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Post up to 3 jobs, get veteran leads, and unlock priority listing. Use code AGENCY50 for $299/year (regularly $598)."})]}),n.jsx("button",{className:"px-6 py-2.5 rounded-full border border-[#d4a843] text-[#d4a843] font-semibold text-sm whitespace-nowrap cursor-default",children:"Upgrade Now"})]})}),r&&!e.careersUrl&&n.jsx("div",{className:"rounded-xl p-5",style:{background:"linear-gradient(135deg, #0d1a2e 0%, #162032 100%)",border:"1px solid #22c55e25"},children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"p-2.5 rounded-lg shrink-0",style:{background:"#22c55e15"},children:n.jsx(GC,{className:"w-5 h-5",style:{color:"#22c55e"}})}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-base font-bold text-white",children:"Unlimited Job Postings"}),n.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold",style:{background:"#22c55e20",color:"#22c55e"},children:"NO CAP"})]}),n.jsx("p",{className:"text-sm",style:{color:"#94a3b8"},children:"Link your GovernmentJobs.com careers page and VET-TO-LEO will automatically scan it daily. Every new law enforcement opening gets posted to your profile with no limit on listings."}),n.jsx("button",{className:"mt-3 px-4 py-2 rounded-lg text-sm font-semibold cursor-default",style:{background:"#22c55e",color:"#000"},children:"Link GovernmentJobs.com"})]})]})}),n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:n.jsxs("div",{className:"flex items-start gap-4",children:[e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-16 h-16 rounded-lg object-contain bg-white/5 p-1"}):n.jsx("div",{className:"w-16 h-16 rounded-lg bg-[#00b4ff10] flex items-center justify-center",children:n.jsx(Be,{className:"w-8 h-8 text-[#00b4ff]"})}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:e.name}),e.isHonorary&&n.jsx(Vl,{size:"md"}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${e.tier==="platinum"||e.tier==="member"?"bg-[#d4a843]/20 text-[#d4a843] border border-[#d4a843]/30":"bg-[#00b4ff]/10 text-[#00b4ff] border border-[#00b4ff]/20"}`,children:e.tier==="platinum"?"State-Level Featured":e.tier==="member"?"Agency Member":"Participating Agency"})]}),n.jsxs("p",{className:"text-[#94a3b8] text-sm",children:[e.city?`${e.city}, `:"",e.state]})]}),n.jsx("button",{onClick:()=>t("profile"),className:"px-3 py-1.5 rounded-lg border border-[#1e293b] text-[#94a3b8] text-sm hover:text-white hover:border-[#00b4ff40] transition-colors",children:"Edit Profile"})]})}),r?n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[{icon:Wn,label:"Profile Views",value:e.anal
234ytics.profileViews,color:"#00b4ff"},{icon:ht,label:"Active Jobs",value:a.length,color:"#22c55e"},{icon:Vc,label:"Job Clicks",value:e.analytics.jobClicks,color:"#a855f7"},{icon:Pn,label:"Website Clicks",value:e.analytics.websiteClicks,color:"#f59e0b"}].map(s=>n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5 hover:border-[#00b4ff20] transition-all",children:[n.jsxs("div",{className:"flex items-start justify-between mb-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:`${s.color}15`},children:n.jsx(s.icon,{className:"w-5 h-5",style:{color:s.color}})}),n.jsx(ii,{className:"w-4 h-4 text-[#22c55e]"})]}),n.jsx("div",{className:"text-2xl font-bold text-white mb-0.5",children:s.value}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:s.label})]},s.label))}):n.jsxs("div",{className:"relative rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center space-y-5 overflow-hidden",children:[n.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-[#d4a843]/10 flex items-center justify-center",children:n.jsx(qc,{className:"w-8 h-8 text-[#d4a843]"})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h2",{className:"text-xl font-bold text-white",children:"Agency Statistics & Analytics"}),n.jsx("p",{className:"text-[#94a3b8] max-w-md mx-auto",children:"Upgrade to Agency Member to track profile views, job clicks, website clicks, and veteran engagement in real time."})]}),n.jsxs("div",{className:"rounded-xl border border-[#d4a843]/20 bg-[#d4a843]/5 p-4 max-w-sm mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[n.jsx(It,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] font-semibold text-sm",children:"LIMITED TIME OFFER"})]}),n.jsxs("p",{className:"text-white font-bold text-lg",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-sm mr-1",children:"$598"})," $299/year"]}),n.jsx("p",{className:"text-[#94a3b8] text-xs mt-1",children:"Use code AGENCY50 at checkout for 50% off"})]}),n.jsxs("button",{className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-full border border-[#d4a843]/40 text-[#d4a843] font-semibold text-sm cursor-default",children:[n.jsx(It,{className:"w-4 h-4"})," Become an Agency Member"]})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:[{icon:Rt,label:"Agency Profile",desc:"Manage your public profile",color:"#00b4ff",page:"profile"},{icon:ht,label:"Job Postings",desc:r?"Manage your listings":"Upgrade to post jobs",color:"#22c55e",page:"jobs"},{icon:Wc,label:"Recruiters",desc:"Manage recruiter profiles",color:"#06b6d4",page:"recruiters"},{icon:Fr,label:"Analytics",desc:r?"View your performance":"Upgrade to view analytics",color:"#a855f7",page:"analytics"},{icon:en,label:"Veteran Leads",desc:"See veterans interested in your agency",color:"#f59e0b",page:"leads"}].map(s=>n.jsxs("button",{type:"button",onClick:()=>t(s.page),className:"text-left rounded-xl bg-[#111827] border border-[#1e293b] p-5 hover:border-[#00b4ff40] transition-all",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center mb-3",style:{backgroundColor:`${s.color}15`},children:n.jsx(s.icon,{className:"w-5 h-5",style:{color:s.color}})}),n.jsx("div",{className:"text-white font-semibold mb-0.5",children:s.label}),n.jsx("div",{className:"text-[#94a3b8] text-sm",children:s.desc})]},s.label))})]})}function Fle({d:e}){const t=te(F.admin.updateAgency),[r,a]=y.useState(!1),[s,i]=y.useState({name:e.name??"",city:e.city??"",state:e.state??"",address:e.address??"",postalCode:e.postalCode??"",email:e.email??"",phone:e.phone??"",website:e.website??"",description:e.description??"",contactName:e.contactName??"",contactTitle:e.contactTitle??"",agencyType:e.agencyType??"",departmentSize:e.departmentSize??"",officerCount:e.officerCount?.toString()??"",salaryMin:e.salaryMin?.toString()??"",salaryMax:e.salaryMax?.toString()??"",signingBonus:e.signingBonus??"",educationIncentive:e.educationIncentive??"",retirementPlanType:e.retirementPlanType??"",retirementDetails:e.retirementDetails??"",benefits:(e.benefits??[]).join(", "),socialFacebook:e.s
234ocialFacebook??"",socialInstagram:e.socialInstagram??"",socialLinkedin:e.socialLinkedin??"",socialTwitter:e.socialTwitter??"",socialYoutube:e.socialYoutube??"",socialTiktok:e.socialTiktok??"",careersUrl:e.careersUrl??""}),o=y.useCallback(d=>u=>i(h=>({...h,[d]:u})),[]);async function c(){a(!0);try{await t({agencyId:e._id,name:s.name||void 0,city:s.city||void 0,state:s.state||void 0,address:s.address||void 0,postalCode:s.postalCode||void 0,email:s.email||void 0,phone:s.phone||void 0,website:s.website||void 0,description:s.description||void 0,contactName:s.contactName||void 0,contactTitle:s.contactTitle||void 0,agencyType:s.agencyType||void 0,departmentSize:s.departmentSize||void 0,officerCount:s.officerCount?parseInt(s.officerCount):void 0,salaryMin:s.salaryMin?parseInt(s.salaryMin):void 0,salaryMax:s.salaryMax?parseInt(s.salaryMax):void 0,signingBonus:s.signingBonus||void 0,educationIncentive:s.educationIncentive||void 0,retirementPlanType:s.retirementPlanType||void 0,retirementDetails:s.retirementDetails||void 0,benefits:s.benefits?s.benefits.split(",").map(d=>d.trim()).filter(Boolean):void 0,socialFacebook:s.socialFacebook||void 0,socialInstagram:s.socialInstagram||void 0,socialLinkedin:s.socialLinkedin||void 0,socialTwitter:s.socialTwitter||void 0,socialYoutube:s.socialYoutube||void 0,socialTiktok:s.socialTiktok||void 0,careersUrl:s.careersUrl||void 0}),W.success("Agency profile updated")}catch(d){W.error(d.message??"Failed to update")}a(!1)}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Agency Profile"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Manage the agency's public profile."})]}),n.jsxs("button",{onClick:c,disabled:r,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-[#00b4ff] text-black text-sm font-semibold hover:bg-[#0096d4] disabled:opacity-50",children:[r?n.jsx("div",{className:"w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin"}):n.jsx(Gs,{className:"w-4 h-4"}),"Save Changes"]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-3",children:"Agency Logo"}),e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:e.name,className:"w-24 h-24 rounded-lg object-contain bg-white/5 p-2 border border-[#1e293b]"}):n.jsx("div",{className:"w-24 h-24 rounded-lg bg-[#00b4ff10] flex items-center justify-center border border-[#1e293b]",children:n.jsx(Be,{className:"w-10 h-10 text-[#00b4ff]"})})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-4",children:"Basic Information"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(ze,{label:"Agency Name",value:s.name,onChange:o("name")}
234),n.jsx(ze,{label:"Agency Type",value:s.agencyType,onChange:o("agencyType"),placeholder:"Municipal Police, Sheriff..."}),n.jsx(ze,{label:"City",value:s.city,onChange:o("city")}),n.jsx(ze,{label:"State",value:s.state,onChange:o("state")}),n.jsx(ze,{label:"Email",value:s.email,onChange:o("email"),type:"email"}),n.jsx(ze,{label:"Phone",value:s.phone,onChange:o("phone")}),n.jsx(ze,{label:"Website",value:s.website,onChange:o("website"),placeholder:"https://"}),n.jsx(ze,{label:"Address",value:s.address,onChange:o("address")}),n.jsx(ze,{label:"ZIP Code",value:s.postalCode,onChange:o("postalCode")})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-4",children:"Contact Person"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(ze,{label:"Contact Name",value:s.contactName,onChange:o("contactName")}),n.jsx(ze,{label:"Contact Title",value:s.contactTitle,onChange:o("contactTitle"),placeholder:"Chief of Police, HR Director..."})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-4",children:"Description"}),n.jsx(ze,{label:"Agency Description",value:s.description,onChange:o("description"),textarea:!0,placeholder:"Tell veterans about your department..."})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-4",children:"Compensation & Department"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(kM,{label:"Department Size",value:s.departmentSize,onChange:o("departmentSize"),options:[{value:"small",label:"Small (<100 sworn)"},{value:"medium",label:"Medium (100-300 sworn)"},{value:"large",label:"Large (300+ sworn)"}]}),n.jsx(ze,{label:"Officer Count",value:s.officerCount,onChange:o("officerCount"),type:"number"}),n.jsx(ze,{label:"Salary Min ($)",value:s.salaryMin,onChange:o("salaryMin"),type:"number"}),n.jsx(ze,{label:"Salary Max ($)",value:s.salaryMax,onChange:o("salaryMax"),type:"number"}
234),n.jsx(ze,{label:"Signing Bonus",value:s.signingBonus,onChange:o("signingBonus")}),n.jsx(ze,{label:"Education Incentive",value:s.educationIncentive,onChange:o("educationIncentive")}),n.jsx(ze,{label:"Retirement Plan Type",value:s.retirementPlanType,onChange:o("retirementPlanType")}),n.jsx(ze,{label:"Retirement Details",value:s.retirementDetails,onChange:o("retirementDetails")})]}),n.jsx("div",{className:"mt-4",children:n.jsx(ze,{label:"Benefits (comma-separated)",value:s.benefits,onChange:o("benefits"),placeholder:"Health Insurance, Dental & Vision, Life Insurance..."})})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-4",children:"Social Media"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(ze,{label:"Facebook",value:s.socialFacebook,onChange:o("socialFacebook")}),n.jsx(ze,{label:"Instagram",value:s.socialInstagram,onChange:o("socialInstagram")}),n.jsx(ze,{label:"LinkedIn",value:s.socialLinkedin,onChange:o("socialLinkedin")}),n.jsx(ze,{label:"Twitter/X",value:s.socialTwitter,onChange:o("socialTwitter")}),n.jsx(ze,{label:"YouTube",value:s.socialYoutube,onChange:o("socialYoutube")}),n.jsx(ze,{label:"TikTok",value:s.socialTiktok,onChange:o("socialTiktok")})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold text-sm mb-4",children:"GovernmentJobs.com Integration"}),n.jsx(ze,{label:"Careers Page URL",value:s.careersUrl,onChange:o("careersUrl"),placeholder:"https://www.governmentjobs.com/careers/youragency"}),n.jsx("p",{className:"text-[#64748b] text-xs mt-1",children:"Paste the agency's GovernmentJobs.com careers page URL for auto-scanning."})]}),n.jsx("div",{className:"flex justify-end pb-6",children:n.jsxs("button",{onClick:c,disabled:r,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-[#00b4ff] text-black text-sm font-semibold hover:bg-[#0096d4] disabled:opacity-50",children:[r?n.jsx("div",{className:"w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin"}):n.jsx(Gs,{className:"w-4 h-4"}),"Save Changes"]})})]})}function Ble({d:e}){const t=e.tier==="member"||e.tier==="platinum",r=te(F.admin.adminCreateJob),a=te(F.admin.adminUpdateJob),s=te(F.admin.adminDeleteJob),[i,o]=y.useState(null),[c,d]=y.useState(!1),[u,h]=y.useState(!1),m={title:"",description:"",applicationUrl:"",salary:"",jobType:"",status:"active"},[p,b]=y.useState(m),w=N=>C=>b(A=>({...A,[N]:C}));function x(N){o(N._id),d(!1),b({title:N.title??"",description:N.description??"",applicationUrl:N.applicationUrl??"",salary:N.salary??"",jobType:N.jobType??"",status:N.status??"active"})}function g(){d(!0),o(null),b(m)}function j(){o(null),d(!1),b(m)}async function S(){h(!0);try{c?(await r({agencyId:e._id,title:p.title,description:p.description,applicationUrl:p.applicationUrl||void 0,salary:p.salary||void 0,jobType:p.jobType||void 0}),W.success("Job created")):i&&(await a({jobId:i,title:p.title||void 0,description:p.description||void 0,applicationUrl:p.applicationUrl||void 0,salary:p.salary||void 0,jobType:p.jobType||void 0,status:p.status}),W.success("Job updated")),j()}catch(N){W.error(N.message??"Failed")}h(!1)}async function _(N){if(confirm("Delete this job posting?"))try{await s({jobId:N}),W.success("Job deleted")}catch(C){W.error(C.message)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Job Postings"}),n.jsx("p",{className:"text-[#94a3b8]",children:t?"Manage your job listings":"Upgrade to Agency Member to post jobs"})]}),n.jsxs("button",{onClick:g,className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold text-sm",children:[n.jsx(pt,{className:"w-4 h-4"})," New Posting"]})]}),!t&&n.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"rounded-xl bg-gradient-to-br from-[#0d1a2e] to-[#162032] border border-[#00b4ff30] p-6 space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"p-2 rounded-lg bg-[#00b4ff]/10",children:n.jsx(ht,{className:"w-5 h-5 text-[#00b4ff]"})}),n.jsx("h3",{className:"text-lg font-bold text-white",children:"Annual Job Posting"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Post a single job listing for one full year. Your posting will be visible to veteran candidates actively looking for law enforcement careers."}),n.jsxs("p",{className:"text-white font-bold text-2xl",children:["$129",n.jsx("span",{className:"text-[#94a3b8] text-sm font-normal",children:"/year per posting"})]}),n.jsx("button",{className:"w-full py-2.5 rounded-full bg-[#00b4ff] text-black font-semibold text-sm cursor-default",children:"Purchase Job Posting"})]}),n.jsxs("div",{className:"rounded-xl bg-gradient-to-br from-[#1a1a0e] to-[#1e1c12] border border-[#d4a843]/30 p-6 space-y-3 relative",children:[n.jsx("div",{className:"absolute top-3 right-3 px-2 py-0.5 rounded-full bg-[#d4a843]/15 border border-[#d4a843]/30",children:n.jsx("span",{className:"text-[#d4a843] text-xs font-semibold",children:"BEST VALUE"})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"p-2 rounded-lg bg-[#d4a843]/10",children:n.jsx(It,{className:"w-5 h-5 text-[#d4a843]"})}),n.jsx("h3",{className:"text-lg font-bold text-white",children:"Agency Membership"})]}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Post up to 3 job listings, access analytics, veteran leads, and a full agency profile. Use code AGENCY50 for 50% off."}),n.jsxs("p",{className:"text-white font-bold text-2xl",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-sm mr-1",children:"$598"})," $299",n.jsx("span",{className:"text-[#94a3b8] text-sm font-normal",children:"/year"})]}),n.jsx("button",{className:"w-full py-2.5 rounded-full border border-[#d4a843]/40 text-[#d4a843] font-semibold text-sm cursor-default",children:"Become an Agency Member"})]})]}),(c||i)&&n.jsxs("div",{className:"rounded-xl border border-[#00b4ff]/30 bg-[#0d1a2e] p-5 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-white font-semibold",children:c?"Create New Job":"Edit Job"}),n.jsx("button",{onClick:j,className:"text-[#94a3b8] hover:text-white",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(ze,{label:"Job Title",value:p.title,onChange:w("title"),placeholder:"Police Officer - Lateral"}),n.jsx(ze,{label:"Salary",value:p.salary,onChange:w("salary"),placeholder:"$55,000 - $85,000"}
234),n.jsx(ze,{label:"Job Type",value:p.jobType,onChange:w("jobType"),placeholder:"Patrol, Investigations..."}),n.jsx(ze,{label:"Application URL",value:p.applicationUrl,onChange:w("applicationUrl"),placeholder:"https://..."}),i&&n.jsx(kM,{label:"Status",value:p.status,onChange:w("status"),options:[{value:"active",label:"Active"},{value:"draft",label:"Draft"},{value:"expired",label:"Expired"}]})]}),n.jsx(ze,{label:"Description",value:p.description,onChange:w("description"),textarea:!0}),n.jsxs("div",{className:"flex gap-3 justify-end",children:[n.jsx("button",{onClick:j,className:"px-4 py-2 rounded-lg border border-[#1e293b] text-[#94a3b8] text-sm hover:text-white",children:"Cancel"}),n.jsxs("button",{onClick:S,disabled:u,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#00b4ff] text-black text-sm font-semibold disabled:opacity-50",children:[u?n.jsx("div",{className:"w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin"}):n.jsx(Gs,{className:"w-4 h-4"}),c?"Create Job":"Save"]})]})]}),e.jobs.length===0&&!c?n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center",children:[n.jsx(ht,{className:"w-12 h-12 text-[#475569] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"No Job Postings"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"This agency hasn't posted any jobs yet."})]}):n.jsx("div",{className:"space-y-3",children:p0(e.jobs).map(N=>n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[n.jsx("h4",{className:"text-white font-semibold",children:N.title}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium uppercase ${N.status==="active"?"bg-[#22c55e]/10 text-[#22c55e]":N.status==="expired"?"bg-[#ef4444]/10 text-[#ef4444]":"bg-[#475569]/10 text-[#475569]"}`,children:N.status}),N.featured&&n.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-medium bg-[#d4a843]/10 text-[#d4a843]",children:"FEATURED"})]}),n.jsxs("div",{className:"flex items-center gap-3 text-sm text-[#94a3b8]",children:[N.salary&&n.jsx("span",{children:N.salary}),N.jobType&&n.jsx("span",{children:N.jobType})]}),N.description&&n.jsx("p",{className:"text-[#64748b] text-sm mt-1.5 line-clamp-2",children:N.description}),N.applicationUrl&&n.jsx("a",{href:N.applicationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[#00b4ff] text-xs hover:underline mt-1.5 inline-block",children:"Application Link â"})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx("button",{onClick:()=>x(N),className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-[#00b4ff]",children:n.jsx(qt,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>_(N._id),className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-[#ef4444]",children:n.jsx(_n,{className:"w-4 h-4"})})]})]})},N._id))})]})}function Ule({d:e}){const t=te(F.admin.adminCreateRecruiter),r=te(F.admin.adminUpdateRecruiter),a=te(F.admin.adminDeleteRecruiter),s=te(F.storage.generateUploadUrl),[i,o]=y.useState(null),[c,d]=y.useState(!1),[u,h]=y.useState(!1),[m,p]=y.useState(null),[b,w]=y.useState(null),x=y.useRef(null),g={firstName:"",lastName:"",title:"",email:"",phone:"",bio:""},[j,S]=y.useState(g),_=R=>B=>S(D=>({...D,[R]:B}));function N(){p(null),w(null),x.current&&(x.current.value="")}function C(R){o(R._id),d(!1),S({firstName:R.firstName??"",lastName:R.lastName??"",title:R.title??"",email:R.email??"",phone:R.phone??"",bio:R.bio??""}),N(),w(R.photoUrl??null)}function A(){d(!0),o(null),S(g),N()}function P(){o(null),d(!1),S(g),N()}function O(R){if(R){if(!R.type.startsWith("image/")){W.error("Please choose an image file");return}if(R.size>5*1024*1024){W.error("Image must be under 5MB");return}p(R),w(URL.createObjectURL(R))}}async function E(){if(!m)return;const R=await s(),B=await fetch(R,{method:"POST",headers:{"Content-Type":m.type},body:m});if(!B.ok)throw new Error("Photo upload failed");const{storageId:D}=await B.json();return D}async function $(){h(!0);try{const R=await E();c?(await t({agencyId:e._id,firstName:j.firstName,lastName:j.lastName,title:j.title||void 0,email:j.email||void 0,phone:j.phone||void 0,bio:j.bio||void 0,photoStorageId:R}),W.success("Recruiter added")):i&&(await r({recruiterId:i,firstName:j.firstName||void 0,lastName:j.lastName||void 0,title:j.title||void 0,email:j.email||void 0,phone:j.phone||void 0,bio:j.bio||void 0,photoStorageId:R}),W.success("Recruiter updated")),P()}catch(R){W.error(R.message??"Failed")}h(!1)}
234async function M(R){if(confirm("Delete this recruiter?"))try{await a({recruiterId:R}),W.success("Recruiter deleted")}catch(B){W.error(B.message)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Recruiters"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Manage recruiter profiles for this agency."})]}),n.jsxs("button",{onClick:A,className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg bg-[#00b4ff] hover:bg-[#0096d4] text-black font-semibold text-sm",children:[n.jsx(pt,{className:"w-4 h-4"})," Add Recruiter"]})]}),(c||i)&&n.jsxs("div",{className:"rounded-xl border border-[#06b6d4]/30 bg-[#0d1a2e] p-5 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-white font-semibold",children:c?"Add New Recruiter":"Edit Recruiter"}),n.jsx("button",{onClick:P,className:"text-[#94a3b8] hover:text-white",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[b?n.jsx("img",{src:b,alt:"",className:"w-20 h-20 rounded-full object-cover border border-[#1e293b]"}):n.jsx("div",{className:"w-20 h-20 rounded-full bg-[#06b6d4]/10 border border-[#1e293b] flex items-center justify-center",children:n.jsx(Ze,{className:"w-9 h-9 text-[#06b6d4]"})}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[#94a3b8] text-xs font-medium mb-1",children:"Profile Photo"}),n.jsx("input",{ref:x,type:"file",accept:"image/*",onChange:R=>O(R.target.files?.[0]??null),className:"hidden"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>x.current?.click(),className:"px-3 py-1.5 rounded-lg border border-[#1e293b] text-[#94a3b8] hover:text-white text-xs",children:b?"Change Photo":"Upload Photo"}),m&&n.jsx("button",{type:"button",onClick:N,className:"text-xs text-[#94a3b8] hover:text-[#ef4444]",children:"Remove"})]}),n.jsx("p",{className:"text-[#64748b] text-[11px] mt-1",children:"Square image works best. JPG or PNG, under 5MB. Optional."})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(ze,{label:"First Name",value:j.firstName,onChange:_("firstName")}),n.jsx(ze,{label:"Last Name",value:j.lastName,onChange:_("lastName")}),n.jsx(ze,{label:"Title",value:j.title,onChange:_("title"),placeholder:"Recruiting Sergeant"}),n.jsx(ze,{label:"Email",value:j.email,onChange:_("email"),type:"email"}),n.jsx(ze,{label:"Phone",value:j.phone,onChange:_("phone")})]}),n.jsx(ze,{label:"Bio",value:j.bio,onChange:_("bio"),textarea:!0}),n.jsxs("div",{className:"flex gap-3 justify-end",children:[n.jsx("button",{onClick:P,className:"px-4 py-2 rounded-lg border border-[#1e293b] text-[#94a3b8] text-sm hover:text-white",children:"Cancel"}),n.jsxs("button",{onClick:$,disabled:u,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#00b4ff] text-black text-sm font-semibold disabled:opacity-50",children:[u?n.jsx("div",{className:"w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin"}):n.jsx(Gs,{className:"w-4 h-4"}),c?"Add Recruiter":"Save"]})]})]}),e.recruiters.length===0&&!c?n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center",children:[n.jsx(en,{className:"w-12 h-12 text-[#475569] mx-auto mb-3"}),n.jsx("h3",{className:"text-lg font-bold text-white mb-1",children:"No Recruiters"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No recruiter profiles added yet."})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.recruiters.map(R=>n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[R.photoUrl?n.jsx("img",{src:R.photoUrl,alt:`${R.firstName} ${R.lastName}`,className:"w-14 h-14 rounded-full object-cover"}):n.jsx("div",{className:"w-14 h-14 rounded-full bg-[#06b6d4]/10 flex items-center justify-center",children:n.jsx(Ze,{className:"w-7 h-7 text-[#06b6d4]"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"text-white font-semibold",children:[R.firstName," ",R.lastName]}),n.jsx("div",{className:"text-[#94a3b8] text-sm",children:R.title||"Recruiter"}),R.email&&n.jsxs("div",{className:"text-[#64748b] text-xs mt-1 flex items-center gap-1",children:[n.jsx(Sn,{className:"w-3 h-3"})," ",R.email]}),R.phone&&n.jsxs("div",{className:"text-[#64748b] text-xs flex items-center gap-1",children:[n.jsx(zo,{className:"w-3 h-3"})," ",R.phone]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>C(R),className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-[#00b4ff]",children:n.jsx(qt,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>M(R._id),className:"p-2 rounded-lg hover:bg-[#1e293b] text-[#94a3b8] hover:text-[#ef4444]",children:n.jsx(_n,{className:"w-4 h-4"})})]})]})},R._id))})]})}function zle({d:e}){return e.tier==="member"||e.tier==="platinum"?n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Analytics"}),n.jsx("p",{className:"text-[#94a3b8]",children:"View your agency's performance."})]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[{icon:Wn,label:"Profile Views",value:e.anal
234ytics.profileViews,color:"#00b4ff"},{icon:Vc,label:"Job Clicks",value:e.analytics.jobClicks,color:"#a855f7"},{icon:Pn,label:"Website Clicks",value:e.analytics.websiteClicks,color:"#f59e0b"}].map(r=>n.jsxs("div",{className:"rounded-xl bg-[#111827] border border-[#1e293b] p-5",children:[n.jsxs("div",{className:"flex items-start justify-between mb-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{backgroundColor:`${r.color}15`},children:n.jsx(r.icon,{className:"w-5 h-5",style:{color:r.color}})}),n.jsx(ii,{className:"w-4 h-4 text-[#22c55e]"})]}),n.jsx("div",{className:"text-2xl font-bold text-white mb-0.5",children:r.value}),n.jsx("div",{className:"text-sm text-[#94a3b8]",children:r.label})]},r.label))}),e.analytics.recentEvents.length>0&&n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold mb-3",children:"Recent Activity"}),n.jsx("div",{className:"space-y-2",children:e.analytics.recentEvents.map((r,a)=>n.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-[#1e293b] last:border-0",children:[n.jsx("span",{className:"text-[#94a3b8] text-sm",children:r.event}),n.jsx("span",{className:"text-[#64748b] text-xs",children:new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]},a))})]})]}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Analytics"}),n.jsx("p",{className:"text-[#94a3b8]",children:"View your agency's performance."})]}),n.jsxs("div",{className:"relative rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center space-y-5",children:[n.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-[#d4a843]/10 flex items-center justify-center",children:n.jsx(qc,{className:"w-8 h-8 text-[#d4a843]"})}),n.jsx("h2",{className:"text-xl font-bold text-white",children:"Campaign Analytics"}),n.jsx("p",{className:"text-[#94a3b8] max-w-md mx-auto",children:"Upgrade to Agency Member to access detailed analytics on profile views, job engagement, and veteran interest."}),n.jsxs("div",{className:"rounded-xl border border-[#d4a843]/20 bg-[#d4a843]/5 p-4 max-w-sm mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[n.jsx(It,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] font-semibold text-sm",children:"LIMITED TIME OFFER"})]}),n.jsxs("p",{className:"text-white font-bold text-lg",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-sm mr-1",children:"$598"})," $299/year"]})]}),n.jsxs("button",{className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-full border border-[#d4a843]/40 text-[#d4a843] font-semibold text-sm cursor-default",children:[n.jsx(It,{className:"w-4 h-4"})," Become an Agency Member"]})]})]})}function PM({title:e,feature:t,desc:r}){return n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{children:n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:e})}),n.jsxs("div",{className:"relative rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center space-y-5",children:[n.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-[#d4a843]/10 flex items-center justify-center",children:n.jsx(qc,{className:"w-8 h-8 text-[#d4a843]"})}),n.jsx("h2",{className:"text-xl font-bold text-white",children:t}),n.jsx("p",{className:"text-[#94a3b8] max-w-md mx-auto",children:r}),n.jsxs("div",{className:"rounded-xl border border-[#d4a843]/20 bg-[#d4a843]/5 p-4 max-w-sm mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[n.jsx(It,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] font-semibold text-sm",children:"LIMITED TIME OFFER"})]}),n.jsxs("p",{className:"text-white font-bold text-lg",children:[n.jsx("span",{className:"line-through text-[#94a3b8] text-sm mr-1",children:"$598"})," $299/year"]})]}),n.jsxs("button",{className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-full border border-[#d4a843]/40 text-[#d4a843] font-semibold text-sm cursor-default",children:[n.jsx(It,{className:"w-4 h-4"})," Become an Agency Member"]})]})]})}function Wle({d:e}){return e.tier!=="member"&&e.tier!=="platinum"?n.jsx(PM,{title:"Veteran Leads",feature:"Veteran Lead Pipeline",desc:"Upgrade to Agency Member to see veterans who are interested in your agency and connect with them directly."}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Veteran Leads"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Veterans interested in this agency."})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center",children:[n.jsx(en,{className:"w-12 h-12 text-[#475569] mx-auto mb-3"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No veteran leads yet."})]})]})}function qle({d:e}){return e.tier!=="member"&&e.tier!=="platinum"?n.jsx(PM,{title:"Messages",feature:"Agency Messaging",desc:"Upgrade to Agency Member to communicate directly with veteran candidates through VET-TO-LEO's secure messaging system."}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Messages"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Conversations with veteran candidates."})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-8 text-center",children:[n.jsx(tn,{className:"w-12 h-12 text-[#475569] mx-auto mb-3"}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"No conversations yet."})]})]})}function Vle({d:e}){const t=te(F.admin.setAgencyTier),r=te(F.admin.setAgencyStatus),[a,s]=y.useState(!1),i=e.tier==="platinum"?"State-Level Featured":e.tier==="member"?"Agency Member":"Participating Agency";async function o(d){s(!0);try{await t({agencyId:e._id,tier:d}),W.success(`Tier changed to ${d}`)}catch(u){W.error(u.message)}s(!1)}async function c(d){s(!0);try{await r({agencyId:e._id,status:d}),W.success(`Status changed to ${d}`)}catch(u){W.error(u.message)}s(!1)}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Subscription"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Current plan and billing."})]}),n.jsxs("div",{className:"rounded-xl border border-[#d4a843]/30 bg-[#d4a843]/5 p-5",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(Be,{className:"w-4 h-4 text-[#d4a843]"}),n.jsx("span",{className:"text-[#d4a843] text-sm font-semibold",children:"Admin Controls"})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[#94a3b8] text-xs block mb-2",children:"Change Tier"}),n.jsx("div",{className:"flex gap-2 flex-wrap",children:["participating","member","platinum"].map(d=>n.jsx("button",{onClick:()=>o(d),disabled:e.tier===d||a,className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${e.tier===d?"bg-[#00b4ff]/20 text-[#00b4ff] border border-[#00b4ff]/30 cursor-default":"border border-[#1e293b] text-[#94a3b8] hover:text-white hover:border-[#00b4ff]/40"} disabled:opacity-50`,children:d==="platinum"?"State-Level Featured":d==="member"?"Agency Member":"Participating"},d))})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[#94a3b8] text-xs block mb-2",children:"Change Status"}),n.jsx("div",{className:"flex gap-2 flex-wrap",children:["active","pending","suspended"].map(d=>n.jsx("button",{onClick:()=>c(d),disabled:e.status===d||a,className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${e.status===d?`${d==="active"?"bg-[#22c55e]/20 text-[#22c55e] border-[#22c55e]/30":d==="suspended"?"bg-[#ef4444]/20 text-[#ef4444] border-[#ef4444]/30":"bg-[#f59e0b]/20 text-[#f59e0b] border-[#f59e0b]/30"} border cursor-default`:"border border-[#1e293b] text-[#94a3b8] hover:text-white"} disabled:opacity-50`,children:d.charAt(0).toUpperCase()+d.slice(1)},d))})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[n.jsx("div",{className:`w-14 h-14 roun
234ded-lg flex items-center justify-center ${e.tier==="participating"?"bg-[#00b4ff]/10":"bg-[#d4a843]/10"}`,children:n.jsx(Be,{className:`w-7 h-7 ${e.tier==="participating"?"text-[#00b4ff]":"text-[#d4a843]"}`})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-white font-bold text-lg",children:i}),n.jsx("p",{className:"text-[#94a3b8] text-sm",children:"Current plan"})]})]}),(e.stripeCustomerId||e.ownerEmail)&&n.jsxs("div",{className:"space-y-2 pt-3 border-t border-[#1e293b]",children:[e.ownerEmail&&n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-[#64748b]",children:"Account Email"}),n.jsx("span",{className:"text-white",children:e.ownerEmail})]}),e.stripeCustomerId&&n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-[#64748b]",children:"Stripe Customer"}),n.jsx("a",{href:`https://dashboard.stripe.com/customers/${e.stripeCustomerId}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#00b4ff] hover:underline",children:e.stripeCustomerId})]}),e.stripeSubscriptionId&&n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-[#64748b]",children:"Subscription"}),n.jsx("a",{href:`https://dashboard.stripe.com/subscriptions/${e.stripeSubscriptionId}`,target:"_blank",rel:"noopener noreferrer",className:"text-[#00b4ff] hover:underline",children:e.stripeSubscriptionId})]})]})]})]})}function Hle({d:e}){return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Settings"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Account settings for this agency."})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5",children:[n.jsx("h3",{className:"text-white font-semibold mb-3",children:"Account Information"}),n.jsx("div",{className:"space-y-2",children:[["Agency ID",e._id],["Account Email",e.ownerEmail],["Joined",new Date(e._creationTime).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]].filter(([,t])=>t).map(([t,r])=>n.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-[#1e293b] last:border-0",children:[n.jsx("span",{className:"text-[#64748b] text-sm",children:t}),n.jsx("span",{className:"text-white text-sm",children:r})]},t))})]})]})}function Gle(){const{id:e}=x0(),[t]=$c(),r=t.get("tab")??"dashboard",[a,s]=y.useState(r),i=ie(F.admin.getAgencyDashboard,e?{agencyId:e}:"skip");return i===void 0?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsx("div",{className:"w-8 h-8 border-2 border-[#d4a843] border-t-transparent rounded-full animate-spin"})}):i===null?n.jsxs("div",{className:"text-center py-20",children:[n.jsx(Be,{className:"w-12 h-12 text-[#475569] mx-auto mb-4"}),n.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Agency Not Found"}),n.jsx(ye,{to:"/admin/all-agencies",className:"text-[#00b4ff] hover:underline text-sm",children:"Back to All Agencies"})]}):n.jsxs("div",{className:"flex min-h-[calc(100vh-80px)] -m-4 lg:-m-6",children:[n.jsxs("div",{className:"w-[240px] shrink-0 bg-[#0a0e17] border-r border-[#1e293b] flex flex-col",children:[n.jsx("div",{className:"border-b border-[#1e293b] px-4 py-5 flex items-center justify-center",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"w-full h-auto drop-shadow-[0_0_12px_rgba(212,168,67,0.3)]"})}),n.jsxs("div",{className:"flex-1 px-3 py-4 space-y-6 overflow-y-auto",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[#475569] text-xs uppercase tracking-wider font-medium px-2 mb-2",children:"Agency"}),n.jsx("div",{className:"space-y-0.5",children:Rle.map(o=>n.jsxs("button",{onClick:()=>s(o.id),className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${a===o.id?"bg-[#111827] text-white":"text-[#94a3b8] hover:text-white hover:bg-[#111827]/50"}`,children:[n.jsx(o.icon,{className:"w-4 h-4"}),o.label]},o.id))})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[#475569] text-xs uppercase tracking-wider font-medium px-2 mb-2",children:"Account"}),n.jsx("div",{className:"space-y-0.5",children:Dle.map(o=>n.jsxs("button",{onClick:()=>s(o.id),className:`w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${a===o.id?"bg-[#111827] text-white":"text-[#94a3b8] hover:text-white hover:bg-[#111827]/50"}`,children:[n.jsx(o.icon,{className:"w-4 h-4"}),o.label]},o.id))})]})]}),n.jsx("div",{className:"border-t border-[#1e293b] p-3",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-2",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#00b4ff] flex items-center justify-center text-black text-sm font-bold shrink-0",children:(i.contactName||i.name||"A").charAt(0).toUpperCase()}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-medium text-white truncate",children:i.contactName||"Agency User"}),n.jsx("div",{className:"text-xs text-[#94a3b8] truncate",children:i.ownerEmail||i.email||""})]})]})})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[n.jsxs("div",{className:"bg-[#d4a843]/10 border-b border-[#d4a843]/20 px-6 py-3 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wn,{className:"w-4 h-4 text-[#d4a843]"}),n.jsxs("span",{className:"text-[#d4a843] text-sm font-semibold",children:["Admin View: ",i.name]}),n.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium ${i.tier==="participating"?"bg-[#00b4ff]/10 text-[#00b4ff]":"bg-[#d4a843]/20 text-[#d4a843]"}`,children:i.tier==="platinum"?"State-Level Featured":i.tier==="member"?"Agency Member":"Participating"})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs(ye,{to:`/admin/messages?to=agency:${i._id}`,className:"inline-flex items-center gap-2 text-[#d4a843] hover:text-white text-sm",children:[n.jsx(tn,{className:"w-4 h-4"})," Message Agency"]}),n.jsxs(ye,{to:`/admin/agency/${e}`,className:"inline-flex items-center gap-2 text-[#94a3b8] hover:text-white text-sm",children:[n.jsx(Zr,{className:"w-4 h-4"})," Back to Admin"]})]})]}),n.jsxs("div",{className:"flex-1 p-4 lg:p-6 overflow-y-auto",children:[a==="dashboard"&&n.jsx($le,{d:i,onNavigate:s}),a==="profile"&&n.jsx(Fle,{d:i}),a==="jobs"&&n.jsx(Ble,{d:i}),a==="recruiters"&&n.jsx(Ule,{d:i}),a==="analytics"&&n.jsx(zle,{d:i}),a==="leads"&&n.jsx(Wle,{d:i}),a==="messages"&&n.jsx(qle,{d:i}),a==="subscription"&&n.jsx(Vle,{d:i}),a==="settings"&&n.jsx(Hle,{d:i})]})]})]})}const Hh="#d4a843";function Kle({onSelect:e}){const t=ie(F.veteranPortal.listAllVeterans),[r,a]=y.useState(""),s=(t||[]).filter(i=>r?`${i.firstName} ${i.lastName}`.toLowerCase().includes(r.toLowerCase())||i.branch?.toLowerCase().includes(r.toLowerCase()):!0);return n.jsxs("div",{className:"border-b border-[#1e293b] bg-[#0a0e17] px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2.5",children:[n.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500",children:"Veterans"}),n.jsxs("div",{className:"relative flex-1 max-w-xs",children:[n.jsx(Dt,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500"}),n.jsx("input",{type:"text",placeholder:"Search...",value:r,onChange:i=>a(i.target.value),className:"w-full bg-[#111827] border border-[#1e293b] rounded px-6 py-1 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-[#d4a843]/40"})]})]}),n.jsxs("div",{className:"flex gap-4 overflow-x-auto pb-1",children:[s.length===0&&n.jsx("p",{className:"text-xs text-gray-600 py-2",children:r?"No veterans match that search.":"No veterans have selected your state yet. New candidates appear here as soon as one lists your state as a place they want to work."}),s.slice(0,20).map(i=>{const o=`${(i.firstName||"")[0]||""}${(i.lastName||"")[0]||""}`.toUpperCase();return n.jsxs("button",{onClick:()=>e({userId:i.userId,name:`${i.firstName} ${i.lastName}`,photoUrl:i.photoUrl}),className:"flex flex-col items-center gap-1.5 min-w-[60px] group",children:[i.photoUrl?n.jsx("img",{src:i.photoUrl,alt:"",className:"w-11 h-11 rounded-full object-cover border-2 border-transparent group-hover:border-[#d4a843]/60 transition-colors"}):n.jsx("div",{className:"w-11 h-11 rounded-full bg-[#1e293b] flex items-center justify-center border-2 border-transparent group-hover:border-[#d4a843]/60 transition-colors",children:n.jsx("span",{className:"text-xs font-bold text-gray-400",children:o})}),n.jsx("span",{className:"text-[10px] text-center leading-tight truncate w-full text-gray-500 group-hover:text-gray-300 transition-colors",children:i.firstName})]},i._id)})]})]})}function Yle({conversations:e,selectedId:t,onSelect:r}){return n.jsx("div",{className:"divide-y divide-[#1e293b]",children:e.length===0?n.jsxs("div",{className:"px-4 py-12 text-center",children:[n.jsx(tn,{className:"w-8 h-8 mx-auto mb-2 text-gray-600"}),n.jsx("p",{className:"text-sm text-gray-500",children:"No conversations yet."}),n.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Browse veterans to start a conversation."})]}):e.map(a=>n.jsx("button",{onClick:()=>r(a.otherUserId),className:`w-full text-left px-4 py-3 hover:bg-[#1e293b]/50 transition-colors ${t===a.otherUserId?"bg-[#1e293b]/70":""}`,children:n.jsxs("div",{className:"flex items-center gap-3",children:[a.otherPhotoUrl?n.jsx("img",{src:a.otherPhotoUrl,alt:"",className:"w-10 h-10 rounded-full object-cover flex-shrink-0"}):n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#1e293b] flex items-center justify-center flex-shrink-0",children:n.jsx(Ze,{className:"w-5 h-5 text-gray-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("p",{className:"text-sm font-medium text-white truncate",children:a.otherName}),a.unreadCount>0&&n.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full flex-shrink-0",style:{background:Hh,color:"#000"},children:a.unreadCount})]}),n.jsx("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:a.lastMessagePreview||"Start a conversation"}),n.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:TM(a.lastMessageAt)}
234)]})]})},a._id))})}function PC({otherUserId:e,otherName:t,otherPhoto:r,onBack:a,hideBack:s}){const i=ie(F.messaging.getMessages,{otherUserId:e}),o=ie(F.messaging.listConversations),c=te(F.messaging.sendMessage),d=te(F.messaging.markAsRead),[u,h]=y.useState(""),[m,p]=y.useState(!1),b=y.useRef(null),w=o?.find(S=>S.otherUserId===e),x=w?.otherName||t||"Veteran",g=w?.otherPhotoUrl||r;y.useEffect(()=>{e&&d({otherUserId:e}).catch(()=>{})},[e,i?.length]),y.useEffect(()=>{b.current?.scrollIntoView({behavior:"smooth"})},[i?.length]);const j=async()=>{if(!(!u.trim()||m)){p(!0);try{await c({recipientId:e,body:u.trim()}),h("")}finally{p(!1)}}};return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[#1e293b]",children:[!s&&n.jsx("button",{onClick:a,className:"lg:hidden p-1 rounded hover:bg-[#1e293b]",children:n.jsx(Zr,{className:"w-5 h-5 text-gray-400"})}),g?n.jsx("img",{src:g,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1e293b] flex items-center justify-center",children:n.jsx(Ze,{className:"w-4 h-4 text-gray-500"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:x}),n.jsx("p",{className:"text-[11px] text-gray-500",children:w?.otherRole==="VET-TO-LEO Support"?"VET-TO-LEO Support":"Veteran"})]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[i?i.length===0?n.jsxs("div",{className:"text-center py-12",children:[n.jsx(tn,{className:"w-8 h-8 mx-auto mb-2 text-gray-600"}),n.jsx("p",{className:"text-sm text-gray-500",children:"Send a message to start the conversation."})]}):i.map(S=>n.jsx("div",{className:`flex ${S.isMine?"justify-end":"justify-start"}`,children:n.jsxs("div",{className:"max-w-[75%] px-4 py-2.5 rounded-2xl text-sm",style:{background:S.isMine?Hh:"#1e293b",color:S.isMine?"#000":"#e2e8f0",borderBottomRightRadius:S.isMine?"4px":"16px",borderBottomLeftRadius:S.isMine?"16px":"4px"},children:[n.jsx("p",{children:S.body}),n.jsx("p",{className:"text-[10px] mt-1",style:{color:S.isMine?"rgba(0,0,0,0.5)":"rgba(148,163,184,0.6)"},children:TM(S._creationTime)})]})},S._id)):n.jsx("div",{className:"text-center py-8",children:n.jsx("div",{className:"w-6 h-6 border-2 border-gray-600 border-t-gray-400 rounded-full animate-spin mx-auto"})}),n.jsx("div",{ref:b})]}),n.jsx("div",{className:"border-t border-[#1e293b] p-3",children:n.jsxs("form",{onSubmit:S=>{S.preventDefault(),j()},className:"flex items-center gap-2",children:[n.jsx(Ee,{value:u,onChange:S=>h(S.target.value),placeholder:"Type a message...",className:"flex-1 bg-[#0d1117] border-[#1e293b] text-white",disabled:m}),n.jsx(be,{type:"submit",size:"icon",disabled:!u.trim()||m,style:{background:Hh,color:"#000"},children:n.jsx(si,{className:"w-4 h-4"})})]})})]})}function TM(e){const t=new Date(e),a=new Date().getTime()-t.getTime(),s=Math.floor(a/864e5);return s===0?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):s===1?"Yesterday":s<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function Zle(){const e=ie(F.agencies.getMyAgency),t=e?.tier==="member"||e?.tier==="platinum",r=ie(F.messaging.listConversations),a=ie(F.messaging.getUnreadCount)??0,[s,i]=y.useState(null),[o,c]=y.useState(),[d,u]=y.useState();if(!t){const p=(r||[]).find(b=>b.otherRole==="VET-TO-LEO Support");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Messages"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Communicate directly with veteran candidates."})]}),p&&n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] overflow-hidden flex flex-col",style:{height:"min(560px, calc(100vh - 14rem))"},children:n.jsx(PC,{otherUserId:p.otherUserId,otherName:p.otherName,otherPhoto:p.otherPhotoUrl,onBack:()=>{},hideBack:!0})}),n.jsx(bf,{feature:"Direct Messaging",description:"Upgrade to Agency Member to message veterans directly. Reach out to qualified candidates, answer questions about your agency, and build relationships before they apply."})]})}
234const h=p=>{i(p.userId),c(p.name),u(p.photoUrl)},m=p=>{c(void 0),u(void 0),i(p)};return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white mb-1",children:"Messages"}),n.jsx("p",{className:"text-[#94a3b8]",children:"Communicate directly with veteran candidates."})]}),a>0&&n.jsxs("span",{className:"text-sm font-bold px-3 py-1 rounded-full",style:{background:Hh,color:"#000"},children:[a," unread"]})]}),n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] overflow-hidden",style:{height:"calc(100vh - 12rem)"},children:n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:`w-full lg:w-80 border-r border-[#1e293b] overflow-y-auto flex flex-col ${s?"hidden lg:flex":"flex"}`,children:[n.jsx("div",{className:"px-4 py-3 border-b border-[#1e293b]",children:n.jsx("h3",{className:"text-sm font-semibold text-white",children:"Conversations"})}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx(Yle,{conversations:r||[],selectedId:s,onSelect:m})})]}),n.jsxs("div",{className:`flex-1 flex flex-col ${s?"":"hidden lg:flex"}`,children:[n.jsx(Kle,{onSelect:h}),n.jsx("div",{className:"flex-1 flex flex-col min-h-0",children:s?n.jsx(PC,{otherUserId:s,otherName:o,otherPhoto:d,onBack:()=>{i(null),c(void 0),u(void 0)}}):n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center p-8",children:[n.jsx(tn,{className:"w-12 h-12 mx-auto mb-3 text-gray-600"}),n.jsx("p",{className:"text-gray-400",children:"Select a veteran or conversation to start messaging."})]})})})]})]})})]})}const Xle=1e4;function Jle(e){return e.isAuthenticated?"/dashboard":!e.isLoading&&!e.hadOAuthCode?e.returnedFromSignIn?Iw:"/login":e.timedOut?Iw:null}function Qle({hadOAuthCode:e=XI(),returnedFromSignIn:t=JI()}){const{isAuthenticated:r,isLoading:a}=Vn(),[s,i]=y.useState(!1);y.useEffect(()=>{if(!e||r)return;const c=setTimeout(()=>i(!0),Xle);return()=>clearTimeout(c)},[e,r]);const o=Jle({isAuthenticated:r,isLoading:a,hadOAuthCode:e,returnedFromSignIn:t,timedOut:s});return o!==null?n.jsx(Mt,{to:o,replace:!0}):n.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3",children:[n.jsx(gt,{className:"size-6 animate-spin text-muted-foreground"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Signing you in..."})]})}const TC="#d4a843";function ece(){const e=ai(),{signOut:t}=rs(),r=ie(F.veteranPortal.getMyProfile),a=ie(F.messaging.getUnreadCount)??0,s=[{label:"Dashboard",path:"/vet/dashboard",icon:qC},{label:"Job Board",path:"/vet/jobs",icon:ht},{label:"Saved Jobs",path:"/vet/saved",icon:Jh},{label:"Messages",path:"/vet/messages",icon:tn,badge:a}],i=[{label:"Getting Certified",path:"/certified",icon:Be},{label:"Education Programs",path:"/education",icon:pn}];return n.jsxs(di,{children:[n.jsx(hi,{className:"border-b border-sidebar-border px-4 py-4",children:n.jsx(ye,{to:"/vet/dashboard",className:"flex items-center gap-3",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"h-10"})})}),n.jsxs(mi,{children:[n.jsxs(es,{children:[n.jsx(Zs,{className:"text-xs uppercase tracking-wider text-gray-500",children:"My Portal"}),n.jsx(ts,{children:n.jsx(On,{children:s.map(o=>{const c=e.pathname===o.path;return n.jsxs(ln,{children:[n.jsx(Un,{asChild:!0,isActive:c,children:n.jsxs(ye,{to:o.path,className:"flex items-center gap-3",children:[n.jsx(o.icon,{className:"w-4 h-4"}),n.jsx("span",{children:o.label})]})}),o.badge?n.jsx(Xk,{className:"text-xs font-bold rounded-full px-2 py-0.5",style:{background:TC,color:"#000"},children:o.badge}):null]},o.path)})})})]}),n.jsxs(es,{children:[n.jsx(Zs,{className:"text-xs uppercase tracking-wider text-gray-500",children:"Resources"}),n.jsx(ts,{children:n.jsx(On,{children:i.map(o=>{const c=e.pathname===o.path;return n.jsx(ln,{children:n.jsx(Un,{asChild:!0,isActive:c,children:n.jsxs(ye,{to:o.path,className:"flex items-center gap-3",children:[n.jsx(o.icon,{className:"w-4 h-4"}),n.jsx("span",{children:o.label})]})})},o.path)})})})]})]}),n.jsx(fi,{className:"border-t border-sidebar-border pb-4 pt-4",children:n.jsxs(On,{className:"space-y-3",children:[n.jsx(ln,{children:n.jsx(Un,{asChild:!0,isActive:e.pathname==="/vet/profile",children:n.jsxs(ye,{to:"/vet/profile",className:"flex items-center gap-3 py-2",children:[r?.photoUrl?n.jsx("img",{src:r.photoUrl,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsxs("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold",style:{background:TC,color:"#000"},children:[r?.firstName?.[0],r?.lastName?.[0]]}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:r?`${r.firstName} ${r.lastName}`:"My Profile"}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r?.branch||"Veteran"})]})]})})}),n.jsx(ln,{children:n.jsxs(Un,{onClick:()=>t(),className:"text-red-400 hover:text-red-300",children:[n.jsx(tf,{className:"w-4 h-4"}),n.jsx("span",{children:"Sign Out"})]})})]})})]})}const tce={"/vet/dashboard":"Dashboard","/vet/jobs":"Job Board","/vet/saved":"Saved Jobs","/vet/messages":"Messages","/vet/profile":"My Profile"};function nce(){const e=ai(),t=tce[e.pathname]||"Veteran Portal";return n.jsxs("header",{className:"flex h-14 items-center gap-2 border-b px-4",children:[n.jsx(Xc,{className:"-ml-1"}),n.jsx(Zh,{orientation:"vertical",className:"mr-2 h-4"}),n.jsx("h1",{className:"text-sm font-semibold",children:t})]})}function rce(){return gf(),n.jsxs(ci,{children:[n.jsx(ece,{}),n.jsxs(ui,{children:[n.jsx(nce,{}),n.jsx("main",{className:"flex-1 p-4 lg:p-6",children:n.jsx(Yr,{})})]})]})}function OC(){return n.jsxs(ci,{children:[n.jsxs(di,{children:[n.jsx(hi,{className:"border-b border-sidebar-border",children:n.jsx("div",{className:"flex items-center gap-2.5 px-2 py-1",children:n.jsx(Je,{className:"h-10 w-24"})})}),n.jsx(mi,{children:n.jsx("div",{className:"p-2",children:n.jsx(On,{children:[1,2,3,4,5].map(e=>n.jsx(ln,{children:n.jsx(ju,{showIcon:!0})},e))})})}),n.jsx(fi,{className:"border-t border-sidebar-border",children:n.jsxs("div",{className:"flex items-center gap-3 p-2",children:[n.jsx(Je,{className:"size-8 rounded-full"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(Je,{className:"h-3.5 w-24"}),n.jsx(Je,{className:"h-3 w-32"})]})]})})]}),n.jsxs(ui,{children:[n.jsxs("header",{className:"flex h-14 items-center gap-2 border-b px-4",children:[n.jsx(Je,{className:"size-7 rounded-md"}),n.jsx("div",{className:"flex-1"})]}),n.jsxs("main",{className:"flex-1 p-4 lg:p-6 space-y-6",children:[n.jsx(Je,{className:"h-8 w-48"}),n.jsx("div",{className:"grid gap-4 md:grid-cols-4",children:[1,2,3,4].map(e=>n.jsx(Je,{className:"h-32 rounded-lg"},e))})]})]})]})}function ace(){const{isAuthenticated:e,isLoading:t}=Vn(),r=ie(F.veteranPortal.getMyProfile,e?{}:"skip");return t?n.jsx(OC,{}):e?r===void 0?n.jsx(OC,{}):r===null?n.jsx(Mt,{to:"/vet/onboarding",replace:!0}):n.jsx(Yr,{}):n.jsx(Mt,{to:"/vet/login",replace:!0})}const sce="#d4a843";function wv({icon:e,label:t,value:r,href:a}){return n.jsxs(ye,{to:a,className:"group rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155] transition-colors",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center",style:{background:"rgba(212,168,67,0.15)"},children:n.jsx(e,{className:"w-5 h-5",style:{color:sce}})}),n.jsx(Bc,{className:"w-4 h-4 text-gray-600 group-hover:text-gray-400 transition-colors"})]}),n.jsx("p",{className:"text-2xl font-bold text-white",children:r}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:t})]})}function ice(){const e=ie(F.veteranPortal.getDashboardStats),t=ie(F.veteranPortal.getMyProfile);return!e||!t?n.jsxs("div",{className:"space-y-6",children:[n.jsx("div",{className:"h-8 w-48 bg-gray-800 rounded animate-pulse"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4].map(r=>n.jsx("div",{className:"h-32 rounded-xl bg-gray-800/50 animate-pulse"},r))})]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(ye,{to:"/vet/profile",className:"flex-shrink-0 group relative",children:t.photoUrl?n.jsx("img",{src:t.photoUrl,alt:t.firstName,className:"w-14 h-14 roun
234ded-full object-cover border-2 border-[#1e293b] group-hover:border-[#d4a843] transition-colors"}):n.jsx("div",{className:"w-14 h-14 rounded-full bg-[#1e293b] flex items-center justify-center border-2 border-[#1e293b] group-hover:border-[#d4a843] transition-colors",children:n.jsx(Ze,{className:"w-6 h-6 text-gray-500"})})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-xl font-bold text-white",children:["Welcome back, ",t.firstName]}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Here's what's happening with your career search."})]})]}),t.status==="pending"&&n.jsxs("div",{className:"rounded-lg border px-4 py-3 text-sm",style:{borderColor:"rgba(245,158,11,0.3)",background:"rgba(245,158,11,0.08)",color:"#fbbf24"},children:[n.jsx("strong",{children:"Account Pending:"})," Your profile is being reviewed. You can still browse jobs and prepare your profile while you wait."]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[n.jsx(wv,{icon:ht,label:"Available Jobs",value:e.availableJobs,href:"/vet/jobs"}),n.jsx(wv,{icon:Jh,label:"Saved Jobs",value:e.savedJobsCount,href:"/vet/saved"}),n.jsx(wv,{icon:tn,label:"Unread Messages",value:e.unreadMessages,href:"/vet/messages"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs(ye,{to:"/vet/profile",className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155] transition-colors group",children:[n.jsx("h4",{className:"text-sm font-semibold text-white mb-1",children:"Complete Your Profile"}),n.jsx("p",{className:"text-xs text-gray-500",children:"A complete profile helps agencies find you and improves your match quality."})]}),n.jsxs(ye,{to:"/vet/jobs",className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155] transition-colors group",children:[n.jsx("h4",{className:"text-sm font-semibold text-white mb-1",children:"Explore Career Fields"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Browse open positions from law enforcement agencies across the country."})]})]})]})}const En={Army:["Private (E-1)","Private Second Class (E-2)","Private First Class (E-3)","Specialist (E-4)","Corporal (E-4)","Sergeant (E-5)","Staff Sergeant (E-6)","Sergeant First Class (E-7)","Master Sergeant (E-8)","First Sergeant (E-8)","Sergeant Major (E-9)","Command Sergeant Major (E-9)","Sergeant Major of the Army (E-9)","Warrant Officer 1 (W-1)","Chief Warrant Officer 2 (W-2)","Chief Warrant Officer 3 (W-3)","Chief Warrant Officer 4 (W-4)","Chief Warrant Officer 5 (W-5)","Second Lieutenant (O-1)","First Lieutenant (O-2)","Captain (O-3)","Major (O-4)","Lieutenant Colonel (O-5)","Colonel (O-6)","Brigadier General (O-7)","Major General (O-8)","Lieutenant General (O-9)","General (O-10)"],Navy:["Seaman Recruit (E-1)","Seaman Apprentice (E-2)","Seaman (E-3)","Petty Officer Third Class (E-4)","Petty Officer Second Class (E-5)","Petty Officer First Class (E-6)","Chief Petty Officer (E-7)","Senior Chief Petty Officer (E-8)","Master Chief Petty Officer (E-9)","Command Master Chief Petty Officer (E-9)","Master Chief Petty Officer of the Navy (E-9)","Warrant Officer 1 (W-1)","Chief Warrant Officer 2 (W-2)","Chief Warrant Officer 3 (W-3)","Chief Warrant Officer 4 (W-4)","Chief Warrant Officer 5 (W-5)","Ensign (O-1)","Lieutenant Junior Grade (O-2)","Lieutenant (O-3)","Lieutenant Commander (O-4)","Commander (O-5)","Captain (O-6)","Rear Admiral Lower Half (O-7)","Rear Admiral Upper Half (O-8)","Vice Admiral (O-9)","Admiral (O-10)"],"Air Force":["Airman Basic (E-1)","Airman (E-2)","Airman First Class (E-3)","Senior Airman (E-4)","Staff Sergeant (E-5)","Technical Sergeant (E-6)","Master Sergeant (E-7)","Senior Master Sergeant (E-8)","Chief Master Sergeant (E-9)","Command Chief Master Sergeant (E-9)","Chief Master Sergeant of the Air Force (E-9)","Second Lieutenant (O-1)","First Lieutenant (O-2)","Captain (O-3)","Major (O-4)","Lieutenant Colonel (O-5)","Colonel (O-6)","Brigadier General (O-7)","Major General (O-8)","Lieutenant General (O-9)","General (O-10)"],"Marine Corps":["Private (E-1)","Private First Class (E-2)","Lance Corporal (E-3)","Corporal (E-4)","Sergeant (E-5)","Staff Sergeant (E-6)","Gunnery Sergeant (E-7)","Master Sergeant (E-8)","First Sergeant (E-8)","Master Gunnery Sergeant (E-9)","Sergeant Major (E-9)","Sergeant Major of the Marine Corps (E-9)","Warrant Officer 1 (W-1)","Chief Warrant Officer 2 (W-2)","Chief Warrant Officer 3 (W-3)","Chief Warrant Officer 4 (W-4)","Chief Warrant Officer 5 (W-5)","Second Lieutenant (O-1)","First Lieutenant (O-2)","Captain (O-3)","Major (O-4)","Lieutenant Colonel (O-5)","Colonel (O-6)","Brigadier General (O-7)","Major General (O-8)","Lieutenant General (O-9)","General (O-10)"],"Coast Guard":["Seaman Recruit (E-1)","Seaman Apprentice (E-2)","Seaman (E-3)","Petty Officer Third Class (E-4)","Petty Officer Second Class (E-5)","Petty Officer First Class (E-6)","Chief Petty Officer (E-7)","Senior Chief Petty Officer (E-8)","Master Chief Petty Officer (E-9)","Command Master Chief Petty Officer (E-9)","Master Chief Petty Officer of the Coast Guard (E-9)","Warrant Officer 1 (W-1)","Chief Warrant Officer 2 (W-2)","Chief Warrant Officer 3 (W-3)","Chief Warrant Officer 4 (W-4)","Ensign (O-1)","Lieutenant Junior Grade (O-2)","
234Lieutenant (O-3)","Lieutenant Commander (O-4)","Commander (O-5)","Captain (O-6)","Rear Admiral Lower Half (O-7)","Rear Admiral Upper Half (O-8)","Vice Admiral (O-9)","Admiral (O-10)"],"Space Force":["Specialist 1 (E-1)","Specialist 2 (E-2)","Specialist 3 (E-3)","Specialist 4 (E-4)","Sergeant (E-5)","Technical Sergeant (E-6)","Master Sergeant (E-7)","Senior Master Sergeant (E-8)","Chief Master Sergeant (E-9)","Chief Master Sergeant of the Space Force (E-9)","Second Lieutenant (O-1)","First Lieutenant (O-2)","Captain (O-3)","Major (O-4)","Lieutenant Colonel (O-5)","Colonel (O-6)","Brigadier General (O-7)","Major General (O-8)","Lieutenant General (O-9)","General (O-10)"]};En["Army Reserve"]=En.Army;En["Navy Reserve"]=En.Navy;En["Air Force Reserve"]=En["Air Force"];En["Marine Corps Reserve"]=En["Marine Corps"];En["Coast Guard Reserve"]=En["Coast Guard"];En["National Guard"]=En.Army;const Mn={Army:["09L - Interpreter/Translator","11B - Infantry","11C - Indirect Fire Infantryman","12B - Combat Engineer","12C - Bridge Crewmember","12D - Diver","12K - Plumber","12M - Firefighter","12N - Horizontal Construction Engineer","12P - Prime Power Production Specialist","12R - Interior Electrician","12T - Technical Engineer","12W - Carpentry and Masonry Specialist","12Y - Geospatial Engineer","13B - Cannon Crewmember","13F - Joint Fire Support Specialist","13J - Fire Control Specialist","13M - MLRS Crewmember","13R - Field Artillery Firefinder Radar Operator","14E - Patriot Fire Control Enhanced Operator/Maintainer","14G - Air and Missile Defense Crewmember","14H - AMD Sensor Operator","14P - Air and Missile Defense Crewmember","14S - Air and Missile Defense Crewmember","14T - Patriot Launching Station Enhanced Operator/Maintainer","15B - Aircraft Powerplant Repairer","15D - Aircraft Powertrain Repairer","15E - Unmanned Aircraft Systems Repairer","15F - Aircraft Electrician","15G - Aircraft Structural Repairer","15H - Aircraft Pneudraulics Repairer","15N - Avionic Mechanic","15P - Aviation Operations Specialist","15Q - Air Traffic Control Operator","15R - AH-64 Attack Helicopter Repairer","15S - OH-58D/ARH Helicopter Repairer","15T - UH-60 Helicopter Repairer","15U - CH-47 Helicopter Repairer","15W - Unmanned Aircraft Systems Operator","15Y - AH-64D Armament/Electrical/Avionics Systems Repairer","17C - Cyber Operations Specialist","17E - Electronic Warfare Specialist","18B - Special Forces Weapons Sergeant","18C - Special Forces Engineer Sergeant","18D - Special Forces Medical Sergeant","18E - Special Forces Communications Sergeant","18X - Special Forces Candidate","19D - Cavalry Scout","19K - M1 Armor Crewman","25B - Information Technology Specialist","25C - Radio Operator-Maintainer","25D - Cyber Network Defender","25E - Ele
234ctromagnetic Spectrum Manager","25L - Cable Systems Installer-Maintainer","25M - Multimedia Illustrator","25N - Nodal Network Systems Operator-Maintainer","25P - Microwave Systems Operator-Maintainer","25Q - Multichannel Transmission Systems Operator-Maintainer","25R - Visual Information Equipment Operator-Maintainer","25S - Satellite Communication Systems Operator-Maintainer","25U - Signal Support Systems Specialist","25V - Combat Documentation/Production Specialist","27D - Paralegal Specialist","31B - Military Police","31D - Criminal Investigations Special Agent","31E - Internment/Resettlement Specialist","31K - Military Working Dog Handler","35F - Intelligence Analyst","35G - Geospatial Intelligence Imagery Analyst","35L - Counterintelligence Agent","35M - Human Intelligence Collector","35N - Signals Intelligence Analyst","35P - Cryptologic Linguist","35Q - Cryptologic Network Warfare Specialist","35S - Signals Collector/Analyst","35T - Military Intelligence Systems Maintainer/Integrator","36B - Financial Management Technician","37F - Psychological Operations Specialist","38B - Civil Affairs Specialist","42A - Human Resources Specialist","42R - Musician","46Q - Public Affairs Specialist","46R - Broadcast Journalist","56M - Religious Affairs Specialist","68A - Biomedical Equipment Specialist","68B - Orthopedic Specialist","68C - Practical Nursing Specialist","68D - Operating Room Specialist","68E - Dental Specialist","68F - Physical Therapy Specialist","68G - Patient Administration Specialist","68H - Optical Laboratory Specialist","68J - Medical Logistics Specialist","68K - Medical Laboratory Specialist","68L - Occupational Therapy Specialist","68M - Nutrition Care Specialist","68N - Cardiovascular Specialist","68P - Radiology Specialist","68Q - Pharmacy Specialist","68R - Veterinary Food Inspection Specialist","68S - Preventive Medicine Specialist","68T - Animal Care Specialist","68U - Ear, Nose, and Throat Specialist","68V - Respiratory Specialist","68W - Combat Medic Specialist","68X - Behavioral Health Specialist","68Y - Eye Specialist","74D - CBRN Specialist","88H - Cargo Specialist","88K - Watercraft Operator","88L - Watercraft Engineer","88M - Motor Transport Operator","88N - Transportation Management Coordinator","89B - Ammunition Specialist","89D - Explosive Ordnance Disposal Specialist","91A - M1 Abrams Tank System Maintainer","91B - Wheeled Vehicle Mechanic","91C - Utilities Equipment Repairer","91D - Power-Generation Equipment Repairer","91E - Allied Trades Specialist","91F - Small Arms/Artillery Repairer","91H - Track Vehicle Repairer","91J - Quartermaster and Chemical Equipment Repairer","91L - Construction Equipment Repairer","91M - Bradley Fighting Vehicle System Maintainer","91P - Artillery Mechanic","91S - Stryker Systems Maintainer","92A - Automated Logistical Specialist","92F - Petroleum Supply Specialist","92G - Culinary Specialist","92L - Petroleum Laboratory Specialist","92M - Mortuary Affairs Specialist","92R - Parachute Rigger","92S - Shower/Laundry and Clothing Repair Specialist","92W - Water Treatment Specialist","92Y - Unit Supply Specialist","94A - Land Combat Electronic Missile System Repairer","94D - Air Traffic Control Equipment Repairer","94E - Radio and Communications Security Repairer","94F - Computer/Detection Systems Repairer","94H - TMDE Maintenance Support Specialist","94M - Radar Repairer","94P - MLRS Repairer","94R - Avionic and Survivability Equipment Repairer","94S - Patriot System Repairer","94T - Avenger System Repairer","94Y - Integrated Family of Test Equipment Operator and Maintainer"],Navy:["AB - Aviation Boatswain's Mate","ABE - Aviation Boatswain's Mate (Launching & Recovery)","ABF - Aviation Boatswain's Mate (Fuels)","ABH - Aviation Boatswain's Mate (Aircraft Handling)","AC - Air Traffic Controller","AD - Aviation Machinist's Mate","AE - Aviation Electrician's Mate","AG - Aerographer's Mate","AM - Aviation Structural Mechanic","AME - Aviation Structural Mechanic (Safety Equipment)","AO - Aviation Ordnanceman","AS - Aviation Support Equipment Technician","AT - Aviation Electronics Technician","AW - Aircrewman","AWF - Aircrewman (Mechanical)","AWO - Aircrewman (Operator)","AWR - Aircrewman (Tactical Helicopter)","AWS - Aircrewman (Helicopter)","AWV - Aircrewman (Avionics)","AZ - Aviation Maintenance Administrationman","BM - Boatswain's Mate","BU - Builder","CE - Construction Electrician","CM - Construction Mechanic","CS - Culinary Specialist","CT - Cryptologic Technician","CTI - Cryptologic Technician Interpretive","CTM - Cryptologic Technician Maintenance","CTN - Cryptologic Technician Networks","CTR - Cryptologic Technician Collection","CTT - Cryptologic Technician Technical","CWT - Cyber Warfare Technician","DC - Damage Controlman","EA - Engineering Aid","EM - Electrician's Mate","EN - Engineman","EO - Equipment Operator","EOD - Explosive Ordnance Disposal Technician","ET - Electronics Technician","FC - Fire Controlman","FT - Fire Control Technician","GM - Gunner's Mate","GSE - Gas Turbine Systems Technician (Electrical)","GSM - Gas Turbine Systems Technician (Mechanical)","HM - Hospital Corpsman","HT - Hull Maintenance Technician","IC - Interior Communications Electrician","IS - Intelligence Specialist","IT - Information Systems Technician","LN - Legalman","LS - Logistics Specialist","MA - Master-at-Arms","MC - Mass Communications Specialist","MM - Machinist's Mate","MN - Mineman","MR - Machinery Repairman","MT - Missile Technician","MU - Musician","NC - Navy Counselor","ND - Navy Diver","OS - Operations Specialist","PR - Aircrew Survival Equipmentman","PS - Personnel Specialist","QM - Quartermaster","RP - Religious Program Specialist","SB - Special Warfare Boat Operator","SH - Ship's Serviceman","SO - Special Warfare Operator (Navy SEAL)","STG -
234Sonar Technician (Surface)","STS - Sonar Technician (Submarine)","SW - Steelworker","UT - Utilitiesman","YN - Yeoman"],"Air Force":["1A0X1 - In-Flight Refueling","1A1X1 - Flight Engineer","1A2X1 - Aircraft Loadmaster","1A3X1 - Airborne Mission Systems Operator","1A6X1 - Flight Attendant","1A7X1 - Aerial Gunner","1A8X1 - Airborne Cryptologic Linguist","1A8X2 - Airborne ISR Operator","1A9X1 - Special Missions Aviator","1B4X1 - Cyber Warfare Operations","1C0X2 - Aviation Resource Management","1C1X1 - Air Traffic Control","1C2X1 - Combat Control","1C3X1 - Command Post","1C4X1 - Tactical Air Control Party","1C5X1 - Command and Control Battle Management Operations","1C6X1 - Space Systems Operations","1C7X1 - Airfield Management","1C8X3 - Ground Radar Systems","1D7X1 - Cyber Defense Operations","1D7X2 - Cyber Systems Operations","1D7X3 - Cyber Surety","1D7X4 - Client Systems","1N0X1 - All Source Intelligence Analyst","1N1X1 - Geospatial Intelligence","1N2X1 - Signals Intelligence Analyst","1N3X1 - Cryptologic Language Analyst","1N4X1 - Fusion Analyst","1N7X1 - Human Intelligence Specialist","1N8X1 - Targeting Analyst","1P0X1 - Aircrew Flight Equipment","1S0X1 - Safety","1T0X1 - Survival, Evasion, Resistance, and Escape","1T2X1 - Pararescue","1U0X1 - Remotely Piloted Aircraft Sensor Operator","1W0X1 - Weather","1W0X2 - Special Operations Weather","2A0X1 - Avionics Test Station and Components","2A2X1 - Integrated Avionics Systems","2A2X2 - SOF/PR Integrated Instrument and Flight Control Systems","2A2X3 - SOF/PR Integrated Electronic Warfare Systems","2A3X3 - Tactical Aircraft Maintenance","2A5X1 - Aerospace Maintenance","2A5X2 - Helicopter Maintenance","2A5X4 - Refuel/Bomber Aircraft Maintenance","2A6X1 - Aerospace Propulsion","2A6X2 - Aerospace Ground Equipment","2A6X4 - Aircraft Fuel Systems","2A6X5 - Aircraft Hydraulic Systems","2A6X6 - Aircraft Electrical and Environmental Systems","2A7X1 - Aircraft Metals Technology","2A7X3 - Aircraft Structural Maintenance","2F0X1 - Fuels","2G0X1 - Logistics Plans","2M0X1 - Missile and Space Systems Maintenance","2P0X1 - Precision Measurement Equipment Laboratory","2R0X1 - Maintenance Management Analysis","2R1X1 - Maintenance Management Production","2S0X1 - Material Management","2T0X1 - Traffic Management","2T1X1 - Vehicle Operations","2T2X1 - Air Transportation","2T3X1 - Vehicle Maintenance","2W0X1 - Munitions Systems","2W1X1 - Aircraft Armament Systems","3E0X1 - Electrical Systems","3E0X2 - Electrical Power Production","3E1X1 - HVAC and Refrigeration","3E2X1 - Pavement and Construction Equipment","3E3X1 - Structural","3E4X1 - Water and Fuel Systems Maintenance","3E4X3 - Pest Management","3E5X1 - Engineering","3E7X1 - Fire Protection","3E8X1 - Explosive Ordnance Disposal","3E9X1 - Emergency Management","3F0X1 - Personnel","3F1X1 - Services","3F2X1 - Education and Training","3F3X1 - Manpower","3F5X1 - Administration","3N0X5 - Photojournalist","3N1X1 - Regional Band","3P0X1 - Security Forces","4A0X1 - Health Services Management","4A1X1 - Medical Materiel","4A2X1 - Biomedical Equipment","4B0X1 - Bioenvironmental Engineering","4C0X1 - Mental Health Service","4D0X1 - Diet Therapy","4E0X1 - Public Health","4H0X1 - Cardiopulmonary Laboratory","4J0X2 - Physical Medicine","4M0X1 - Aerospace and Operational Physiology","4N0X1 - Aerospace Medical Service","4N1X1 - Surgical Service","4P0X1 - Pharmacy","4R0X1 - Diagnostic Imaging","4T0X1 - Medical Laboratory","4T0X2 - Histopathology","4V0X1 - Ophthalmic","4Y0X1 - Dental Assistant","4Y0X2 - Dental Laboratory","5J0X1 - Paralegal","5R0X1 - Chaplain Assistant","6C0X1 - Contracting","6F0X1 - Financial Management and Comptroller","7S0X1 - Special Investigations","9S100 - Technical Applications Specialist"],"Marine Corps":["0100 - Personnel and Administration","0111 - Administrative Specialist","0121 - Personnel Clerk","0151 - Financial Management Resource Analyst","0161 - Postal Clerk","0171 - Manpower Information Systems Analyst","0200 - Intelligence","0211 - Counterintelligence/HUMINT Specialist","0231 - Intelligence Specialist","0261 - Geographic Intelligence Specialist","0300 - Infantry","0311 - Rifleman","0313 - LAR Marine","0317 - Scout Sniper","0321 - Reconnaissance Man","0331 - Machine Gunner","0341 - Mortarman","0351 - Infantry Assaultman","0352 - Anti-Tank Missile Gunner","0369 - Infantry Unit Leader","0400 - Logistics","0431 - Logistics/Embarkation Specialist","0451 - Airborne and Air Delivery Specialist","0481 - Landing Support Specialist","0500 - MAGTF Plans","0600 - Communications","0612 - Tactical Data Systems Administrator","0621 - Transmission Systems Operator","0627 - Ground Communication Organizational Repairer","0631 - Network Administrator","0671 - Data Systems Administrator","0689 - Information Assurance Technician","0800 - Field Artillery","0811 - Field Artillery Cannoneer","0814 - HIMARS Operator","0842 - Field Artillery Radar Operator","0844 - Field Artillery Fire Control Marine","0847 - Field Artillery Sensor Support Marine","0861 - Fire Support Marine","0900 - Training","1100 - Utilities","1141 - Electrician","1142 - Electrical Equipment Repair Specialist","1161 - Refrigeration and AC Technician","1171 - Hygiene Equipment Operator","1300 - Engineer, Construction, Facilities, and Equipment","1316 - Metal Worker","1341 - Engineer Equipment Mechanic","1345 - Engineer Equipment Operator","1361 - Engineer Assistant","1371 - Combat Engineer","1391 - Bulk Fuel Specialist","1700 - Cyberspace Operations","1721 - Cyberspace Warfare Operator","1799 - Cyberspace Warfare Chief","1800 - Tank and Assault Amphibious Vehicle","1812 - M1A1 Tank Crewman","1833 - Assault Amphibious Vehicle Crewman","2100 - Ground Ordnance Maintenance","2111 - Small Arms Repairer/Technician","2131 - Towed Artillery Systems Technician","2141
234- Assault Amphibious Vehicle Repairer/Technician","2146 - Main Battle Tank Repairer/Technician","2147 - Light Armored Vehicle Repairer/Technician","2300 - Ammunition and Explosive Ordnance Disposal","2311 - Ammunition Technician","2336 - Explosive Ordnance Disposal Technician","2600 - Signals Intelligence/Ground Electronic Warfare","2621 - Special Communications Signals Collection Operator/Analyst","2631 - Electronic Intelligence Intercept Operator/Analyst","2651 - Special Intelligence System Admin/Communicator","2800 - Ground Electronics Maintenance","2841 - Ground Electronics Transmission Systems Maintainer","2846 - Ground Electronics Transmission Systems Technician","2862 - Electronics Maintenance Technician","3000 - Supply Administration and Operations","3043 - Supply Administration and Operations Specialist","3051 - Warehouse Clerk","3100 - Distribution Management","3112 - Distribution Management Specialist","3300 - Food Service","3381 - Food Service Specialist","3400 - Financial Management","3432 - Finance Technician","3500 - Motor Transport","3521 - Motor Vehicle Operator","3531 - Motor Transport Operator","4000 - Band","4100 - Marine Corps Community Services","4300 - Public Affairs","4400 - Legal Services","4421 - Legal Services Specialist","4600 - Combat Camera","5700 - Nuclear, Biological, and Chemical Defense","5711 - CBRN Defense Specialist","5800 - Military Police and Corrections","5811 - Military Police","5831 - Correctional Specialist","5900 - Electronics Maintenance","5911 - Electronics Maintenance Technician","5937 - Aviation Electronic Warfare Systems Technician","5939 - Aviation Communication Systems Technician","5948 - Aviation Radar Repairer","5952 - Air Traffic Control Navigational Aids Technician","5953 - Air Traffic Control Radar Technician","5954 - Aviation Air Traffic Control Systems Technician","6000 - Aircraft Maintenance","6042 - Individual Material Readiness List Clerk","6048 - Flight Equipment Technician","6062 - Aircraft Intermediate Level Hydraulic/Pneumatic Mechanic","6072 - Aircraft Maintenance Administration Specialist","6092 - Aircraft Intermediate Level Structures Mechanic","6100 - Aircraft Maintenance (Rotary Wing)","6114 - UH-1 Helicopter Mechanic","6116 - Tiltrotor Mechanic (MV-22)","6154 - Helicopter Power Plants Mechanic","6174 - Helicopter Crew Chief","6200 - Aircraft Maintenance (Fixed Wing)","6212 - Fixed-Wing Aircraft Mechanic","6252 - Fixed-Wing Aircraft Power Plants Mechanic","6276 - Fixed-Wing Aircraft Airframe Mechanic","6300 - Avionics","6314 - UAV Air Vehicle Operator","6317 - UAV Operator","6323 - Avionics Technician","6326 - Avionics Technician (Fixed Wing)","6332 - Avionics Technician (Rotary Wing)","6336 - Avionics Technician (V-22)","6400 - Avionics (ATC and Communications)","6423 - Aviation Electronic Micro/Miniature Component Repair Technician","6432 - Aircraft Electrical/Instrument/Flight Control Systems Technician","6469 - Aviation Operations Specialist","6500 - Aviation Ordnance","6531 - Aviation Ordnance Technician","6600 - Aviation Logistics","6672 - Aviation Supply Specialist","6800 - Meteorology and Oceanography","7000 - Airfield Services","7011 - Expeditionary Airfield Systems Technician","7041 - Aviation Operations Specialist","7051 - Expeditionary Firefighting and Rescue Specialist","7200 - Air Control/Anti-Air Warfare/Air Support","7212 - Low Altitude Air Defense Gunner","7234 - Air Control Electronics Operator","7236 - Tactical Air Defense Controller","7242 - Air Support Operations Operator","7300 - Flight Crews","7314 - UAV Air Vehicle Commander","7316 - Small Unmanned Aircraft System Operator"],"Coast Guard":["AET - Aviation Electrical Technician","AMT - Aviation Maintenance Technician","AST - Aviation Survival Technician","AVT - Avionics Electrical Technician","BM - Boatswain's Mate","CMS - Cyber Mission Specialist","CS - Culinary Specialist","DC - Damage Controlman","EM - Electrician's Mate","ET - Electronics Technician","FS - Food Service Specialist","GM - Gunner's Mate","HS - Health Services Technician","IS - Intelligence Specialist","IT - Information Systems Technician","IV - Investigator","ME - Maritime Enforcement Specialist","MK - Machinery Technician","MST - Marine Science Technician","OS - Operations Specialist","PA - Public Affairs Specialist","SK - Storekeeper","TT - Telecommunications Technician","YN - Yeoman"],"Space Force":["1C6 - Space Systems Operations","1D7 - Cyber Operations","3F - Force Support","5S - Space Systems Intelligence","13S - Space Operations Officer","Acquisition Manager","Aeronautical Engineer","All Source Analyst","Astronautical Engineer","Civil Engineering","Command and Control","Communications and Information","Computer Systems Engineer","Cryptologic Analyst","Cyber Operations","Cyberspace Effects Operations Officer","Developmental Engineering","Electrical/Electronic Engineer","Electromagnetic Warfare","Financial Management","Geospatial Intelligence Analyst","Human Factors Engineer","Information Technology","Intelligence Officer","Intelligence Operations","Mechanical Engineer Officer","Missile Warning","Orbital Warfare","Program Management","Satellite Operations","Science & Engineering","Security Forces","Signals Intelligence Analyst","Space Access and Sustainment","Space Battle Management","Space Domain Awareness","Space Electronic Warfare","Space Operations","Space Systems Operator","Targeting Analyst"]};Mn["Army Reserve"]=Mn.Army;Mn["Navy Reserve"]=Mn.Navy;Mn["Air Force Reserve"]=Mn["Air Force"];Mn["Marine Corps Reserve"]=Mn["Marine Corps"];Mn["Coast Guard Reserve"]=Mn["Coast Guard"];Mn["National Guard"]=Mn.Army;function Gh(e){return e.includes("Navy")||e.includes("Coast Guard")?"Rating":e.includes("Air Force")||e.includes("Space Force")?"AFSC":"MOS"}const OM=["Army","Navy","Air Force","Marine Corps","Coast Guard","Space Force","National Guard","Army Reserve","Navy Reserve","Air Force Reserve","Marine Corps Reserve","Coast Guard Reserve"],au="#d4a843";function oce({label:e,value:t,onChange:r,options:a,placeholder:s}){const[i,o]=y.useState(""),[c,d]=y.useState(!1),u=y.useRef(null),h=y.useMemo(()=>
234{if(!i)return a;const m=i.toLowerCase();return a.filter(p=>p.toLowerCase().includes(m))},[a,i]);return n.jsxs("div",{className:"space-y-1.5 relative",ref:u,children:[n.jsx(we,{className:"text-xs text-gray-400",children:e}),n.jsx(Ee,{value:c?i:t,onChange:m=>{o(m.target.value),d(!0)},onFocus:()=>{d(!0),o("")},onBlur:()=>setTimeout(()=>d(!1),200),placeholder:s,className:"bg-[#0d1117] border-[#1e293b] text-white"}),c&&h.length>0&&n.jsxs("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 max-h-60 overflow-y-auto rounded-md border border-[#1e293b] bg-[#0d1117] shadow-lg",children:[h.map(m=>n.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-sm text-white hover:bg-[#1e293b] transition-colors",onMouseDown:p=>{p.preventDefault(),r(m),d(!1),o("")},children:m},m)),!i&&h.length>20&&n.jsxs("div",{className:"sticky bottom-0 bg-[#0d1117] px-3 py-2 text-xs text-gray-500 border-t border-[#1e293b]",children:["Type to search ",h.length," entries..."]})]})]})}const lce=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],cce=["Honorable","General (Under Honorable Conditions)","Other Than Honorable","Bad Conduct","Still Serving"],dce=["High School / GED","Some College","Associate's Degree","Bachelor's Degree","Master's Degree","Doctorate"],uce=["Field Training Officer (FTO)","Drug Recognition Expert (DRE)","Advanced Roadside Impairment Driving Enforcement (ARIDE)","Speed Measurement (RADAR/LIDAR)","SWAT/SRT","K9","Crisis/Hostage Negotiator","Digital Forensics Examiner","Crash Reconstructionist","Crisis Intervention Team (CIT)","NA
234SRO's SRO Program(s)"];function hce(){const e=ie(F.veteranPortal.getMyProfile),t=te(F.veteranPortal.updateMyProfile),[r,a]=y.useState(!1),[s,i]=y.useState(!1),[o,c]=y.useState({firstName:"",lastName:"",phone:"",city:"",state:"",branch:"",rank:"",mos:"",yearsOfService:"",separationDate:"",dischargeStatus:"",education:"",certifications:"",skills:"",leCertifications:[]});y.useEffect(()=>{e&&c({firstName:e.firstName||"",lastName:e.lastName||"",phone:e.phone||"",city:e.city||"",state:e.state||"",branch:e.branch||"",rank:e.rank||"",mos:e.mos||"",yearsOfService:e.yearsOfService?.toString()||"",separationDate:e.separationDate||"",dischargeStatus:e.dischargeStatus||"",education:e.education||"",certifications:e.certifications?.join(", ")||"",skills:e.skills?.join(", ")||"",leCertifications:e.leCertifications||[]})},[e]);const d=async()=>{a(!0);try{await t({firstName:o.firstName||void 0,lastName:o.lastName||void 0,phone:o.phone||void 0,city:o.city||void 0,state:o.state||void 0,branch:o.branch||void 0,rank:o.rank||void 0,mos:o.mos||void 0,yearsOfService:o.yearsOfService?parseInt(o.yearsOfService):void 0,separationDate:o.separationDate||void 0,dischargeStatus:o.dischargeStatus||void 0,education:o.education||void 0,certifications:o.certifications?o.certifications.split(",").map(P=>P.trim()).filter(Boolean):void 0,skills:o.skills?o.skills.split(",").map(P=>P.trim()).filter(Boolean):void 0,leCertifications:o.leCertifications.length>0?o.leCertifications:void 0}),i(!0),setTimeout(()=>i(!1),3e3)}finally{a(!1)}};if(!e)return n.jsx("div",{className:"max-w-3xl space-y-6",children:[1,2,3].map(P=>n.jsx("div",{className:"h-48 rounded-xl bg-gray-800/50 animate-pulse"},P))});const u=(P,O,E)=>n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(we,{className:"text-xs text-gray-400",children:O}),n.jsx(Ee,{value:o[P],onChange:$=>c({...o,[P]:$.target.value}),className:"bg-[#0d1117] border-[#1e293b] text-white",...E})]}),h=(P,O,E)=>n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(we,{className:"text-xs text-gray-400",children:O}),n.jsxs("select",{value:o[P],onChange:$=>c({...o,[P]:$.target.value}),className:"w-full h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm",children:[n.jsx("option",{value:"",children:"Select..."}),E.map($=>n.jsx("option",{value:$,children:$},$))]})]}),m=te(F.veteranPortal.uploadMyPhoto),p=te(F.veteranPortal.uploadMyResume),b=te(F.veteranPortal.deleteMyResume),w=te(F.storage.generateUploadUrl),x=y.useRef(null),g=y.useRef(null),[j,S]=y.useState(!1),[_,N]=y.useState(!1),C=async P=>{const O=P.target.files?.[0];if(!(!O||!O.type.startsWith("image/"))){S(!0);try{const E=await w(),$=await fetch(E,{method:"POST",headers:{"Content-Type":O.type},body:O}),{storageId:M}=await $.json();await m({storageId:M})}finally{S(!1),x.current&&(x.current.value="")}}},A=async P=>{const O=P.target.files?.[0];if(O){N(!0);try{const E=await w(),$=await fetch(E,{method:"POST",headers:{"Content-Type":O.type},body:O}),{storageId:M}=await $.json();await p({storageId:M,fileName:O.name})}finally{N(!1),g.current&&(g.current.value="")}}};return n.jsxs("div",{className:"max-w-3xl space-y-6",children:[n.jsxs("section",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-6",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-4",children:"Profile Photo"}),n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsxs("div",{className:"relative group",children:[e.photoUrl?n.jsx("img",{src:e.photoUrl,alt:"Profile",className:"w-24 h-24 rounded-full object-cover border-2",style:{borderColor:au}}):n.jsx("div",{className:"w-24 h-24 rounded-full bg-[#1e293b] flex items-center justify-center border-2 border-[#334155]",children:n.jsx(Ze,{className:"w-10 h-10 text-gray-500"})}),n.jsx("button",{type:"button",onClick:()=>x.current?.click(),disabled:j,className:"absolute inset-0 rounded-full bg-black/50 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:j?n.jsx(gt,{className:"w-5 h-5 text-white animate-spin"}):n.jsx(UC,{className:"w-5 h-5 text-white"})})]}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("button",{type:"button",onClick:()=>x.current?.click(),disabled:j,className:"text-sm font-medium transition-colors hover:underline",style:{color:au},children:j?"Uploading...":"Change Photo"}),n.jsx("p",{className:"text-xs text-gray-500",children:"JPG, PNG, or WebP. Shown on your profile and messages."})]}),n.jsx("input",{ref:x,type:"file",accept:"image/*",onChange:C,className:"hidden"})]})]}),n.jsxs("section",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-6",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-4",children:"Resume"}),e.resumeUrl?n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-[#1e293b] bg-[#0a0e17] px-4 py-3",children:[n.jsx(hu,{className:"w-5 h-5 text-gray-400 flex-shrink-0"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("a",{href:e.resumeUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium truncate block hover:underline",style:{color:au},children:e.resumeFileName||"Resume"})}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx("button",{type:"button",onClick:()=>g.current?.click(),className:"text-xs text-gray-400 hover:text-white transition-colors",children:"Replace"}),n.jsx("button",{type:"button",onClick:()=>b(),className:"p-1.5 rounded hover:bg-red-500/20 text-gray-500 hover:text-red-400 transition-colors",children:n.jsx(_n,{className:"w-3.5 h-3.5"})})]})]}):n.jsxs("button",{type:"button",onClick:()=>g.current?.click(),disabled:_,className:"w-full flex items-center gap-3 rounded-lg border border-[#1e293b] bg-[#0a0e17] px-4 py-4 hover:border-[#d4a843]/40 transition-colors group",children:[_?n.jsx(gt,{className:"w-5 h-5 text-gray-400 animate-spin flex-shrink-0"}):n.jsx(Et,{className:"w-5 h-5 text-gray-500 group-hover:text-[#d4a843] transition-colors flex-shrink-0"}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-sm text-gray-300 group-hover:text-white transition-colors",children:_?"
234Uploading...":"Upload Resume"}),n.jsx("p",{className:"text-xs text-gray-600",children:"PDF, DOC, or DOCX"})]})]}),n.jsx("input",{ref:g,type:"file",accept:".pdf,.doc,.docx,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",onChange:A,className:"hidden"})]}),n.jsxs("section",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-6",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-4",children:"Personal Information"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u("firstName","First Name"),u("lastName","Last Name"),u("phone","Phone Number",{type:"tel"}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(we,{className:"text-xs text-gray-400",children:"Email"}),n.jsx(Ee,{value:e.email,disabled:!0,className:"bg-[#0d1117] border-[#1e293b] text-gray-500"})]}),u("city","City"),h("state","State",lce)]})]}),n.jsxs("section",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-6",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-4",children:"Military Background"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(we,{className:"text-xs text-gray-400",children:"Branch of Service"}),n.jsxs("select",{value:o.branch,onChange:P=>c({...o,branch:P.target.value,rank:"",mos:""}),className:"w-full h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm",children:[n.jsx("option",{value:"",children:"Select..."}),OM.map(P=>n.jsx("option",{value:P,children:P},P))]})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(we,{className:"text-xs text-gray-400",children:"Rank at Separation"}),n.jsxs("select",{value:o.rank,onChange:P=>c({...o,rank:P.target.value}),className:"w-full h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm",children:[n.jsx("option",{value:"",children:"Select..."}),(En[o.branch]||[]).map(P=>n.jsx("option",{value:P,children:P},P))]})]}),n.jsx(oce,{label:o.branch?`${Gh(o.branch)} / Career Field`:"MOS / Rating / AFSC",value:o.mos,onChange:P=>c({...o,mos:P}),options:Mn[o.branch]||[],placeholder:o.branch?`Search ${Gh(o.branch)}...`:"Select branch first..."}),u("yearsOfService","Years of Service",{type:"number",min:0}),u("separationDate","Separation Date",{type:"date"}),h("dischargeStatus","Discharge Status",cce)]})]}),n.jsxs("section",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-6",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-4",children:"Qualifications"}),n.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[h("education","Highest Education",dce),u("certifications","Certifications (comma-separated)",{placeholder:"POST Certified, CPR, FEMA ICS-100"}),u("skills","Skills (comma-separated)",{placeholder:"Leadership, Firearms Instructor, Investigation"})]})]}),n.jsxs("section",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-6",children:[n.jsx("h3",{className:"text-sm font-semibold text-white mb-1",children:"Law Enforcement Certifications"}),n.jsx("p",{className:"text-xs text-gray-500 mb-4",children:"Check all that apply."}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:uce.map(P=>{const O=o.leCertifications.includes(P);return n.jsxs("label",{className:`flex items-center gap-3 rounded-lg border px-4 py-3 cursor-pointer transition-colors ${O?"border-[#d4a843]/50 bg-[#d4a843]/10":"border-[#1e293b] bg-[#0a0e17] hover:border-[#334155]"}`,children:[n.jsx("input",{type:"checkbox",checked:O,onChange:()=>{c(E=>({...E,leCertifications:O?E.leCertifications.filter($=>$!==P):[...E.leCertifications,P]}))},className:"sr-only"}),n.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center flex-shrink-0 border transition-colors ${O?"border-[#d4a843] bg-[#d4a843]":"border-[#334155] bg-transparent"}`,children:O&&n.jsx("svg",{className:"w-3 h-3 text-black",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("span",{className:`text-sm ${O?"text-white":"text-gray-400"}`,children:P})]},P)})})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs(be,{onClick:d,disabled:r,className:"px-6",style:{background:au,color:"#000"},children:[r?n.jsx(gt,{className:"w-4 h-4 animate-spin mr-2"}):s?n.jsx(v0,{className:"w-4 h-4 mr-2"}):n.jsx(Gs,{className:"w-4 h-4 mr-2"}),r?"Saving...":s?"Saved!":"Save Changes"]}),s&&n.jsx("span",{className:"text-sm text-green-400",children:"Profile updated successfully."})]})]})}const ua="#d4a843",fce=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],su={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},mce=new Set(["AZ","CA","CO","FL","GA","ID","IA","MI","MN","MO","NE","NV","NC","ND","NM","OH","OK","OR","PA","SC","SD","TX","UT","VA","WA","WI"]),EM={};["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"].forEach(e
234=>{EM[e]=mce.has(e)?"blue":"blue-dim"});function pce(){const e=ar(),[t,r]=y.useState(""),[a,s]=y.useState(""),[i,o]=y.useState(""),[c,d]=y.useState(null),u=a?su[a]||a:void 0,h=ie(F.veteranPortal.browseJobs,{search:i||void 0,state:u}),m=te(F.veteranPortal.toggleSaveJob),p=c?su[c]||c:null,b=ie(F.veteranPortal.getStateData,p?{state:p}:"skip"),w=g=>{r(g),clearTimeout(window.__searchTimeout),window.__searchTimeout=setTimeout(()=>{o(g)},300)},x=g=>{g===c?d(null):(d(g),g&&s(g))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"rounded-xl overflow-hidden",style:{background:"#0a0e17"},children:[n.jsxs("div",{className:"text-center pt-10 pb-4 px-6",children:[n.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.25em] mb-3",style:{color:"#00b4ff"},children:"Nationwide Coverage"}),n.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-white mb-2",children:"Law Enforcement Careers for Veterans"}),n.jsx("p",{className:"text-sm text-gray-500 max-w-md mx-auto",children:"Click any state to see agencies, open positions, and recruiters."})]}),n.jsx("div",{className:"relative px-4 pb-2",children:n.jsxs("div",{className:"flex gap-0",children:[n.jsx("div",{className:`transition-all duration-300 ${c?"w-1/2":"w-full"}`,children:n.jsx(C9,{stateStatus:EM,selectedState:c,onStateClick:x})}),c&&n.jsxs("div",{className:"w-1/2 border-l border-[#1e293b] pl-4 overflow-y-auto",style:{maxHeight:500},children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-base font-bold text-white",children:su[c]||c}),n.jsx("button",{onClick:()=>{d(null),s("")},className:"p-1 rounded hover:bg-[#1e293b]",children:n.jsx(Me,{className:"w-4 h-4 text-gray-500"})})]}),b?n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[n.jsxs("div",{className:"rounded-lg bg-[#111827] p-2.5 text-center",children:[n.jsx("p",{className:"text-lg font-bold text-white",children:b.totalAgencies}),n.jsx("p",{className:"text-[10px] text-gray-500",children:"Agencies"})]}),n.jsxs("div",{className:"rounded-lg bg-[#111827] p-2.5 text-center",children:[n.jsx("p",{className:"text-lg font-bold text-white",children:b.totalJobs}),n.jsx("p",{className:"text-[10px] text-gray-500",children:"Open Jobs"})]}),n.jsxs("div",{className:"rounded-lg bg-[#111827] p-2.5 text-center",children:[n.jsx("p",{className:"text-lg font-bold text-white",children:b.recruiters.length}),n.jsx("p",{className:"text-[10px] text-gray-500",children:"Recruiters"})]})]}),b.recruiters.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(en,{className:"w-3.5 h-3.5 text-purple-400"}),n.jsx("h4",{className:"text-xs font-bold uppercase tracking-wider text-purple-400",children:"Recruiters"})]}),n.jsx("div",{className:"space-y-2",children:b.recruiters.map(g=>n.jsxs("div",{className:"rounded-lg bg-[#111827] p-3 flex items-center gap-3",children:[g.photoUrl?n.jsx("img",{src:g.photoUrl,alt:"",className:"w-9 h-9 rounded-full object-cover"}):n.jsx("div",{className:"w-9 h-9 rounded-full bg-[#1e293b] flex items-center justify-center",children:n.jsx(Ze,{className:"w-4 h-4 text-gray-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("p",{className:"text-sm font-medium text-white flex items-center gap-1",children:[g.firstName," ",g.lastName,(g.agencyTier==="member"||g.agencyTier==="platinum")&&n.jsx(Uc,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:ua}})]}),n.jsx("p",{className:"text-xs text-gray-500",children:g.title||g.agencyName})]}),n.jsx("button",{onClick:j=>{j.stopPropagation();const S=new URLSearchParams;S.set("recruiterId",g._id),S.set("recruiterName",`${g.firstName} ${g.lastName}`),g.userId&&S.set("recruiterUserId",g.userId),g.photoUrl&&S.set("recruiterPhoto",g.photoUrl),g.agencyName&&S.set("recruiterAgency",g.agencyName),e(`/vet/messages?${S.toString()}`)},className:"flex-shrink-0 p-2 rounded-lg hover:bg-[#1e293b] transition-colors",title:`Message ${g.firstName}`,children:n.jsx(tn,{className:"w-4 h-4",style:{color:ua}})})]},g._id))})]}),b.members.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Nn,{className:"w-3.5 h-3.5",style:{color:ua}}),n.jsx("h4",{className:"text-xs font-bold uppercase tracking-wider",style:{color:ua},children:"Agency Members"})]}),n.jsx("div",{className:"space-y-2",children:b.members.map(g=>n.jsx(xce,{agency:g},g._id))})]}),b.participating.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Be,{className:"w-3.5 h-3.5 text-blue-400"}),n.jsx("h4",{className:"text-xs font-bold uppercase tracking-wider text-blue-400",children:"Participating Agencies"})]}),n.jsx("div",{className:"flex flex-wrap gap-3",children:b.participating.map(g=>n.jsx("div",{className:"w-12 h-12 rounded-lg bg-[#111827] p-1.5 flex items-center justify-center",title:g.name,children:g.logoUrl?n.jsx("img",{src:g.logoUrl,alt:g.name,className:"w-full h-full object-contain rounded"}):n.jsx(Be,{className:"w-5 h-5 text-gray-600"})},g._id))})]}),b.totalAgencies===0&&b.totalJobs===0&&n.jsxs("div",{className:"text-center py-6",children:[n.jsx(wt,{className:"w-8 h-8 mx-auto mb-2 text-gray-600"}),n.jsx("p",{className:"text-sm text-gray-500",children:"No agencies or jobs in this state yet."}),n.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Check back soon as we expand our network."})]})]}):n.jsx("div",{className:"space-y-3",children:[1,2,3].map(g=>n.jsx("div",{className:"h-16 rounded-lg bg-gray-800/50 animate-pulse"},g))})]})]})}),n.jsx("div",{className:"px-6 pb-8 pt-2 max-w-2xl mx-auto",children:n.jsxs("div",{className:"flex items-center gap-2 rounded-full px-5 py-3",style:{background:"#111827",border:"1px solid #1e293b"},children:[n.jsx(Dt,{className:"w-5 h-5 text-gray-500 flex-shrink-0"}),n.jsx("input",{value:t,onChange:g=>w(g.target.value),placeholder:"Search by state, city, or agency name...",className:"flex-1 bg-transparent border-none outline-none text-sm text-gray-300 placeholder:text-gray-600"}),n.jsx("button",{onClick:()=>o(t),className:"px-5 py-2 rounded-full text-sm font-semibold text-white flex-shrink-0",style:{background:"#00b4ff"},children:"Search"})]})})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("select",{value:a,onChange:g=>{s(g.target.value),d(g.target.value||null)},className:"h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm min-w-[160px]",children:[n.jsx("option",{value:"",children:"All States"}),fce.map(g=>n.jsx("option",{value:g,children:su[g]||g},g))]}),(a||i)&&n.jsxs("button",{onClick:()=>{s(""),d(null),r(""),o("")},className:"text-xs text-gray-400 hover:text-white flex items-center gap-1 px-3 py-2 rounded-md hover:bg-[#1e293b] transition-colors",children:["Clear Filters ",n.jsx(Me,{className:"w-3 h-3"})]})]}),n.jsx("p",{className:"text-sm text-gray-500",children:h?`${h.length} position${h.length!==1?"s":""} found`:"Loading..."}),n.jsx("div",{className:"space-y-3",children:h?h.length===0?n.jsxs("div",{className:"text-center py-12",children:[n.jsx(ht,{className:"w-10 h-10 mx-auto mb-3 text-gray-600"}),n.jsx("p",{className:"text-gray-400",children:"No jobs match your search."})]}):h.map(g=>n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155] transition-colors",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[n.jsx("div",{className:"w-12 h-12 rounded-lg bg-[#1e293b] flex items-center justify-center flex-shrink-0 overflow-hidden",children:g.agencyLogoUrl?n.jsx("img",{src:g.agencyLogoUrl,alt:"",className:"w-full h-full object-contain p-1"}):n.jsx(Rt,{className:"w-5 h-5 text-gray-500"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("h3",{className:"text-sm font-semibold text-white truncate",children:g.title}),n.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:g.agencyName}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-2",children:[g.agencyState&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[n.jsx(wt,{className:"w-3 h-3"}),g.agencyCity?`${g.agencyCity}, `:"",g.agencyState]}),g.salary&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[n.jsx(b0,{className:"w-3 h-3"}
234),g.salary]}),g.jobType&&n.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-[#1e293b] text-gray-400",children:g.jobType}),g.recruitmentType==="continuous"&&n.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"rgba(16,185,129,0.15)",color:"#10b981"},children:"Continuous"})]}),g.description&&n.jsx("p",{className:"text-xs text-gray-500 mt-2 line-clamp-2",children:g.description})]})]}),n.jsxs("div",{className:"flex flex-col items-end gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:()=>m({jobId:g._id}),className:"p-2 rounded-lg hover:bg-[#1e293b] transition-colors",title:g.isSaved?"Unsave":"Save job",children:g.isSaved?n.jsx(Z9,{className:"w-5 h-5",style:{color:ua}}):n.jsx(Jh,{className:"w-5 h-5 text-gray-500 hover:text-gray-300"})}),g.applicationUrl&&n.jsxs("a",{href:g.applicationUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-full transition-colors",style:{background:ua,color:"#000"},children:["Apply ",n.jsx(nn,{className:"w-3 h-3"})]})]})]})},g._id)):Array.from({length:5}).map((g,j)=>n.jsx("div",{className:"h-28 rounded-xl bg-gray-800/50 animate-pulse"},j))})]})}function xce({agency:e}){return n.jsx("div",{className:"rounded-lg bg-[#111827] p-3 hover:bg-[#1a2332] transition-colors",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#1e293b] flex items-center justify-center flex-shrink-0 overflow-hidden",children:e.logoUrl?n.jsx("img",{src:e.logoUrl,alt:"",className:"w-full h-full object-contain p-1"}):n.jsx(Rt,{className:"w-5 h-5 text-gray-500"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("p",{className:"text-sm font-medium text-white truncate flex items-center gap-1",children:[e.name,(e.tier==="member"||e.tier==="platinum")&&n.jsx(Uc,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:ua}})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:[e.city?`${e.city}, `:"",e.state,e.officerCount?` ⢠${e.officerCount} officers`:""]}),e.salaryMin&&e.salaryMax&&n.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["$",e.salaryMin.toLocaleString()," - $",e.salaryMax.toLocaleString()]})]}),e.tier==="platinum"&&n.jsx(Nn,{className:"w-4 h-4 flex-shrink-0",style:{color:ua,fill:ua}})]})})}const EC="#d4a843";function gce(){const e=ie(F.veteranPortal.getSavedJobs),t=te(F.veteranPortal.toggleSaveJob);return n.jsxs("div",{className:"space-y-6",children:[n.jsx("p",{className:"text-sm text-gray-500",children:e?`${e.length} saved job${e.length!==1?"s":""}`:"Loading..."}),n.jsx("div",{className:"space-y-3",children:e?e.length===0?n.jsxs("div",{className:"text-center py-16",children:[n.jsx(Jh,{className:"w-10 h-10 mx-auto mb-3 text-gray-600"}),n.jsx("p",{className:"text-gray-400 mb-3",children:"No saved jobs yet."}),n.jsxs(ye,{to:"/vet/jobs",className:"inline-flex items-center gap-2 text-sm font-medium px-5 py-2 rounded-full",style:{background:EC,color:"#000"},children:[n.jsx(ht,{className:"w-4 h-4"}),"Browse Jobs"]})]}):e.map(r=>n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155] transition-colors",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-[#1e293b] flex items-center justify-center flex-shrink-0 overflow-hidden",children:r.agency.logoUrl?n.jsx("img",{src:r.agency.logoUrl,alt:"",className:"w-full h-full object-contain p-1"}):n.jsx(Rt,{className:"w-5 h-5 text-gray-500"})}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-sm font-semibold text-white truncate",children:r.job.title}),n.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:r.agency.name}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-2",children:[r.agency.state&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[n.jsx(wt,{className:"w-3 h-3"}),r.agency.city?`${r.agency.city}, `:"",r.agency.state]}),r.job.salary&&n.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[n.jsx(b0,{className:"w-3 h-3"}),r.job.salary]}),r.job.status!=="active"&&n.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-red-500/15 text-red-400",children:r.job.status==="expired"?"Expired":r.job.status})]}),n.jsxs("p",{className:"text-[11px] text-gray-600 mt-1",children:["Saved ",new Date(r.savedAt).toLocaleDateString()]})]})]}),n.jsxs("div",{className:"flex flex-col items-end gap-2",children:[n.jsx("button",{onClick:()=>t({jobId:r.job._id}),className:"p-2 rounded-lg hover:bg-red-500/10 text-gray-500 hover:text-red-400 transition-colors",title:"Remove from saved",children:n.jsx(_n,{className:"w-4 h-4"})}),r.job.applicationUrl&&r.job.status==="active"&&n.jsxs("a",{href:r.job.applicationUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-full",style:{background:EC,color:"#000"},children:["Apply ",n.jsx(nn,{className:"w-3 h-3"})]})]})]})},r._id)):Array.from({length:3}).map((r,a)=>n.jsx("div",{className:"h-24 rounded-xl bg-gray-800/50 animate-pulse"},a))})]})}const Mc="#d4a843";function bce({selectedRecruiterId:e,onSelect:t}){const r=ie(F.websitePublic.listPublicRecruiters);return!r||r.length===0?null:n.jsxs("div",{className:"border-b border-[#1e293b] bg-[#0a0e17] px-4 py-3",children:[n.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500 mb-2.5",children:"Recruiters"}),n.jsx("div",{className:"flex gap-4 overflow-x-auto pb-1",children:r.map(a=>{const s=e===a._id,i=`${(a.firstName||"")[0]||""}${(a.lastName||"")[0]||""}`.toUpperCase();return n.jsxs("button",{onClick:()=>t(a),className:"flex flex-col items-center gap-1.5 min-w-[60px] group",children:[n.jsxs("div",{className:"relative",children:[a.photoUrl?n.jsx("img",{src:a.photoUrl,alt:"",className:`w-11 h-11 rounded-full object-cover border-2 transition-colors ${s?"border-[#d4a843]":"border-transparent group-hover:border-[#d4a843]/60"}`}):n.jsx("div",{className:`w-11 h-11 rounded-full bg-[#1e293b] flex items-center justify-center border-2 transition-colors ${s?"border-[#d4a843]":"border-transparent group-hover:border-[#d4a843]/60"}`,children:n.jsx("span",{className:"text-xs font-bold text-gray-400",children:i})}),n.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-full flex items-center justify-center",style:{background:Mc},children:n.jsx(Sn,{className:"w-2 h-2 text-black"})})]}),n.jsx("span",{className:`text-[10px] text-center leading-tight truncate w-full transition-colors ${s?"text-white font-medium":"text-gray-500 group-hover:text-gray-300"}`,children:a.firstName})]},a._id)})})]})}function vce({conversations:e,selectedId:t,onSelect:r}){return n.jsx("div",{className:"divide-y divide-[#1e293b]",children:e.length===0?n.jsxs("div",{className:"px-4 py-12 text-center",children:[n.jsx(tn,{className:"w-8 h-8 mx-auto mb-2 text-gray-600"}),n.jsx("p",{className:"text-sm text-gray-500",children:"No conversations yet."}),n.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Select a recruiter to start a conversation."})]}):e.map(a=>n.jsx("button",{onClick:()=>r(a.otherUserId),className:`w-full text-left px-4 py-3 hover:bg-[#1e293b]/50 transition-colors ${t===a.otherUserId?"bg-[#1e293b]/70":""}`,children:n.jsxs("div",{className:"flex items-center gap-3",children:[a.otherPhotoUrl?n.jsx("img",{src:a.otherPhotoUrl,alt:"",className:"w-10 h-10 rounded-full object-cover flex-shrink-0"}):n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#1e293b] flex items-center justify-center flex-shrink-0",children:a.otherRole==="agency"?n.jsx(Rt,{className:"w-5 h-5 text-gray-500"}):n.jsx(Ze,{className:"w-5 h-5 text-gray-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("p",{className:"text-sm font-medium text-white truncate",children:a.otherName}),a.unreadCount>0&&n.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full flex-shrink-0",style:{background:Mc,color:"#000"},children:a.unreadCount})]}),n.jsx("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:a.lastMessagePreview||"Start a conversation"}),n.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:MM(a.lastMessageAt)}
234)]})]})},a._id))})}function yce({otherUserId:e,recruiterInfo:t,onBack:r}){const a=ie(F.messaging.getMessages,{otherUserId:e}),s=ie(F.messaging.listConversations),i=te(F.messaging.sendMessage),o=te(F.messaging.markAsRead),[c,d]=y.useState(""),[u,h]=y.useState(!1),m=y.useRef(null),p=s?.find(j=>j.otherUserId===e),b=p?.otherName||(t?`${t.firstName} ${t.lastName}`:"Recruiter"),w=p?.otherPhotoUrl||t?.photoUrl,x=p?.otherRole||"Recruiter";y.useEffect(()=>{e&&o({otherUserId:e}).catch(()=>{})},[e,a?.length]),y.useEffect(()=>{m.current?.scrollIntoView({behavior:"smooth"})},[a?.length]);const g=async()=>{if(!(!c.trim()||u)){h(!0);try{await i({recipientId:e,body:c.trim()}),d("")}finally{h(!1)}}};return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[#1e293b]",children:[n.jsx("button",{onClick:r,className:"lg:hidden p-1 rounded hover:bg-[#1e293b]",children:n.jsx(Zr,{className:"w-5 h-5 text-gray-400"})}),w?n.jsx("img",{src:w,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1e293b] flex items-center justify-center",children:n.jsx(Rt,{className:"w-4 h-4 text-gray-500"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:b}),n.jsx("p",{className:"text-[11px] text-gray-500 capitalize",children:t?.agencyName||x})]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[a?a.length===0?n.jsxs("div",{className:"text-center py-12",children:[n.jsx(tn,{className:"w-8 h-8 mx-auto mb-2 text-gray-600"}),n.jsx("p",{className:"text-sm text-gray-500",children:"Send a message to start the conversation."})]}):a.map(j=>n.jsx("div",{className:`flex ${j.isMine?"justify-end":"justify-start"}`,children:n.jsxs("div",{className:"max-w-[75%] px-4 py-2.5 rounded-2xl text-sm",style:{background:j.isMine?Mc:"#1e293b",color:j.isMine?"#000":"#e2e8f0",borderBottomRightRadius:j.isMine?"4px":"16px",borderBottomLeftRadius:j.isMine?"16px":"4px"},children:[n.jsx("p",{children:j.body}),n.jsx("p",{className:"text-[10px] mt-1",style:{color:j.isMine?"rgba(0,0,0,0.5)":"rgba(148,163,184,0.6)"},children:MM(j._creationTime)})]})},j._id)):n.jsx("div",{className:"text-center py-8",children:n.jsx("div",{className:"w-6 h-6 border-2 border-gray-600 border-t-gray-400 rounded-full animate-spin mx-auto"})}),n.jsx("div",{ref:m})]}),n.jsx("div",{className:"border-t border-[#1e293b] p-3",children:n.jsxs("form",{onSubmit:j=>{j.preventDefault(),g()},className:"flex items-center gap-2",children:[n.jsx(Ee,{value:c,onChange:j=>d(j.target.value),placeholder:"Type a message...",className:"flex-1 bg-[#0d1117] border-[#1e293b] text-white",disabled:u}),n.jsx(be,{type:"submit",size:"icon",disabled:!c.trim()||u,style:{background:Mc,color:"#000"},children:n.jsx(si,{className:"w-4 h-4"})})]})})]})}function MM(e){const t=new Date(e),a=new Date().getTime()-t.getTime(),s=Math.floor(a/864e5);return s===0?t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):s===1?"Yesterday":s<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function jce(){const[e,t]=$c(),r=ie(F.messaging.listConversations),a=te(F.messaging.sendMessage),[s,i]=y.useState(null),[o,c]=y.useState(null),[d,u]=y.useState(!1);y.useEffect(()=>{if(d)return;const p=e.get("recruiterId"),b=e.get("recruiterName"),w=e.get("recruiterUserId"),x=e.get("recruiterPhoto"),g=e.get("recruiterAgency");if(p&&b){const j=b.split(" "),S={_id:p,userId:w||void 0,firstName:j[0]||"",lastName:j.slice(1).join(" ")||"",photoUrl:x||"",agencyName:g||""};c(S),w&&i(w),t({},{replace:!0}),u(!0)}},[e,d]);const h=async p=>{if(c(p),!p.userId){i(null);return}if(r?.find(w=>w.otherUserId===p.userId)){i(p.userId);return}try{await a({recipientId:p.userId,body:"Hi, I'm interested in learning more about opportunities with your agency."}),i(p.userId)}catch{i(p.userId)}},m=p=>{c(null),i(p)};return n.jsx("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] overflow-hidden",style:{height:"calc(100vh - 8rem)"},children:n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:`w-full lg:w-80 border-r border-[#1e293b] overflow-y-auto flex flex-col ${s||o?"hidden lg:flex":"flex"}`,children:[n.jsx("div",{className:"px-4 py-3 border-b border-[#1e293b]",children:n.jsx("h3",{className:"text-sm font-semibold text-white",children:"Conversations"})}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx(vce,{conversations:r||[],selectedId:s,onSelect:m})})]}),n.jsxs("div",{className:`flex-1 flex flex-col ${s||o?"":"hidden lg:flex"}`,children:[n.jsx(bce,{selectedRecruiterId:o?._id||null,onSelect:h}),n.jsx("div",{className:"flex-1 flex flex-col min-h-0",children:s?n.jsx(yce,{otherUserId:s,recruiterInfo:o,onBack:()=>{i(null),c(null)}}):o?n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-[#1e293b]",children:[n.jsx("button",{onClick:()=>{c(null),i(null)},className:"lg:hidden p-1 rounded hover:bg-[#1e293b]",children:n.jsx(Zr,{className:"w-5 h-5 text-gray-400"})}),o.photoUrl?n.jsx("img",{src:o.photoUrl,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#1e293b] flex items-center justify-center",children:n.jsx(Rt,{className:"w-4 h-4 text-gray-500"})}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-sm font-medium text-white",children:[o.firstName," ",o.lastName]}),n.jsx("p",{className:"text-[11px] text-gray-500",children:o.agencyName})]})]}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center p-8",children:[n.jsx(tn,{className:"w-10 h-10 mx-auto mb-3 text-gray-600"}),n.jsxs("p",{className:"text-sm text-gray-400",children:["Messaging with ",o.firstName," will be available once their inbox is set up."]})]})}),n.jsx("div",{className:"border-t border-[#1e293b] p-3",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ee,{placeholder:"Type a message...",className:"flex-1 bg-[#0d1117] border-[#1e293b] text-white opacity-50",disabled:!0}),n.jsx(be,{size:"icon",disabled:!0,style:{background:Mc,color:"#000",opacity:.5},children:n.jsx(si,{className:"w-4 h-4"})})]})})]}):n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center p-8",children:[n.jsx(tn,{className:"w-12 h-12 mx-auto mb-3 text-gray-600"}),n.jsx("p",{className:"text-gray-400",children:"Select a recruiter or conversation to start messaging."})]})})})]})]})})}const yr="#d4a843";function wce({label:e,value:t,onChange:r,options:a,placeholder:s}){const[i,o]=y.useState(""),[c,d]=y.useState(!1),u=y.useRef(null),h=y.useMemo(()=>
234{if(!i)return a;const m=i.toLowerCase();return a.filter(p=>p.toLowerCase().includes(m))},[a,i]);return n.jsxs("div",{className:"space-y-1.5 relative",ref:u,children:[n.jsx(we,{className:"text-xs text-gray-400",children:e}),n.jsx(Ee,{value:c?i:t,onChange:m=>{o(m.target.value),d(!0)},onFocus:()=>{d(!0),o("")},onBlur:()=>setTimeout(()=>d(!1),200),placeholder:s,className:"bg-[#0d1117] border-[#1e293b] text-white"}),c&&h.length>0&&n.jsxs("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 max-h-60 overflow-y-auto rounded-md border border-[#1e293b] bg-[#0d1117] shadow-lg",children:[h.map(m=>n.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-sm text-white hover:bg-[#1e293b] transition-colors",onMouseDown:p=>{p.preventDefault(),r(m),d(!1),o("")},children:m},m)),!i&&h.length>20&&n.jsxs("div",{className:"sticky bottom-0 bg-[#0d1117] px-3 py-2 text-xs text-gray-500 border-t border-[#1e293b]",children:["Type to search ",h.length," entries..."]})]})]})}function Ui({label:e,value:t,onChange:r,options:a,required:s}){return n.jsxs("div",{className:"space-y-2.5",children:[n.jsxs("p",{className:"text-xs text-gray-400 leading-relaxed",children:[e," ",s&&n.jsx("span",{style:{color:"#d4a843"},children:"*"})]}),n.jsx("div",{className:"flex flex-wrap gap-3",children:a.map(i=>n.jsxs("label",{className:`flex items-center gap-2 cursor-pointer px-3 py-2 rounded-lg border text-sm transition-colors ${t===i?"border-[#d4a843] bg-[#d4a843]/10 text-white":"border-[#1e293b] bg-transparent text-gray-400 hover:border-[#334155] hover:text-gray-300"}`,children:[n.jsx("input",{type:"radio",checked:t===i,onChange:()=>r(i),className:"sr-only"}),n.jsx("div",{className:`w-3.5 h-3.5 rounded-full border-2 flex items-center justify-center flex-shrink-0 transition-colors ${t===i?"border-[#d4a843]":"border-[#475569]"}`,children:t===i&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-[#d4a843]"})}),i]},i))})]})}const MC=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"];function Nce(){const e=te(F.veteranPortal.registerVeteran),t=te(F.veteranPortal.uploadMyPhoto),r=te(F.storage.generateUploadUrl),a=ar(),s=y.useRef(null),[i,o]=y.useState(!1),[c,d]=y.useState(""),[u,h]=y.useState(null),[m,p]=y.useState(null),[b,w]=y.useState(!1),[x,g]=y.useState({firstName:"",lastName:"",email:"",phone:"",city:"",state:"",branch:"",rank:"",mos:"",yearsOfService:"",separationDate:"",preferredAgency1:"",preferredAgency2:"",preferredAgency3:"",interestedStates:[],completedWithoutDisciplinary:"",receivedNjp:"",courtMartialConviction:"",requiredDisclosures:"",separatedForMisconduct:"",clearanceSuspendedRevoked:""}),j=C=>{const A=C.target.files?.[0];if(A){if(!A.type.startsWith("image/")){d("Please select an image file (JPG, PNG, etc.).");return}if(A.size>10*1024*1024){d("Photo must be under 10MB.");return}h(A),p(URL.createObjectURL(A)),d("")}},S=()=>{h(null),m&&URL.revokeObjectURL(m),p(null),s.current&&(s.current.value="")},_=async C=>{if(C.preventDefault(),!x.firstName||!x.lastName||!x.email||!x.phone||!x.city||!x.state||!x.branch||!x.rank||!x.mos||!x.yearsOfService||!x.separationDate){d("Please fill in all required fields.");return}if(x.interestedStates.length===0){d("Please select at least one state you are interested in working in.");return}if(!x.completedWithoutDisciplinary||!x.receivedNjp||!x.courtMartialConviction||!x.requiredDisclosures||!x.separatedForMisconduct||!x.clearanceSuspendedRevoked){d("Please answer all Military Conduct and Administrative Actions questions.");return}if(!u){d("A profile photo is required.");return}if(!b){d("Please acknowledge the photo requirements.");return}o(!0),d("");try{const A=[x.preferredAgency1,x.preferredAgency2,x.preferredAgency3].filter($=>$.trim()!=="");await e({firstName:x.firstName,lastName:x.lastName,email:x.email,phone:x.phone||void 0,city:x.city||void 0,state:x.state||void 0,branch:x.branch,rank:x.rank||void 0,mos:x.mos||void 0,yearsOfService:x.yearsOfService?parseInt(x.yearsOfService):void 0,separationDate:x.separationDate||void 0,preferredAgencie
234s:A.length>0?A:void 0,interestedStates:x.interestedStates.length>0?x.interestedStates:void 0,completedWithoutDisciplinary:x.completedWithoutDisciplinary||void 0,receivedNjp:x.receivedNjp||void 0,courtMartialConviction:x.courtMartialConviction||void 0,requiredDisclosures:x.requiredDisclosures||void 0,separatedForMisconduct:x.separatedForMisconduct||void 0,clearanceSuspendedRevoked:x.clearanceSuspendedRevoked||void 0});const P=await r(),O=await fetch(P,{method:"POST",headers:{"Content-Type":u.type},body:u}),{storageId:E}=await O.json();await t({storageId:E}),a("/vet/dashboard")}catch(A){d(A.message||"Something went wrong. Please try again.")}finally{o(!1)}},N=(C,A,P,O)=>n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs(we,{className:"text-xs text-gray-400",children:[A," ",P&&n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsx(Ee,{value:x[C],onChange:E=>g({...x,[C]:E.target.value}),className:"bg-[#0d1117] border-[#1e293b] text-white",required:P,...O})]});return n.jsx("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"#080c14"},children:n.jsxs("div",{className:"w-full max-w-lg space-y-6",children:[n.jsxs("div",{className:"text-center",children:[n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"mx-auto h-16 w-auto mb-4"}),n.jsx("h1",{className:"text-xl font-bold text-white",children:"Complete Your Profile"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Tell us about your military service so we can match you with the right opportunities."})]}),n.jsxs("form",{onSubmit:_,className:"space-y-6",children:[n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 space-y-4",children:[n.jsxs("h3",{className:"text-sm font-semibold text-white",children:["Profile Photo ",n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"flex-shrink-0",children:m?n.jsxs("div",{className:"relative",children:[n.jsx("img",{src:m,alt:"Preview",className:"w-24 h-24 rounded-full object-cover border-2",style:{borderColor:yr}}),n.jsx("button",{type:"button",onClick:S,className:"absolute -top-1 -right-1 w-6 h-6 rounded-full bg-red-500 flex items-center justify-center hover:bg-red-400 transition-colors",children:n.jsx(Me,{className:"w-3 h-3 text-white"})})]}):n.jsxs("button",{type:"button",onClick:()=>s.current?.click(),className:"w-24 h-24 rounded-full border-2 border-dashed border-[#334155] flex flex-col items-center justify-center hover:border-[#d4a843] transition-colors group",children:[n.jsx(UC,{className:"w-6 h-6 text-gray-500 group-hover:text-[#d4a843] transition-colors"}),n.jsx("span",{className:"text-[10px] text-gray-600 mt-1",children:"Upload"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"Upload a professional photo of yourself in military uniform or professional attire."}),!m&&n.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>s.current?.click(),className:"text-xs border-[#1e293b] bg-transparent hover:bg-[#1e293b] text-gray-300",children:[n.jsx(Et,{className:"w-3 h-3 mr-1.5"}),"Choose Photo"]})]}),n.jsx("input",{ref:s,type:"file",accept:"image/*",onChange:j,className:"hidden"})]}),n.jsx("div",{className:"rounded-lg border px-4 py-3",style:{borderColor:"rgba(245,158,11,0.3)",background:"rgba(245,158,11,0.06)"},children:n.jsxs("div",{className:"flex items-start gap-2.5",children:[n.jsx(Dc,{className:"w-4 h-4 flex-shrink-0 mt-0.5",style:{color:"#f59e0b"}}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-semibold text-amber-300 mb-1.5",children:"Photo Requirements"}),n.jsxs("p",{className:"text-[11px] text-gray-400 leading-relaxed",children:["Your photo must be a clear, individual headshot or upper-body photo of you in ",n.jsx("strong",{className:"text-gray-300",children:"military uniform"})," or"," ",n.jsx("strong",{className:"text-gray-300",children:"professional attire"}),". Your profile will not be approved if you submit a mirror selfie, group photo, or any image that is unprofessional or unbecoming."]})]})]})}),n.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:b,onChange:C=>w(C.target.checked),className:"sr-only"}),n.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center flex-shrink-0 border mt-0.5 transition-colors ${b?"border-[#d4a843] bg-[#d4a843]":"border-[#334155] bg-transparent"}`,children:b&&n.jsx("svg",{className:"w-3 h-3 text-black",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsxs("span",{className:"text-xs text-gray-400 leading-relaxed",children:["I confirm that my photo meets the requirements above and understand that my profile may be rejected if it does not. ",n.jsx("span",{style:{color:yr},children:"*"})]})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 space-y-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-white",children:"Personal Information"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[N("firstName","First Name",!0),N("lastName","Last Name",!0)]}),N("email","Email",!0,{type:"email"}),N("phone","Phone",!0,{type:"tel"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[N("city","City",!0),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs(we,{className:"text-xs text-gray-400",children:["State ",n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsxs("select",{value:x.state,onChange:C=>g({...x,state:C.target.value}),className:"w-full h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm",required:!0,children:[n.jsx("option",{value:"",children:"Select..."}),MC.map(C=>n.jsx("option",{value:C,children:C},C))]})]})]}),n.jsxs("div",{className:"space-y-2 pt-2",children:[n.jsx(we,{className:"text-xs text-gray-400",children:"Name up to 3 law enforcement agencies you are most interested in working for"}),N("preferredAgency1","Agency 1"),N("preferredAgency2","Agency 2"),N("preferredAgency3","Agency 3")]}),n.jsxs("div",{className:"space-y-2 pt-2",children:[n.jsxs(we,{className:"text-xs text-gray-400",children:["What states are you most interested in working in? ",n.jsx("span",{style:{color:yr},children:"*"})]}
234),n.jsx("div",{className:"grid grid-cols-5 gap-2 max-h-48 overflow-y-auto rounded-lg border border-[#1e293b] bg-[#0d1117] p-3",children:MC.map(C=>n.jsxs("label",{className:`flex items-center gap-1.5 cursor-pointer px-2 py-1.5 rounded text-sm transition-colors ${x.interestedStates.includes(C)?"bg-[#d4a843]/15 text-[#d4a843]":"text-gray-400 hover:text-gray-200"}`,children:[n.jsx("input",{type:"checkbox",checked:x.interestedStates.includes(C),onChange:A=>{A.target.checked?g({...x,interestedStates:[...x.interestedStates,C]}):g({...x,interestedStates:x.interestedStates.filter(P=>P!==C)})},className:"sr-only"}),n.jsx("div",{className:`w-3.5 h-3.5 rounded flex items-center justify-center flex-shrink-0 border transition-colors ${x.interestedStates.includes(C)?"border-[#d4a843] bg-[#d4a843]":"border-[#334155] bg-transparent"}`,children:x.interestedStates.includes(C)&&n.jsx("svg",{className:"w-2.5 h-2.5 text-black",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),C]},C))}),x.interestedStates.length>0&&n.jsxs("p",{className:"text-[11px] text-gray-500",children:["Selected: ",x.interestedStates.join(", ")]})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 space-y-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-white",children:"Military Background"}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs(we,{className:"text-xs text-gray-400",children:["Branch of Service ",n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsxs("select",{value:x.branch,onChange:C=>g({...x,branch:C.target.value,rank:"",mos:""}),className:"w-full h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm",required:!0,children:[n.jsx("option",{value:"",children:"Select..."}),OM.map(C=>n.jsx("option",{value:C,children:C},C))]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs(we,{className:"text-xs text-gray-400",children:["Rank at Separation ",n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsxs("select",{value:x.rank,onChange:C=>g({...x,rank:C.target.value}),className:"w-full h-10 px-3 rounded-md bg-[#0d1117] border border-[#1e293b] text-white text-sm",children:[n.jsx("option",{value:"",children:"Select..."}),(En[x.branch]||[]).map(C=>n.jsx("option",{value:C,children:C},C))]})]}),n.jsx(wce,{label:x.branch?`${Gh(x.branch)} / Career Field *`:"MOS / Rating / AFSC *",value:x.mos,onChange:C=>g({...x,mos:C}),options:Mn[x.branch]||[],placeholder:x.branch?`Search ${Gh(x.branch)}...`:"Select branch first..."})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[N("yearsOfService","Years of Service",!0,{type:"number",min:0}),N("separationDate","Separation Date",!0,{type:"date"})]})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 space-y-5",children:[n.jsxs("h3",{className:"text-sm font-semibold text-white",children:["Military Conduct ",n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsx(Ui,{label:"Did you successfully complete your military service without disciplinary separation?",value:x.completedWithoutDisciplinary,onChange:C=>g({...x,completedWithoutDisciplinary:C}),options:["Yes","No"],required:!0}),n.jsx(Ui,{label:"Have you ever received non-judicial punishment (Article 15, NJP, Captain's Mast, Office Hours)?",value:x.receivedNjp,onChange:C=>g({...x,receivedNjp:C}),options:["Yes","No","Prefer to discuss during background investigation"],required:!0}),n.jsx(Ui,{label:"Have you ever been convicted by a Summary, Special, or General Court-Martial?",value:x.courtMartialConviction,onChange:C=>g({...x,courtMartialConviction:C}),options:["Yes","No"],required:!0}),n.jsx(Ui,{label:"Are there any military disciplinary matters that you are legally required to disclose during a law enforcement background investigation?",value:x.requiredDisclosures,onChange:C=>g({...x,requiredDisclosures:C}),options:["Yes","No"],required:!0})]}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 space-y-5",children:[n.jsxs("h3",{className:"text-sm font-semibold text-white",children:["Administrative Actions ",n.jsx("span",{style:{color:yr},children:"*"})]}),n.jsx(Ui,{label:"Have you ever been administratively separated for misconduct?",value:x.separatedForMisconduct,onChange:C=>g({...x,separatedForMisconduct:C}),options:["Yes","No"],required:!0}),n.jsx(Ui,{label:"Was your security clearance ever suspended or revoked?",value:x.clearanceSuspendedRevoked,onChange:C=>g({...x,clearanceSuspendedRevoked:C}),options:["Yes","No","Not Applicable"],required:!0})]}),c&&n.jsx("p",{className:"text-sm text-red-400 bg-red-500/10 rounded-lg px-4 py-2",children:c}),n.jsxs(be,{type:"submit",className:"w-full h-11 font-bold",disabled:i||!u||!b,style:{background:!u||!b?"#334155":yr,color:!u||!b?"#94a3b8":"#000"},children:[i&&n.jsx(gt,{className:"w-4 h-4 animate-spin mr-2"}),i?"Creating Profile...":"Create My Profile"]})]})]})})}const We="#d4a843",_ce="#00b4ff",Sce="https://buy.stripe.com/3cI8wQ6IzduM26Qb0BeME0a",Cce=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","N
234orth Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming","Puerto Rico","Guam","U.S. Virgin Islands"],Ace=["gmail.com","yahoo.com","hotmail.com","outlook.com","aol.com","icloud.com","mail.com","protonmail.com","zoho.com","yandex.com","live.com","msn.com","me.com","mac.com","comcast.net","verizon.net","att.net","cox.net","sbcglobal.net","earthlink.net","charter.net","optonline.net","frontier.com","windstream.net","suddenlink.net"];function kce(e){const t=(e.split("@")[1]??"").toLowerCase().trim();return!t||Ace.includes(t)}const Pce=["Certificate","Associate","Bachelor's","Master's","Doctorate"],Tce=["On campus","Online","Hybrid"],Oce=["Public university","Private university","Community college","Technical college","Online university"],Ece=["Regional / college-based academy","State academy","Agency-run academy","Reserve / part-time academy","Corrections academy"],wj="w-full h-11 px-3 rounded-lg bg-[#0d1117] border border-[#1e293b] text-sm text-white placeholder:text-gray-600 outline-none focus:border-[#d4a843]/60",Nj="block text-xs font-semibold text-gray-400 mb-1.5";function Ct({label:e,value:t,onChange:r,placeholder:a,required:s,type:i="text",hint:o,maxLength:c=200}){return n.jsxs("div",{children:[n.jsxs("label",{className:Nj,children:[e,s&&n.jsx("span",{style:{color:We},children:" *"})]}),n.jsx("input",{type:i,value:t,onChange:d=>r(d.target.value),placeholder:a,required:s,maxLength:c,className:wj}),o&&n.jsx("p",{className:"text-[11px] text-gray-500 mt-1",children:o})]})}function Kh({label:e,value:t,onChange:r,placeholder:a,rows:s=4}){return n.jsxs("div",{children:[n.jsx("label",{className:Nj,children:e}),n.jsx("textarea",{value:t,onChange:i=>r(i.target.value),placeholder:a,rows:s,maxLength:2e3,className:`${wj} h-auto py-2.5 resize-y`})]})}function Lc({label:e,value:t,onChange:r,options:a,required:s,placeholder:i="Select..."}){return n.jsxs("div",{children:[n.jsxs("label",{className:Nj,children:[e,s&&n.jsx("span",{style:{color:We},children:" *"})]}),n.jsxs("select",{value:t,onChange:o=>r(o.target.value),required:s,className:wj,children:[n.jsx("option",{value:"",children:i}),a.map(o=>n.jsx("option",{value:o,children:o},o))]})]})}function Ws({label:e,checked:t,onChange:r,hint:a}){return n.jsxs("label",{className:"flex items-start gap-3 p-3 rounded-lg border border-[#1e293b] bg-[#0d1117] cursor-pointer hover:border-[#334155]",children:[n.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.target.checked),className:"mt-0.5 size-4 accent-[#d4a843]"}),n.jsxs("span",{children:[n.jsx("span",{className:"text-sm text-white",children:e}),a&&n.jsx("span",{className:"block text-[11px] text-gray-500 mt-0.5",children:a})]})]})}function Va({title:e,subtitle:t,children:r}){return n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-5 md:p-6",children:[n.jsx("h3",{className:"text-base font-bold text-white",children:e}),t&&n.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t}),n.jsx("div",{className:"mt-5 space-y-4",children:r})]})}const Ke=e=>typeof e=="string"?e:"";function LM(e,t=""){return{name:Ke(e?.name),state:Ke(e?.state),city:Ke(e?.city),address:Ke(e?.address),postalCode:Ke(e?.postalCode),phone:Ke(e?.phone),website:Ke(e?.website),publicEmail:Ke(e?.publicEmail),description:Ke(e?.description),contactName:Ke(e?.contactName)||t,contactTitle:Ke(e?.contactTitle),postAgency:Ke(e?.postAgency),postCertNumber:Ke(e?.postCertNumber),academyType:Ke(e?.academyType),programName:Ke(e?.programName),programHours:Ke(e?.programHours),programWeeks:Ke(e?.programWeeks),tuition:Ke(e?.tuition),nextStartDate:Ke(e?.nextStartDate),selfSponsor:!!e?.selfSponsor,giBillApproved:!!e?.giBillApproved,collegeCredit:!!e?.collegeCredit}}function IM(e,t=""){return{name:Ke(e?.name),state:Ke(e?.state),city:Ke(e?.city),address:Ke(e?.address),postalCode:Ke(e?.postalCode),phone:Ke(e?.phone),website:Ke(e?.website),publicEmail:Ke(e?.publicEmail),description:Ke(e?.description),contactName:Ke(e?.contactName)||t,contactTitle:Ke(e?.contactTitle),institutionType:Ke(e?.institutionType),accreditation:Ke(e?.accreditation),veteranServices:Ke(e?.veteranServices),giBillApproved:!!e?.giBillApproved,yellowRibbon:!!e?.yellowRibbon,militaryCredit:!!e?.militaryCredit}}function um(e){const t={};
234for(const[r,a]of Object.entries(e))typeof a=="string"?a.trim()&&(t[r]=a.trim()):t[r]=a;return t}function RM({form:e,set:t,kind:r}){return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(Ct,{label:"City",value:e.city,onChange:a=>t({city:a})}),n.jsx(Lc,{label:"State",required:!0,value:e.state,onChange:a=>t({state:a}),options:Cce})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[1fr_140px] gap-4",children:[n.jsx(Ct,{label:"Street address",value:e.address,onChange:a=>t({address:a})}),n.jsx(Ct,{label:"ZIP",value:e.postalCode,onChange:a=>t({postalCode:a}),maxLength:10})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(Ct,{label:"Website",value:e.website,onChange:a=>t({website:a}),placeholder:"https://"}),n.jsx(Ct,{label:"Phone",value:e.phone,onChange:a=>t({phone:a}),type:"tel"})]}),n.jsx(Ct,{label:r==="academy"?"Public email for veteran applicants":"Veteran admissions email (shown publicly)",value:e.publicEmail,onChange:a=>t({publicEmail:a}),type:"email",hint:"Leave blank to keep your login email private. Veterans will use your website and phone instead."}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(Ct,{label:"Your name",value:e.contactName,onChange:a=>t({contactName:a})}),n.jsx(Ct,{label:"Your title",value:e.contactTitle,onChange:a=>t({contactTitle:a}),placeholder:r==="academy"?"Academy Director":"Director of Veteran Services"})]})]})}function DM({form:e,set:t,showConfirm:r,confirmed:a,setConfirmed:s}){return n.jsxs("div",{className:"space-y-5",children:[n.jsxs(Va,{title:"Academy",subtitle:"This is what veterans see on the academy directory.",children:[n.jsx(Ct,{label:"Academy name",required:!0,value:e.name,onChange:i=>t({name:i}),placeholder:"e.g. Treasure Valley Regional Police Academy"}),n.jsx(Lc,{label:"Academy type",value:e.academyType,onChange:i=>t({academyType:i}),options:Ece}),n.jsx(Kh,{label:"About the academy",value:e.description,onChange:i=>t({description:i}),placeholder:"Who runs it, who it serves, how long it has been training officers, what makes it a good fit for veterans."})]}),n.jsxs(Va,{title:"POST approval",subtitle:"Free listings are for academies approved by a state Peace Officer Standards and Training (POST) agency or equivalent board. We verify this before your listing goes live.",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(Ct,{label:"Approving POST / standards board",required:!0,value:e.postAgency,onChange:i=>t({postAgency:i}),placeholder:"e.g. Idaho POST Council"}),n.jsx(Ct,{label:"POST academy or course ID",value:e.postCertNumber,onChange:i=>t({postCertNumber:i}),hint:"Speeds up verification if you have one."})]}),r&&s&&n.jsx(Ws,{label:"I confirm this academy is currently approved by the state POST or standards board listed above.",checked:!!a,onChange:s})]}),n.jsxs(Va,{title:"Basic academy program",children:[n.jsx(Ct,{label:"Program name",value:e.programName,onChange:i=>t({programName:i}),placeholder:"e.g. Basic Patrol Academy"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsx(Ct,{label:"Hours",value:e.programHours,onChange:i=>t({programHours:i}),placeholder:"e.g. 720"}),n.jsx(Ct,{label:"Length",value:e.programWeeks,onChange:i=>t({programWeeks:i}),placeholder:"e.g. 16 weeks"}),n.jsx(Ct,{label:"Tuition",value:e.tuition,onChange:i=>t({tuition:i}),placeholder:"e.g. $4,500"})]}),n.jsx(Ct,{label:"Next class starts",value:e.nextStartDate,onChange:i=>t({nextStartDate:i}),placeholder:"e.g. January 12, 2027"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[n.jsx(Ws,{label:"Accepts self-sponsored cadets",checked:e.selfSponsor,onChange:i=>t({selfSponsor:i})}),n.jsx(Ws,{label:"GI Bill approved",checked:e.giBillApproved,onChange:i=>t({giBillApproved:i})}),n.jsx(Ws,{label:"Awards college credit",checked:e.collegeCredit,onChange:i=>t({collegeCredit:i})})]})]}),n.jsx(Va,{title:"Location and contact",children:n.jsx(RM,{form:e,set:t,kind:"academy"})})]})}function $M({form:e,set:t}){return n.jsxs("div",{className:"space-y-5",children:[n.jsxs(Va,{title:"College or university",subtitle:"This is what veterans see on the education directory.",children:[n.jsx(Ct,{label:"Institution name",required:!0,value:e.name,onChange:r=>t({name:r}),placeholder:"e.g. Boise State University"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(Lc,{label:"Institution type",value:e.institutionType,onCh
234ange:r=>t({institutionType:r}),options:Oce}),n.jsx(Ct,{label:"Accreditation",value:e.accreditation,onChange:r=>t({accreditation:r}),placeholder:"e.g. NWCCU"})]}),n.jsx(Kh,{label:"About your school",value:e.description,onChange:r=>t({description:r}),placeholder:"Your criminal justice and public safety focus, campus or online options, and why veterans do well here."})]}),n.jsxs(Va,{title:"Veteran benefits",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[n.jsx(Ws,{label:"GI Bill approved",checked:e.giBillApproved,onChange:r=>t({giBillApproved:r})}),n.jsx(Ws,{label:"Yellow Ribbon school",checked:e.yellowRibbon,onChange:r=>t({yellowRibbon:r})}),n.jsx(Ws,{label:"Credit for military training",checked:e.militaryCredit,onChange:r=>t({militaryCredit:r})})]}),n.jsx(Kh,{label:"Veteran services",value:e.veteranServices,onChange:r=>t({veteranServices:r}),rows:3,placeholder:"Veteran resource center, VA certifying official, priority registration, student veteran organization."})]}),n.jsx(Va,{title:"Location and contact",children:n.jsx(RM,{form:e,set:t,kind:"college"})})]})}function Mce({logoUrl:e,kind:t}){const r=te(F.storage.generateUploadUrl),a=te(F.education.setMyLogo),[s,i]=y.useState(!1),o=y.useRef(null),c=t==="academy"?ja:pn,d=async u=>{const h=u.target.files?.[0];if(u.target.value="",!!h){if(!h.type.startsWith("image/"))return W.error("The logo must be an image file.");if(h.size>5*1024*1024)return W.error("Logo must be under 5 MB.");i(!0);try{const m=await r(),p=await fetch(m,{method:"POST",headers:{"Content-Type":h.type},body:h});if(!p.ok)throw new Error("Upload failed");const{storageId:b}=await p.json();await a({storageId:b}),W.success("Logo updated")}catch(m){W.error(m?.message?.replace(/^.*Uncaught Error: /,"").split(` 235`)[0]||"Upload failed")}finally{i(!1)}}};return n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-20 h-20 rounded-xl flex items-center justify-center overflow-hidden shrink-0",style:{background:"#1e293b"},children:e?n.jsx("img",{src:e,alt:"Logo",className:"w-16 h-16 object-contain"}):n.jsx(c,{className:"w-8 h-8",style:{color:We}})}),n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>o.current?.click(),disabled:s,className:"inline-flex items-center gap-2 text-xs font-semibold px-4 py-2 rounded-lg border border-[#334155] text-white hover:bg-[#1e293b] disabled:opacity-60",children:[s?n.jsx(gt,{className:"w-3.5 h-3.5 animate-spin"}):n.jsx(Et,{className:"w-3.5 h-3.5"}),e?"Replace logo":"Upload logo"]}),n.jsx("p",{className:"text-[11px] text-gray-500 mt-1.5",children:"PNG, JPG, SVG or WebP, under 5 MB. A square or wide logo on a transparent background looks best."}),n.jsx("input",{ref:o,type:"file",accept:"image/*",className:"hidden",onChange:d})]})]})}function il(e,t="Something went wrong. Please try again."){const r=String(e?.data??e?.message??""),a=r.match(/Uncaught Error: ([^\n]+)/);return a?a[1].replace(/\s+at .*$/,""):r&&r.length<200?r:t}function FM(e,t){return t.status==="active"?{label:"Live",tone:"live",detail:e==="academy"?"Your academy is listed in the academy directory at vettoleo.com/certified.":"Your school and degree programs are listed at vettoleo.com/education."}:t.status==="suspended"?{label:"Not listed",tone:"off",detail:e==="college"&&t.paymentStatus==="canceled"?"Your $47/yr subscription ended, so the listing was taken down. Renew from Billing to relist.":"This listing is not public right now. Email [email protected] if you think that's a mistake."}:e==="academy"?{label:"In review",tone:"waiting",detail:"We're verifying your POST approval. That usually takes one to two business days, and we'll email you when the listing goes live."}:t.paymentStatus!=="paid"&&t.paymentStatus!=="comped"?{label:"Payment needed",tone:"action",detail:"Your listing goes public once the $47/year listing fee is paid."}:{label:"In review",tone:"waiting",detail:"Payment received. Your login email isn't a .edu address, so our team confirms the school before the listing goes live. We'll email you when it does."}}const BM={live:{bg:"rgba(34,197,94,0.12)",fg:"#22c55e"},waiting:{bg:"rgba(245,158,11,0.12)",fg:"#f59e0b"},action:{bg:"rgba(0,180,255,0.12)",fg:"#00b4ff"},off:{bg:"rgba(239,68,68,0.12)",fg:"#ef4444"}};function UM(e,t){return`${Sce}?client_reference_id=${e._id}&prefilled_email=${encodeURIComponent(t)}`}const Lce={"/education/dashboard":"Dashboard","/education/profile":"Listing Details","/education/programs":"Degree Programs","/education/billing":"Billing"};function Ice(){return n.jsxs("div",{className:"min-h-screen p-6 space-y-4",style:{background:"#0a0e17"},children:[n.jsx(Je,{className:"h-8 w-48"}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[n.jsx(Je,{className:"h-32 rounded-lg"}),n.jsx(Je,{className:"h-32 rounded-lg"}),n.jsx(Je,{className:"h-32 rounded-lg"})]})]})}function Rce(){const{isAuthenticated:e,isLoading:t}=Vn();return t?n.jsx(Ice,{}):e?n.jsx(Yr,{}):n.jsx(Mt,{to:"/education/login",replace:!0})}
235function Dce(){const e=ai(),t=ar(),{signOut:r}=rs(),a=ie(F.education.getMyListing),s=ie(F.education.getMyAccount),i=a?.kind==="college",o=[{label:"Dashboard",path:"/education/dashboard",icon:qC,show:!0},{label:"Listing Details",path:"/education/profile",icon:i?oI:ja,show:!!a},{label:"Degree Programs",path:"/education/programs",icon:KC,show:i},{label:"Billing",path:"/education/billing",icon:It,show:i}].filter(u=>u.show),c=a?.listing?.name,d=a?.listing?.logoUrl;return n.jsxs(di,{children:[n.jsxs(hi,{className:"border-b border-sidebar-border px-4 py-4",children:[n.jsx(ye,{to:"/education/dashboard",className:"flex items-center gap-3",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"h-10"})}),n.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[1.5px] mt-2",style:{color:We},children:"Education Portal"})]}),n.jsxs(mi,{children:[n.jsxs(es,{children:[n.jsx(Zs,{className:"text-xs uppercase tracking-wider text-gray-500",children:a?.kind==="academy"?"Academy":a?.kind==="college"?"College / University":"Get Started"}),n.jsx(ts,{children:n.jsx(On,{children:o.map(u=>n.jsx(ln,{children:n.jsx(Un,{asChild:!0,isActive:e.pathname===u.path,children:n.jsxs(ye,{to:u.path,className:"flex items-center gap-3",children:[n.jsx(u.icon,{className:"w-4 h-4"}),n.jsx("span",{children:u.label})]})})},u.path))})})]}),n.jsxs(es,{children:[n.jsx(Zs,{className:"text-xs uppercase tracking-wider text-gray-500",children:"Public Pages"}),n.jsx(ts,{children:n.jsxs(On,{children:[n.jsx(ln,{children:n.jsx(Un,{asChild:!0,children:n.jsxs("a",{href:"/education",className:"flex items-center gap-3",children:[n.jsx(pn,{className:"w-4 h-4"}),n.jsx("span",{children:"Education Directory"})]})})}),n.jsx(ln,{children:n.jsx(Un,{asChild:!0,children:n.jsxs("a",{href:"/certified",className:"flex items-center gap-3",children:[n.jsx(ja,{className:"w-4 h-4"}),n.jsx("span",{children:"Academy Directory"})]})})})]})})]})]}),n.jsx(fi,{className:"border-t border-sidebar-border pb-4 pt-4",children:n.jsxs(On,{className:"space-y-3",children:[n.jsx(ln,{children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-1",children:[d?n.jsx("img",{src:d,alt:"",className:"w-8 h-8 rounded-md object-contain bg-[#1e293b]"}):n.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{background:`${We}22`},children:n.jsx(pn,{className:"w-4 h-4",style:{color:We}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:c||s?.name||"Your institution"}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s?.email})]})]})}),n.jsx(ln,{children:n.jsxs(Un,{onClick:async()=>{await r(),t("/education/login",{replace:!0})},className:"text-red-400 hover:text-red-300",children:[n.jsx(tf,{className:"w-4 h-4"}),n.jsx("span",{children:"Sign Out"})]})})]})})]})}function $ce(){gf();const e=ai(),t=Lce[e.pathname]||"Education Portal";return n.jsxs(ci,{children:[n.jsx(Dce,{}),n.jsxs(ui,{children:[n.jsxs("header",{className:"flex h-14 items-center gap-2 border-b px-4",children:[n.jsx(Xc,{className:"-ml-1"}),n.jsx(Zh,{orientation:"vertical",className:"mr-2 h-4"}),n.jsx("h1",{className:"text-sm font-semibold",children:t})]}),n.jsx("main",{className:"flex-1 p-4 lg:p-6",children:n.jsx(Yr,{})})]})]})}const zM="vtl_edu_type";function Fce(e){try{e&&sessionStorage.setItem(zM,e)}catch{}}function WM(){try{const e=sessionStorage.getItem(zM);return e==="academy"||e==="college"?e:null}catch{return null}}function Bce({value:e,onChange:t}){const r=[{id:"academy",title:"POST-approved academy",price:"Free",note:"Law enforcement training academies approved by a state POST",Icon:ja},{id:"college",title:"College or university",price:"$47 / year",note:"List your school and its degree programs for veterans",Icon:pn}];return n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:r.map(a=>{const s=e===a.id;return n.jsxs("button",{type:"button",onClick:()=>t(a.id),className:"text-left rounded-xl p-4 border transition-colors relative",style:{background:s?"rgba(212,168,67,0.08)":"#0d1117",borderColor:s?We:"#1e293b"},children:[s&&n.jsx("span",{className:"absolute top-3 right-3 w-5 h-5 rounded-full flex items-center justify-center",style:{background:We},children:n.jsx(xn,{className:"w-3 h-3 text-black"})}),n.jsx(a.Icon,{className:"w-5 h-5 mb-2",style:{color:s?We:"#64748b"}}),n.jsx("div",{className:"text-sm font-semibold text-white pr-6",children:a.title}),n.jsx("div",{className:"text-xs font-bold mt-0.5",style:{color:We},children:a.price}),n.jsx("div",{className:"text-[11px] text-gray-500 mt-1 leading-snug",children:a.note})]},a.id)})})}function Uce(){return n.jsx("div",{className:"hidden lg:flex relative px-12 py-16 flex-col justify-center overflow-hidden",style:{background:"linear-gradient(135deg, #0a0e17 0%, #0f1729 50%, #0a1628 100%)"},children:n.jsxs("div",{className:"max-w-md mx-auto",children:[n.jsx("div",{className:"inline-flex items-center gap-2 rounded-full px-4 py-1.5 mb-5",style:{background:`${We}0a`,border:`1px solid ${We}25`},children:n.jsx("span",{className:"text-[11px] font-bold uppercase tracking-[1.5px]",style:{color:We},children:"Academies, Colleges and Universities"})}),n.jsxs("h1",{className:"text-3xl font-extrabold leading-tight mb-4",children:["Put your program in front of veterans ",n.jsx("span",{style:{color:We},children:"headed into law enforcement"})]}),n.jsx("p",{className:"text-sm leading-relaxed mb-8",style:{color:"#94a3b8"},children:"Veterans come to VET-TO-LEO to find agencies that are hiring. Many of them still need a POST academy, a degree, or both. Your listing shows up right where they're making that decision."}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"rounded-xl p-4 border",style:{background:"#111827",borderColor:"#1e293b"},children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(ja,{className:"w-4 h-4",style:{color:We}}),"POST-approved academies list free"]}),n.jsx("p",{className:"text-xs text-gray-500 mt-1.5 leading-relaxed",children:"Hours, length, tuition, start dates, self
235-sponsor and GI Bill status. We confirm POST approval before it goes live."})]}),n.jsxs("div",{className:"rounded-xl p-4 border",style:{background:"#111827",borderColor:"#1e293b"},children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(pn,{className:"w-4 h-4",style:{color:We}}),"Colleges and universities: $47 a year"]}),n.jsx("p",{className:"text-xs text-gray-500 mt-1.5 leading-relaxed",children:"Your school, veteran benefits, and every criminal justice or public safety degree you offer, on campus or online."})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 pt-2",children:[n.jsx(Ln,{className:"w-4 h-4 text-green-500"}),"Accounts need an official school or academy email. Personal addresses are not accepted."]})]})]})})}function qM({children:e}){return n.jsxs("div",{className:"min-h-screen grid grid-cols-1 lg:grid-cols-2",style:{background:"#060a13"},children:[n.jsx(Uce,{}),n.jsx("div",{className:"flex items-center justify-center px-5 py-12 lg:px-12",style:{background:"#0a0e17",borderLeft:"1px solid #1e293b"}
235,children:n.jsx("div",{className:"w-full max-w-md space-y-6",children:e})})]})}function zce({type:e}){const{signIn:t}=rs(),[r,a]=y.useState("form"),[s,i]=y.useState(""),[o,c]=y.useState(!1);return r==="form"?n.jsx(Ki,{variant:"elevated",children:n.jsx(Yi,{className:"pt-6",children:n.jsxs("form",{className:"space-y-4",onSubmit:async d=>{d.preventDefault(),i("");const u=new FormData(d.currentTarget),h=String(u.get("email")??"").trim().toLowerCase();if(u.set("email",h),!e){i("Choose an academy or college listing above.");return}if(kce(h)){i("Use your official school or academy email. Gmail, Yahoo, Outlook and other personal addresses are not accepted.");return}c(!0);try{await t("password",u),a({email:h})}catch{i("We couldn't create that account. If you already signed up with this email, sign in instead.")}finally{c(!1)}},children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{htmlFor:"edu-name",children:"Your name"}),n.jsx(Ee,{id:"edu-name",name:"name",type:"text",placeholder:"First and last name",autoComplete:"name",className:"h-11",required:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{htmlFor:"edu-email",children:"Official email"}),n.jsx(Ee,{id:"edu-email",name:"email",type:"email",placeholder:e==="academy"?"[email protected]":"[email protected]",autoComplete:"email",className:"h-11",required:!0}),n.jsx("p",{className:"text-xs text-muted-foreground",children:e==="college"?"A .edu address goes live as soon as payment clears. Other school domains are reviewed by our team first.":"Use the email domain of your academy, agency or college."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{htmlFor:"edu-password",children:"Password"}),n.jsx(Ee,{id:"edu-password",name:"password",type:"password",placeholder:"At least 8 characters",minLength:8,autoComplete:"new-password",className:"h-11",required:!0})]}),n.jsx("input",{name:"flow",value:"signUp",type:"hidden"}),s&&n.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:s}),n.jsxs(be,{type:"submit",className:"w-full h-11",disabled:o,children:[o&&n.jsx(gt,{className:"size-4 animate-spin"}),o?"Creating account...":"Create Account"]})]})})}):n.jsx(Ki,{variant:"elevated",children:n.jsxs(Yi,{className:"pt-6",children:[n.jsxs("div",{className:"text-center mb-6",children:[n.jsx("div",{className:"mx-auto size-12 rounded-full bg-primary flex items-center justify-center mb-4",children:n.jsx(Sn,{className:"size-6 text-primary-foreground"})}),n.jsx("h2",{className:"font-semibold text-lg",children:"Check your email"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent a 6-digit code to ",r.email]}),n.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Not there after a minute? Check spam or quarantine. Government and campus mail filters sometimes hold it."})]}),n.jsxs("form",{className:"space-y-4",onSubmit:async d=>{d.preventDefault(),i(""),c(!0);try{await t("password",new FormData(d.currentTarget))}catch{i("That code is invalid or expired. Please try again.")}finally{c(!1)}},children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(we,{htmlFor:"edu-code",children:"Verification code"}),n.jsx(Ee,{id:"edu-code",name:"code",type:"text",inputMode:"numeric",placeholder:"Enter code",autoComplete:"one-time-code",className:"h-11 text-center tracking-[0.5em] font-mono",required:!0})]}),n.jsx("input",{name:"flow",value:"email-verification",type:"hidden"}),n.jsx("input",{name:"email",value:r.email,type:"hidden"}),s&&n.jsx("p",{className:"text-sm text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:s}),n.jsxs(be,{type:"submit",className:"w-full h-11",disabled:o,children:[o&&n.jsx(gt,{className:"size-4 animate-spin"}),o?"Verifying...":"Verify Email"]}),n.jsxs(be,{type:"button",variant:"ghost",className:"w-full",onClick:()=>a("form"),children:[n.jsx(Zr,{className:"size-4"}),"Back"]})]})]})})}function Wce(){const[e]=$c(),t=ar(),{isAuthenticated:r,isLoading:a}=Vn(),s=e.get("type"),[i,o]=y.useState(s==="academy"||s==="college"?s:WM());return y.useEffect(()=>{Fce(i)},[i]),y.useEffect(()=>{!a&&r&&t(`/education/dashboard${i?`?type=${i}`:""}`,{replace:!0})},[r,a,t,i]),n.jsxs(qM,{children:[n.jsxs("div",{className:"text-center",children:[n.jsx(ye,{to:"/education",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"
235VET-TO-LEO",className:"h-14 mx-auto mb-4"})}),n.jsx("h2",{className:"text-2xl font-bold text-white",children:"List Your Program"}),n.jsx("p",{className:"text-sm mt-1",style:{color:"#64748b"},children:"Create your education portal account"})]}),n.jsx(Bce,{value:i,onChange:o}),n.jsx(zce,{type:i}),n.jsxs("p",{className:"text-center text-sm text-gray-500",children:["Already have an account?"," ",n.jsx(ye,{to:"/education/login",className:"font-medium underline",style:{color:We},children:"Sign in"})]})]})}function qce(){const e=ar(),{isAuthenticated:t,isLoading:r}=Vn();return y.useEffect(()=>{!r&&t&&e("/education/dashboard",{replace:!0})},[t,r,e]),n.jsxs(qM,{children:[n.jsxs("div",{className:"text-center",children:[n.jsx(ye,{to:"/education",children:n.jsx("img",{src:"/vettoleo-logo.png",alt:"VET-TO-LEO",className:"h-14 mx-auto mb-4"})}),n.jsx("h2",{className:"text-2xl font-bold text-white",children:"Education Portal Sign In"}),n.jsx("p",{className:"text-sm mt-1",style:{color:"#64748b"},children:"For academies, colleges and universities"})]}),n.jsx(g0,{onAuthenticated:()=>e("/education/dashboard",{replace:!0})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}}),n.jsx("span",{className:"text-[11px] uppercase tracking-wider",style:{color:"#475569"},children:"New here?"}),n.jsx("div",{className:"flex-1 h-px",style:{background:"#1e293b"}})]}),n.jsx(be,{variant:"outline",className:"w-full h-11",style:{border:`1px solid ${We}30`,color:We,background:"transparent",borderRadius:10,fontSize:13,fontWeight:600},asChild:!0,children:n.jsx(ye,{to:"/education/signup",children:"Create an academy or college account"})}),n.jsxs("p",{className:"text-center text-xs",style:{color:"#475569"},children:["Law enforcement agency? ",n.jsx(ye,{to:"/login",style:{color:_ce},children:"Agency sign in"})]})]})}function Vce({onPick:e}){return n.jsxs("div",{className:"max-w-3xl space-y-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"What would you like to list?"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Pick one. Each account holds one listing."})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("button",{type:"button",onClick:()=>e("academy"),className:"text-left rounded-xl p-6 border border-[#1e293b] bg-[#111827] hover:border-[#d4a843]/60 transition-colors",children:[n.jsx(ja,{className:"w-7 h-7 mb-3",style:{color:We}}),n.jsx("div",{className:"text-lg font-bold text-white",children:"Law Enforcement Academy"}),n.jsx("div",{className:"text-sm font-bold mt-1",style:{color:We},children:"Free"}),n.jsx("p",{className:"text-sm text-gray-400 mt-3 leading-relaxed",children:"For academies approved by a state POST or standards board. We verify approval, then list you in the academy directory."})]}),n.jsxs("button",{type:"button",onClick:()=>e("college"),className:"text-left rounded-xl p-6 border border-[#1e293b] bg-[#111827] hover:border-[#d4a843]/60 transition-colors",children:[n.jsx(pn,{className:"w-7 h-7 mb-3",style:{color:We}}),n.jsx("div",{className:"text-lg font-bold text-white",children:"College or University"}),n.jsx("div",{className:"text-sm font-bold mt-1",style:{color:We},children:"$47 / year"}),n.jsx("p",{className:"text-sm text-gray-400 mt-3 leading-relaxed",children:"List your school, veteran benefits and degree programs in criminal justice, public safety and related fields."})]})]})]})}function Hce({contactName:e,onBack:t}){const r=te(F.education.createAcademyListing),[a,s]=y.useState(()=>LM(null,e)),[i,o]=y.useState(!1),[c,d]=y.useState(!1),u=h=>s(m=>({...m,...h}));return n.jsxs("form",{className:"max-w-3xl space-y-5",onSubmit:async h=>{if(h.preventDefault(),!i)return W.error("Please confirm the academy is POST approved.");d(!0);try{const m=um(a);await r({...m,postAgency:a.postAgency.trim(),confirmPostApproved:i}),W.success("Academy submitted for review")}catch(m){W.error(il(m))}finally{d(!1)}},children:[n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:t,className:"text-xs text-gray-500 hover:text-white",children:"â Change listing type"}),n.jsx("h2",{className:"text-2xl font-bold text-white mt-2",children:"List your academy"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Free for POST-approved academies. You can edit all of this later."})]}
235),n.jsx(DM,{form:a,set:u,showConfirm:!0,confirmed:i,setConfirmed:o}),n.jsxs("button",{type:"submit",disabled:c,className:"inline-flex items-center gap-2 px-6 h-11 rounded-full text-sm font-bold text-black disabled:opacity-60",style:{background:We},children:[c&&n.jsx(gt,{className:"w-4 h-4 animate-spin"}),"Submit for review"]})]})}function Gce({contactName:e,onBack:t}){const r=te(F.education.createCollegeListing),a=ar(),[s,i]=y.useState(()=>IM(null,e)),[o,c]=y.useState(!1),d=u=>i(h=>({...h,...u}));return n.jsxs("form",{className:"max-w-3xl space-y-5",onSubmit:async u=>{u.preventDefault(),c(!0);try{await r(um(s)),W.success("School saved. Now add your degree programs."),a("/education/programs")}catch(h){W.error(il(h))}finally{c(!1)}},children:[n.jsxs("div",{children:[n.jsx("button",{type:"button",onClick:t,className:"text-xs text-gray-500 hover:text-white",children:"â Change listing type"}),n.jsx("h2",{className:"text-2xl font-bold text-white mt-2",children:"List your college or university"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Next you'll add degree programs, then activate the $47/year listing."})]}),n.jsx($M,{form:s,set:d}),n.jsxs("button",{type:"submit",disabled:o,className:"inline-flex items-center gap-2 px-6 h-11 rounded-full text-sm font-bold text-black disabled:opacity-60",style:{background:We},children:[o&&n.jsx(gt,{className:"w-4 h-4 animate-spin"}),"Save and add programs"]})]})}function Fa({done:e,title:t,children:r,to:a,cta:s}){return n.jsxs("div",{className:"flex items-start gap-3 py-3 border-b border-[#1e293b] last:border-0",children:[e?n.jsx(gn,{className:"w-5 h-5 text-green-500 shrink-0 mt-0.5"}):n.jsx(fL,{className:"w-5 h-5 text-gray-600 shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`text-sm font-medium ${e?"text-gray-400":"text-white"}`,children:t}),r&&n.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:r})]}),!e&&a&&n.jsxs(ye,{to:a,className:"text-xs font-semibold shrink-0 inline-flex items-center gap-1",style:{color:We},children:[s??"Open"," ",n.jsx(Bc,{className:"w-3 h-3"})]})]})}function Kce({kind:e,listing:t,email:r,justPaid:a}){const s=FM(e,t),i=BM[s.tone],o=t.degreePrograms??[],c=t.paymentStatus==="paid"||t.paymentStatus==="comped",d=e==="academy"?"/certified":"/education";return n.jsxs("div",{className:"max-w-4xl space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 rounded-xl flex items-center justify-center overflow-hidden shrink-0",style:{background:"#1e293b"},children:t.logoUrl?n.jsx("img",{src:t.logoUrl,alt:"",className:"w-14 h-14 object-contain"}):e==="academy"?n.jsx(ja,{className:"w-7 h-7",style:{color:We}}):n.jsx(pn,{className:"w-7 h-7",style:{color:We}})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h2",{className:"text-2xl font-bold text-white break-words",children:t.name}),n.jsxs("p",{className:"text-sm text-gray-500",children:[[t.city,t.state].filter(Boolean).join(", ")," · ",e==="academy"?"Law Enforcement Academy":"College / University"]})]}),n.jsx("span",{className:"self-start sm:self-center text-xs font-bold px-3 py-1.5 rounded-full",style:{background:i.bg,color:i.fg},children:s.label})]}),a&&!c&&n.jsxs("div",{className:"rounded-xl p-4 border flex items-center gap-3",style:{background:"rgba(34,197,94,0.06)",borderColor:"rgba(34,197,94,0.3)"},children:[n.jsx(gt,{className:"w-4 h-4 animate-spin text-green-500"}),n.jsx("p",{className:"text-sm text-gray-300",children:"Thanks! Stripe is confirming your payment. This page updates on its own in a few seconds."})]}),a&&c&&n.jsxs("div",{className:"rounded-xl p-4 border flex items-center gap-3",style:{background:"rgba(34,197,94,0.06)",borderColor:"rgba(34,197,94,0.3)"},children:[n.jsx(GL,{className:"w-4 h-4 text-green-500"}),n.jsx("p",{className:"text-sm text-gray-300",children:"Payment received. Thank you for supporting veterans moving into law enforcement."})]}),n.jsxs("div",{className:"rounded-xl p-5 border",style:{background:"#111827",borderColor:"#1e293b"},children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider mb-1",style:{color:i.fg},children:"Listing status"}),n.jsx("p",{className:"text-sm text-gray-300 leading-relaxed",children:s.detail}),n.jsxs("div",{className:"flex flex-wrap gap-3 mt-4",children:[s.tone==="action"&&n.jsxs("a",{href:UM(t,r),className:"inline-flex items-center gap-2 px-5 h-10 rounded-full text-sm font-bold text-black",style:{background:We},children:[n.jsx(It,{className:"w-4 h-4"})," Pay $47 / year"]}),t.status==="active"&&n.jsxs("a",{href:d,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 px-5 h-10 rounded-full text-sm font-semibold border border-[#334155] text-white hover:bg-[#1e293b]",children:["View public listing ",n.jsx(nn,{className:"w-3.5 h-3.5"})]})]})]}),n.jsxs("div",{className:"rounded-xl p-5 border",style:{background:"#111827",borderColor:"#1e293b"},children:[n.jsx("h3",{className:"text-base font-bold text-white mb-1",children:"Make the listing count"}),n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Veterans compare schools side by side. Complete listings get the clicks."}),n.jsx(Fa,{done:!!t.logoUrl,title:"Upload your logo",to:"/education/profile",cta:"Add logo"}),n.jsx(Fa,{done:!!t.description&&t.description.length>80,title:"Write a short description",to:"/education/profile",cta:"Edit",children:"A few sentences on who you serve and why veterans do well in y
235our program."}),e==="academy"?n.jsxs(n.Fragment,{children:[n.jsx(Fa,{done:!!t.postAgency,title:"POST approval details",to:"/education/profile",cta:"Edit",children:t.postAgency?`${t.postAgency}${t.postCertNumber?`, #${t.postCertNumber}`:""}`:void 0}),n.jsx(Fa,{done:!!(t.programHours&&t.programWeeks),title:"Program hours and length",to:"/education/profile",cta:"Edit"}),n.jsx(Fa,{done:!!t.nextStartDate,title:"Next class start date",to:"/education/profile",cta:"Edit"})]}):n.jsxs(n.Fragment,{children:[n.jsx(Fa,{done:o.length>0,title:"Add your degree programs",to:"/education/programs",cta:"Add programs",children:o.length>0?`${o.length} program${o.length===1?"":"s"} listed`:"Criminal justice, public safety, emergency management, cybersecurity and similar."}),n.jsx(Fa,{done:!!(t.giBillApproved||t.yellowRibbon||t.militaryCredit),title:"Veteran benefits",to:"/education/profile",cta:"Edit"}),n.jsx(Fa,{done:c,title:"Activate the $47/year listing",to:"/education/billing",cta:"Billing"})]})]}),e==="college"&&n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsxs(ye,{to:"/education/programs",className:"group rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155]",children:[n.jsx(KC,{className:"w-5 h-5 mb-3",style:{color:We}}),n.jsx("div",{className:"text-2xl font-bold text-white",children:o.length}),n.jsx("div",{className:"text-sm text-gray-500",children:"Degree programs listed"})]}),n.jsxs(ye,{to:"/education/billing",className:"group rounded-xl border border-[#1e293b] bg-[#0d1117] p-5 hover:border-[#334155]",children:[n.jsx(It,{className:"w-5 h-5 mb-3",style:{color:We}}),n.jsx("div",{className:"text-2xl font-bold text-white",children:c?t.paymentStatus==="comped"?"Comped":"Paid":"Unpaid"}),n.jsx("div",{className:"text-sm text-gray-500",children:"$47 / year listing"})]})]})]})}function Yce(){const[e]=$c(),t=ie(F.education.getMyListing),r=ie(F.education.getMyAccount),a=e.get("type"),[s,i]=y.useState(a==="academy"||a==="college"?a:WM());if(t===void 0||r===void 0)return n.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[n.jsx(gt,{className:"w-4 h-4 animate-spin"})," Loading..."]});if(t)return n.jsx(Kce,{kind:t.kind,listing:t.listing,email:r?.email??"",justPaid:e.get("paid")==="1"});if(r?.isPersonalEmail)return n.jsxs("div",{className:"max-w-xl rounded-xl p-6 border",style:{background:"#111827",borderColor:"#1e293b"},children:[n.jsx("h2",{className:"text-lg font-bold text-white",children:"An official email is required"}),n.jsxs("p",{className:"text-sm text-gray-400 mt-2 leading-relaxed",children:["You're signed in as ",r.email,". Academy and college listings need an account on your school or academy email domain, so sign out and create one with that address."]})]});const o=r?.name??"";return s==="academy"?n.jsx(Hce,{contactName:o,onBack:()=>i(null)}):s==="college"?n.jsx(Gce,{contactName:o,onBack:()=>i(null)}):n.jsx(Vce,{onPick:i})}function _j(){return n.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[n.jsx(gt,{className:"w-4 h-4 animate-spin"})," Loading..."]})}function Sj({saving:e,label:t="Save changes"}){return n.jsxs("button",{type:"submit",disabled:e,className:"inline-flex items-center gap-2 px-6 h-11 rounded-full text-sm font-bold text-black disabled:opacity-60",style:{background:We},children:[e&&n.jsx(gt,{className:"w-4 h-4 animate-spin"}),t]})}function Zce({listing:e}){const t=te(F.education.updateMyAcademy),[r,a]=y.useState(()=>LM(e)),[s,i]=y.useState(!1),o=c=>a(d=>({...d,...c}));return n.jsxs("form",{className:"space-y-5",onSubmit:async c=>{c.preventDefault(),i(!0);try{const d={...um(r)};for(const u of Object.keys(r))u in d||(d[u]="");await t(d),W.success("Saved")}catch(d){W.error(il(d))}finally{i(!1)}},children:[n.jsx(DM,{form:r,set:o}),n.jsx(Sj,{saving:s})]})}function Xce({listing:e}){const t=te(F.education.updateMyCollege),[r,a]=y.useState(()=>IM(e)),[s,i]=y.useState(!1),o=c=>a(d=>({...d,...c}));return n.jsxs("form",{className:"space-y-5",onSubmit:async c=>{c.preventDefault(),i(!0);try{const d={...um(r)};for(const u of Object.keys(r))u in d||(d[u]="");await t(d),W.success("Saved")}catch(d){W.error(il(d))}finally{i(!1)}},children:[n.jsx($M,{form:r,set:o}),n.jsx(Sj,{saving:s})]})}
235function Jce(){const e=ie(F.education.getMyListing);return e===void 0?n.jsx(_j,{}):e===null?n.jsx(Mt,{to:"/education/dashboard",replace:!0}):n.jsxs("div",{className:"max-w-3xl space-y-5",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"Listing details"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Changes show on your public listing right away."})]}),n.jsx(Va,{title:"Logo",children:n.jsx(Mce,{logoUrl:e.listing.logoUrl,kind:e.kind})}),e.kind==="academy"?n.jsx(Zce,{listing:e.listing},e.listing._id):n.jsx(Xce,{listing:e.listing},e.listing._id)]})}const Qce={name:"",level:"Bachelor's",format:"On campus",length:"",url:"",description:""};function ede({initial:e,onClose:t}){const r=te(F.education.saveDegreeProgram),[a,s]=y.useState(e),[i,o]=y.useState(!1),c=d=>s(u=>({...u,...d}));return y.useEffect(()=>{const d=u=>{u.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t]),n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",children:n.jsxs("form",{className:"w-full max-w-lg rounded-2xl border border-[#1e293b] bg-[#111827] max-h-[90vh] overflow-y-auto",onSubmit:async d=>{d.preventDefault(),o(!0);try{await r({id:a.id,name:a.name,level:a.level,format:a.format,length:a.length||void 0,url:a.url||void 0,description:a.description||void 0}),W.success(a.id?"Program updated":"Program added"),t()}catch(u){W.error(il(u))}finally{o(!1)}},children:[n.jsxs("div",{className:"flex items-center justify-between p-5 border-b border-[#1e293b]",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:a.id?"Edit program":"Add a degree program"}),n.jsx("button",{type:"button",onClick:t,className:"text-gray-500 hover:text-white",children:n.jsx(Me,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"p-5 space-y-4",children:[n.jsx(Ct,{label:"Program name",required:!0,value:a.name,onChange:d=>c({name:d}),placeholder:"e.g. B.S. Criminal Justice",maxLength:160}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[n.jsx(Lc,{label:"Degree level",required:!0,value:a.level,onChange:d=>c({level:d}),options:Pce}),n.jsx(Lc,{label:"Format",required:!0,value:a.format,onChange:d=>c({format:d}),options:Tce})]}),n.jsx(Ct,{label:"Length",value:a.length,onChange:d=>c({length:d}),placeholder:"e.g. 120 credits, about 4 years"}),n.jsx(Ct,{label:"Program page link",value:a.url,onChange:d=>c({url:d}),placeholder:"https://"}),n.jsx(Kh,{label:"Short description",value:a.description,onChange:d=>c({description:d}),rows:3,placeholder:"What the program covers and how it lines up with a law enforcement career."})]}),n.jsxs("div",{className:"flex gap-3 p-5 border-t border-[#1e293b]",children:[n.jsx(Sj,{saving:i,label:a.id?"Save program":"Add program"}),n.jsx("button",{type:"button",onClick:t,className:"px-5 h-11 rounded-full text-sm text-gray-400 border border-[#1e293b] hover:bg-[#1e293b]",children:"Cancel"})]})]})})}function tde(){const e=ie(F.education.getMyListing),t=te(F.education.deleteDegreeProgram),[r,a]=y.useState(null);if(e===void 0)return n.jsx(_j,{});if(e===null||e.kind!=="college")return n.jsx(Mt,{to:"/education/dashboard",replace:!0});const s=e.listing.degreePrograms??[];return n.jsxs("div",{className:"max-w-4xl space-y-5",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"Degree programs"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"List the degrees and certificates that lead into law enforcement and public safety careers."})]}),n.jsxs("button",{type:"button",onClick:()=>a({...Qce}),className:"inline-flex items-center gap-2 px-5 h-10 rounded-full text-sm font-bold text-black self-start",style:{background:We},children:[n.jsx(pt,{className:"w-4 h-4"})," Add program"]})]}),s.length===0?n.jsxs("div",{className:"rounded-xl border border-dashed border-[#334155] p-10 text-center",children:[n.jsx("p",{className:"text-white font-semibold",children:"No programs yet"}),n.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Start with your main criminal justice degree. Veterans filter by level and online or on-campus, so fill those in."})]}):n.jsx("div",{className:"space-y-3",children:s.map(i=>n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-4 flex flex-col sm:flex-row sm:items-start gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm font-semibold text-white break-words",children:i.name}),n.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[n.jsx("span",{className:"text-[11px] px-2.5 py-0.5 rounded-md bg-[#1e293b] text-[#00b4ff]",children:i.level}),n.jsx("span",{className:"text-[11px] px-2.5 py-0.5 rounded-md bg-[#1e293b] text-gray-300",children:i.format}),i.length&&n.jsx("span",{className:"text-[11px] px-2.5 py-0.5 rounded-md bg-[#1e293b] text-gray-400",children:i.length})]}),i.description&&n.jsx("p",{className:"text-xs text-gray-400 mt-2 leading-relaxed break-words",children:i.description}),i.url&&n.jsxs("a",{href:i.url,target:"_blank",rel:"noreferrer",className:"text-xs mt-2 inline-flex items-center gap-1 break-all",style:{color:We},children:[i.url," ",n.jsx(nn,{className:"w-3 h-3 shrink-0"})]})]}),n.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.jsx("button",{type:"button",onClick:()=>a({id:i.id,name:i.name,level:i.level,format:i.format,length:i.length??"",url:i.url??"",description:i.description??""}),className:"p-2 rounded-lg border border-[#1e293b] text-gray-400 hover:text-white","aria-label":"Edit program",children:n.jsx(qt,{className:"w-4 h-4"})}),n.jsx("button",{type:"button",onClick:async()=>
235{if(window.confirm(`Remove "${i.name}"?`))try{await t({id:i.id}),W.success("Program removed")}catch(o){W.error(il(o))}},className:"p-2 rounded-lg border border-[#1e293b] text-gray-400 hover:text-red-400","aria-label":"Remove program",children:n.jsx(_n,{className:"w-4 h-4"})})]})]},i.id))}),r&&n.jsx(ede,{initial:r,onClose:()=>a(null)})]})}function nde(){const e=ie(F.education.getMyListing),t=ie(F.education.getMyAccount);if(e===void 0||t===void 0)return n.jsx(_j,{});if(e===null||e.kind!=="college")return n.jsx(Mt,{to:"/education/dashboard",replace:!0});const r=e.listing,a=FM("college",r),s=BM[a.tone],i=r.paymentStatus==="paid"||r.paymentStatus==="comped",o=!i||r.paymentStatus==="canceled";return n.jsxs("div",{className:"max-w-2xl space-y-5",children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"Billing"}),n.jsxs("div",{className:"rounded-xl border border-[#1e293b] bg-[#111827] p-6",children:[n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-gray-500",children:"Plan"}),n.jsx("div",{className:"text-lg font-bold text-white mt-1",children:"College / University Listing"}),n.jsx("div",{className:"text-sm mt-0.5",style:{color:We},children:"$47 per year"})]}),n.jsx("span",{className:"text-xs font-bold px-3 py-1.5 rounded-full",style:{background:s.bg,color:s.fg},children:r.paymentStatus==="comped"?"Comped":i?"Paid":r.paymentStatus==="canceled"?"Canceled":"Unpaid"})]}),n.jsxs("ul",{className:"mt-5 space-y-1.5 text-sm text-gray-400",children:[n.jsx("li",{children:"Your school on the vettoleo.com/education directory"}),n.jsx("li",{children:"Up to 40 degree programs with level, format and links"}),n.jsx("li",{children:"GI Bill, Yellow Ribbon and military credit badges"})]}),r.paidAt&&n.jsxs("p",{className:"text-xs text-gray-500 mt-5",children:["Last payment ",new Date(r.paidAt).toLocaleDateString(),". Renews automatically each year through Stripe."]}),o&&n.jsxs("a",{href:UM(r,t?.email??r.email),className:"mt-6 inline-flex items-center gap-2 px-6 h-11 rounded-full text-sm font-bold text-black",style:{background:We},children:[n.jsx(It,{className:"w-4 h-4"})," ",r.paymentStatus==="canceled"?"Renew for $47 / year":"Pay $47 / year"]}),o&&n.jsx("p",{className:"text-[11px] text-gray-500 mt-2",children:"Secure checkout by Stripe. You'll come back here when it's done."})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["Need a receipt, a W-9, or to cancel? Email ",n.jsx("a",{href:"mailto:[email protected]",style:{color:We},children:"[email protected]"}),"."]})]})}function rde(){return n.jsxs(m9,{children:[n.jsxs(he,{element:n.jsx(W9,{}),children:[n.jsx(he,{path:"/",element:n.jsx(MF,{})}),n.jsx(he,{path:"/mission",element:n.jsx(A9,{})}),n.jsx(he,{path:"/become-a-sponsor",element:n.jsx(Mt,{to:"/mission#sponsor-signup",replace:!0})}),n.jsx(he,{path:"/company",element:n.jsx(k9,{})}),n.jsx(he,{path:"/qa",element:n.jsx(P9,{})}),n.jsx(he,{path:"/agencies",element:n.jsx(T9,{})}),n.jsx(he,{path:"/agencies/:slug",element:n.jsx(O9,{})}),n.jsx(he,{path:"/active-recruiters",element:n.jsx(E9,{})}),n.jsx(he,{path:"/openings",element:n.jsx(M9,{})}),n.jsx(he,{path:"/certified",element:n.jsx(L9,{})}),n.jsx(he,{path:"/education",element:n.jsx(I9,{})}),n.jsx(he,{path:"/terms",element:n.jsx(R9,{})}),n.jsx(he,{path:"/privacy",element:n.jsx(D9,{})}),n.jsx(he,{path:"/cookies",element:n.jsx($9,{})}),n.jsx(he,{path:"/acceptable-use",element:n.jsx(F9,{})}),n.jsx(he,{path:"/disclaimer",element:n.jsx(B9,{})}),n.jsx(he,{path:"/service-agreement",element:n.jsx(U9,{})}),n.jsx(he,{path:"/thank-you",element:n.jsx(z9,{})}),n.jsx(he,{path:"/confirmation-welcome-to-vettoleo-user-id-ia7k36uz",element:n.jsx(Mt,{to:"/thank-you",replace:!0})})]}),n.jsxs(he,{element:n.jsx(_F,{}),children:[n.jsx(he,{path:"/welcome",element:n.jsx(zF,{})}),n.jsxs(he,{element:n.jsx(CF,{}),children:[n.jsx(he,{path:"/login",element:n.jsx(GF,{})}),n.jsx(he,{path:"/signup",element:n.jsx(KF,{})})]})]}),n.jsx(he,{path:j0,element:n.jsx(Qle,{})}),n.jsx(he,{path:"/admin/login",element:n.jsx($W,{})}),n.jsx(he,{path:"/vet/login",element:n.jsx(q9,{})}),n.jsx(he,{path:"/vet/signup",element:n.jsx(V9,{})}),n.jsx(he,{path:"/vet/onboarding",element:n.jsx(Nce,{})}),n.jsx(he,{path:"/education/login",element:n.jsx(qce,{})}),n.jsx(he,{path:"/education/signup",element:n.jsx(Wce,{})}),n.jsx(he,{element:n.jsx(Rce,{}),children:n.jsxs(he,{element:n.jsx($ce,{}),children:[n.jsx(he,{path:"/education/dashboard",element:n.jsx(Yce,{})}),n.jsx(he,{path:"/education/profile",element:n.jsx(Jce,{})}),n.jsx(he,{path:"/education/programs",element:n.jsx(tde,{})}),n.jsx(he,{path:"/education/billing",element:n.jsx(nde,{})})]})}),n.jsx(he,{element:n.jsx(ace,{}),children:n.jsxs(he,{element:n.jsx(rce,{}),children:[n.jsx(he,{path:"/vet/dashboard",element:n.jsx(ice,{})}),n.jsx(he,{path:"/vet/profile",element:n.jsx(hce,{})}),n.jsx(he,{path:"/vet/jobs",element:n.jsx(pce,{})}),n.jsx(he,{path:"/vet/saved",element:n.jsx(gce,{})}),n.jsx(he,{path:"/vet/messages",element:n.jsx(jce,{})})]})}),n.jsx(he,{element:n.jsx(jF,{}),children:n.jsxs(he,{element:n.jsx(vF,{}),children:[n.jsx(he,{path:"/dashboard",element:n.jsx(wB,{})}),n.jsx(he,{path:"/profile",element:n.jsx(CU,{})}),n.jsx(he,{path:"/jobs",element:n.jsx(kU,{})}),n.jsx(he,{path:"/recruiters",element:n.jsx(LU,{})}),n.jsx(he,{path:"/analytics",element:n.jsx(TU,{})}),n.jsx(he,{path:"/leads",element:n.jsx(OU,{})}),n.jsx(he,{path:"/subscription",element:n.jsx(VU,{})}),n.jsx(he,{path:"/settings",element:n.jsx(IB,{})}),n.jsx(he,{path:"/messages",element:n.jsx(Zle,{})})]})}),n.jsx(he,{element:n.jsx(uF,{}),children:n.jsxs(he,{element:n.jsx(cF,{}),children:[n.jsx(he,{path:"/admin",element:n.jsx(ez,{})}),n.jsx(he,{path:"/admin/pending",element:n.jsx(nz,{})}),n.jsx(he,{path:"/admin/members",element:n.jsx(Bd,{filter:"members"})}),n.jsx(he,{path:"/admin/participating",element:n.jsx(Bd,{filter:"participating"})}),n.jsx(he,{path:"/admin/platinum",element:n.jsx(Bd,{filter:"platinum"})}),n.jsx(he,{path:"/admin/all-agencies",element:n.jsx(Bd,{filter:"all"})}),n.jsx(he,{path:"/admin/agency/:id",element:n.jsx(Ile,{})}),n.jsx(he,{path:"/admin/agency/:id/preview",element:n.jsx(Gle,{})}),n.jsx(he,{path:"/admin/veterans/pending",element:n.jsx(UW,{})}),n.jsx(he,{path:"/admin/veterans",element:n.jsx(VW,{})}),n.jsx(he,{path:"/admin/veteran/:id",element:n.jsx(YW,{})}),n.jsx(he,{path:"/admin/billing",element:n.jsx(QW,{})}),n.jsx(he,{path:"/admin/colleges",element:n.jsx(gp,{category:"colleges"})}),n.jsx(he,{path:"/admin/academies",element:n.jsx(gp,{category:"academies"})}),n.jsx(he,{path:"/admin/business",element:n.jsx(gp,{category:"business"})}),n.jsx(he,{path:"/admin/calendar",element:n.jsx(pq,{})}),n.jsx(he,{path:"/admin/jobs",element:n.jsx(yq,{})}),n.jsx(he,{path:"/admin/messages",element:n.jsx(Eq,{})}),n.jsx(he,{path:"/admin/carousel",element:n.jsx(xq,{})}),n.jsx(he,{path:"/admin/settings",element:n.jsx(dz,{})}),n.jsx(he,{path:"/admin/activity",element:n.jsx(PW,{})}),n.jsx(he,{path:"/admin/system-updates",element:n.jsx(DW,{})}),n.jsx(he,{path:"/admin/site-analytics",element:n.jsx(Cle,{})})]})}),n.jsx(he,{path:"*",element:n.jsx(Mt,{to:"/",replace:!0})})]})}function wde(){return n.jsxs(TF,{enabled:!0,children:[n.jsx(kF,{}),n.jsx(rde,{})]})}
235export{wde as AuthenticatedAppRoutes,rde as AuthenticatedRoutes};
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.