1import{c as cr,al as zt,am as Lj,an as Bf,ao as qf,ap as As,aq as Fj,D as Ge,a1 as ur,a2 as Xe,s as Y,r as S,u as G,j as a,C as K,d as H,m as Se,a as oe,b as le,x as Nd,I as ee,p as Vt,q as Kt,t as Gt,v as Ht,w as ve,B as F,E as He,f as qe,Z as me,X as Va,M as Tr,U as xt,g as Tt,P as Xr,ar as ke,as as ia,at as Zr,au as Ei,V as it,e as be,h as lt,i as ps,k as Bj,l as pv,L as q,S as yt,av as qt,a3 as he,aa as qj,ab as Uj,aw as Os,ax as De,ay as je,ai as k,az as Pe,H as mr,W as ut,aA as Ql,aB as dr,n as ji,aC as zj,aD as Wj,aE as Vj,aF as Ps,aG as ua,_ as _d,a8 as wi,a9 as Kj,z as Gj,a6 as Uf,y as gv,aH as zf,$ as Zn,a0 as Hj,aI as Wf,ac as Yj,ad as Xj,ae as Qj,af as Jj,a7 as Zj,o as e0,F as t0,N as Vf,Y as Kf,J as r0,aJ as n0,aj as a0,ak as i0}from"./index-DaxYHL_c.js";import{T as Ce}from"./textarea-ClQoQ89_.js";import{T as Ka,a as On,b as ge,c as ye}from"./tabs-T_RMNOoQ.js";import{B as ne}from"./badge-BgIO1kHT.js";import{A as da,a as fa,b as ma,c as ha,d as pa,e as ga,f as va,g as xa,h as $c}from"./alert-dialog-5io1GJXA.js";import{c as s0,i as Gf,G as vv,a as o0,b as l0,C as c0,T as u0}from"./useWishlistNotifications-BWolgjTJ.js";import{e as xv,d as d0,P as Tc,a as Mc,b as Dc,C as Hf,s as f0,i as m0,c as Ni}from"./popover-DQVhrFj0.js";import{D as Je,a as Ze,b as dt,c as ft,d as Ga,e as Lr,f as h0}from"./dialog-DeLki9hm.js";import{M as Mr}from"./message-square-CxfFIDVA.js";import{C as St}from"./clock-1P3HsIwi.js";import{C as yv}from"./circle-x-BKft3PDz.js";import{P as en}from"./progress-BDTKN3Dw.js";import{I as p0,a as g0}from"./ImageUpload-BUkA2O_m.js";import{G as v0}from"./GalleryImageUpload-CXvQWRmz.js";import{R as x0,P as y0,O as b0,C as j0}from"./index-DH87JRKS.js";import{B as kr}from"./building-2-BOtdQgRw.js";import{T as Qr}from"./tag-2KOo46Ep.js";import{I as sa}from"./images-DfmOqT0c.js";import{F as nt}from"./file-text-DzhWP4BB.js";import{c as w0,e as Ic,s as Ys,f as N0,g as _0,h as S0,i as A0,j as O0,k as P0,l as C0,m as k0,n as E0,o as $0,S as Yf,u as T0,p as M0,q as D0,r as I0}from"./useSupplierArticles-Dw4aPMX5.js";import{C as R0,B as L0}from"./circle-help-CB9aOH0Q.js";import{i as hn,a as F0,b as B0}from"./isBefore-Dj7M197n.js";import{E as br}from"./eye-BjgtwxLJ.js";import{T as _t}from"./trending-up-BbjbvywI.js";import{S as bt}from"./switch-KmY3AqC1.js";import{P as Rc}from"./percent-BKdBJY7j.js";import{P as q0}from"./pencil-ywXNjd7y.js";import{c as Gs,i as U0,P as Sd,S as z0,T as Xs,a as W0,L as Xf,b as Lc,d as bv,u as rl,e as V0,F as Qf,G as K0,f as G0,I as H0}from"./usePlanningData-D1c6S295.js";import{P as Qs,a as Y0}from"./plane-D3eULt9a.js";import{a as X0,b as Q0,c as J0,d as Z0,g as ew,e as tw}from"./useSupplierVideos-CnE3WP_L.js";import{V as Hr}from"./video-DEdiaA3R.js";import{L as jv}from"./link-Bc6AK5mt.js";import{U as Fc}from"./upload-C6fF1fIL.js";import{P as Ad}from"./play-tt2Ry16H.js";import{E as In}from"./external-link-KPfB8_RY.js";import{E as Bc}from"./eye-off-q_6WWv0e.js";import{S as rw}from"./square-pen-C_Od1meM.js";import{D as nw,T as wv,P as Cs}from"./trophy-B5hxm7_c.js";import{C as Mt}from"./copy-mfXluwzR.js";import{Q as Nv}from"./index-rWffNBm7.js";import{Q as _v}from"./qr-code-8yOhZHtp.js";import{S as aw}from"./smartphone-DFD4mi2y.js";import{C as xi}from"./checkbox-rvsf6R6_.js";import{C as Od}from"./circle-alert-BSao5Pkh.js";import{S as iw}from"./sun-D5diiv4l.js";import{G as Pd}from"./gift-BsS1q6zb.js";import{u as sw}from"./useReferralRewards-CqWadQOx.js";import{S as Rn}from"./save-495dEaF3.js";import{U as ow,F as lw,M as cw,C as uw}from"./utensils-BEBLmkxA.js";import{G as dw,S as fw,P as mw}from"./shirt-ByaXZFED.js";import{P as hw}from"./pen-tool-B8JFsyCp.js";import{L as Sv}from"./lock-DPqnL3Iu.js";import{Z as yi}from"./zap-DiFGlUZa.js";import{C as Av}from"./credit-card-BFfDOqb6.js";import{S as Jf}from"./skeleton-BhNP70EB.js";import{R as $i}from"./refresh-cw-BIXVFWoU.js";import{E as Ov,a as pw}from"./jspdf.plugin.autotable-CsP_YfzO.js";import{B as Js}from"./bell-CtIsCSxG.js";import{M as qc}from"./minus-BziT2x9T.js";import{T as Uc}from"./trending-down-DbIV-u_Z.js";import{I as Pv}
1from"./image-Dgq5GkHQ.js";import{P as Cv}from"./palette-BTazE1Oh.js";import{A as gw,a as vw}from"./alert-D4c6VO8E.js";import{E as kv}from"./Elite2027Announcement-vk5qrOp0.js";import{S as Zf}from"./stripeTiers-D6mjG3Ok.js";import{R as xw}from"./rotate-ccw-BhI4WsQ1.js";import{C as zc}from"./chart-column-DnpXP7-q.js";import"./avatar-CtqlEmcU.js";import"./shield-check-4NVZlJnT.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Ev=cr("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const $v=cr("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 12 * @license lucide-react v0.462.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const yw=cr("CalendarCheck",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/** 17 * @license lucide-react v0.462.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const bw=cr("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 22 * @license lucide-react v0.462.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const jw=cr("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** 27 * @license lucide-react v0.462.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const Ti=cr("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** 32 * @license lucide-react v0.462.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */const ww=cr("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 37 * @license lucide-react v0.462.0 - ISC 38 * 39 * This source code is licensed under the ISC license. 40 * See the LICENSE file in the root directory of this source tree. 41 */const Nw=cr("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/** 42 * @license lucide-react v0.462.0 - ISC 43 * 44 * This source code is licensed under the ISC license. 45 * See the LICENSE file in the root directory of this source tree. 46 */const _w=cr("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/** 47 * @license lucide-react v0.462.0 - ISC 48 * 49 * This source code is licensed under the ISC license. 50 * See the LICENSE file in the root directory of this source tree. 51 */const Sw=cr("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/** 52 * @license lucide-react v0.462.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */const Aw=cr("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
56kijz"}],["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"}]]);function Ow(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Pw(e,t){return+zt(e)-+zt(t)}function Cw(e){const t=zt(e);return t.setHours(23,59,59,999),t}function kw(e){const t=zt(e);return+Cw(t)==+xv(t)}function Ew(e,t){const r=zt(e),n=zt(t),i=Gs(r,n),s=Math.abs(d0(r,n));let o;if(s<1)o=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*s);let l=Gs(r,n)===-i;kw(zt(e))&&s===1&&Gs(e,n)===1&&(l=!1),o=i*(s-Number(l))}return o===0?0:o}function $w(e,t,r){const n=Pw(e,t)/1e3;return Ow(r==null?void 0:r.roundingMethod)(n)}function Tw(e,t,r){const n=Fj(),i=(r==null?void 0:r.locale)??n.locale??Lj,s=2520,o=Gs(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o});let c,u;o>0?(c=zt(t),u=zt(e)):(c=zt(e),u=zt(t));const f=$w(u,c),d=(Bf(u)-Bf(c))/1e3,m=Math.round((f-d)/60);let h;if(m<2)return r!=null&&r.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,l):f<10?i.formatDistance("lessThanXSeconds",10,l):f<20?i.formatDistance("lessThanXSeconds",20,l):f<40?i.formatDistance("halfAMinute",0,l):f<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<qf){const g=Math.round(m/60);return i.formatDistance("aboutXHours",g,l)}else{if(m<s)return i.formatDistance("xDays",1,l);if(m<As){const g=Math.round(m/qf);return i.formatDistance("xDays",g,l)}else if(m<As*2)return h=Math.round(m/As),i.formatDistance("aboutXMonths",h,l)}if(h=Ew(u,c),h<12){const g=Math.round(m/As);return i.formatDistance("xMonths",g,l)}else{const g=h%12,p=Math.trunc(h/12);return g<3?i.formatDistance("aboutXYears",p,l):g<9?i.formatDistance("overXYears",p,l):i.formatDistance("almostXYears",p+1,l)}}function Mw(e,t){return Tw(e,s0(e),t)}function em(e){return zt(e).getMonth()}const Dw=e=>Ge({queryKey:["supplier-categories",e],queryFn:async()=>{if(!e)return[];const{data:t,error:r}=await Y.from("supplier_categories").select("*").eq("supplier_id",e);if(r)throw r;return t},enabled:!!e}),Iw=()=>{const e=ur();return Xe({mutationFn:async({supplierId:t,categoryIds:r})=>{const{error:n}=await Y.from("supplier_categories").delete().eq("supplier_id",t);if(n)throw n;if(r.length>0){const{error:i}=await Y.from("supplier_categories").insert(r.map(s=>({supplier_id:t,category_id:s})));if(i)throw i}return r},onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["supplier-categories",r.supplierId]})}})},Rw={pending:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-400",responded:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",booked:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",declined:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Lw={pending:a.jsx(St,{className:"w-3 h-3"}),responded:a.jsx(Mr,{className:"w-3 h-3"}),booked:a.jsx(ke,{className:"w-3 h-3"}),declined:a.jsx(yv,{className:"w-3 h-3"})},Fw=({supplierId:e,highlightedEnquiryId:t,onEnquiryOpened:r})=>{var I,B;const n=ur(),[i,s]=S.useState(null),[o,l]=S.useState(""),[c,u]=S.useState(null),[f,d]=S.useState(!1),[m,h]=S.useState(""),[g,p]=S.useState("all"),[v,x]=S.useState(void 0),[b,j]=S.useState(void 0),{data:N}=Ge({queryKey:["supplier-name",e],queryFn:async()=>{const{data:L,error:X}=await Y.from("suppliers").select("name").eq("id",e).single();if(X)throw X;return L}}),{data:y,isLoading:w}=Ge({queryKey:["supplier-enquiries",e],queryFn:async()=>{const{data:L,error:X}=await Y.from("enquiries").select("*").eq("supplier_id",e).order("created_at",{ascending:!1});if(X)throw X;return L}});S.useEffect(()=>{if(t&&y&&!f){const L=y.find(X=>X.id===t);L&&(A(L),d(!0),r==null||r())}},[t,y,f]);const _=Xe({mutationFn:async({id:L,status:X,supplier_notes:z,enquiry:U})=>{const D={},Q=(U==null?void 0:U.status)==="responded"||(U==null?void 0:U.status)==="booked"||(U==null?void 0:U.status)==="declined";X&&(D.status=X,(X==="responded"||X==="booked"||X==="declined")&&!(U!=null&&U.responded_at)&&(D.responded_at=new Date().toISOString())),z!==void 0&&(D.supplier_notes=z);const{error:ae}=await Y.from("enquiries").update(D).eq("id",L);if(ae)throw ae;if(X==="responded"&&!Q&&(U!=null&&U.couple_email))try{console.log("Sending response notification to couple:",U.couple_email),await Y.functions.invoke("send-enquiry-response-notification",{body:{coupleEmail:U.couple_email,coupleName:U.couple_name,supplierName:U.supplier_name||"A supplier"}})}catch(te){console.error("Failed to send response notification:",te)}},onSuccess:()=>{n.invalidateQueries({queryKey:["supplier-enquiries",e]}),G.success("Enquiry updated")},onError:()=>{G.error("Failed to update enquiry")}}),O=Xe({mutationFn:async L=>{const{error:X}=await Y.from("enquiries").update({read_at:new Date().toISOString()}).eq("id",L);if(X)throw X},onSuccess:()=>{n.invalidateQueries({queryKey:["supplier-enquiries",e]})}}),A=L=>{s(L),l(L.supplier_notes||""),L.read_at||O.mutate(L.id)},C=()=>{i&&_.mutate({id:i.id,supplier_notes:o})},P=(y==null?void 0:y.filter(L=>!L.read_at).length)||0,M=(y==null?void 0:y.filter(L=>L.status==="pending").length)||0,E=(y==null?void 0:y.filter(L=>{var X,z,U,D;if(m){const Q=m.toLowerCase(),ae=(X=L.couple_name)==null?void 0:X.toLowerCase().includes(Q),te=(z=L.venue_name)==null?void 0:z.toLowerCase().includes(Q),pe=(U=L.couple_email)==null?void 0:U.toLowerCase().includes(Q),Ne=(D=L.message)==null?void 0:D.toLowerCase().includes(Q);if(!ae&&!te&&!pe&&!Ne)return!1}return!(g!=="all"&&L.status!==g||v&&L.wedding_date&&new Date(L.wedding_date)<v||b&&L.wedding_date&&new Date(L.wedding_date)>b)}))||[],T=m||g!=="all"||v||b,$=()=>{h(""),p("all"),x(void 0),j(void 0)};return w?a.jsx(K,{children:a.jsx(H,{className:"p-6 flex items-center justify-center",children:a.jsx(Se,{className:"w-6 h-6 animate-spin text-muted-foreground"})})}):a.jsxs(a.Fragment,{children:[a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Mr,{className:"w-5 h-5"}),"Enquiries",P>0&&a.jsxs(ne,{variant:"destructive",className:"ml-2",children:[P," new"]})]}),M>0&&a.jsxs(ne,{className:"bg-amber-100 text-amber-800",children:[M," pending"]})]})}
56),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Nd,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground"}),a.jsx(ee,{placeholder:"Search by name, venue, email...",value:m,onChange:L=>h(L.target.value),className:"pl-9"})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(Vt,{value:g,onValueChange:p,children:[a.jsx(Kt,{className:"w-[140px]",children:a.jsx(Gt,{placeholder:"Status"})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"all",children:"All Status"}),a.jsx(ve,{value:"pending",children:"Pending"}),a.jsx(ve,{value:"responded",children:"Responded"}),a.jsx(ve,{value:"booked",children:"Booked"}),a.jsx(ve,{value:"declined",children:"Declined"})]})]}),a.jsxs(Tc,{children:[a.jsx(Mc,{asChild:!0,children:a.jsxs(F,{variant:"outline",size:"sm",className:He("justify-start text-left font-normal",!v&&"text-muted-foreground"),children:[a.jsx(qe,{className:"mr-2 h-4 w-4"}),v?me(v,"MMM d, yyyy"):"Wedding from"]})}),a.jsx(Dc,{className:"w-auto p-0",align:"start",children:a.jsx(Hf,{mode:"single",selected:v,onSelect:x,initialFocus:!0,className:He("p-3 pointer-events-auto")})})]}),a.jsxs(Tc,{children:[a.jsx(Mc,{asChild:!0,children:a.jsxs(F,{variant:"outline",size:"sm",className:He("justify-start text-left font-normal",!b&&"text-muted-foreground"),children:[a.jsx(qe,{className:"mr-2 h-4 w-4"}),b?me(b,"MMM d, yyyy"):"Wedding to"]})}),a.jsx(Dc,{className:"w-auto p-0",align:"start",children:a.jsx(Hf,{mode:"single",selected:b,onSelect:j,initialFocus:!0,className:He("p-3 pointer-events-auto")})})]}),T&&a.jsxs(F,{variant:"ghost",size:"sm",onClick:$,children:[a.jsx(Va,{className:"w-4 h-4 mr-1"}),"Clear"]})]}),T&&a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",E.length," of ",(y==null?void 0:y.length)||0," enquiries"]})]}),E.length>0?a.jsx("div",{className:"space-y-3",children:E.map(L=>a.jsx("div",{className:`p-4 rounded-lg border cursor-pointer transition-colors hover:bg-muted/50 ${L.read_at?"border-border":"bg-primary/5 border-primary/20"}`,onClick:()=>A(L),children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-medium text-foreground",children:L.couple_name}),!L.read_at&&a.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"})]}),a.jsx("p",{className:"text-sm text-muted-foreground truncate",children:L.message}),a.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground flex-wrap",children:[a.jsx("span",{children:me(new Date(L.created_at),"MMM d, yyyy")}),L.venue_name&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Tr,{className:"w-3 h-3"}),L.venue_name]}),L.guest_count&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(xt,{className:"w-3 h-3"}),L.guest_count," guests"]}),L.wedding_date&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(qe,{className:"w-3 h-3"}),me(new Date(L.wedding_date),"MMM d, yyyy")]})]})]}),a.jsxs(ne,{className:Rw[L.status],children:[Lw[L.status],a.jsx("span",{className:"ml-1 capitalize",children:L.status})]})]})},L.id))}):y&&y.length>0?a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No enquiries match your filters"}):a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No enquiries yet"})]})]}),a.jsx(Je,{open:!!i,onOpenChange:()=>s(null),children:a.jsxs(Ze,{className:"sm:max-w-lg",children:[a.jsx(dt,{children:a.jsxs(ft,{children:["Enquiry from ",i==null?void 0:i.couple_name]})}),i&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-muted rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Tt,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("a",{href:`mailto:${i.couple_email}`,className:"text-sm hover:text-primary",children:i.couple_email})]}),i.couple_phone&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xr,{className:"w-4 h-4 text-muted-foreground"}
56),a.jsx("a",{href:`tel:${i.couple_phone}`,className:"text-sm hover:text-primary",children:i.couple_phone})]}),i.venue_name&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Tr,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm",children:i.venue_name})]}),i.guest_count&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xt,{className:"w-4 h-4 text-muted-foreground"}),a.jsxs("span",{className:"text-sm",children:[i.guest_count," guests"]})]}),i.wedding_date&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-4 h-4 text-muted-foreground"}),a.jsxs("span",{className:"text-sm",children:["Wedding: ",me(new Date(i.wedding_date),"MMMM d, yyyy")]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Message"}),a.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap bg-muted p-4 rounded-lg",children:i.message})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Status"}),a.jsxs(Vt,{value:i.status,onValueChange:L=>{const X={...i,supplier_name:N==null?void 0:N.name},z=i.status==="responded"||i.status==="booked"||i.status==="declined";L==="responded"&&!z?u({id:i.id,status:L,enquiry:X}):(_.mutate({id:i.id,status:L,enquiry:X}),s({...i,status:L}))},children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"pending",children:"Pending"}),a.jsx(ve,{value:"responded",children:"Responded"}),a.jsx(ve,{value:"booked",children:"Booked"}),a.jsx(ve,{value:"declined",children:"Declined"})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Your Notes (private)"}),a.jsx(Ce,{value:o,onChange:L=>l(L.target.value),placeholder:"Add private notes about this enquiry...",rows:3}),a.jsx(F,{size:"sm",className:"mt-2",onClick:C,disabled:_.isPending,children:"Save Notes"})]}),a.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[a.jsxs(F,{variant:"outline",className:"flex-1",onClick:()=>window.location.href=`mailto:${i.couple_email}`,children:[a.jsx(Tt,{className:"w-4 h-4 mr-2"}),"Reply by Email"]}),i.couple_phone&&a.jsxs(F,{variant:"outline",className:"flex-1",onClick:()=>window.location.href=`tel:${i.couple_phone}`,children:[a.jsx(Xr,{className:"w-4 h-4 mr-2"}),"Call"]})]})]})]})}),a.jsx(da,{open:!!c,onOpenChange:()=>u(null),children:a.jsxs(fa,{children:[a.jsxs(ma,{children:[a.jsx(ha,{children:"Mark as Responded?"}),a.jsxs(pa,{children:["This will send an email notification to ",a.jsx("strong",{children:(I=c==null?void 0:c.enquiry)==null?void 0:I.couple_name})," at ",a.jsx("strong",{children:(B=c==null?void 0:c.enquiry)==null?void 0:B.couple_email})," letting them know you have responded to their enquiry."]})]}),a.jsxs(ga,{children:[a.jsx(va,{children:"Cancel"}),a.jsx(xa,{onClick:()=>{c&&(_.mutate(c),s({...i,status:c.status}),u(null))},children:"Confirm & Notify Couple"})]})]})})]})};var tm=1,Bw=.9,qw=.8,Uw=.17,Jl=.1,Zl=.999,zw=.9999,Ww=.99,Vw=/[\\\/_+.#"@\[\(\{&]/,Kw=/[\\\/_+.#"@\[\(\{&]/g,Gw=/[\s-]/,Tv=/[\s-]/g;function Wc(e,t,r,n,i,s,o){if(s===t.length)return i===e.length?tm:Ww;var l=`${i},${s}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(s),u=r.indexOf(c,i),f=0,d,m,h,g;u>=0;)d=Wc(e,t,r,n,u+1,s+1,o),d>f&&(u===i?d*=tm:Vw.test(e.charAt(u-1))?(d*=qw,h=e.slice(i,u-1).match(Kw),h&&i>0&&(d*=Math.pow(Zl,h.length))):Gw.test(e.charAt(u-1))?(d*=Bw,g=e.slice(i,u-1).match(Tv),g&&i>0&&(d*=Math.pow(Zl,g.length))):(d*=Uw,i>0&&(d*=Math.pow(Zl,u-i))),e.charAt(u)!==t.charAt(s)&&(d*=zw)),(d<Jl&&r.charAt(u-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(u-1)!==n.charAt(s))&&(m=Wc(e,t,r,n,u+1,s+2,o),m*Jl>d&&(d=m*Jl)),d>f&&(f=d),u=r.indexOf(c,u+1);return o[l]=f,f}function rm(e){return e.toLowerCase().replace(Tv," ")}function Hw(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Wc(e,t,rm(e),rm(t),0,0,{})}var oi='[cmdk-group=""]',ec='[cmdk-group-items=""]',Yw='[cmdk-group-heading=""]',Mv='[cmdk-item=""]',nm=`${Mv}:not([aria-disabled="true"])`,Vc="cmdk-item-select",Qn="data-value",Xw=(e,t,r)=>Hw(e,t,r),Dv=S.createContext(void 0),gs=()=>S.useContext(Dv),Iv=S.createContext(void 0),Cd=()=>S.useContext(Iv),Rv=S.createContext(void 0),Lv=S.forwardRef((e,t)=>
vendor: 10,168 bytes, line 56
56{let r=Jn(()=>{var D,Q;return{search:"",value:(Q=(D=e.value)!=null?D:e.defaultValue)!=null?Q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=Jn(()=>new Set),i=Jn(()=>new Map),s=Jn(()=>new Map),o=Jn(()=>new Set),l=Fv(e),{label:c,children:u,value:f,onValueChange:d,filter:m,shouldFilter:h,loop:g,disablePointerSelection:p=!1,vimBindings:v=!0,...x}=e,b=ia(),j=ia(),N=ia(),y=S.useRef(null),w=oN();Pn(()=>{if(f!==void 0){let D=f.trim();r.current.value=D,_.emit()}},[f]),Pn(()=>{w(6,E)},[]);let _=S.useMemo(()=>({subscribe:D=>(o.current.add(D),()=>o.current.delete(D)),snapshot:()=>r.current,setState:(D,Q,ae)=>{var te,pe,Ne,Z;if(!Object.is(r.current[D],Q)){if(r.current[D]=Q,D==="search")M(),C(),w(1,P);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let R=document.getElementById(N);R?R.focus():(te=document.getElementById(b))==null||te.focus()}if(w(7,()=>{var R;r.current.selectedItemId=(R=T())==null?void 0:R.id,_.emit()}),ae||w(5,E),((pe=l.current)==null?void 0:pe.value)!==void 0){let R=Q??"";(Z=(Ne=l.current).onValueChange)==null||Z.call(Ne,R);return}}_.emit()}},emit:()=>{o.current.forEach(D=>D())}}),[]),O=S.useMemo(()=>({value:(D,Q,ae)=>{var te;Q!==((te=s.current.get(D))==null?void 0:te.value)&&(s.current.set(D,{value:Q,keywords:ae}),r.current.filtered.items.set(D,A(Q,ae)),w(2,()=>{C(),_.emit()}))},item:(D,Q)=>(n.current.add(D),Q&&(i.current.has(Q)?i.current.get(Q).add(D):i.current.set(Q,new Set([D]))),w(3,()=>{M(),C(),r.current.value||P(),_.emit()}),()=>{s.current.delete(D),n.current.delete(D),r.current.filtered.items.delete(D);let ae=T();w(4,()=>{M(),(ae==null?void 0:ae.getAttribute("id"))===D&&P(),_.emit()})}),group:D=>(i.current.has(D)||i.current.set(D,new Set),()=>{s.current.delete(D),i.current.delete(D)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:N,labelId:j,listInnerRef:y}),[]);function A(D,Q){var ae,te;let pe=(te=(ae=l.current)==null?void 0:ae.filter)!=null?te:Xw;return D?pe(D,r.current.search,Q):0}function C(){if(!r.current.search||l.current.shouldFilter===!1)return;let D=r.current.filtered.items,Q=[];r.current.filtered.groups.forEach(te=>{let pe=i.current.get(te),Ne=0;pe.forEach(Z=>{let R=D.get(Z);Ne=Math.max(R,Ne)}),Q.push([te,Ne])});let ae=y.current;$().sort((te,pe)=>{var Ne,Z;let R=te.getAttribute("id"),re=pe.getAttribute("id");return((Ne=D.get(re))!=null?Ne:0)-((Z=D.get(R))!=null?Z:0)}).forEach(te=>{let pe=te.closest(ec);pe?pe.appendChild(te.parentElement===pe?te:te.closest(`${ec} > *`)):ae.appendChild(te.parentElement===ae?te:te.closest(`${ec} > *`))}),Q.sort((te,pe)=>pe[1]-te[1]).forEach(te=>{var pe;let Ne=(pe=y.current)==null?void 0:pe.querySelector(`${oi}[${Qn}="${encodeURIComponent(te[0])}"]`);Ne==null||Ne.parentElement.appendChild(Ne)})}function P(){let D=$().find(ae=>ae.getAttribute("aria-disabled")!=="true"),Q=D==null?void 0:D.getAttribute(Qn);_.setState("value",Q||void 0)}function M(){var D,Q,ae,te;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let pe=0;for(let Ne of n.current){let Z=(Q=(D=s.current.get(Ne))==null?void 0:D.value)!=null?Q:"",R=(te=(ae=s.current.get(Ne))==null?void 0:ae.keywords)!=null?te:[],re=A(Z,R);r.current.filtered.items.set(Ne,re),re>0&&pe++}for(let[Ne,Z]of i.current)for(let R of Z)if(r.current.filtered.items.get(R)>0){r.current.filtered.groups.add(Ne);break}r.current.filtered.count=pe}function E(){var D,Q,ae;let te=T();te&&(((D=te.parentElement)==null?void 0:D.firstChild)===te&&((ae=(Q=te.closest(oi))==null?void 0:Q.querySelector(Yw))==null||ae.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function T(){var D;return(D=y.current)==null?void 0:D.querySelector(`${Mv}[aria-selected="true"]`)}function $(){var D;return Array.from(((D=y.current)==null?void 0:D.querySelectorAll(nm))||[])}function I(D){let Q=$()[D];Q&&_.setState("value",Q.getAttribute(Qn))}function B(D){var Q;let ae=T(),te=$(),pe=te.findIndex(Z=>Z===ae),Ne=te[pe+D];(Q=l.current)!=null&&Q.loop&&(Ne=pe+D<0?te[te.length-1]:pe+D===te.length?te[0]:te[pe+D]),Ne&&_.setState("value",Ne.getAttribute(Qn))}function L(D){let Q=T(),ae=Q==null?void 0:Q.closest(oi),te;for(;ae&&!te;)ae=D>0?iN(ae,oi):sN(ae,oi),te=ae==null?void 0:ae.querySelector(nm);te?_.setState("value",te.getAttribute(Qn)):B(D)}let X=()=>I($().length-1),z=D=>{D.preventDefault(),D.metaKey?X():D.altKey?L(1):B(1)},U=D=>{D.preventDefault(),D.metaKey?I(0):D.altKey?L(-1):B(-1)};return S.createElement(Zr.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:D=>{var Q;(Q=x.onKeyDown)==null||Q.call(x,D);let ae=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||ae))switch(D.key){case"n":case"j":{v&&D.ctrlKey&&z(D);break}case"ArrowDown":{z(D);break}case"p":case"k":{v&&D.ctrlKey&&U(D);break}case"ArrowUp":{U(D);break}case"Home":{D.preventDefault(),I(0);break}case"End":{D.preventDefault(),X();break}case"Enter":{D.preventDefault();let te=T();if(te){let pe=new Event(Vc);te.dispatchEvent(pe)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:cN},c),nl(e,D=>S.createElement(Iv.Provider,{value:_},S.createElement(Dv.Provider,{value:O},D))))}),Qw=S.forwardRef((e,t)=>{var r,n;let i=ia(),s=S.useRef(null),o=S.useContext(Rv),l=gs(),c=Fv(e),u=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;Pn(()=>{if(!u)return l.item(i,o==null?void 0:o.id)},[u]);let f=Bv(i,s,[e.value,e.children,s],e.keywords),d=Cd(),m=Jr(w=>w.value&&w.value===f.current),h=Jr(w=>u||l.filter()===!1?!0:w.search?w.filtered.items.get(i)>0:!0);S.useEffect(()=>{let w=s.current;if(!(!w||e.disabled))return w.addEventListener(Vc,g),()=>w.removeEventListener(Vc,g)},[h,e.onSelect,e.disabled]);function g(){var w,_;p(),(_=(w=c.current).onSelect)==null||_.call(w,f.current)}function p(){d.setState("value",f.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:b,forceMount:j,keywords:N,...y}=e;return S.createElement(Zr.div,{ref:Ei(s,t),...y,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:p,onClick:v?void 0:g},e.children)}),Jw=S.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...s}=e,o=ia(),l=S.useRef(null),c=S.useRef(null),u=ia(),f=gs(),d=Jr(h=>i||f.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);Pn(()=>f.group(o),[]),Bv(o,l,[e.value,e.heading,c]);let m=S.useMemo(()=>({id:o,forceMount:i}),[i]);return S.createElement(Zr.div,{ref:Ei(l,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},r&&S.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),nl(e,h=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},S.createElement(Rv.Provider,{value:m},h))))}),Zw=S.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=S.useRef(null),s=Jr(o=>!o.search);return!r&&!s?null:S.createElement(Zr.div,{ref:Ei(i,t),...n,"cmdk-separator":"",role:"separator"})}),eN=S.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,s=Cd(),o=Jr(u=>u.search),l=Jr(u=>u.selectedItemId),c=gs();return S.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),S.createElement(Zr.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?e.value:o,onChange:u=>{i||s.setState("search",u.target.value),r==null||r(u.target.value)}})}),tN=S.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,s=S.useRef(null),o=S.useRef(null),l=Jr(u=>u.selectedItemId),c=gs();return S.useEffect(()=>{if(o.current&&s.current){let u=o.current,f=s.current,d,m=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let h=u.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return m.observe(u),()=>{cancelAnimationFrame(d),m.unobserve(u)}}},[]),S.createElement(Zr.div,{ref:Ei(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},nl(e,u=>S.createElement("div",{ref:Ei(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),rN=S.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:s,container:o,...l}=e;return S.createElement(x0,{open:r,onOpenChange:n},S.createElement(y0,{container:o},S.createElement(b0,{"cmdk-overlay":"",className:i}),S.createElement(j0,{"aria-label":e.label,"cmdk-dialog":"",className:s},S.createElement(Lv,{ref:t,...l}))))}),nN=S.forwardRef((e,t)=>Jr(r=>r.filtered.count===0)?S.createElement(Zr.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),aN=S.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...s}=e;return S.createElement(Zr.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},nl(e,o=>S.createElement("div",{"aria-hidden":!0},o)))}),Ot=Object.assign(Lv,{List:tN,Item:Qw,Input:eN,Group:Jw,Separator:Zw,Dialog:rN,Empty:nN,Loading:aN});function iN(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function sN(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Fv(e){let t=S.useRef(e);return Pn(()=>{t.current=e}),t}var Pn=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Jn(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Jr(e){let t=Cd(),r=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,r,r)}function Bv(e,t,r,n=[]){let i=S.useRef(),s=gs();return Pn(()=>{var o;let l=(()=>{var u;for(let f of r){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():i.current}})(),c=n.map(u=>u.trim());s.value(e,l,c),(o=t.current)==null||o.setAttribute(Qn,l),i.current=l}),i}var oN=()=>{let[e,t]=S.useState(),r=Jn(()=>new Map);return Pn(()=>{r.current.forEach(n=>
56n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function lN(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function nl({asChild:e,children:t},r){return e&&S.isValidElement(t)?S.cloneElement(lN(t),{ref:t.ref},r(t.props.children)):r(t)}var cN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const qv=S.forwardRef(({className:e,...t},r)=>a.jsx(Ot,{ref:r,className:He("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));qv.displayName=Ot.displayName;const Uv=S.forwardRef(({className:e,...t},r)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(Nd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Ot.Input,{ref:r,className:He("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Uv.displayName=Ot.Input.displayName;const zv=S.forwardRef(({className:e,...t},r)=>a.jsx(Ot.List,{ref:r,className:He("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));zv.displayName=Ot.List.displayName;const Wv=S.forwardRef((e,t)=>a.jsx(Ot.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Wv.displayName=Ot.Empty.displayName;const Vv=S.forwardRef(({className:e,...t},r)=>a.jsx(Ot.Group,{ref:r,className:He("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Vv.displayName=Ot.Group.displayName;const uN=S.forwardRef(({className:e,...t},r)=>a.jsx(Ot.Separator,{ref:r,className:He("-mx-1 h-px bg-border",e),...t}));uN.displayName=Ot.Separator.displayName;const Kv=S.forwardRef(({className:e,...t},r)=>a.jsx(Ot.Item,{ref:r,className:He("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));Kv.displayName=Ot.Item.displayName;const Gv=({categories:e,selectedIds:t,onChange:r,placeholder:n="Select categories...",disabled:i=!1})=>{const[s,o]=S.useState(!1),l=f=>{t.includes(f)?r(t.filter(d=>d!==f)):r([...t,f])},c=(f,d)=>{d.stopPropagation(),r(t.filter(m=>m!==f))},u=(e==null?void 0:e.filter(f=>t.includes(f.id)))||[];return a.jsxs(Tc,{open:s,onOpenChange:o,children:[a.jsx(Mc,{asChild:!0,children:a.jsxs(F,{variant:"outline",role:"combobox","aria-expanded":s,disabled:i,className:"w-full justify-between h-auto min-h-10 py-2",children:[a.jsx("div",{className:"flex flex-wrap gap-1 flex-1",children:u.length===0?a.jsx("span",{className:"text-muted-foreground",children:n}):u.map(f=>a.jsxs(ne,{variant:"secondary",className:"mr-1 mb-1",children:[f.name,a.jsxs("button",{type:"button",onClick:d=>c(f.id,d),className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[a.jsx(Va,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"}),a.jsxs("span",{className:"sr-only",children:["Remove ",f.name]})]})]},f.id))}),a.jsx(jw,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(Dc,{className:"w-full p-0",align:"start",children:a.jsxs(qv,{children:[a.jsx(Uv,{placeholder:"Search categories..."}),a.jsxs(zv,{children:[a.jsx(Wv,{children:"No category found."}),a.jsx(Vv,{children:e==null?void 0:e.map(f=>a.jsxs(Kv,{value:f.name,onSelect:()=>l(f.id),children:[a.jsx(it,{className:He("mr-2 h-4 w-4",t.includes(f.id)?"opacity-100":"opacity-0")}),f.name]},f.id))})]})]})})]})},_r=[{id:"membership",title:"Choose Plan",icon:be},{id:"business",title:"Business Info",icon:kr},{id:"categories",title:"Services",icon:Qr},{id:"location",title:"Location",icon:Tr},{id:"photos",title:"Photos",icon:sa},{id:"description",title:"Description",icon:nt}],tc={free:{name:"Free",price:"£0",images:1,onlineFeatures:["Basic business listing","Contact information display","1 profile image","Listed in directory"]},standard:{name:"Standard",price:"£10/month",images:3,onlineFeatures:["Featured as Recognised Supplier","Up to 3 gallery images","Video portfolio showcase","Social media links","Social media promotion","Enquiry notifications","Basic analytics dashboard","Enquiry response templates","Response time badge","Priority customer support"],offlineFeatures:["10% off exhibition spaces","10% off magazine advertising"]},elite:{name:"Elite Vow Collective",price:"£25/month",images:10,highlight:!0,onlineFeatures:["Pri
56ority search ranking","Homepage spotlight rotation","Couple wishlist alerts","Unlimited gallery images","Video testimonials showcase","Pinned reviews at top","Custom profile themes","Multi-location listings","Larger, stand-out profile cards","Verified badge on profile","360° virtual tour integration",'"Recommended to Book" badge',"Elite badge & priority placement","AI-powered enquiry replies","AI Wedding Match inclusion","Contract management system","Advanced analytics & insights","Conversion analytics","Peak demand insights","Pricing benchmarks","Promotions & marketing tools","Email campaigns to saved couples","QR code generator","Portfolio PDF export","Calendar sync (Google/iCal)","Review response manager","Referral program access","Achievement badges","Co-branded marketing materials","Training resources & webinars","API access for integrations","Early access to new features"],offlineFeatures:["Featured at wedding shows","20% off exhibition spaces","20% off magazine advertising","Directory feature in every magazine","Show attendee data access (GDPR)","First to know show dates","VIP goody bag literature","Dedicated account manager"]}},rc="supplier_onboarding_wizard",dN=({userId:e,businessName:t,email:r,phone:n,categories:i,onListingCreated:s})=>{const l=S.useCallback(()=>{try{const C=localStorage.getItem(`${rc}_${e}`);if(C)return JSON.parse(C)}catch(C){console.error("Failed to load wizard state:",C)}return{currentStep:"membership",selectedMembership:"free",formData:{name:t,short_description:"",description:"",location:"",category_ids:[],website:"",image_url:"",gallery_images:[]}}},[e,t])(),[c,u]=S.useState(l.currentStep),[f,d]=S.useState(l.selectedMembership),[m,h]=S.useState(!1),[g,p]=S.useState(l.formData);S.useEffect(()=>{const C={currentStep:c,selectedMembership:f,formData:g};try{localStorage.setItem(`${rc}_${e}`,JSON.stringify(C))}catch(P){console.error("Failed to save wizard state:",P)}},[c,f,g,e]);const v=S.useCallback(()=>{try{localStorage.removeItem(`${rc}_${e}`)}catch(C){console.error("Failed to clear wizard state:",C)}},[e]),x=_r.findIndex(C=>C.id===c),b=(x+1)/_r.length*100,j=C=>C.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")+"-"+Math.random().toString(36).substring(2,8),N=()=>{switch(c){case"membership":return!0;case"business":return g.name.trim().length>0;case"categories":return g.category_ids.length>0;case"location":return g.location.trim().length>0;case"photos":return!0;case"description":return!0;default:return!0}},y=()=>{const C=_r.findIndex(P=>P.id===c);C<_r.length-1&&u(_r[C+1].id)},w=()=>{const C=_r.findIndex(P=>P.id===c);C>0&&u(_r[C-1].id)},_=async()=>{h(!0);try{if(f==="elite"&&g.category_ids.length>0){const{data:P}=await Y.from("supplier_profiles").select("regions_covered").eq("user_id",e).maybeSingle(),M=(P==null?void 0:P.regions_covered)||[],E=g.category_ids[0];if(M.length>0&&E){const{data:T}=await Y.from("suppliers").select("id, regions_covered").eq("is_elite_member",!0).eq("category_id",E);for(const $ of M)if((T||[]).filter(B=>{var L;return(L=B.regions_covered)==null?void 0:L.includes($)}).length>=4){const B=$.split("-").map(L=>L.charAt(0).toUpperCase()+L.slice(1)).join(" ");G.error(`Elite capacity is full for this category in ${B}. Please contact us to discuss availability.`),h(!1);return}}}const{error:C}=await Y.rpc("create_own_supplier_listing",{_name:g.name,_slug:j(g.name),_short_description:g.short_description||void 0,_description:g.description||void 0,_location:g.location||void 0,_category_ids:g.category_ids,_website:g.website||void 0,_image_url:g.image_url||void 0,_gallery_images:g.gallery_images.length>0?g.gallery_images:void 0,_membership_type:f});if(C)throw C;try{const P=g.category_ids.map(M=>{var E;return(E=i==null?void 0:i.find(T=>T.id===M))==null?void 0:E.name}).filter(Boolean).join(", ");await Y.functions.invoke("send-profile-complete-notification",{body:{businessName:g.name,email:r,phone:n,category:P||void 0,location:g.location,membershipType:f,regi
56ons:[]}})}catch(P){console.error("Failed to send profile complete notification:",P)}v(),G.success("Your listing has been created!"),s()}catch(C){console.error("Error creating listing:",C),G.error(C.message||"Failed to create listing")}finally{h(!1)}},O=()=>{switch(c){case"membership":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(yt,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"font-display text-2xl text-foreground mb-2",children:"Choose Your Plan"}),a.jsx("p",{className:"text-muted-foreground",children:"Select the plan that best fits your business needs"})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:Object.entries(tc).map(([C,P])=>a.jsxs("div",{onClick:()=>d(C),className:`relative p-4 rounded-lg border-2 cursor-pointer transition-all ${f===C?(P.highlight,"border-primary bg-primary/5"):"border-border hover:border-muted-foreground/50"} ${P.highlight?"ring-2 ring-primary/20":""}`,children:[P.highlight&&a.jsxs(ne,{className:"absolute -top-2 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground",children:[a.jsx(be,{className:"w-3 h-3 mr-1"}),"Recommended"]}),a.jsxs("div",{className:"text-center mb-4 pt-2",children:[a.jsx("div",{className:"flex justify-center mb-2",children:C==="elite"?a.jsx(be,{className:"w-8 h-8 text-primary"}):C==="standard"?a.jsx(lt,{className:"w-8 h-8 text-blue-500"}):a.jsx(kr,{className:"w-8 h-8 text-muted-foreground"})}),a.jsx("h3",{className:"font-semibold text-lg",children:P.name}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:P.price})]}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[a.jsx(yt,{className:"w-3 h-3 text-primary"}),a.jsx("span",{className:"text-xs font-semibold text-primary",children:"Digital Features"})]}),a.jsx("ul",{className:"space-y-1.5 text-sm max-h-48 overflow-y-auto",children:P.onlineFeatures.map((M,E)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(it,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${C==="elite"?"text-gold":"text-green-500"}`}),a.jsx("span",{className:"text-xs text-muted-foreground",children:M})]},E))})]}),P.offlineFeatures&&P.offlineFeatures.length>0&&a.jsxs("div",{className:"pt-3 border-t border-border/50",children:[a.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[a.jsx(kr,{className:`w-3 h-3 ${C==="elite"?"text-gold":"text-primary"}`}),a.jsx("span",{className:`text-xs font-semibold ${C==="elite"?"text-gold":"text-primary"}`,children:"Show & Print Benefits"})]}),a.jsx("ul",{className:"space-y-1.5 text-sm",children:P.offlineFeatures.map((M,E)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(it,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${C==="elite"?"text-gold":"text-green-500"}`}),a.jsx("span",{className:"text-xs text-muted-foreground",children:M})]},E))})]}),f===C&&a.jsx("div",{className:"absolute top-2 right-2",children:a.jsx("div",{className:"w-6 h-6 rounded-full bg-primary flex items-center justify-center",children:a.jsx(it,{className:"w-4 h-4 text-primary-foreground"})})})]},C))})]});case"business":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(kr,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"font-display text-2xl text-foreground mb-2",children:"Business Details"}),a.jsx("p",{className:"text-muted-foreground",children:"Let couples know who you are"})]}),a.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"name",children:"Business Name *"}),a.jsx(ee,{id:"name",value:g.name,onChange:C=>p(P=>({...P,name:C.target.value})),placeholder:"Your business name"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"website",children:"Website (
56optional)"}),a.jsx(ee,{id:"website",value:g.website,onChange:C=>p(P=>({...P,website:C.target.value})),placeholder:"https://..."})]})]})]});case"categories":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(Qr,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"font-display text-2xl text-foreground mb-2",children:"Your Services"}),a.jsx("p",{className:"text-muted-foreground",children:"Select the categories that match what you offer"})]}),a.jsxs("div",{className:"max-w-md mx-auto",children:[a.jsx(Gv,{categories:i,selectedIds:g.category_ids,onChange:C=>p(P=>({...P,category_ids:C})),placeholder:"Select categories..."}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Select all services you offer â this helps couples find you"})]})]});case"location":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(Tr,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"font-display text-2xl text-foreground mb-2",children:"Your Location"}),a.jsx("p",{className:"text-muted-foreground",children:"Where are you based?"})]}),a.jsx("div",{className:"max-w-md mx-auto",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"location",children:"Location *"}),a.jsx(ee,{id:"location",value:g.location,onChange:C=>p(P=>({...P,location:C.target.value})),placeholder:"e.g. North Wales, Wrexham"})]})})]});case"photos":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(sa,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"font-display text-2xl text-foreground mb-2",children:"Showcase Your Work"}),a.jsx("p",{className:"text-muted-foreground",children:"Add photos to attract more enquiries"})]}),a.jsxs("div",{className:"max-w-lg mx-auto space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Profile Image"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This will be your main listing image shown in search results"}),a.jsx(p0,{value:g.image_url,onChange:C=>p(P=>({...P,image_url:C})),folder:"suppliers"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Gallery Images"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Add up to ",tc[f].images," images to showcase your work"]}),a.jsx(v0,{value:g.gallery_images,onChange:C=>p(P=>({...P,gallery_images:C})),membershipType:f,folder:"gallery"})]})]})]});case"description":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:a.jsx(nt,{className:"w-8 h-8 text-primary"})}),a.jsx("h2",{className:"font-display text-2xl text-foreground mb-2",children:"Tell Your Story"}),a.jsx("p",{className:"text-muted-foreground",children:"Help couples understand what makes you special"})]}),a.jsxs("div",{className:"max-w-lg mx-auto space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"short_description",children:"Short Description"}),a.jsx(ee,{id:"short_description",value:g.short_description,onChange:C=>p(P=>({...P,short_description:C.target.value})),placeholder:"Brief tagline for search results (max 200 chars)",maxLength:200})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"description",children:"Full Description"}),a.jsx(Ce,{id:"description",value:g.description,onChange:C=>p(P=>({...P,description:C.target.value})),placeholder:"Tell couples about your experience, style, and what you love about what you do...",rows:6})]})]})]});default:return null}},A=c==="description";return a.jsxs(K,{className:"max-w-4xl mx-auto",children:[a.jsx(oe,{className:"pb-4",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("span",{className:"text-muted-foreground",children:["Step ",x+1," of ",_r.length]}),a.jsxs(ne,{variant:"outline",className:"gap-1",children:[f==="elite"&&a.jsx(be,{className:"w-3 h-3"}),f==="standard"&&a.jsx(lt,{className:"w-3 h-3"}),tc[f].name," Plan"]})]}),a.jsx(en,{value:b,className:"h-2"}),a.jsx("div",{className:"hidden sm:flex items-center justify-between",children:_r.map((C,P)=>{const M=C.icon,E=P===x,T=P<x;return a.jsxs("button",{onClick:()=>T&&u(C.id),disabled:!T,className:`flex items-center gap-2 text-xs transition-all ${E?"text-primary font-medium":T?"text-green-600 hover:text-green-700 cursor-pointer":"text-muted-foreground cursor-default"}`,children:[a.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center transition-all ${E?"bg-primary text-primary-foreground":T?"bg-green-100 text-green-600 hover:bg-green-200":"bg-muted"}`,children:T?a.jsx(ps,{className:"w-4 h-4"}):a.jsx(M,{className:"w-4 h-4"})}),a.jsx("span",{className:"hidden lg:inline",children:C.title})]},C.id)})})]})}
56),a.jsxs(H,{className:"pt-4",children:[O(),a.jsxs("div",{className:"flex justify-between mt-8 pt-6 border-t",children:[a.jsxs(F,{variant:"outline",onClick:w,disabled:x===0,className:"gap-2",children:[a.jsx(Bj,{className:"w-4 h-4"}),"Back"]}),a.jsxs("div",{className:"flex gap-2",children:[(c==="photos"||c==="description")&&a.jsx(F,{variant:"ghost",onClick:y,className:"text-muted-foreground",children:"Skip for now"}),A?a.jsx(F,{onClick:_,disabled:m,className:"gap-2 bg-primary hover:bg-primary/90",children:m?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"w-4 h-4 animate-spin"}),"Creating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Aw,{className:"w-4 h-4"}),"Create My Listing"]})}):a.jsxs(F,{onClick:y,disabled:!N(),className:"gap-2",children:["Continue",a.jsx(pv,{className:"w-4 h-4"})]})]})]})]})]})},fN={available:"bg-green-500",booked:"bg-red-500",tentative:"bg-amber-500"},mN=({supplierId:e})=>{const[t,r]=S.useState(new Date),[n,i]=S.useState([]),[s,o]=S.useState(!1),[l,c]=S.useState("available"),[u,f]=S.useState(""),[d,m]=S.useState(!1),[h,g]=S.useState(null),p=S.useRef(new Set),{availability:v,isLoading:x,setAvailability:b,deleteAvailability:j}=w0(e),N=f0(t),y=xv(t),w=Ic({start:N,end:y}),_=N.getDay(),O=Array(_).fill(null).concat(w),A=z=>{const U=me(z,"yyyy-MM-dd");return v.find(D=>D.date===U)},C=z=>{const U=me(z,"yyyy-MM-dd");return p.current.has(U)||n.some(D=>me(D,"yyyy-MM-dd")===U)},P=S.useCallback((z,U)=>{U.preventDefault(),!hn(qt(z),qt(new Date))&&(m(!0),g(z),p.current=new Set([me(z,"yyyy-MM-dd")]),i([z]))},[]),M=S.useCallback(z=>{if(!(!d||hn(qt(z),qt(new Date)))&&h){const U=h<z?h:z,D=h<z?z:h,Q=Ic({start:U,end:D}).filter(ae=>!hn(qt(ae),qt(new Date)));p.current=new Set(Q.map(ae=>me(ae,"yyyy-MM-dd"))),i(Q)}},[d,h]),E=S.useCallback(()=>{d&&n.length>0&&o(!0),m(!1)},[d,n.length]),T=z=>{if(hn(qt(z),qt(new Date)))return;const U=A(z);i([z]),p.current=new Set([me(z,"yyyy-MM-dd")]),c((U==null?void 0:U.status)||"available"),f((U==null?void 0:U.notes)||""),o(!0)},$=async()=>{if(n.length!==0){for(const z of n)await b.mutateAsync({date:me(z,"yyyy-MM-dd"),status:l,notes:u||void 0});B()}},I=async()=>{if(n.length!==0){for(const z of n)await j.mutateAsync(me(z,"yyyy-MM-dd"));B()}},B=()=>{o(!1),i([]),p.current=new Set,c("available"),f("")},L=z=>{r(U=>{const D=new Date(U);return D.setMonth(U.getMonth()+(z==="next"?1:-1)),D})},X=n.some(z=>A(z));return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-5 h-5 text-primary"}),"Availability Calendar"]}),a.jsx(he,{children:"Click a date or drag to select multiple dates at once"})]}),a.jsxs(H,{children:[a.jsxs("div",{className:"flex flex-wrap gap-4 mb-4 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"}),a.jsx("span",{children:"Available"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-amber-500"}),a.jsx("span",{children:"Tentative"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),a.jsx("span",{children:"Booked"})]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-4 bg-muted/50 rounded-lg px-3 py-2",children:[a.jsx(_w,{className:"w-4 h-4"}),a.jsx("span",{children:"Tip: Click and drag across dates to select multiple days at once"})]}),a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx(F,{variant:"outline",size:"icon",onClick:()=>L("prev"),children:a.jsx(qj,{className:"w-4 h-4"})}),a.jsx("h3",{className:"font-semibold text-lg",children:me(t,"MMMM yyyy")}),a.jsx(F,{variant:"outline",size:"icon",onClick:()=>L("next"),children:a.jsx(Uj,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-7 gap-1 select-none",onMouseLeave:()=>{d&&E()},children:[["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(z=>a.jsx("div",{className:"text-center text-xs font-medium text-muted-foreground py-2",children:z},z)),O.map((z,U)=>{if(!z)return a.jsx("div",{className:"aspect-square"},`empty-${U}`);const D=A(z),Q=hn(qt(z),qt(new Date)),ae=C(z);return a.jsxs("div",{onMouseDown:te=>P(z,te),onMouseEnter:()=>M(z),onMouseUp:E,onClick:()=>!d&&T(z),className:He("aspect-square rounded-lg flex flex-col items-center justify-center text-sm transition-all relative",Q&&"opacity-40 cursor-not-allowed",!Q&&"hover:bg-muted cursor-pointer",Gf(z)&&"ring-2 ring-primary",!m0(z,t)&&"text-muted-foreground",ae&&!Q&&"bg-primary/20 ring-2 ring-primary/50"),children:[a.jsx("span",{className:He(Gf(z)&&"font-bold"),children:me(z,"d")}),D&&a.jsx("div",{className:He("w-2 h-2 rounded-full mt-1",fN[D.status])})]},z.toISOString())})]}),n.length>1&&!s&&a.jsxs("div",{className:"mt-4 text-sm text-muted-foreground text-center",children:[n.length," dates selected"]}),a.jsx(Je,{open:s,onOpenChange:z=>{z?o(z):B()},children:a.jsxs(Ze,{children:[a.jsx(dt,{children:a.jsx(ft,{children:n.length===1?`Set Availability - ${me(n[0],"MMMM d, yyyy")}`:`Set Availability for ${n.length} Dates`})}),n.length>1&&a.jsxs("div",{className:"text-sm text-muted-foreground bg-muted/50 rounded-lg p-3",children:[a.jsx("p",{className:"font-medium mb-1",children:"Selected dates:"}),a.jsxs("div",{className:"flex flex-wrap gap-1 max-h-24 overflow-y-auto",children:[n.slice(0,10).map(z=>a.jsx("span",{className:"bg-background px-2 py-0.5 rounded text-xs",children:me(z,"MMM d")},z.toISOString())),n.length>10&&a.jsxs("span",{className:"text-xs",children:["+",n.length-10," more"]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Status"}),a.jsxs(Vt,{value:l,onValueChange:c,children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"available",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-4 h-4 text-green-500"}),"Available"]})}),a.jsx(ve,{value:"tentative",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(R0,{className:"w-4 h-4 text-amber-500"}),"Tentative"]})}),a.jsx(ve,{value:"booked",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yv,{className:"w-4 h-4 text-red-500"}),"Booked"]})})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Notes (optional)"}),a.jsx(Ce,{value:u,onChange:z=>f(z.target.value),placeholder:"Any additional notes...",rows:3})]})]}),a.jsxs(Ga,{className:"gap-2",children:[X&&a.jsxs(F,{variant:"outline",onClick:I,className:"mr-auto",disabled:b.isPending||j.isPending,children:["Clear ",n.length>1?"All":""]}),a.jsx(F,{variant:"outline",onClick:B,children:"Cancel"}),a.jsx(F,{onClick:$,className:"bg-gold text-secondary hover:bg-gold/90",disabled:b.isPending,children:b.isPending?"Saving...":`Save${n.length>1?` ${n.length} Dates`:""}`})]})]})})]})]})},hN=e=>Ge({queryKey:["supplier-stats",e],queryFn:async()=>
56{if(!e)return{totalViews:0,totalEnquiries:0,totalSaves:0,monthlyData:[],conversionRate:0};const t=Ys(new Date,6),{data:r,error:n}=await Y.from("supplier_stats").select("*").eq("supplier_id",e).gte("date",me(t,"yyyy-MM-dd")).order("date",{ascending:!0});if(n)throw n;const i=r,s=i.reduce((d,m)=>d+(m.profile_views||0),0),o=i.reduce((d,m)=>d+(m.enquiries_received||0),0),l=i.reduce((d,m)=>d+(m.saves_count||0),0),c=new Map;for(let d=5;d>=0;d--){const m=me(Ys(new Date,d),"MMM yyyy");c.set(m,{views:0,enquiries:0,saves:0})}i.forEach(d=>{const m=me(new Date(d.date),"MMM yyyy"),h=c.get(m)||{views:0,enquiries:0,saves:0};c.set(m,{views:h.views+(d.profile_views||0),enquiries:h.enquiries+(d.enquiries_received||0),saves:h.saves+(d.saves_count||0)})});const u=Array.from(c.entries()).map(([d,m])=>({month:d,...m})),f=s>0?o/s*100:0;return{totalViews:s,totalEnquiries:o,totalSaves:l,monthlyData:u,conversionRate:f}},enabled:!!e});var pN=Array.isArray,Pt=pN,gN=typeof Os=="object"&&Os&&Os.Object===Object&&Os,Hv=gN,vN=Hv,xN=typeof self=="object"&&self&&self.Object===Object&&self,yN=vN||xN||Function("return this")(),wr=yN,bN=wr,jN=bN.Symbol,vs=jN,am=vs,Yv=Object.prototype,wN=Yv.hasOwnProperty,NN=Yv.toString,li=am?am.toStringTag:void 0;function _N(e){var t=wN.call(e,li),r=e[li];try{e[li]=void 0;var n=!0}catch{}var i=NN.call(e);return n&&(t?e[li]=r:delete e[li]),i}var SN=_N,AN=Object.prototype,ON=AN.toString;function PN(e){return ON.call(e)}var CN=PN,im=vs,kN=SN,EN=CN,$N="[object Null]",TN="[object Undefined]",sm=im?im.toStringTag:void 0;function MN(e){return e==null?e===void 0?TN:$N:sm&&sm in Object(e)?kN(e):EN(e)}var Fr=MN;function DN(e){return e!=null&&typeof e=="object"}var Br=DN,IN=Fr,RN=Br,LN="[object Symbol]";function FN(e){return typeof e=="symbol"||RN(e)&&IN(e)==LN}var Ha=FN,BN=Pt,qN=Ha,UN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zN=/^\w*$/;function WN(e,t){if(BN(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||qN(e)?!0:zN.test(e)||!UN.test(e)||t!=null&&e in Object(t)}var kd=WN;function VN(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var tn=VN;const Ya=De(tn);var KN=Fr,GN=tn,HN="[object AsyncFunction]",YN="[object Function]",XN="[object GeneratorFunction]",QN="[object Proxy]";function JN(e){if(!GN(e))return!1;var t=KN(e);return t==YN||t==XN||t==HN||t==QN}var Ed=JN;const fe=De(Ed);var ZN=wr,e1=ZN["__core-js_shared__"],t1=e1,nc=t1,om=function(){var e=/[^.]+$/.exec(nc&&nc.keys&&nc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function r1(e){return!!om&&om in e}var n1=r1,a1=Function.prototype,i1=a1.toString;function s1(e){if(e!=null){try{return i1.call(e)}catch{}try{return e+""}catch{}}return""}var Xv=s1,o1=Ed,l1=n1,c1=tn,u1=Xv,d1=/[\\^$.*+?()[\]{}|]/g,f1=/^\[object .+?Constructor\]$/,m1=Function.prototype,h1=Object.prototype,p1=m1.toString,g1=h1.hasOwnProperty,v1=RegExp("^"+p1.call(g1).replace(d1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x1(e){if(!c1(e)||l1(e))return!1;var t=o1(e)?v1:f1;return t.test(u1(e))}var y1=x1;function b1(e,t){return e==null?void 0:e[t]}var j1=b1,w1=y1,N1=j1;function _1(e,t){var r=N1(e,t);return w1(r)?r:void 0}var Ln=_1,S1=Ln,A1=S1(Object,"create"),al=A1,lm=al;function O1(){this.__data__=lm?lm(null):{},this.size=0}var P1=O1;function C1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var k1=C1,E1=al,$1="__lodash_hash_undefined__",T1=Object.prototype,M1=T1.hasOwnProperty;function D1(e){var t=this.__data__;if(E1){var r=t[e];return r===$1?void 0:r}return M1.call(t,e)?t[e]:void 0}var I1=D1,R1=al,L1=Object.prototype,F1=L1.hasOwnProperty;function B1(e){var t=this.__data__;return R1?t[e]!==void 0:F1.call(t,e)}var q1=B1,U1=al,z1="__lodash_hash_undefined__";function W1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=U1&&t===void 0?z1:t,this}var V1=W1,K1=P1,G1=k1,H1=I1,Y1=q1,X1=V1;function Xa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Xa.prototype.clear=K1;Xa.prototype.delete=G1;Xa.prototype.get=H1;Xa.prototype.has=Y1;Xa.prototype.set=X1;var Q1=Xa;function J1(){this.__data__=[],this.size=0}var Z1=J1;function e_(e,t){return e===t||e!==e&&t!==t}var $d=e_,t_=$d;function r_(e,t){for(var r=e.length;r--;)if(t_(e[r][0],t))return r;return-1}var il=r_,n_=il,a_=Array.prototype,i_=a_.splice;function s_(e){var t=this.__data__,r=n_(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():i_.call(t,r,1),--this.size,!0}var o_=s_,l_=il;function c_(e){var t=this.__data__,r=l_(t,e);return r<0?void 0:t[r][1]}var u_=c_,d_=il;function f_(e){return d_(this.__data__,e)>-1}var m_=f_,h_=il;function p_(e,t){var r=this.__data__,n=h_(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var g_=p_,v_=Z1,x_=o_,y_=u_,b_=m_,j_=g_;function Qa(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Qa.prototype.clear=v_;Qa.prototype.delete=x_;Qa.prototype.get=y_;Qa.prototype.has=b_;Qa.prototype.set=j_;var sl=Qa,w_=Ln,N_=wr,__=w_(N_,"Map"),Td=__,cm=Q1,S_=sl,A_=Td;function O_(){this.size=0,this.__data__={hash:new cm,map:new(A_||S_),string:new cm}}var P_=O_;function C_(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var k_=C_,E_=k_;function $_(e,t){var r=e.__data__;return E_(t)?r[typeof t=="string"?"string":"hash"]:r.map}var ol=$_,T_=ol;function M_(e){var t=T_(this,e).delete(e);return this.size-=t?1:0,t}var D_=M_,I_=ol;function R_(e){return I_(this,e).get(e)}var L_=R_,F_=ol;function B_(e){return F_(this,e).has(e)}var q_=B_,U_=ol;function z_(e,t){var r=U_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var W_=z_,V_=P_,K_=D_,G_=L_,H_=q_,Y_=W_;function Ja(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ja.prototype.clear=V_;Ja.prototype.delete=K_;Ja.prototype.get=G_;Ja.prototype.has=H_;Ja.prototype.set=Y_;var Md=Ja,Qv=Md,X_="Expected a function";function Dd(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(X_);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Dd.Cache||Qv),r}Dd.Cache=Qv;var Jv=Dd;const Q_=De(Jv);var J_=Jv,Z_=500;function eS(e){var t=J_(e,function(n){return r.size===Z_&&r.clear(),n}
vendor: 6,644 bytes, lines 56-64
56),r=t.cache;return t}var tS=eS,rS=tS,nS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aS=/\\(\\)?/g,iS=rS(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(nS,function(r,n,i,s){t.push(i?s.replace(aS,"$1"):n||r)}),t}),sS=iS;function oS(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Id=oS,um=vs,lS=Id,cS=Pt,uS=Ha,dS=1/0,dm=um?um.prototype:void 0,fm=dm?dm.toString:void 0;function Zv(e){if(typeof e=="string")return e;if(cS(e))return lS(e,Zv)+"";if(uS(e))return fm?fm.call(e):"";var t=e+"";return t=="0"&&1/e==-dS?"-0":t}var fS=Zv,mS=fS;function hS(e){return e==null?"":mS(e)}var ex=hS,pS=Pt,gS=kd,vS=sS,xS=ex;function yS(e,t){return pS(e)?e:gS(e,t)?[e]:vS(xS(e))}var tx=yS,bS=Ha,jS=1/0;function wS(e){if(typeof e=="string"||bS(e))return e;var t=e+"";return t=="0"&&1/e==-jS?"-0":t}var ll=wS,NS=tx,_S=ll;function SS(e,t){t=NS(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[_S(t[r++])];return r&&r==n?e:void 0}var Rd=SS,AS=Rd;function OS(e,t,r){var n=e==null?void 0:AS(e,t);return n===void 0?r:n}var rx=OS;const Dt=De(rx);function PS(e){return e==null}var CS=PS;const xe=De(CS);var kS=Fr,ES=Pt,$S=Br,TS="[object String]";function MS(e){return typeof e=="string"||!ES(e)&&$S(e)&&kS(e)==TS}var DS=MS;const Cn=De(DS);var nx={exports:{}},Ee={};/** 57 * @license React 58 * react-is.production.min.js 59 * 60 * Copyright (c) Facebook, Inc. and its affiliates. 61 * 62 * This source code is licensed under the MIT license found in the 63 * LICENSE file in the root directory of this source tree. 64 */var Ld=Symbol.for("react.element"),Fd=Symbol.for("react.portal"),cl=Symbol.for("react.fragment"),ul=Symbol.for("react.strict_mode"),dl=Symbol.for("react.profiler"),fl=Symbol.for("react.provider"),ml=Symbol.for("react.context"),IS=Symbol.for("react.server_context"),hl=Symbol.for("react.forward_ref"),pl=Symbol.for("react.suspense"),gl=Symbol.for("react.suspense_list"),vl=Symbol.for("react.memo"),xl=Symbol.for("react.lazy"),RS=Symbol.for("react.offscreen"),ax;ax=Symbol.for("react.module.reference");function Xt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ld:switch(e=e.type,e){case cl:case dl:case ul:case pl:case gl:return e;default:switch(e=e&&e.$$typeof,e){case IS:case ml:case hl:case xl:case vl:case fl:return e;default:return t}}case Fd:return t}}}Ee.ContextConsumer=ml;Ee.ContextProvider=fl;Ee.Element=Ld;Ee.ForwardRef=hl;Ee.Fragment=cl;Ee.Lazy=xl;Ee.Memo=vl;Ee.Portal=Fd;Ee.Profiler=dl;Ee.StrictMode=ul;Ee.Suspense=pl;Ee.SuspenseList=gl;Ee.isAsyncMode=function(){return!1};Ee.isConcurrentMode=function(){return!1};Ee.isContextConsumer=function(e){return Xt(e)===ml};Ee.isContextProvider=function(e){return Xt(e)===fl};Ee.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ld};Ee.isForwardRef=function(e){return Xt(e)===hl};Ee.isFragment=function(e){return Xt(e)===cl};Ee.isLazy=function(e){return Xt(e)===xl};Ee.isMemo=function(e){return Xt(e)===vl};Ee.isPortal=function(e){return Xt(e)===Fd};Ee.isProfiler=function(e){return Xt(e)===dl};Ee.isStrictMode=function(e){return Xt(e)===ul};Ee.isSuspense=function(e){return Xt(e)===pl};Ee.isSuspenseList=function(e){return Xt(e)===gl};Ee.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===cl||e===dl||e===ul||e===pl||e===gl||e===RS||typeof e=="object"&&e!==null&&(e.$$typeof===xl||e.$$typeof===vl||e.$$typeof===fl||e.$$typeof===ml||e.$$typeof===hl||e.$$typeof===ax||e.getModuleId!==void 0)};Ee.typeOf=Xt;nx.exports=Ee;var LS=nx.exports,FS=Fr,BS=Br,qS="[object Number]";function US(e){return typeof e=="number"||BS(e)&&FS(e)==qS}var ix=US;const zS=De(ix);var WS=ix;function VS(e){return WS(e)&&e!=+e}var KS=VS;const Za=De(KS);var jt=function(t){return t===0?0:t>0?1:-1},gn=function(t){return Cn(t)&&t.indexOf("%")===t.length-1},J=function(t){return zS(t)&&!Za(t)},GS=function(t){return xe(t)},at=function(t){return J(t)||Cn(t)},HS=0,Fn=function(t){var r=++HS;return"".concat(t||"").concat(r)},wt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!J(t)&&!Cn(t))return n;var s;if(gn(t)){var o=t.indexOf("%");s=r*parseFloat(t.slice(0,o))/100}else s=+t;return Za(s)&&(s=n),i&&s>r&&(s=r),s},Vr=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},YS=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i<r;i++)if(!n[t[i]])n[t[i]]=!0;else return!0;return!1},rt=function(t,r){return J(t)&&J(r)?function(n){return t+n*(r-t)}:function(){return r}};function Zs(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Dt(n,t))===r})}var XS=function(t,r){return J(t)&&J(r)?t-r:Cn(t)&&Cn(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function oa(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}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)}var QS=["viewBox","children"],JS=["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","colorRen
64dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],mm=["points","pathLength"],ac={svg:QS,polygon:mm,polyline:mm},Bd=["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","onDrag
64Capture","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"],eo=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(S.isValidElement(t)&&(n=t.props),!Ya(n))return null;var i={};return Object.keys(n).forEach(function(s){Bd.includes(s)&&(i[s]=r||function(o){return n[s](n,o)})}),i},ZS=function(t,r,n){return function(i){return t(r,n,i),null}},kn=function(t,r,n){if(!Ya(t)||Kc(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(s){var o=t[s];Bd.includes(s)&&typeof o=="function"&&(i||(i={}),i[s]=ZS(o,r,n))}),i},eA=["children"],tA=["children"];function hm(e,t){if(e==null)return{};var r=rA(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}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 pm={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"},Er=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},gm=null,ic=null,qd=function e(t){if(t===gm&&Array.isArray(ic))return ic;var r=[];return S.Children.forEach(t,function(n){xe(n)||(LS.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),ic=r,gm=t,r};function It(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Er(i)}):n=[Er(t)],qd(e).forEach(function(i){var s=Dt(i,"type.displayName")||Dt(i,"type.name");n.indexOf(s)!==-1&&r.push(i)}),r}function Et(e,t){var r=It(e,t);return r&&r[0]}var vm=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!J(n)||n<=0||!J(i)||i<=0)},nA=["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"],aA=function(t){return t&&t.type&&Cn(t.type)&&nA.indexOf(t.type)>=0},sx=function(t){return t&&Gc(t)==="object"&&"clipDot"in t},iA=function(t,r,n,i){var s,o=(s=ac==null?void 0:ac[i])!==null&&s!==void 0?s:[];return r.startsWith("data-")||!fe(t)&&(i&&o.includes(r)||JS.includes(r))||n&&Bd.includes(r)},ue=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(S.isValidElement(t)&&(i=t.props),!Ya(i))return null;var s={};
64return Object.keys(i).forEach(function(o){var l;iA((l=i)===null||l===void 0?void 0:l[o],o,r,n)&&(s[o]=i[o])}),s},Hc=function e(t,r){if(t===r)return!0;var n=S.Children.count(t);if(n!==S.Children.count(r))return!1;if(n===0)return!0;if(n===1)return xm(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var s=t[i],o=r[i];if(Array.isArray(s)||Array.isArray(o)){if(!e(s,o))return!1}else if(!xm(s,o))return!1}return!0},xm=function(t,r){if(xe(t)&&xe(r))return!0;if(!xe(t)&&!xe(r)){var n=t.props||{},i=n.children,s=hm(n,eA),o=r.props||{},l=o.children,c=hm(o,tA);return i&&l?oa(s,c)&&Hc(i,l):!i&&!l?oa(s,c):!1}return!1},ym=function(t,r){var n=[],i={};return qd(t).forEach(function(s,o){if(aA(s))n.push(s);else if(s){var l=Er(s.type),c=r[l]||{},u=c.handler,f=c.once;if(u&&(!f||!i[l])){var d=u(s,l,o);n.push(d),i[l]=!0}}}),n},sA=function(t){var r=t&&t.type;return r&&pm[r]?pm[r]:null},oA=function(t,r){return qd(r).indexOf(t)},lA=["children","width","height","viewBox","className","style","title","desc"];function Yc(){return Yc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yc.apply(this,arguments)}function cA(e,t){if(e==null)return{};var r=uA(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xc(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,u=cA(e,lA),f=i||{width:r,height:n,x:0,y:0},d=je("recharts-surface",s);return k.createElement("svg",Yc({},ue(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),k.createElement("title",null,l),k.createElement("desc",null,c),t)}var dA=["children","className"];function Qc(){return Qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qc.apply(this,arguments)}function fA(e,t){if(e==null)return{};var r=mA(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mA(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var _e=k.forwardRef(function(e,t){var r=e.children,n=e.className,i=fA(e,dA),s=je("recharts-layer",n);return k.createElement("g",Qc({className:s},ue(i,!0),{ref:t}),r)}),rr=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s]};function hA(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}var pA=hA,gA=pA;function vA(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:gA(e,t,r)}var xA=vA,yA="\\ud800-\\udfff",bA="\\u0300-\\u036f",jA="\\ufe20-\\ufe2f",wA="\\u20d0-\\u20ff",NA=bA+jA+wA,_A="\\ufe0e\\ufe0f",SA="\\u200d",AA=RegExp("["+SA+yA+NA+_A+"]");function OA(e){return AA.test(e)}var ox=OA;function PA(e){return e.split("")}var CA=PA,lx="\\ud800-\\udfff",kA="\\u0300-\\u036f",EA="\\ufe20-\\ufe2f",$A="\\u20d0-\\u20ff",TA=kA+EA+$A,MA="\\ufe0e\\ufe0f",DA="["+lx+"]",Jc="["+TA+"]",Zc="\\ud83c[\\udffb-\\udfff]",IA="(?:"+Jc+"|"+Zc+")",cx="[^"+lx+"]",ux="(?:\\ud83c[\\udde6-\\uddff]){2}",dx="[\\ud800-\\udbff][\\udc00-\\udfff]",RA="\\u200d",fx=IA+"?",mx="["+MA+"]?",LA="(?:"+RA+"(?:"+[cx,ux,dx].join("|")+")"+mx+fx+")*",FA=mx+fx+LA,BA="(?:"+[cx+Jc+"?",Jc,ux,dx,DA].join("|")+")",qA=RegExp(Zc+"(?="+Zc+")|"+BA+FA,"g");function UA(e){return e.match(qA)||[]}var zA=UA,WA=CA,VA=ox,KA=zA;function GA(e){return VA(e)?KA(e):WA(e)}var HA=GA,YA=xA,XA=ox,QA=HA,JA=ex;function ZA(e){return function(t){t=JA(t);var r=XA(t)?QA(t):void 0,n=r?r[0]:t.charAt(0),i=r?YA(r,1).join(""):t.slice(1);return n[e]()+i}}var eO=ZA,tO=eO,rO=tO("toUpperCase"),nO=rO;const yl=De(nO);function Re(e){return function(){return e}}const hx=Math.cos,to=Math.sin,fr=Math.sqrt,ro=Math.PI,bl=2*ro,eu=Math.PI,tu=2*eu,dn=1e-6,aO=tu-dn;function px(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function iO(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return px;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class sO{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?px:iO(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,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,s,o){this._append`C${+t},${+r},${+n}
64,${+i},${this._x1=+s},${this._y1=+o}`}arcTo(t,r,n,i,s){if(t=+t,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=n-t,u=i-r,f=o-t,d=l-r,m=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>dn)if(!(Math.abs(d*c-u*f)>dn)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,g=i-l,p=c*c+u*u,v=h*h+g*g,x=Math.sqrt(p),b=Math.sqrt(m),j=s*Math.tan((eu-Math.acos((p+m-v)/(2*x*b)))/2),N=j/b,y=j/x;Math.abs(N-1)>dn&&this._append`L${t+N*f},${r+N*d}`,this._append`A${s},${s},0,0,${+(d*h>f*g)},${this._x1=t+y*c},${this._y1=r+y*u}`}}arc(t,r,n,i,s,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),u=t+l,f=r+c,d=1^o,m=o?i-s:s-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>dn||Math.abs(this._y1-f)>dn)&&this._append`L${u},${f}`,n&&(m<0&&(m=m%tu+tu),m>aO?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:m>dn&&this._append`A${n},${n},0,${+(m>=eu)},${d},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Ud(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new sO(t)}function zd(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gx(e){this._context=e}gx.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 jl(e){return new gx(e)}function vx(e){return e[0]}function xx(e){return e[1]}function yx(e,t){var r=Re(!0),n=null,i=jl,s=null,o=Ud(l);e=typeof e=="function"?e:e===void 0?vx:Re(e),t=typeof t=="function"?t:t===void 0?xx:Re(t);function l(c){var u,f=(c=zd(c)).length,d,m=!1,h;for(n==null&&(s=i(h=o())),u=0;u<=f;++u)!(u<f&&r(d=c[u],u,c))===m&&((m=!m)?s.lineStart():s.lineEnd()),m&&s.point(+e(d,u,c),+t(d,u,c));if(h)return s=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Re(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Re(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Re(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(s=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=s=null:s=i(n=c),l):n},l}function ks(e,t,r){var n=null,i=Re(!0),s=null,o=jl,l=null,c=Ud(u);e=typeof e=="function"?e:e===void 0?vx:Re(+e),t=typeof t=="function"?t:Re(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?xx:Re(+r);function u(d){var m,h,g,p=(d=zd(d)).length,v,x=!1,b,j=new Array(p),N=new Array(p);for(s==null&&(l=o(b=c())),m=0;m<=p;++m){if(!(m<p&&i(v=d[m],m,d))===x)if(x=!x)h=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=m-1;g>=h;--g)l.point(j[g],N[g]);l.lineEnd(),l.areaEnd()}x&&(j[m]=+e(v,m,d),N[m]=+t(v,m,d),l.point(n?+n(v,m,d):j[m],r?+r(v,m,d):N[m]))}if(b)return l=null,b+""||null}function f(){return yx().defined(i).curve(o).context(s)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Re(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Re(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Re(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Re(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Re(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Re(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Re(!!d),u):i},u.curve=function(d){return arguments.length?(o=d,s!=null&&(l=o(s)),u):o},u.context=function(d){return arguments.length?(d==null?s=l=null:l=o(s=d),u):s},u}class bx{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 oO(e){return new bx(e,!0)}function lO(e){return new bx(e,!1)}const Wd={draw(e,t){const r=fr(t/ro);e.moveTo(r,0),e.arc(0,0,r,0,bl)}},cO={draw(e,t){const r=fr(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()}},jx=fr(1/3),uO=jx*2,dO={draw(e,t){const r=fr(t/uO),n=r*jx;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},fO={draw(e,t){const r=fr(t),n=-r/2;e.rect(n,n,r,r)}},mO=.8908130915292852,wx=to(ro/10)/to(7*ro/10),hO=to(bl/10)*wx,pO=-hx(bl/10)*wx,gO={draw(e,t){const r=fr(t*mO),n=hO*r,i=pO*r;e.moveTo(0,-r),e.lineTo(n,i);for(let s=1;s<5;++s){const o=bl*s/5,l=hx(o),c=to(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},sc=fr(3),vO={draw(e,t){const r=-fr(t/(sc*3));e.moveTo(0,r*2),e.lineTo(-sc*r,-r),e.lineTo(sc*r,-r),e.closePath()}}
vendor: 7,115 bytes, line 64
64,Lt=-.5,Ft=fr(3)/2,ru=1/fr(12),xO=(ru/2+1)*3,yO={draw(e,t){const r=fr(t/xO),n=r/2,i=r*ru,s=n,o=r*ru+r,l=-s,c=o;e.moveTo(n,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(Lt*n-Ft*i,Ft*n+Lt*i),e.lineTo(Lt*s-Ft*o,Ft*s+Lt*o),e.lineTo(Lt*l-Ft*c,Ft*l+Lt*c),e.lineTo(Lt*n+Ft*i,Lt*i-Ft*n),e.lineTo(Lt*s+Ft*o,Lt*o-Ft*s),e.lineTo(Lt*l+Ft*c,Lt*c-Ft*l),e.closePath()}};function bO(e,t){let r=null,n=Ud(i);e=typeof e=="function"?e:Re(e||Wd),t=typeof t=="function"?t:Re(t===void 0?64:+t);function i(){let s;if(r||(r=s=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:Re(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Re(+s),i):t},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function no(){}function ao(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 Nx(e){this._context=e}Nx.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:ao(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:ao(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jO(e){return new Nx(e)}function _x(e){this._context=e}_x.prototype={areaStart:no,areaEnd:no,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:ao(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wO(e){return new _x(e)}function Sx(e){this._context=e}Sx.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,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ao(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NO(e){return new Sx(e)}function Ax(e){this._context=e}Ax.prototype={areaStart:no,areaEnd:no,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 _O(e){return new Ax(e)}function bm(e){return e<0?-1:1}function jm(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(s*i+o*n)/(n+i);return(bm(s)+bm(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function wm(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function oc(e,t,r){var n=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-n)/3;e._context.bezierCurveTo(n+l,i+l*t,s-l,o-l*r,s,o)}function io(e){this._context=e}io.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:oc(this,this._t0,wm(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,oc(this,wm(this,r=jm(this,e,t)),r);break;default:oc(this,this._t0,r=jm(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Ox(e){this._context=new Px(e)}(Ox.prototype=Object.create(io.prototype)).point=function(e,t){io.prototype.point.call(this,t,e)};function Px(e){this._context=e}Px.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,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function SO(e){return new io(e)}function AO(e){return new Ox(e)}function Cx(e){this._context=e}Cx.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 n=Nm(e),i=Nm(t),s=0,o=1;o<r;++s,++o)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],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 Nm(e){var t,r=e.length-1,n,i=new Array(r),s=new Array(r),o=new Array(r);for(i[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,s[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/s[t-1],s[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/s[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function OO(e){return new Cx(e)}function wl(e,t){this._context=e,this._t=t}wl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,131 bytes, lines 64-67
64default:{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 PO(e){return new wl(e,.5)}function CO(e){return new wl(e,0)}function kO(e){return new wl(e,1)}function ya(e,t){if((o=e.length)>1)for(var r=1,n,i,s=e[t[0]],o,l=s.length;r<o;++r)for(i=s,s=e[t[r]],n=0;n<l;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function nu(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function EO(e,t){return e[t]}function $O(e){const t=[];return t.key=e,t}function TO(){var e=Re([]),t=nu,r=ya,n=EO;function i(s){var o=Array.from(e.apply(this,arguments),$O),l,c=o.length,u=-1,f;for(const d of s)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(d,o[l].key,u,s)]).data=d;for(l=0,f=zd(t(o));l<c;++l)o[f[l]].index=l;return r(o,f),o}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Re(Array.from(s)),i):e},i.value=function(s){return arguments.length?(n=typeof s=="function"?s:Re(+s),i):n},i.order=function(s){return arguments.length?(t=s==null?nu:typeof s=="function"?s:Re(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(r=s??ya,i):r},i}function MO(e,t){if((n=e.length)>0){for(var r,n,i=0,s=e[0].length,o;i<s;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}ya(e,t)}}function DO(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,s=n.length;r<s;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}ya(e,t)}}function IO(e,t){if(!(!((o=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,s,o;n<s;++n){for(var l=0,c=0,u=0;l<o;++l){for(var f=e[t[l]],d=f[n][1]||0,m=f[n-1][1]||0,h=(d-m)/2,g=0;g<l;++g){var p=e[t[g]],v=p[n][1]||0,x=p[n-1][1]||0;h+=v-x}c+=d,u+=h*d}i[n-1][1]+=i[n-1][0]=r,c&&(r-=u/c)}i[n-1][1]+=i[n-1][0]=r,ya(e,t)}}function Mi(e){"@babel/helpers - typeof";return Mi=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},Mi(e)}var RO=["type","size","sizeType"];function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},au.apply(this,arguments)}function _m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_m(Object(r),!0).forEach(function(n){LO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_m(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LO(e,t,r){return t=FO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FO(e){var t=BO(e,"string");return Mi(t)=="symbol"?t:t+""}function BO(e,t){if(Mi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qO(e,t){if(e==null)return{};var r=UO(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function UO(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var kx={symbolCircle:Wd,symbolCross:cO,symbolDiamond:dO,symbolSquare:fO,symbolStar:gO,symbolTriangle:vO,symbolWye:yO},zO=Math.PI/180,WO=function(t){var r="symbol".concat(yl(t));return kx[r]||Wd},VO=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*zO;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},KO=function(t,r){kx["symbol".concat(yl(t))]=r},Vd=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,s=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=qO(t,RO),u=Sm(Sm({},c),{},{type:n,size:s,sizeType:l}),f=function(){var v=WO(n),x=bO().type(v).size(VO(s,l,n));return x()},d=u.className,m=u.cx,h=u.cy,g=ue(u,!0);return m===+m&&h===+h&&s===+s?k.createElement("path",au({},g,{className:je("recharts-symbols",d),transform:"translate(".concat(m,", ").concat(h,")"),d:f()})):null};Vd.registerSymbol=KO;function ba(e){"@babel/helpers - typeof";return ba=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},ba(e)}function iu(){return iu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iu.apply(this,arguments)}function Am(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function GO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Am(Object(r),!0).forEach(function(n){Di(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Am(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$x(n.key),n)}}function XO(e,t,r){return t&&YO(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function QO(e,t,r){return t=so(t),JO(e,Ex()?Reflect.construct(t,r||[],so(e).constructor):t.apply(e,r))}function JO(e,t){if(t&&(ba(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZO(e)}function ZO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ex(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ex=function(){return!!e})()}function so(e){return so=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},so(e)}function eP(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&&su(e,t)}function su(e,t){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},su(e,t)}function Di(e,t,r){return t=$x(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $x(e){var t=tP(e,"string");return ba(t)=="symbol"?t:t+""}function tP(e,t){if(ba(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ba(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bt=32,Kd=function(e){function t(){return HO(this,t),QO(this,t,arguments)}return eP(t,e),XO(t,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,s=Bt/2,o=Bt/6,l=Bt/3,c=n.inactive?i:n.color;if(n.type==="plainline")return k.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:s,x2:Bt,y2:s,className:"recharts-legend-icon"});if(n.type==="line")return k.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,` 65 A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(s,` 66 H`).concat(Bt,"M").concat(2*l,",").concat(s,` 67 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(n.type==="rect")return k.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Bt/8,"h").concat(Bt,"v").concat(Bt*3/4,"h").concat(-Bt,"z"),className:"recharts-legend-icon"});if(k.isValidElement(n.legendIcon)){var u=GO({},n);return delete u.legendIcon,k.cloneElement(n.legendIcon,u)}return k.createElement(Vd,{fill:c,cx:s,cy:s,size:Bt,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,s=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,f={x:0,y:0,width:Bt,height:Bt}
67,d={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(h,g){var p=h.formatter||c,v=je(Di(Di({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",h.inactive));if(h.type==="none")return null;var x=fe(h.value)?null:h.value;rr(!fe(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=h.inactive?u:h.color;return k.createElement("li",iu({className:v,style:d,key:"legend-item-".concat(g)},kn(n.props,h,g)),k.createElement(Xc,{width:o,height:o,viewBox:f,style:m},n.renderIcon(h)),k.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},p?p(x,h,g):x))})}},{key:"render",value:function(){var n=this.props,i=n.payload,s=n.layout,o=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return k.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(S.PureComponent);Di(Kd,"displayName","Legend");Di(Kd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var rP=sl;function nP(){this.__data__=new rP,this.size=0}var aP=nP;function iP(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var sP=iP;function oP(e){return this.__data__.get(e)}var lP=oP;function cP(e){return this.__data__.has(e)}var uP=cP,dP=sl,fP=Td,mP=Md,hP=200;function pP(e,t){var r=this.__data__;if(r instanceof dP){var n=r.__data__;if(!fP||n.length<hP-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new mP(n)}return r.set(e,t),this.size=r.size,this}var gP=pP,vP=sl,xP=aP,yP=sP,bP=lP,jP=uP,wP=gP;function ei(e){var t=this.__data__=new vP(e);this.size=t.size}ei.prototype.clear=xP;ei.prototype.delete=yP;ei.prototype.get=bP;ei.prototype.has=jP;ei.prototype.set=wP;var Tx=ei,NP="__lodash_hash_undefined__";function _P(e){return this.__data__.set(e,NP),this}var SP=_P;function AP(e){return this.__data__.has(e)}var OP=AP,PP=Md,CP=SP,kP=OP;function oo(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new PP;++t<r;)this.add(e[t])}oo.prototype.add=oo.prototype.push=CP;oo.prototype.has=kP;var Mx=oo;function EP(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Dx=EP;function $P(e,t){return e.has(t)}var Ix=$P,TP=Mx,MP=Dx,DP=Ix,IP=1,RP=2;function LP(e,t,r,n,i,s){var o=r&IP,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=s.get(e),f=s.get(t);if(u&&f)return u==t&&f==e;var d=-1,m=!0,h=r&RP?new TP:void 0;for(s.set(e,t),s.set(t,e);++d<l;){var g=e[d],p=t[d];if(n)var v=o?n(p,g,d,t,e,s):n(g,p,d,e,t,s);if(v!==void 0){if(v)continue;m=!1;break}if(h){if(!MP(t,function(x,b){if(!DP(h,b)&&(g===x||i(g,x,r,n,s)))return h.push(b)})){m=!1;break}}else if(!(g===p||i(g,p,r,n,s))){m=!1;break}}return s.delete(e),s.delete(t),m}var Rx=LP,FP=wr,BP=FP.Uint8Array,qP=BP;function UP(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var zP=UP;function WP(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Gd=WP,Om=vs,Pm=qP,VP=$d,KP=Rx,GP=zP,HP=Gd,YP=1,XP=2,QP="[object Boolean]",JP="[object Date]",ZP="[object Error]",eC="[object Map]",tC="[object Number]",rC="[object RegExp]",nC="[object Set]",aC="[object String]",iC="[object Symbol]",sC="[object ArrayBuffer]",oC="[object DataView]",Cm=Om?Om.prototype:void 0,lc=Cm?Cm.valueOf:void 0;function lC(e,t,r,n,i,s,o){switch(r){case oC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case sC:return!(e.byteLength!=t.byteLength||!s(new Pm(e),new Pm(t)));case QP:case JP:case tC:return VP(+e,+t);case ZP:return e.name==t.name&&e.message==t.message;case rC:case aC:return e==t+"";case eC:var l=GP;case nC:var c=n&YP;if(l||(l=HP),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=XP,o.set(e,t);var f=KP(l(e),l(t),n,i,s,o);return o.delete(e),f;case iC:if(lc)return lc.call(e)==lc.call(t)}return!1}var cC=lC;function uC(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;
vendor: 5,388 bytes, line 67
67)e[i+r]=t[r];return e}var Lx=uC,dC=Lx,fC=Pt;function mC(e,t,r){var n=t(e);return fC(e)?n:dC(n,r(e))}var hC=mC;function pC(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var gC=pC;function vC(){return[]}var xC=vC,yC=gC,bC=xC,jC=Object.prototype,wC=jC.propertyIsEnumerable,km=Object.getOwnPropertySymbols,NC=km?function(e){return e==null?[]:(e=Object(e),yC(km(e),function(t){return wC.call(e,t)}))}:bC,_C=NC;function SC(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var AC=SC,OC=Fr,PC=Br,CC="[object Arguments]";function kC(e){return PC(e)&&OC(e)==CC}var EC=kC,Em=EC,$C=Br,Fx=Object.prototype,TC=Fx.hasOwnProperty,MC=Fx.propertyIsEnumerable,DC=Em(function(){return arguments}())?Em:function(e){return $C(e)&&TC.call(e,"callee")&&!MC.call(e,"callee")},Hd=DC,lo={exports:{}};function IC(){return!1}var RC=IC;lo.exports;(function(e,t){var r=wr,n=RC,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(lo,lo.exports);var Bx=lo.exports,LC=9007199254740991,FC=/^(?:0|[1-9]\d*)$/;function BC(e,t){var r=typeof e;return t=t??LC,!!t&&(r=="number"||r!="symbol"&&FC.test(e))&&e>-1&&e%1==0&&e<t}var Yd=BC,qC=9007199254740991;function UC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qC}var Xd=UC,zC=Fr,WC=Xd,VC=Br,KC="[object Arguments]",GC="[object Array]",HC="[object Boolean]",YC="[object Date]",XC="[object Error]",QC="[object Function]",JC="[object Map]",ZC="[object Number]",e2="[object Object]",t2="[object RegExp]",r2="[object Set]",n2="[object String]",a2="[object WeakMap]",i2="[object ArrayBuffer]",s2="[object DataView]",o2="[object Float32Array]",l2="[object Float64Array]",c2="[object Int8Array]",u2="[object Int16Array]",d2="[object Int32Array]",f2="[object Uint8Array]",m2="[object Uint8ClampedArray]",h2="[object Uint16Array]",p2="[object Uint32Array]",Fe={};Fe[o2]=Fe[l2]=Fe[c2]=Fe[u2]=Fe[d2]=Fe[f2]=Fe[m2]=Fe[h2]=Fe[p2]=!0;Fe[KC]=Fe[GC]=Fe[i2]=Fe[HC]=Fe[s2]=Fe[YC]=Fe[XC]=Fe[QC]=Fe[JC]=Fe[ZC]=Fe[e2]=Fe[t2]=Fe[r2]=Fe[n2]=Fe[a2]=!1;function g2(e){return VC(e)&&WC(e.length)&&!!Fe[zC(e)]}var v2=g2;function x2(e){return function(t){return e(t)}}var qx=x2,co={exports:{}};co.exports;(function(e,t){var r=Hv,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(co,co.exports);var y2=co.exports,b2=v2,j2=qx,$m=y2,Tm=$m&&$m.isTypedArray,w2=Tm?j2(Tm):b2,Ux=w2,N2=AC,_2=Hd,S2=Pt,A2=Bx,O2=Yd,P2=Ux,C2=Object.prototype,k2=C2.hasOwnProperty;function E2(e,t){var r=S2(e),n=!r&&_2(e),i=!r&&!n&&A2(e),s=!r&&!n&&!i&&P2(e),o=r||n||i||s,l=o?N2(e.length,String):[],c=l.length;for(var u in e)(t||k2.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||O2(u,c)))&&l.push(u);return l}var $2=E2,T2=Object.prototype;function M2(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||T2;return e===r}var D2=M2;function I2(e,t){return function(r){return e(t(r))}}var zx=I2,R2=zx,L2=R2(Object.keys,Object),F2=L2,B2=D2,q2=F2,U2=Object.prototype,z2=U2.hasOwnProperty;function W2(e){if(!B2(e))return q2(e);var t=[];for(var r in Object(e))z2.call(e,r)&&r!="constructor"&&t.push(r);return t}var V2=W2,K2=Ed,G2=Xd;function H2(e){return e!=null&&G2(e.length)&&!K2(e)}var xs=H2,Y2=$2,X2=V2,Q2=xs;function J2(e){return Q2(e)?Y2(e):X2(e)}var Nl=J2,Z2=hC,ek=_C,tk=Nl;function rk(e){return Z2(e,tk,ek)}var nk=rk,Mm=nk,ak=1,ik=Object.prototype,sk=ik.hasOwnProperty;function ok(e,t,r,n,i,s){var o=r&ak,l=Mm(e),c=l.length,u=Mm(t),f=u.length;if(c!=f&&!o)return!1;for(var d=c;d--;){var m=l[d];if(!(o?m in t:sk.call(t,m)))return!1}var h=s.get(e),g=s.get(t);if(h&&g)return h==t&&g==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=o;++d<c;){m=l[d];var x=e[m],b=t[m];if(n)var j=o?n(b,x,m,t,e,s):n(x,b,m,e,t,s);if(!(j===void 0?x===b||i(x,b,r,n,s):j)){p=!1;break}v||(v=m=="constructor")}if(p&&!v){var N=e.constructor,y=t.constructor;N!=y&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof y=="function"&&y instanceof y)&&(p=!1)}return s.delete(e),s.delete(t),p}var lk=ok,ck=Ln,uk=wr,dk=ck(uk,"DataView"),fk=dk,mk=Ln,hk=wr,pk=mk(hk,"Promise"),gk=pk,vk=Ln,xk=wr,yk=vk(xk,"Set"),Wx=yk,bk=Ln,jk=wr,wk=bk(jk,"WeakMap"),Nk=wk,ou=fk,lu=Td,cu=gk,uu=Wx,du=Nk,Vx=Fr,ti=Xv,Dm="[object Map]",_k="[object Object]",Im="[object Promise]",Rm="[object Set]",Lm="[object WeakMap]",Fm="[object DataView]",Sk=ti(ou),Ak=ti(lu),Ok=ti(cu),Pk=ti(uu),Ck=ti(du),fn=Vx;(ou&&fn(new ou(new ArrayBuffer(1)))!=Fm||lu&&fn(new lu)!=Dm||cu&&fn(cu.resolve())!=Im||uu&&fn(new uu)!=Rm||du&&fn(new du)!=Lm)&&(fn=function(e){var t=Vx(e),r=t==_k?e.constructor:void 0,n=r?ti(r):"";if(n)switch(n){case Sk:return Fm;case Ak:return Dm;case Ok:return Im;case Pk:return Rm;case Ck:return Lm}return t});var kk=fn,cc=Tx,Ek=Rx,$k=cC,Tk=lk,Bm=kk,qm=Pt,Um=Bx,Mk=Ux,Dk=1,zm="[object Arguments]",Wm="[object Array]",Es="[object Object]",Ik=Object.prototype,Vm=Ik.hasOwnProperty;function Rk(e,t,r,n,i,s){var o=qm(e),l=qm(t),c=o?Wm:Bm(e),u=l?Wm:Bm(t);c=c==zm?Es:c,u=u==zm?Es:u;var f=c==Es,d=u==Es,m=c==u;if(m&&Um(e)){if(!Um(t))return!1;o=!0,f=!1}if(m&&!f)return s||(s=new cc),o||Mk(e)?Ek(e,t,r,n,i,s):$k(e,t,c,r,n,i,s);if(!(r&Dk)){var h=f&&Vm.call(e,"__wrapped__"),g=d&&Vm.call(t,"__wrapped__");
67if(h||g){var p=h?e.value():e,v=g?t.value():t;return s||(s=new cc),i(p,v,r,n,s)}}return m?(s||(s=new cc),Tk(e,t,r,n,i,s)):!1}var Lk=Rk,Fk=Lk,Km=Br;function Kx(e,t,r,n,i){return e===t?!0:e==null||t==null||!Km(e)&&!Km(t)?e!==e&&t!==t:Fk(e,t,r,n,Kx,i)}var Qd=Kx,Bk=Tx,qk=Qd,Uk=1,zk=2;function Wk(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=r[i];var c=l[0],u=e[c],f=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var d=new Bk;if(n)var m=n(u,f,c,e,t,d);if(!(m===void 0?qk(f,u,Uk|zk,n,d):m))return!1}}return!0}var Vk=Wk,Kk=tn;function Gk(e){return e===e&&!Kk(e)}var Gx=Gk,Hk=Gx,Yk=Nl;function Xk(e){for(var t=Yk(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Hk(i)]}return t}var Qk=Xk;function Jk(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Hx=Jk,Zk=Vk,eE=Qk,tE=Hx;function rE(e){var t=eE(e);return t.length==1&&t[0][2]?tE(t[0][0],t[0][1]):function(r){return r===e||Zk(r,e,t)}}var nE=rE;function aE(e,t){return e!=null&&t in Object(e)}var iE=aE,sE=tx,oE=Hd,lE=Pt,cE=Yd,uE=Xd,dE=ll;function fE(e,t,r){t=sE(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=dE(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&uE(i)&&cE(o,i)&&(lE(e)||oE(e)))}var mE=fE,hE=iE,pE=mE;function gE(e,t){return e!=null&&pE(e,t,hE)}var vE=gE,xE=Qd,yE=rx,bE=vE,jE=kd,wE=Gx,NE=Hx,_E=ll,SE=1,AE=2;function OE(e,t){return jE(e)&&wE(t)?NE(_E(e),t):function(r){var n=yE(r,e);return n===void 0&&n===t?bE(r,e):xE(t,n,SE|AE)}}var PE=OE;function CE(e){return e}var ri=CE;function kE(e){return function(t){return t==null?void 0:t[e]}}var EE=kE,$E=Rd;function TE(e){return function(t){return $E(t,e)}}var ME=TE,DE=EE,IE=ME,RE=kd,LE=ll;function FE(e){return RE(e)?DE(LE(e)):IE(e)}var BE=FE,qE=nE,UE=PE,zE=ri,WE=Pt,VE=BE;function KE(e){return typeof e=="function"?e:e==null?zE:typeof e=="object"?WE(e)?UE(e[0],e[1]):qE(e):VE(e)}var Nr=KE;function GE(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var Yx=GE;function HE(e){return e!==e}var YE=HE;function XE(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var QE=XE,JE=Yx,ZE=YE,e$=QE;function t$(e,t,r){return t===t?e$(e,t,r):JE(e,ZE,r)}var r$=t$,n$=r$;function a$(e,t){var r=e==null?0:e.length;return!!r&&n$(e,t,0)>-1}var i$=a$;function s$(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var o$=s$;function l$(){}var c$=l$,uc=Wx,u$=c$,d$=Gd,f$=1/0,m$=uc&&1/d$(new uc([,-0]))[1]==f$?function(e){return new uc(e)}:u$,h$=m$,p$=Mx,g$=i$,v$=o$,x$=Ix,y$=h$,b$=Gd,j$=200;function w$(e,t,r){var n=-1,i=g$,s=e.length,o=!0,l=[],c=l;if(r)o=!1,i=v$;else if(s>=j$){var u=t?null:y$(e);if(u)return b$(u);o=!1,i=x$,c=new p$}else c=t?[]:l;e:for(;++n<s;){var f=e[n],d=t?t(f):f;if(f=r||f!==0?f:0,o&&d===d){for(var m=c.length;m--;)if(c[m]===d)continue e;t&&c.push(d),l.push(f)}else i(c,d,r)||(c!==l&&c.push(d),l.push(f))}return l}var N$=w$,_$=Nr,S$=N$;function A$(e,t){return e&&e.length?S$(e,_$(t)):[]}var O$=A$;const Gm=De(O$);function Xx(e,t,r){return t===!0?Gm(e,r):fe(t)?Gm(e,t):e}function ja(e){"@babel/helpers - typeof";return ja=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},ja(e)}var P$=["ref"];function Hm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hm(Object(r),!0).forEach(function(n){_l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function C$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ym(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jx(n.key),n)}}function k$(e,t,r){return t&&Ym(e.prototype,t),r&&Ym(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function E$(e,t,r){return t=uo(t),$$(e,Qx()?Reflect.construct(t,r||[],uo(e).constructor):t.apply(e,r))}function $$(e,t){if(t&&(ja(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T$(e)}function T$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qx=function(){return!!e})()}
67function uo(e){return uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uo(e)}function M$(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&&fu(e,t)}function fu(e,t){return fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fu(e,t)}function _l(e,t,r){return t=Jx(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jx(e){var t=D$(e,"string");return ja(t)=="symbol"?t:t+""}function D$(e,t){if(ja(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ja(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I$(e,t){if(e==null)return{};var r=R$(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function R$(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function L$(e){return e.value}function F$(e,t){if(k.isValidElement(e))return k.cloneElement(e,t);if(typeof e=="function")return k.createElement(e,t);t.ref;var r=I$(t,P$);return k.createElement(Kd,r)}var Xm=1,nr=function(e){function t(){var r;C$(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=E$(this,t,[].concat(i)),_l(r,"lastBoundingBox",{width:-1,height:-1}),r}return M$(t,e),k$(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>Xm||Math.abs(i.height-this.lastBoundingBox.height)>Xm)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Sr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,s=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,f=i.chartHeight,d,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&s==="vertical"){var h=this.getBBoxSnapshot();d={left:((u||0)-h.width)/2}}else d=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();m={top:((f||0)-g.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Sr(Sr({},d),m)}},{key:"render",value:function(){var n=this,i=this.props,s=i.content,o=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Sr(Sr({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return k.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(h){n.wrapperNode=h}},F$(s,Sr(Sr({},this.props),{},{payload:Xx(f,u,L$)})))}}],[{key:"getWithHeight",value:function(n,i){var s=Sr(Sr({},this.defaultProps),n.props),o=s.layout;return o==="vertical"&&J(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(S.PureComponent);_l(nr,"displayName","Legend");_l(nr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Qm=vs,B$=Hd,q$=Pt,Jm=Qm?Qm.isConcatSpreadable:void 0;function U$(e){return q$(e)||B$(e)||!!(Jm&&e&&e[Jm])}var z$=U$,W$=Lx,V$=z$;function Zx(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=V$),i||(i=[]);++s<o;){var l=e[s];t>0&&r(l)?t>1?Zx(l,t-1,r,n,i):W$(i,l):n||(i[i.length]=l)}return i}var ey=Zx;function K$(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++i];if(r(s[c],c,s)===!1)break}return t}}var G$=K$,H$=G$,Y$=H$(),X$=Y$,Q$=X$,J$=Nl;function Z$(e,t){return e&&Q$(e,t,J$)}var ty=Z$,eT=xs;function tT(e,t){return function(r,n){if(r==null)return r;if(!eT(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Object(r);(t?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}var rT=tT,nT=ty,aT=rT,iT=aT(nT),Jd=iT,sT=Jd,oT=xs;function lT(e,t){var r=-1,n=oT(e)?Array(e.length):[];return sT(e,function(i,s,o){n[++r]=t(i,s,o)}),n}var ry=lT;function cT(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var uT=cT,Zm=Ha;function dT(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,s=Zm(e),o=t!==void 0,l=t===null,c=t===t,u=Zm(t);if(!l&&!u&&!s&&e>t||s&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!i)return 1;if(!n&&!s&&!u&&e<t||u&&r&&i&&!n&&!s||l&&r&&i||!o&&i||!c)return-1}return 0}var fT=dT,mT=fT;function hT(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,l=r.length;++n<o;){var c=mT(i[n],s[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var pT=hT,dc=Id,gT=Rd,vT=Nr,xT=ry,yT=uT,bT=qx,jT=pT,wT=ri,NT=Pt;function _T(e,t,r){t.length?t=dc(t,function(s){return NT(s)?function(o){return gT(o,s.length===1?s[0]:s)}:s}):t=[wT];var n=-1;t=dc(t,bT(vT));var i=xT(e,function(s,o,l){var c=dc(t,function(u){return u(s)});return{criteria:c,index:++n,value:s}});return yT(i,function(s,o){return jT(s,o,r)})}var ST=_T;function AT(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var OT=AT,PT=OT,eh=Math.max;function CT(e,t,r){return t=eh(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=eh(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),PT(e,this,l)}}var kT=CT;function ET(e){return function(){return e}}var $T=ET,TT=Ln,MT=function(){try{var e=TT(Object,"defineProperty");return e({},"",{}),e}catch{}}
67(),ny=MT,DT=$T,th=ny,IT=ri,RT=th?function(e,t){return th(e,"toString",{configurable:!0,enumerable:!1,value:DT(t),writable:!0})}:IT,LT=RT,FT=800,BT=16,qT=Date.now;function UT(e){var t=0,r=0;return function(){var n=qT(),i=BT-(n-r);if(r=n,i>0){if(++t>=FT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zT=UT,WT=LT,VT=zT,KT=VT(WT),GT=KT,HT=ri,YT=kT,XT=GT;function QT(e,t){return XT(YT(e,t,HT),e+"")}var JT=QT,ZT=$d,eM=xs,tM=Yd,rM=tn;function nM(e,t,r){if(!rM(r))return!1;var n=typeof t;return(n=="number"?eM(r)&&tM(t,r.length):n=="string"&&t in r)?ZT(r[t],e):!1}var Sl=nM,aM=ey,iM=ST,sM=JT,rh=Sl,oM=sM(function(e,t){if(e==null)return[];var r=t.length;return r>1&&rh(e,t[0],t[1])?t=[]:r>2&&rh(t[0],t[1],t[2])&&(t=[t[0]]),iM(e,aM(t,1),[])}),lM=oM;const Zd=De(lM);function Ii(e){"@babel/helpers - typeof";return Ii=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},Ii(e)}function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mu.apply(this,arguments)}function cM(e,t){return mM(e)||fM(e,t)||dM(e,t)||uM()}function uM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 68In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dM(e,t){if(e){if(typeof e=="string")return nh(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 nh(e,t)}}function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fM(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function mM(e){if(Array.isArray(e))return e}function ah(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ah(Object(r),!0).forEach(function(n){hM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ah(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hM(e,t,r){return t=pM(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pM(e){var t=gM(e,"string");return Ii(t)=="symbol"?t:t+""}function gM(e,t){if(Ii(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vM(e){return Array.isArray(e)&&at(e[0])&&at(e[1])?e.join(" ~ "):e}var xM=function(t){var r=t.separator,n=r===void 0?" : ":r,i=t.contentStyle,s=i===void 0?{}:i,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,f=t.payload,d=t.formatter,m=t.itemSorter,h=t.wrapperClassName,g=t.labelClassName,p=t.label,v=t.labelFormatter,x=t.accessibilityLayer,b=x===void 0?!1:x,j=function(){if(f&&f.length){var M={padding:0,margin:0},E=(m?Zd(f,m):f).map(function(T,$){if(T.type==="none")return null;var I=fc({display:"block",paddingTop:4,paddingBottom:4,color:T.color||"#000"},l),B=T.formatter||d||vM,L=T.value,X=T.name,z=L,U=X;if(B&&z!=null&&U!=null){var D=B(L,X,T,$,f);if(Array.isArray(D)){var Q=cM(D,2);z=Q[0],U=Q[1]}else z=D}return k.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:I},at(U)?k.createElement("span",{className:"recharts-tooltip-item-name"},U):null,at(U)?k.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,k.createElement("span",{className:"recharts-tooltip-item-value"},z),k.createElement("span",{className:"recharts-tooltip-item-unit"},T.unit||""))});return k.createElement("ul",{className:"recharts-tooltip-item-list",style:M},E)}return null},N=fc({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),y=fc({margin:0},u),w=!xe(p),_=w?p:"",O=je("recharts-default-tooltip",h),A=je("recharts-tooltip-label",g);w&&v&&f!==void 0&&f!==null&&(_=v(p,f));
vendor: 7,209 bytes, line 68
68var C=b?{role:"status","aria-live":"assertive"}:{};return k.createElement("div",mu({className:O,style:N},C),k.createElement("p",{className:A,style:y},k.isValidElement(_)?_:"".concat(_)),j())};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 $s(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=bM(e,"string");return Ri(t)=="symbol"?t:t+""}function bM(e,t){if(Ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ci="recharts-tooltip-wrapper",jM={visibility:"hidden"};function wM(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return je(ci,$s($s($s($s({},"".concat(ci,"-right"),J(r)&&t&&J(t.x)&&r>=t.x),"".concat(ci,"-left"),J(r)&&t&&J(t.x)&&r<t.x),"".concat(ci,"-bottom"),J(n)&&t&&J(t.y)&&n>=t.y),"".concat(ci,"-top"),J(n)&&t&&J(t.y)&&n<t.y))}function ih(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&J(s[n]))return s[n];var f=r[n]-l-i,d=r[n]+i;if(t[n])return o[n]?f:d;if(o[n]){var m=f,h=c[n];return m<h?Math.max(d,c[n]):Math.max(f,c[n])}var g=d+l,p=c[n]+u;return g>p?Math.max(f,c[n]):Math.max(d,c[n])}function NM(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function _M(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=ih({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=ih({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=NM({translateX:f,translateY:d,useTranslate3d:l})):u=jM,{cssProperties:u,cssClasses:wM({translateX:f,translateY:d,coordinate:r})}}function wa(e){"@babel/helpers - typeof";return wa=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},wa(e)}function sh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function oh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sh(Object(r),!0).forEach(function(n){pu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iy(n.key),n)}}function OM(e,t,r){return t&&AM(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PM(e,t,r){return t=fo(t),CM(e,ay()?Reflect.construct(t,r||[],fo(e).constructor):t.apply(e,r))}function CM(e,t){if(t&&(wa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kM(e)}function kM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ay(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ay=function(){return!!e})()}function fo(e){return fo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fo(e)}function EM(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&&hu(e,t)}function hu(e,t){return hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hu(e,t)}function pu(e,t,r){return t=iy(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iy(e){var t=$M(e,"string");return wa(t)=="symbol"?t:t+""}function $M(e,t){if(wa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lh=1,TM=function(e){function t(){var r;SM(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=PM(this,t,[].concat(i)),pu(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),pu(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,f;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(f=r.props.coordinate)===null||f===void 0?void 0:f.y)!==null&&u!==void 0?u:0}})}}),r}return EM(t,e),OM(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>lh||Math.abs(n.height-this.state.lastBoundingBox.height)>lh)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,m=i.isAnimationActive,h=i.offset,g=i.position,p=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,b=i.wrapperStyle,j=_M({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:h,position:g,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}
68),N=j.cssClasses,y=j.cssProperties,w=oh(oh({transition:m&&s?"transform ".concat(l,"ms ").concat(c):void 0},y),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&d?"visible":"hidden",position:"absolute",top:0,left:0},b);return k.createElement("div",{tabIndex:-1,className:N,style:w,ref:function(O){n.wrapperNode=O}},u)}}])}(S.PureComponent),MM=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ar={isSsr:MM(),get:function(t){return ar[t]},set:function(t,r){if(typeof t=="string")ar[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){ar[i]=t[i]})}}};function Na(e){"@babel/helpers - typeof";return Na=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},Na(e)}function ch(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ch(Object(r),!0).forEach(function(n){ef(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ch(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IM(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oy(n.key),n)}}function RM(e,t,r){return t&&IM(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LM(e,t,r){return t=mo(t),FM(e,sy()?Reflect.construct(t,r||[],mo(e).constructor):t.apply(e,r))}function FM(e,t){if(t&&(Na(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BM(e)}function BM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sy=function(){return!!e})()}function mo(e){return mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mo(e)}function qM(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&&gu(e,t)}function gu(e,t){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},gu(e,t)}function ef(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=UM(e,"string");return Na(t)=="symbol"?t:t+""}function UM(e,t){if(Na(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Na(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zM(e){return e.dataKey}function WM(e,t){return k.isValidElement(e)?k.cloneElement(e,t):typeof e=="function"?k.createElement(e,t):k.createElement(xM,t)}var gt=function(e){function t(){return DM(this,t),LM(this,t,arguments)}return qM(t,e),RM(t,[{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,f=i.coordinate,d=i.filterNull,m=i.isAnimationActive,h=i.offset,g=i.payload,p=i.payloadUniqBy,v=i.position,x=i.reverseDirection,b=i.useTranslate3d,j=i.viewBox,N=i.wrapperStyle,y=g??[];d&&y.length&&(y=Xx(g.filter(function(_){return _.value!=null&&(_.hide!==!0||n.props.includeHidden)}),p,zM));var w=y.length>0;return k.createElement(TM,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:m,active:s,coordinate:f,hasPayload:w,offset:h,position:v,reverseDirection:x,useTranslate3d:b,viewBox:j,wrapperStyle:N},WM(u,uh(uh({},this.props),{},{payload:y})))}}])}(S.PureComponent);ef(gt,"displayName","Tooltip");ef(gt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ar.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 VM=wr,KM=function(){return VM.Date.now()},GM=KM,HM=/\s/;function YM(e){for(var t=e.length;t--&&HM.test(e.charAt(t)););return t}var XM=YM,QM=XM,JM=/^\s+/;function ZM(e){return e&&e.slice(0,QM(e)+1).replace(JM,"")}var eD=ZM,tD=eD,dh=tn,rD=Ha,fh=NaN,nD=/^[-+]0x[0-9a-f]+$/i,aD=/^0b[01]+$/i,iD=/^0o[0-7]+$/i,sD=parseInt;function oD(e){if(typeof e=="number")return e;if(rD(e))return fh;if(dh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=dh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=tD(e);var r=aD.test(e);return r||iD.test(e)?sD(e.slice(2),r?2:8):nD.test(e)?fh:+e}var ly=oD,lD=tn,mc=GM,mh=ly,cD="Expected a function",uD=Math.max,dD=Math.min;function fD(e,t,r){var n,i,s,o,l,c,u=0,f=!1,d=!1,m=!0;if(typeof e!="function")throw new TypeError(cD);t=mh(t)||0,lD(r)&&(f=!!r.leading,d="maxWait"in r,s=d?uD(mh(r.maxWait)||0,t):s,m="trailing"in r?!!r.trailing:m);function h(w){var _=n,O=i;return n=i=void 0,u=w,o=e.apply(O,_),o}function g(w){return u=w,l=setTimeout(x,t),f?h(w):o}function p(w){var _=w-c,O=w-u,A=t-_;return d?dD(A,s-O):A}function v(w){var _=w-c,O=w-u;return c===void 0||_>=t||_<0||d&&O>=s}function x(){var w=mc();if(v(w))return b(w);l=setTimeout(x,p(w))}function b(w){return l=void 0,m&&n?h(w):(n=i=void 0,o)}function j(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function N(){return l===void 0?o:b(mc())}function y(){var w=mc(),_=v(w);if(n=arguments,i=this,c=w,_){if(l===void 0)return g(c);if(d)return clearTimeout(l),l=setTimeout(x,t),h(c)}return l===void 0&&(l=setTimeout(x,t)),o}
vendor: 14,298 bytes, lines 68-75
68return y.cancel=j,y.flush=N,y}var mD=fD,hD=mD,pD=tn,gD="Expected a function";function vD(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(gD);return pD(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),hD(e,t,{leading:n,maxWait:t,trailing:i})}var xD=vD;const cy=De(xD);function Li(e){"@babel/helpers - typeof";return Li=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},Li(e)}function hh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ts(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hh(Object(r),!0).forEach(function(n){yD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yD(e,t,r){return t=bD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bD(e){var t=jD(e,"string");return Li(t)=="symbol"?t:t+""}function jD(e,t){if(Li(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wD(e,t){return AD(e)||SD(e,t)||_D(e,t)||ND()}function ND(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 69In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _D(e,t){if(e){if(typeof e=="string")return ph(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 ph(e,t)}}function ph(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function SD(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function AD(e){if(Array.isArray(e))return e}var jn=S.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,i=n===void 0?{width:-1,height:-1}:n,s=e.width,o=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,f=u===void 0?0:u,d=e.minHeight,m=e.maxHeight,h=e.children,g=e.debounce,p=g===void 0?0:g,v=e.id,x=e.className,b=e.onResize,j=e.style,N=j===void 0?{}:j,y=S.useRef(null),w=S.useRef();w.current=b,S.useImperativeHandle(t,function(){return Object.defineProperty(y.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),y.current},configurable:!0})});var _=S.useState({containerWidth:i.width,containerHeight:i.height}),O=wD(_,2),A=O[0],C=O[1],P=S.useCallback(function(E,T){C(function($){var I=Math.round(E),B=Math.round(T);return $.containerWidth===I&&$.containerHeight===B?$:{containerWidth:I,containerHeight:B}})},[]);S.useEffect(function(){var E=function(X){var z,U=X[0].contentRect,D=U.width,Q=U.height;P(D,Q),(z=w.current)===null||z===void 0||z.call(w,D,Q)};p>0&&(E=cy(E,p,{trailing:!0,leading:!1}));var T=new ResizeObserver(E),$=y.current.getBoundingClientRect(),I=$.width,B=$.height;return P(I,B),T.observe(y.current),function(){T.disconnect()}},[P,p]);var M=S.useMemo(function(){var E=A.containerWidth,T=A.containerHeight;if(E<0||T<0)return null;rr(gn(o)||gn(c),`The width(%s) and height(%s) are both fixed numbers, 70 maybe you don't need to use a ResponsiveContainer.`,o,c),rr(!r||r>0,"The aspect(%s) must be greater than zero.",r);var $=gn(o)?E:o,I=gn(c)?T:c;r&&r>0&&($?I=$/r:I&&($=I*r),m&&I>m&&(I=m)),rr($>0||I>0,`The width(%s) and height(%s) of chart should be greater than 0, 71 please check the style of container, or the props width(%s) and height(%s), 72 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 73 height and width.`,$,I,o,c,f,d,r);var B=!Array.isArray(h)&&Er(h.type).endsWith("Chart");return k.Children.map(h,function(L){return k.isValidElement(L)?S.cloneElement(L,Ts({width:$,height:I},B?{style:Ts({height:"100%",width:"100%",maxHeight:I,maxWidth:$},L.props.style)}:{})):L})},[r,h,c,m,d,f,A,o]);return k.createElement("div",{id:v?"".concat(v):void 0,className:je("recharts-responsive-container",x),style:Ts(Ts({},N),{},{width:o,height:c,minWidth:f,minHeight:d,maxHeight:m}),ref:y},M)}),Al=function(t){return null};Al.displayName="Cell";function Fi(e){"@babel/helpers - typeof";return Fi=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},Fi(e)}function gh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gh(Object(r),!0).forEach(function(n){OD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OD(e,t,r){return t=PD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PD(e){var t=CD(e,"string");return Fi(t)=="symbol"?t:t+""}function CD(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wn={widthCache:{},cacheCount:0},kD=2e3,ED={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},vh="recharts_measurement_span";function $D(e){var t=vu({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var _i=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ar.isSsr)return{width:0,height:0};var n=$D(r),i=JSON.stringify({text:t,copyStyle:n});if(Wn.widthCache[i])return Wn.widthCache[i];try{var s=document.getElementById(vh);s||(s=document.createElement("span"),s.setAttribute("id",vh),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=vu(vu({},ED),n);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return Wn.widthCache[i]=c,++Wn.cacheCount>kD&&(Wn.cacheCount=0,Wn.widthCache={}),c}catch{return{width:0,height:0}}},TD=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Bi(e){"@babel/helpers - typeof";return Bi=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},Bi(e)}function ho(e,t){return RD(e)||ID(e,t)||DD(e,t)||MD()}function MD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 74In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DD(e,t){if(e){if(typeof e=="string")return xh(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 xh(e,t)}}function xh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ID(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function RD(e){if(Array.isArray(e))return e}function LD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,BD(n.key),n)}}function FD(e,t,r){return t&&yh(e.prototype,t),r&&yh(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BD(e){var t=qD(e,"string");return Bi(t)=="symbol"?t:t+""}function qD(e,t){if(Bi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bh=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,jh=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,UD=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,zD=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uy={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},WD=Object.keys(uy),ea="NaN";function VD(e,t){return e*uy[t]}var Ms=function(){function e(t,r){LD(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!UD.test(r)&&(this.num=NaN,this.unit=""),WD.includes(r)&&(this.num=VD(t,r),this.unit="px")}return FD(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 n,i=(n=zD.exec(r))!==null&&n!==void 0?n:[],s=ho(i,3),o=s[1],l=s[2];return new e(parseFloat(o),l??"")}}])}();function dy(e){if(e.includes(ea))return ea;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=bh.exec(t))!==null&&r!==void 0?r:[],i=ho(n,4),s=i[1],o=i[2],l=i[3],c=Ms.parse(s??""),u=Ms.parse(l??""),f=o==="*"?c.multiply(u):c.divide(u);if(f.isNaN())return ea;t=t.replace(bh,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,m=(d=jh.exec(t))!==null&&d!==void 0?d:[],h=ho(m,4),g=h[1],p=h[2],v=h[3],x=Ms.parse(g??""),b=Ms.parse(v??""),j=p==="+"?x.add(b):x.subtract(b);if(j.isNaN())return ea;t=t.replace(jh,j.toString())}return t}var wh=/\(([^()]*)\)/;function KD(e){for(var t=e;t.includes("(");){var r=wh.exec(t),n=ho(r,2),i=n[1];t=t.replace(wh,dy(i))}return t}function GD(e){var t=e.replace(/\s+/g,"");return t=KD(t),t=dy(t),t}function HD(e){try{return GD(e)}catch{return ea}}function hc(e){var t=HD(e.slice(5,-1));return t===ea?"":t}var YD=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],XD=["dx","dy","angle","className","breakAll"];function xu(){return xu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xu.apply(this,arguments)}function Nh(e,t){if(e==null)return{};var r=QD(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _h(e,t){return t4(e)||e4(e,t)||ZD(e,t)||JD()}function JD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 75In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZD(e,t){if(e){if(typeof e=="string")return Sh(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 Sh(e,t)}}function Sh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function e4(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function t4(e){if(Array.isArray(e))return e}var fy=/[ \f\n\r\t\v\u2028\u2029]+/,my=function(t){var r=t.children,n=t.breakAll,i=t.style;try{var s=[];xe(r)||(n?s=r.toString().split(""):s=r.toString().split(fy));var o=s.map(function(c){return{word:c,width:_i(c,i).width}}),l=n?0:_i(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},r4=function(t,r,n,i,s){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,f=J(o),d=l,m=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return $.reduce(function(I,B){var L=B.word,X=B.width,z=I[I.length-1];if(z&&(i==null||s||z.width+X+n<Number(i)))z.words.push(L),z.width+=X+n;else{var U={words:[L],width:X};I.push(U)}return I},[])},h=m(r),g=function($){return $.reduce(function(I,B){return I.width>B.width?I:B})};if(!f)return h;for(var p="â¦",v=function($){var I=d.slice(0,$),B=my({breakAll:u,style:c,children:I+p}).wordsWithComputedWidth,L=m(B),X=L.length>o||g(L).width>Number(i);
75return[X,L]},x=0,b=d.length-1,j=0,N;x<=b&&j<=d.length-1;){var y=Math.floor((x+b)/2),w=y-1,_=v(w),O=_h(_,2),A=O[0],C=O[1],P=v(y),M=_h(P,1),E=M[0];if(!A&&!E&&(x=y+1),A&&E&&(b=y-1),!A&&E){N=C;break}j++}return N||h},Ah=function(t){var r=xe(t)?[]:t.toString().split(fy);return[{words:r}]},n4=function(t){var r=t.width,n=t.scaleToFit,i=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!ar.isSsr){var c,u,f=my({breakAll:o,children:i,style:s});if(f){var d=f.wordsWithComputedWidth,m=f.spaceWidth;c=d,u=m}else return Ah(i);return r4({breakAll:o,children:i,maxLines:l,style:s},c,u,r,n)}return Ah(i)},Oh="#808080",En=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.scaleToFit,d=f===void 0?!1:f,m=t.textAnchor,h=m===void 0?"start":m,g=t.verticalAnchor,p=g===void 0?"end":g,v=t.fill,x=v===void 0?Oh:v,b=Nh(t,YD),j=S.useMemo(function(){return n4({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:d,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,d,b.style,b.width]),N=b.dx,y=b.dy,w=b.angle,_=b.className,O=b.breakAll,A=Nh(b,XD);if(!at(n)||!at(s))return null;var C=n+(J(N)?N:0),P=s+(J(y)?y:0),M;switch(p){case"start":M=hc("calc(".concat(u,")"));break;case"middle":M=hc("calc(".concat((j.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:M=hc("calc(".concat(j.length-1," * -").concat(l,")"));break}var E=[];if(d){var T=j[0].width,$=b.width;E.push("scale(".concat((J($)?$/T:1)/T,")"))}return w&&E.push("rotate(".concat(w,", ").concat(C,", ").concat(P,")")),E.length&&(A.transform=E.join(" ")),k.createElement("text",xu({},ue(A,!0),{x:C,y:P,className:je("recharts-text",_),textAnchor:h,fill:x.includes("url")?Oh:x}),j.map(function(I,B){var L=I.words.join(O?"":" ");return k.createElement("tspan",{x:C,dy:B===0?M:l,key:"".concat(L,"-").concat(B)},L)}))};function Yr(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function a4(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tf(e){let t,r,n;e.length!==2?(t=Yr,r=(l,c)=>Yr(e(l),c),n=(l,c)=>e(l)-c):(t=e===Yr||e===a4?e:i4,r=e,n=e);function i(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<0?u=d+1:f=d}while(u<f)}return u}function s(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function o(l,c,u=0,f=l.length){const d=i(l,c,u,f-1);return d>u&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:i,center:o,right:s}}function i4(){return 0}function hy(e){return e===null?NaN:+e}function*s4(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const o4=tf(Yr),ys=o4.right;tf(hy).center;class Ph extends Map{constructor(t,r=u4){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Ch(this,t))}has(t){return super.has(Ch(this,t))}set(t,r){return super.set(l4(this,t),r)}delete(t){return super.delete(c4(this,t))}}function Ch({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function l4({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function c4({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function u4(e){return e!==null&&typeof e=="object"?e.valueOf():e}function d4(e=Yr){if(e===Yr)return py;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function py(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const f4=Math.sqrt(50),m4=Math.sqrt(10),h4=Math.sqrt(2);function po(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),o=s>=f4?10:s>=m4?5:s>=h4?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?po(e,t,r*2):[l,c,u]}function yu(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,s,o]=n?po(t,e,r):po(e,t,r);if(!(s>=i))return[];const l=s-i+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(s-u)/-o;else for(let u=0;u<l;++u)c[u]=(s-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(i+u)/-o;else for(let u=0;u<l;++u)c[u]=(i+u)*o;return c}function bu(e,t,r){return t=+t,e=+e,r=+r,po(e,t,r)[2]}function ju(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?bu(t,e,r):bu(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function kh(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Eh(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}
75function gy(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?py:d4(i);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),m=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),h=Math.max(r,Math.floor(t-u*d/c+m)),g=Math.min(n,Math.floor(t+(c-u)*d/c+m));gy(e,t,h,g,i)}const s=e[t];let o=r,l=n;for(ui(e,r,t),i(e[n],s)>0&&ui(e,r,n);o<l;){for(ui(e,o,l),++o,--l;i(e[o],s)<0;)++o;for(;i(e[l],s)>0;)--l}i(e[r],s)===0?ui(e,r,l):(++l,ui(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function ui(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function p4(e,t,r){if(e=Float64Array.from(s4(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Eh(e);if(t>=1)return kh(e);var n,i=(n-1)*t,s=Math.floor(i),o=kh(gy(e,s).subarray(0,s+1)),l=Eh(e.subarray(s+1));return o+(l-o)*(i-s)}}function g4(e,t,r=hy){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,s=Math.floor(i),o=+r(e[s],s,e),l=+r(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function v4(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++n<i;)s[n]=e+n*r;return s}function Qt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qr(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const wu=Symbol("implicit");function rf(){var e=new Ph,t=[],r=[],n=wu;function i(s){let o=e.get(s);if(o===void 0){if(n!==wu)return n;e.set(s,o=t.push(s)-1)}return r[o%r.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Ph;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return rf(t,r).unknown(n)},Qt.apply(i,arguments),i}function qi(){var e=rf().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,s,o,l=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var m=t().length,h=i<n,g=h?i:n,p=h?n:i;s=(p-g)/Math.max(1,m-c+u*2),l&&(s=Math.floor(s)),g+=(p-g-s*(m-c))*f,o=s*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=v4(m).map(function(x){return g+s*x});return r(h?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),d()):t()},e.range=function(m){return arguments.length?([n,i]=m,n=+n,i=+i,d()):[n,i]},e.rangeRound=function(m){return[n,i]=m,n=+n,i=+i,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(m){return arguments.length?(l=!!m,d()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,u=+m),d()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),d()):c},e.paddingOuter=function(m){return arguments.length?(u=+m,d()):u},e.align=function(m){return arguments.length?(f=Math.max(0,Math.min(1,m)),d()):f},e.copy=function(){return qi(t(),[n,i]).round(l).paddingInner(c).paddingOuter(u).align(f)},Qt.apply(d(),arguments)}function vy(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return vy(t())},e}function Si(){return vy(qi.apply(null,arguments).paddingInner(1))}function nf(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function xy(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function bs(){}var Ui=.7,go=1/Ui,la="\\s*([+-]?\\d+)\\s*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",x4=/^#([0-9a-f]{3,8})$/,y4=new RegExp(`^rgb\\(${la},${la},${la}\\)$`),b4=new RegExp(`^rgb\\(${gr},${gr},${gr}\\)$`),j4=new RegExp(`^rgba\\(${la},${la},${la},${zi}\\)$`),w4=new RegExp(`^rgba\\(${gr},${gr},${gr},${zi}\\)$`),N4=new RegExp(`^hsl\\(${zi},${gr},${gr}\\)$`),_4=new RegExp(`^hsla\\(${zi},${gr},${gr},${zi}\\)$`),$h={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};nf(bs,Wi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Th,formatHex:Th,formatHex8:S4,formatHsl:A4,formatRgb:Mh,toString:Mh});function Th(){return this.rgb().formatHex()}function S4(){return this.rgb().formatHex8()}function A4(){return yy(this).formatHsl()}function Mh(){return this.rgb().formatRgb()}function Wi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=x4.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Dh(t):r===3?new At(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ds(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ds(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=y4.exec(e))?new At(t[1],t[2],t[3],1):(t=b4.exec(e))?new At(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=j4.exec(e))?Ds(t[1],t[2],t[3],t[4]):(t=w4.exec(e))?Ds(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=N4.exec(e))?Lh(t[1],t[2]/100,t[3]/100,1):(t=_4.exec(e))?Lh(t[1],t[2]/100,t[3]/100,t[4]):$h.hasOwnProperty(e)?Dh($h[e]):e==="transparent"?new At(NaN,NaN,NaN,0):null}function Dh(e){return new At(e>>16&255,e>>8&255,e&255,1)}function Ds(e,t,r,n){return n<=0&&(e=t=r=NaN),new At(e,t,r,n)}function O4(e){return e instanceof bs||(e=Wi(e)),e?(e=e.rgb(),new At(e.r,e.g,e.b,e.opacity)):new At}function Nu(e,t,r,n){return arguments.length===1?O4(e):new At(e,t,r,n??1)}function At(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}nf(At,Nu,xy(bs,{brighter(e){return e=e==null?go:Math.pow(go,e),new At(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ui:Math.pow(Ui,e),new At(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new At(wn(this.r),wn(this.g),wn(this.b),vo(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:Ih,formatHex:Ih,formatHex8:P4,formatRgb:Rh,toString:Rh}));function Ih(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}`}function P4(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}${vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rh(){const e=vo(this.opacity);return`${e===1?"rgb(":"rgba("}${wn(this.r)}, ${wn(this.g)}, ${wn(this.b)}${e===1?")":`, ${e})`}`}function vo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vn(e){return e=wn(e),(e<16?"0":"")+e.toString(16)}function Lh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,r,n)}function yy(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof bs||(e=Wi(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(r-n)/l+(r<n)*6:r===s?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?s+i:2-s-i,o*=60):l=c>0&&c<1?0:o,new tr(o,l,c,e.opacity)}function C4(e,t,r,n){return arguments.length===1?yy(e):new tr(e,t,r,n??1)}function tr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}nf(tr,C4,xy(bs,{brighter(e){return e=e==null?go:Math.pow(go,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ui:Math.pow(Ui,e),new tr(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,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new At(pc(e>=240?e-240:e+120,i,n),pc(e,i,n),pc(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new tr(Fh(this.h),Is(this.s),Is(this.l),vo(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=vo(this.opacity);return`${e===1?"hsl(":"hsla("}${Fh(this.h)}, ${Is(this.s)*100}%, ${Is(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fh(e){return e=(e||0)%360,e<0?e+360:e}function Is(e){return Math.max(0,Math.min(1,e||0))}function pc(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 af=e=>()=>e;function k4(e,t){return function(r){return e+r*t}}function E4(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function $4(e){return(e=+e)==1?by:function(t,r){return r-t?E4(t,r,e):af(isNaN(t)?r:t)}}function by(e,t){var r=t-e;return r?k4(e,r):af(isNaN(e)?t:e)}const Bh=function e(t){var r=$4(t);function n(i,s){var o=r((i=Nu(i)).r,(s=Nu(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),u=by(i.opacity,s.opacity);return function(f){return i.r=o(f),i.g=l(f),i.b=c(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function T4(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(s){for(i=0;i<r;++i)n[i]=e[i]*(1-s)+t[i]*s;return n}}function M4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function D4(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),s=new Array(r),o;for(o=0;o<n;++o)i[o]=ni(e[o],t[o]);for(;o<r;
vendor: 8,971 bytes, line 75
75++o)s[o]=t[o];return function(l){for(o=0;o<n;++o)s[o]=i[o](l);return s}}function I4(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function xo(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function R4(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=ni(e[i],t[i]):n[i]=t[i];return function(s){for(i in r)n[i]=r[i](s);return n}}var _u=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gc=new RegExp(_u.source,"g");function L4(e){return function(){return e}}function F4(e){return function(t){return e(t)+""}}function B4(e,t){var r=_u.lastIndex=gc.lastIndex=0,n,i,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=_u.exec(e))&&(i=gc.exec(t));)(s=i.index)>r&&(s=t.slice(r,s),l[o]?l[o]+=s:l[++o]=s),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:xo(n,i)})),r=gc.lastIndex;return r<t.length&&(s=t.slice(r),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?F4(c[0].x):L4(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}function ni(e,t){var r=typeof t,n;return t==null||r==="boolean"?af(t):(r==="number"?xo:r==="string"?(n=Wi(t))?(t=n,Bh):B4:t instanceof Wi?Bh:t instanceof Date?I4:M4(t)?T4:Array.isArray(t)?D4:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?R4:xo)(e,t)}function sf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function q4(e,t){t===void 0&&(t=e,e=ni);for(var r=0,n=t.length-1,i=t[0],s=new Array(n<0?0:n);r<n;)s[r]=e(i,i=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return s[l](o-l)}}function U4(e){return function(){return e}}function yo(e){return+e}var qh=[0,1];function Nt(e){return e}function Su(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:U4(isNaN(t)?NaN:.5)}function z4(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function W4(e,t,r){var n=e[0],i=e[1],s=t[0],o=t[1];return i<n?(n=Su(i,n),s=r(o,s)):(n=Su(n,i),s=r(s,o)),function(l){return s(n(l))}}function V4(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),s=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Su(e[o],e[o+1]),s[o]=r(t[o],t[o+1]);return function(l){var c=ys(e,l,1,n)-1;return s[c](i[c](l))}}function js(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ol(){var e=qh,t=qh,r=ni,n,i,s,o=Nt,l,c,u;function f(){var m=Math.min(e.length,t.length);return o!==Nt&&(o=z4(e[0],e[m-1])),l=m>2?V4:W4,c=u=null,d}function d(m){return m==null||isNaN(m=+m)?s:(c||(c=l(e.map(n),t,r)))(n(o(m)))}return d.invert=function(m){return o(i((u||(u=l(t,e.map(n),xo)))(m)))},d.domain=function(m){return arguments.length?(e=Array.from(m,yo),f()):e.slice()},d.range=function(m){return arguments.length?(t=Array.from(m),f()):t.slice()},d.rangeRound=function(m){return t=Array.from(m),r=sf,f()},d.clamp=function(m){return arguments.length?(o=m?!0:Nt,f()):o!==Nt},d.interpolate=function(m){return arguments.length?(r=m,f()):r},d.unknown=function(m){return arguments.length?(s=m,d):s},function(m,h){return n=m,i=h,f()}}function of(){return Ol()(Nt,Nt)}function K4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function bo(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function _a(e){return e=bo(Math.abs(e)),e?e[1]:NaN}function G4(e,t){return function(r,n){for(var i=r.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function H4(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Y4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vi(e){if(!(t=Y4.exec(e)))throw new Error("invalid format: "+e);var t;return new lf({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]})}Vi.prototype=lf.prototype;function lf(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+""}lf.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 X4(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var jy;function Q4(e,t){var r=bo(e,t);if(!r)return e+"";var n=r[0],i=r[1],s=i-(jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+bo(e,Math.max(0,t+s-1))[0]}function Uh(e,t){var r=bo(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const zh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:K4,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)=>Uh(e*100,t),r:Uh,s:Q4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Wh(e){return e}var Vh=Array.prototype.map,Kh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function J4(e){var t=e.grouping===void 0||e.thousands===void 0?Wh:G4(Vh.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Wh:H4(Vh.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"â":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d){d=Vi(d);var m=d.fill,h=d.align,g=d.sign,p=d.symbol,v=d.zero,x=d.width,b=d.comma,j=d.precision,N=d.trim,y=d.type;y==="n"?(b=!0,y="g"):zh[y]||(j===void 0&&(j=12),N=!0,y="g"),(v||m==="0"&&h==="=")&&(v=!0,m="0",h="=");var w=p==="$"?r:p==="#"&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_=p==="$"?n:/[%p]/.test(y)?o:"",O=zh[y],A=/[defgprs%]/.test(y);j=j===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function C(P){var M=w,E=_,T,$,I;if(y==="c")E=O(P)+E,P="";else{P=+P;var B=P<0||1/P<0;if(P=isNaN(P)?c:O(Math.abs(P),j),N&&(P=X4(P)),B&&+P==0&&g!=="+"&&(B=!1),M=(B?g==="("?g:l:g==="-"||g==="("?"":g)+M,E=(y==="s"?Kh[8+jy/3]:"")+E+(B&&g==="("?")":""),A){for(T=-1,$=P.length;++T<$;)if(I=P.charCodeAt(T),48>I||I>57){E=(I===46?i+P.slice(T+1):P.slice(T))+E,P=P.slice(0,T);break}}}b&&!v&&(P=t(P,1/0));var L=M.length+P.length+E.length,X=L<x?new Array(x-L+1).join(m):"";switch(b&&v&&(P=t(X+P,X.length?x-E.length:1/0),X=""),h){case"<":P=M+P+E+X;break;case"=":P=M+X+P+E;break;case"^":P=X.slice(0,L=X.length>>1)+M+P+E+X.slice(L);break;default:P=X+M+P+E;break}return s(P)}return C.toString=function(){return d+""},C}function f(d,m){var h=u((d=Vi(d),d.type="f",d)),g=Math.max(-8,Math.min(8,Math.floor(_a(m)/3)))*3,p=Math.pow(10,-g),v=Kh[8+g/3];return function(x){return h(p*x)+v}}return{format:u,formatPrefix:f}}var Rs,cf,wy;Z4({thousands:",",grouping:[3],currency:["$",""]});function Z4(e){return Rs=J4(e),cf=Rs.format,wy=Rs.formatPrefix,Rs}function eI(e){return Math.max(0,-_a(Math.abs(e)))}function tI(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_a(t)/3)))*3-_a(Math.abs(e)))}function rI(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_a(t)-_a(e))+1}function Ny(e,t,r,n){var i=ju(e,t,r),s;switch(n=Vi(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(s=tI(i,o))&&(n.precision=s),wy(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=rI(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=eI(i))&&(n.precision=s-(n.type==="%")*2);break}}return cf(n)}function rn(e){var t=e.domain;return e.ticks=function(r){var n=t();return yu(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ny(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,s=n.length-1,o=n[i],l=n[s],c,u,f=10;for(l<o&&(u=o,o=l,l=u,u=i,i=s,s=u);f-- >0;){if(u=bu(o,l,r),u===c)return n[i]=o,n[s]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function jo(){var e=of();return e.copy=function(){return js(e,jo())}
vendor: 2,934 bytes, line 75
75,Qt.apply(e,arguments),rn(e)}function _y(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,yo),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return _y(e).unknown(t)},e=arguments.length?Array.from(e,yo):[0,1],rn(r)}function Sy(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],s=e[n],o;return s<i&&(o=r,r=n,n=o,o=i,i=s,s=o),e[r]=t.floor(i),e[n]=t.ceil(s),e}function Gh(e){return Math.log(e)}function Hh(e){return Math.exp(e)}function nI(e){return-Math.log(-e)}function aI(e){return-Math.exp(-e)}function iI(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sI(e){return e===10?iI:e===Math.E?Math.exp:t=>Math.pow(e,t)}function oI(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 Yh(e){return(t,r)=>-e(-t,r)}function uf(e){const t=e(Gh,Hh),r=t.domain;let n=10,i,s;function o(){return i=oI(n),s=sI(n),r()[0]<0?(i=Yh(i),s=Yh(s),e(nI,aI)):e(Gh,Hh),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let m=i(u),h=i(f),g,p;const v=l==null?10:+l;let x=[];if(!(n%1)&&h-m<v){if(m=Math.floor(m),h=Math.ceil(h),u>0){for(;m<=h;++m)for(g=1;g<n;++g)if(p=m<0?g/s(-m):g*s(m),!(p<u)){if(p>f)break;x.push(p)}}else for(;m<=h;++m)for(g=n-1;g>=1;--g)if(p=m>0?g/s(-m):g*s(m),!(p<u)){if(p>f)break;x.push(p)}x.length*2<v&&(x=yu(u,f,v))}else x=yu(m,h,Math.min(h-m,v)).map(s);return d?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Vi(c)).precision==null&&(c.trim=!0),c=cf(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return f=>{let d=f/s(Math.round(i(f)));return d*n<n-.5&&(d*=n),d<=u?c(f):""}},t.nice=()=>r(Sy(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function Ay(){const e=uf(Ol()).domain([1,10]);return e.copy=()=>js(e,Ay()).base(e.base()),Qt.apply(e,arguments),e}function Xh(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Qh(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function df(e){var t=1,r=e(Xh(t),Qh(t));return r.constant=function(n){return arguments.length?e(Xh(t=+n),Qh(t)):t},rn(r)}function Oy(){var e=df(Ol());return e.copy=function(){return js(e,Oy()).constant(e.constant())},Qt.apply(e,arguments)}function Jh(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function lI(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function cI(e){return e<0?-e*e:e*e}function ff(e){var t=e(Nt,Nt),r=1;function n(){return r===1?e(Nt,Nt):r===.5?e(lI,cI):e(Jh(r),Jh(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},rn(t)}function mf(){var e=ff(Ol());return e.copy=function(){return js(e,mf()).exponent(e.exponent())}
75,Qt.apply(e,arguments),e}function uI(){return mf.apply(null,arguments).exponent(.5)}function Zh(e){return Math.sign(e)*e*e}function dI(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Py(){var e=of(),t=[0,1],r=!1,n;function i(s){var o=dI(e(s));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(s){return e.invert(Zh(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,yo)).map(Zh)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return Py(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Qt.apply(i,arguments),rn(i)}function Cy(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=g4(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?n:t[ys(r,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Yr),i()},s.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},s.unknown=function(o){return arguments.length?(n=o,s):n},s.quantiles=function(){return r.slice()},s.copy=function(){return Cy().domain(e).range(t).unknown(n)},Qt.apply(s,arguments)}function ky(){var e=0,t=1,r=1,n=[.5],i=[0,1],s;function o(c){return c!=null&&c<=c?i[ys(n,c,0,r)]:s}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return ky().domain([e,t]).range(i).unknown(s)},Qt.apply(rn(o),arguments)}function Ey(){var e=[.5],t=[0,1],r,n=1;function i(s){return s!=null&&s<=s?t[ys(e,s,0,n)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Ey().domain(e).range(t).unknown(r)},Qt.apply(i,arguments)}const vc=new Date,xc=new Date;function st(e,t,r,n){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o<l-s?o:l},i.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let u;do c.push(u=new Date(+s)),t(s,l),e(s);while(u<s&&s<o);return c},i.filter=s=>st(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),r&&(i.count=(s,o)=>(vc.setTime(+s),xc.setTime(+o),e(vc),e(xc),Math.floor(r(vc,xc))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?o=>n(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const wo=st(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);wo.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?st(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):wo);wo.range;const Or=1e3,Wt=Or*60,Pr=Wt*60,Dr=Pr*24,hf=Dr*7,ep=Dr*30,yc=Dr*365,xn=st(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Or)},(e,t)=>(t-e)/Or,e=>e.getUTCSeconds());xn.range;const pf=st(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Or)},(e,t)=>{e.setTime(+e+t*Wt)},(e,t)=>(t-e)/Wt,e=>e.getMinutes());pf.range;const gf=st(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Wt)},(e,t)=>(t-e)/Wt,e=>e.getUTCMinutes());gf.range;const vf=st(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Or-e.getMinutes()*Wt)},(e,t)=>{e.setTime(+e+t*Pr)},(e,t)=>(t-e)/Pr,e=>e.getHours());vf.range;const xf=st(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pr)},(e,t)=>(t-e)/Pr,e=>e.getUTCHours());xf.range;const ws=st(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Wt)/Dr,e=>e.getDate()-1);ws.range;const Pl=st(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dr,e=>e.getUTCDate()-1);Pl.range;const $y=st(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dr,e=>Math.floor(e/Dr));$y.range;function Bn(e){return st(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())*Wt)/hf)}const Cl=Bn(0),No=Bn(1),fI=Bn(2),mI=Bn(3),Sa=Bn(4),hI=Bn(5),pI=Bn(6);Cl.range;No.range;fI.range;mI.range;Sa.range;hI.range;pI.range;function qn(e){return st(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)/hf)}const kl=qn(0),_o=qn(1),gI=qn(2),vI=qn(3),Aa=qn(4),xI=qn(5),yI=qn(6);kl.range;_o.range;gI.range;vI.range;Aa.range;xI.range;yI.range;const yf=st(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());yf.range;const bf=st(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());bf.range;const Ir=st(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());Ir.every=e=>
vendor: 10,035 bytes, line 75
75!isFinite(e=Math.floor(e))||!(e>0)?null:st(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)});Ir.range;const Rr=st(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());Rr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:st(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)});Rr.range;function Ty(e,t,r,n,i,s){const o=[[xn,1,Or],[xn,5,5*Or],[xn,15,15*Or],[xn,30,30*Or],[s,1,Wt],[s,5,5*Wt],[s,15,15*Wt],[s,30,30*Wt],[i,1,Pr],[i,3,3*Pr],[i,6,6*Pr],[i,12,12*Pr],[n,1,Dr],[n,2,2*Dr],[r,1,hf],[t,1,ep],[t,3,3*ep],[e,1,yc]];function l(u,f,d){const m=f<u;m&&([u,f]=[f,u]);const h=d&&typeof d.range=="function"?d:c(u,f,d),g=h?h.range(u,+f+1):[];return m?g.reverse():g}function c(u,f,d){const m=Math.abs(f-u)/d,h=tf(([,,v])=>v).right(o,m);if(h===o.length)return e.every(ju(u/yc,f/yc,d));if(h===0)return wo.every(Math.max(ju(u,f,d),1));const[g,p]=o[m/o[h-1][2]<o[h][2]/m?h-1:h];return g.every(p)}return[l,c]}const[bI,jI]=Ty(Rr,bf,kl,$y,xf,gf),[wI,NI]=Ty(Ir,yf,Cl,ws,vf,pf);function bc(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 jc(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 di(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function _I(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=fi(i),f=mi(i),d=fi(s),m=mi(s),h=fi(o),g=mi(o),p=fi(l),v=mi(l),x=fi(c),b=mi(c),j={a:B,A:L,b:X,B:z,c:null,d:sp,e:sp,f:GI,g:nR,G:iR,H:WI,I:VI,j:KI,L:My,m:HI,M:YI,p:U,q:D,Q:cp,s:up,S:XI,u:QI,U:JI,V:ZI,w:eR,W:tR,x:null,X:null,y:rR,Y:aR,Z:sR,"%":lp},N={a:Q,A:ae,b:te,B:pe,c:null,d:op,e:op,f:uR,g:bR,G:wR,H:oR,I:lR,j:cR,L:Iy,m:dR,M:fR,p:Ne,q:Z,Q:cp,s:up,S:mR,u:hR,U:pR,V:gR,w:vR,W:xR,x:null,X:null,y:yR,Y:jR,Z:NR,"%":lp},y={a:C,A:P,b:M,B:E,c:T,d:ap,e:ap,f:BI,g:np,G:rp,H:ip,I:ip,j:II,L:FI,m:DI,M:RI,p:A,q:MI,Q:UI,s:zI,S:LI,u:CI,U:kI,V:EI,w:PI,W:$I,x:$,X:I,y:np,Y:rp,Z:TI,"%":qI};j.x=w(r,j),j.X=w(n,j),j.c=w(t,j),N.x=w(r,N),N.X=w(n,N),N.c=w(t,N);function w(R,re){return function(se){var V=[],Ae=-1,ce=0,we=R.length,$e,ze,Rt;for(se instanceof Date||(se=new Date(+se));++Ae<we;)R.charCodeAt(Ae)===37&&(V.push(R.slice(ce,Ae)),(ze=tp[$e=R.charAt(++Ae)])!=null?$e=R.charAt(++Ae):ze=$e==="e"?" ":"0",(Rt=re[$e])&&($e=Rt(se,ze)),V.push($e),ce=Ae+1);return V.push(R.slice(ce,Ae)),V.join("")}}function _(R,re){return function(se){var V=di(1900,void 0,1),Ae=O(V,R,se+="",0),ce,we;if(Ae!=se.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(re&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(ce=jc(di(V.y,0,1)),we=ce.getUTCDay(),ce=we>4||we===0?_o.ceil(ce):_o(ce),ce=Pl.offset(ce,(V.V-1)*7),V.y=ce.getUTCFullYear(),V.m=ce.getUTCMonth(),V.d=ce.getUTCDate()+(V.w+6)%7):(ce=bc(di(V.y,0,1)),we=ce.getDay(),ce=we>4||we===0?No.ceil(ce):No(ce),ce=ws.offset(ce,(V.V-1)*7),V.y=ce.getFullYear(),V.m=ce.getMonth(),V.d=ce.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),we="Z"in V?jc(di(V.y,0,1)).getUTCDay():bc(di(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(we+5)%7:V.w+V.U*7-(we+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,jc(V)):bc(V)}}function O(R,re,se,V){for(var Ae=0,ce=re.length,we=se.length,$e,ze;Ae<ce;){if(V>=we)return-1;if($e=re.charCodeAt(Ae++),$e===37){if($e=re.charAt(Ae++),ze=y[$e in tp?re.charAt(Ae++):$e],!ze||(V=ze(R,se,V))<0)return-1}else if($e!=se.charCodeAt(V++))return-1}return V}function A(R,re,se){var V=u.exec(re.slice(se));return V?(R.p=f.get(V[0].toLowerCase()),se+V[0].length):-1}function C(R,re,se){var V=h.exec(re.slice(se));return V?(R.w=g.get(V[0].toLowerCase()),se+V[0].length):-1}function P(R,re,se){var V=d.exec(re.slice(se));return V?(R.w=m.get(V[0].toLowerCase()),se+V[0].length):-1}function M(R,re,se){var V=x.exec(re.slice(se));return V?(R.m=b.get(V[0].toLowerCase()),se+V[0].length):-1}function E(R,re,se){var V=p.exec(re.slice(se));return V?(R.m=v.get(V[0].toLowerCase()),se+V[0].length):-1}function T(R,re,se){return O(R,t,re,se)}function $(R,re,se){return O(R,r,re,se)}function I(R,re,se){return O(R,n,re,se)}function B(R){return o[R.getDay()]}function L(R){return s[R.getDay()]}function X(R){return c[R.getMonth()]}function z(R){return l[R.getMonth()]}function U(R){return i[+(R.getHours()>=12)]}function D(R){return 1+~~(R.getMonth()/3)}function Q(R){return o[R.getUTCDay()]}function ae(R){return s[R.getUTCDay()]}function te(R){return c[R.getUTCMonth()]}function pe(R){return l[R.getUTCMonth()]}function Ne(R){return i[+(R.getUTCHours()>=12)]}function Z(R){return 1+~~(R.getUTCMonth()/3)}return{format:function(R){var re=w(R+="",j);return re.toString=function(){return R},re},parse:function(R){var re=_(R+="",!1);return re.toString=function(){return R},re},utcFormat:function(R){var re=w(R+="",N);return re.toString=function(){return R},re},utcParse:function(R){var re=_(R+="",!0);return re.toString=function(){return R},re}}}var tp={"-":"",_:" ",0:"0"},mt=/^\s*\d+/,SI=/^%/,AI=/[\\^$*+?|[\]().{}]/g;function Oe(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",s=i.length;return n+(s<r?new Array(r-s+1).join(t)+i:i)}function OI(e){return e.replace(AI,"\\$&")}function fi(e){return new RegExp("^(?:"+e.map(OI).join("|")+")","i")}function mi(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function PI(e,t,r){var n=mt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function CI(e,t,r){var n=mt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function kI(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function EI(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function $I(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function rp(e,t,r){var n=mt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function np(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function TI(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function MI(e,t,r){var n=mt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function DI(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function ap(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function II(e,t,r){var n=mt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function ip(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function RI(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function LI(e,t,r){var n=mt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function FI(e,t,r){var n=mt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function BI(e,t,r){var n=mt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function qI(e,t,r){var n=SI.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function UI(e,t,r){var n=mt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function zI(e,t,r){var n=mt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function sp(e,t){return Oe(e.getDate(),t,2)}function WI(e,t){return Oe(e.getHours(),t,2)}function VI(e,t){return Oe(e.getHours()%12||12,t,2)}function KI(e,t){return Oe(1+ws.count(Ir(e),e),t,3)}function My(e,t){return Oe(e.getMilliseconds(),t,3)}function GI(e,t){return My(e,t)+"000"}function HI(e,t){return Oe(e.getMonth()+1,t,2)}function YI(e,t){return Oe(e.getMinutes(),t,2)}function XI(e,t){return Oe(e.getSeconds(),t,2)}function QI(e){var t=e.getDay();return t===0?7:t}function JI(e,t){return Oe(Cl.count(Ir(e)-1,e),t,2)}function Dy(e){var t=e.getDay();return t>=4||t===0?Sa(e):Sa.ceil(e)}function ZI(e,t){return e=Dy(e),Oe(Sa.count(Ir(e),e)+(Ir(e).getDay()===4),t,2)}function eR(e){return e.getDay()}function tR(e,t){return Oe(No.count(Ir(e)-1,e),t,2)}function rR(e,t){return Oe(e.getFullYear()%100,t,2)}function nR(e,t){return e=Dy(e),Oe(e.getFullYear()%100,t,2)}function aR(e,t){return Oe(e.getFullYear()%1e4,t,4)}function iR(e,t){var r=e.getDay();return e=r>=4||r===0?Sa(e):Sa.ceil(e),Oe(e.getFullYear()%1e4,t,4)}function sR(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Oe(t/60|0,"0",2)+Oe(t%60,"0",2)}function op(e,t){return Oe(e.getUTCDate(),t,2)}function oR(e,t){return Oe(e.getUTCHours(),t,2)}function lR(e,t){return Oe(e.getUTCHours()%12||12,t,2)}function cR(e,t){return Oe(1+Pl.count(Rr(e),e),t,3)}function Iy(e,t){return Oe(e.getUTCMilliseconds(),t,3)}function uR(e,t){return Iy(e,t)+"000"}function dR(e,t){return Oe(e.getUTCMonth()+1,t,2)}function fR(e,t){return Oe(e.getUTCMinutes(),t,2)}function mR(e,t){return Oe(e.getUTCSeconds(),t,2)}function hR(e){var t=e.getUTCDay();return t===0?7:t}function pR(e,t){return Oe(kl.count(Rr(e)-1,e),t,2)}function Ry(e){var t=e.getUTCDay();return t>=4||t===0?Aa(e):Aa.ceil(e)}function gR(e,t){return e=Ry(e),Oe(Aa.count(Rr(e),e)+(Rr(e).getUTCDay()===4),t,2)}function vR(e){return e.getUTCDay()}function xR(e,t){return Oe(_o.count(Rr(e)-1,e),t,2)}function yR(e,t){return Oe(e.getUTCFullYear()%100,t,2)}function bR(e,t){return e=Ry(e),Oe(e.getUTCFullYear()%100,t,2)}function jR(e,t){return Oe(e.getUTCFullYear()%1e4,t,4)}function wR(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Aa(e):Aa.ceil(e),Oe(e.getUTCFullYear()%1e4,t,4)}function NR(){return"+0000"}function lp(){return"%"}function cp(e){return+e}function up(e){return Math.floor(+e/1e3)}var Vn,Ly,Fy;_R({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
75ay","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 _R(e){return Vn=_I(e),Ly=Vn.format,Vn.parse,Fy=Vn.utcFormat,Vn.utcParse,Vn}function SR(e){return new Date(e)}function AR(e){return e instanceof Date?+e:+new Date(+e)}function jf(e,t,r,n,i,s,o,l,c,u){var f=of(),d=f.invert,m=f.domain,h=u(".%L"),g=u(":%S"),p=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),b=u("%b %d"),j=u("%B"),N=u("%Y");function y(w){return(c(w)<w?h:l(w)<w?g:o(w)<w?p:s(w)<w?v:n(w)<w?i(w)<w?x:b:r(w)<w?j:N)(w)}return f.invert=function(w){return new Date(d(w))},f.domain=function(w){return arguments.length?m(Array.from(w,AR)):m().map(SR)},f.ticks=function(w){var _=m();return e(_[0],_[_.length-1],w??10)},f.tickFormat=function(w,_){return _==null?y:u(_)},f.nice=function(w){var _=m();return(!w||typeof w.range!="function")&&(w=t(_[0],_[_.length-1],w??10)),w?m(Sy(_,w)):f},f.copy=function(){return js(f,jf(e,t,r,n,i,s,o,l,c,u))},f}function OR(){return Qt.apply(jf(wI,NI,Ir,yf,Cl,ws,vf,pf,xn,Ly).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function PR(){return Qt.apply(jf(bI,jI,Rr,bf,kl,Pl,xf,gf,xn,Fy).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function El(){var e=0,t=1,r,n,i,s,o=Nt,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:o(i===0?.5:(d=(s(d)-r)*i,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=s(e=+e),n=s(t=+t),i=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(o=d,u):o};function f(d){return function(m){var h,g;return arguments.length?([h,g]=m,o=d(h,g),u):[o(0),o(1)]}}return u.range=f(ni),u.rangeRound=f(sf),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return s=d,r=d(e),n=d(t),i=r===n?0:1/(n-r),u}}function nn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function By(){var e=rn(El()(Nt));return e.copy=function(){return nn(e,By())},qr.apply(e,arguments)}function qy(){var e=uf(El()).domain([1,10]);return e.copy=function(){return nn(e,qy()).base(e.base())},qr.apply(e,arguments)}function Uy(){var e=df(El());return e.copy=function(){return nn(e,Uy()).constant(e.constant())},qr.apply(e,arguments)}function wf(){var e=ff(El());return e.copy=function(){return nn(e,wf()).exponent(e.exponent())},qr.apply(e,arguments)}function CR(){return wf.apply(null,arguments).exponent(.5)}function zy(){var e=[],t=Nt;function r(n){if(n!=null&&!isNaN(n=+n))return t((ys(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Yr),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>p4(e,s/n))},r.copy=function(){return zy(t).domain(e)},qr.apply(r,arguments)}function $l(){var e=0,t=.5,r=1,n=1,i,s,o,l,c,u=Nt,f,d=!1,m;function h(p){return isNaN(p=+p)?m:(p=.5+((p=+f(p))-s)*(n*p<n*s?l:c),u(d?Math.max(0,Math.min(1,p)):p))}h.domain=function(p){return arguments.length?([e,t,r]=p,i=f(e=+e),s=f(t=+t),o=f(r=+r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,h):[e,t,r]},h.clamp=function(p){return arguments.length?(d=!!p,h):d},h.interpolator=function(p){return arguments.length?(u=p,h):u};function g(p){return function(v){var x,b,j;return arguments.length?([x,b,j]=v,u=q4(p,[x,b,j]),h):[u(0),u(.5),u(1)]}}return h.range=g(ni),h.rangeRound=g(sf),h.unknown=function(p){return arguments.length?(m=p,h):m},function(p){return f=p,i=p(e),s=p(t),o=p(r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,h}}function Wy(){var e=rn($l()(Nt));return e.copy=function(){return nn(e,Wy())},qr.apply(e,arguments)}function Vy(){var e=uf($l()).domain([.1,1,10]);return e.copy=function(){return nn(e,Vy()).base(e.base())},qr.apply(e,arguments)}function Ky(){var e=df($l());return e.copy=function(){return nn(e,Ky()).constant(e.constant())},qr.apply(e,arguments)}function Nf(){var e=ff($l());return e.copy=function(){return nn(e,Nf()).exponent(e.exponent())},qr.apply(e,arguments)}function kR(){return Nf.apply(null,arguments).exponent(.5)}const dp=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:qi,scaleDiverging:Wy,scaleDivergingLog:Vy,scaleDivergingPow:Nf,scaleDivergingSqrt:kR,scaleDivergingSymlog:Ky,scaleIdentity:_y,scaleImplicit:wu,scaleLinear:jo,scaleLog:Ay,scaleOrdinal:rf,scalePoint:Si,scalePow:mf,scaleQuantile:Cy,scaleQuantize:ky,scaleRadial:Py,scaleSequential:By,scaleSequentialLog:qy,scaleSequentialPow:wf,scaleSequentialQuantile:zy,scaleSequentialSqrt:CR,scaleSequentialSymlog:Uy,scaleSqrt:uI,scaleSymlog:Oy,scaleThreshold:Ey,scaleTime:OR,scaleUtc:PR,tickFormat:Ny},Symbol.toStringTag,{value:"Module"}));var ER=Ha;function $R(e,t,r){for(var n=-1,i=e.length;++n<i;){var s=e[n],o=t(s);if(o!=null&&(l===void 0?o===o&&!ER(o):r(o,l)))var l=o,c=s}return c}var Tl=$R;function TR(e,t){return e>t}var Gy=TR,MR=Tl,DR=Gy,IR=ri;function RR(e){return e&&e.length?MR(e,IR,DR):void 0}var LR=RR;const Kr=De(LR);function FR(e,t){return e<t}var Hy=FR,BR=Tl,qR=Hy,UR=ri;function zR(e){return e&&e.length?BR(e,UR,qR):void 0}var WR=zR;const Ml=De(WR);var VR=Id,KR=Nr,GR=ry,HR=Pt;function YR(e,t){var r=HR(e)?VR:GR;return r(e,KR(t))}var XR=YR,QR=ey,JR=XR;function ZR(e,t){return QR(JR(e,t),1)}var e3=ZR;const t3=De(e3);var r3=Qd;function n3(e,t){return r3(e,t)}var a3=n3;const $n=De(a3);
vendor: 24,272 bytes, lines 75-79
75var ai=1e9,i3={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Sf,Ue=!0,Yt="[DecimalError] ",Nn=Yt+"Invalid argument: ",_f=Yt+"Exponent out of range: ",ii=Math.floor,mn=Math.pow,s3=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$t,ot=1e7,Be=7,Yy=9007199254740991,So=ii(Yy/Be),ie={};ie.absoluteValue=ie.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ie.comparedTo=ie.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};ie.decimalPlaces=ie.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Be;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};ie.dividedBy=ie.div=function(e){return $r(this,new this.constructor(e))};ie.dividedToIntegerBy=ie.idiv=function(e){var t=this,r=t.constructor;return Me($r(t,new r(e),0,1),r.precision)};ie.equals=ie.eq=function(e){return!this.cmp(e)};ie.exponent=function(){return Qe(this)};ie.greaterThan=ie.gt=function(e){return this.cmp(e)>0};ie.greaterThanOrEqualTo=ie.gte=function(e){return this.cmp(e)>=0};ie.isInteger=ie.isint=function(){return this.e>this.d.length-2};ie.isNegative=ie.isneg=function(){return this.s<0};ie.isPositive=ie.ispos=function(){return this.s>0};ie.isZero=function(){return this.s===0};ie.lessThan=ie.lt=function(e){return this.cmp(e)<0};ie.lessThanOrEqualTo=ie.lte=function(e){return this.cmp(e)<1};ie.logarithm=ie.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($t))throw Error(Yt+"NaN");if(r.s<1)throw Error(Yt+(r.s?"NaN":"-Infinity"));return r.eq($t)?new n(0):(Ue=!1,t=$r(Ki(r,s),Ki(e,s),s),Ue=!0,Me(t,i))};ie.minus=ie.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Jy(t,e):Xy(t,(e.s=-e.s,e))};ie.modulo=ie.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Yt+"NaN");return r.s?(Ue=!1,t=$r(r,e,0,1).times(e),Ue=!0,r.minus(t)):Me(new n(r),i)};ie.naturalExponential=ie.exp=function(){return Qy(this)};ie.naturalLogarithm=ie.ln=function(){return Ki(this)};ie.negated=ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ie.plus=ie.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Xy(t,e):Jy(t,(e.s=-e.s,e))};ie.precision=ie.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Nn+e);if(t=Qe(i)+1,n=i.d.length-1,r=n*Be+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};ie.squareRoot=ie.sqrt=function(){var e,t,r,n,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Yt+"NaN")}for(e=Qe(l),Ue=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=hr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ii((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(s=n,n=s.plus($r(l,s,o+2)).times(.5),hr(s.d).slice(0,o)===(t=hr(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Me(s,r+1,0),s.times(s).eq(l)){n=s;break}}else if(t!="9999")break;o+=4}return Ue=!0,Me(n,r)};ie.times=ie.mul=function(e){var t,r,n,i,s,o,l,c,u,f=this,d=f.constructor,m=f.d,h=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,c=m.length,u=h.length,c<u&&(s=m,m=h,h=s,o=c,c=u,u=o),s=[],o=c+u,n=o;n--;)s.push(0);for(n=u;--n>=0;){for(t=0,i=c+n;i>n;)l=s[i]+h[n]*m[i-n-1]+t,s[i--]=l%ot|0,t=l/ot|0;s[i]=(s[i]+t)%ot|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,Ue?Me(e,d.precision):e};ie.toDecimalPlaces=ie.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(jr(e,0,ai),t===void 0?t=n.rounding:jr(t,0,8),Me(r,e+Qe(r)+1,t))};ie.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Tn(n,!0):(jr(e,0,ai),t===void 0?t=i.rounding:jr(t,0,8),n=Me(new i(n),e+1,t),r=Tn(n,!0,e+1)),r};ie.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?Tn(i):(jr(e,0,ai),t===void 0?t=s.rounding:jr(t,0,8),n=Me(new s(i),e+Qe(i)+1,t),r=Tn(n.abs(),!1,e+Qe(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};ie.toInteger=ie.toint=function(){var e=this,t=e.constructor;return Me(new t(e),Qe(e)+1,t.rounding)};ie.toNumber=function(){return+this};ie.toPower=ie.pow=function(e){var t,r,n,i,s,o,l=this,c=l.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c($t);if(l=new c(l),!l.s){if(e.s<1)throw Error(Yt+"Infinity");return l}if(l.eq($t))return l;if(n=c.precision,e.eq($t))return Me(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,s=l.s,o){if((r=f<0?-f:f)<=Yy){for(i=new c($t),t=Math.ceil(n/Be+4),Ue=!1;r%2&&(i=i.times(l),mp(i.d,t)),r=ii(r/2),r!==0;)l=l.times(l),mp(l.d,t);return Ue=!0,e.s<0?new c($t).div(i):Me(i,n)}}else if(s<0)throw Error(Yt+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Ue=!1,i=e.times(Ki(l,n+u)),Ue=!0,i=Qy(i),i.s=s,i};ie.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=Qe(i),n=Tn(i,r<=s.toExpNeg||r>=s.toExpPos)):(jr(e,1,ai),t===void 0?t=s.rounding:jr(t,0,8),i=Me(new s(i),e,t),r=Qe(i),n=Tn(i,e<=r||r<=s.toExpNeg,e)),n};ie.toSignificantDigits=ie.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(jr(e,1,ai),t===void 0?t=n.rounding:jr(t,0,8)),Me(new n(r),e,t)};ie.toString=ie.valueOf=ie.val=ie.toJSON=ie[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qe(e),r=e.constructor;return Tn(e,t<=r.toExpNeg||t>=r.toExpPos)};function Xy(e,t){var r,n,i,s,o,l,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Ue?Me(t,d):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(n=c,s=-s,l=u.length):(n=u,i=o,l=c.length),o=Math.ceil(d/Be),l=o>l?o+1:l+1,s>l&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(l=c.length,s=u.length,l-s<0&&(s=l,n=u,u=c,c=n),r=0;s;)r=(c[--s]=c[s]+u[s]+r)/ot|0,c[s]%=ot;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ue?Me(t,d):t}function jr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Nn+e)}function hr(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=Be-n.length,r&&(s+=Wr(r)),s+=n;o=e[t],n=o+"",r=Be-n.length,r&&(s+=Wr(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var $r=function(){function e(n,i){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%ot|0,o=s/ot|0;return o&&n.unshift(o),n}function t(n,i,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,s){for(var o=0;s--;)n[s]-=o,o=n[s]<i[s]?1:0,n[s]=o*ot+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o){var l,c,u,f,d,m,h,g,p,v,x,b,j,N,y,w,_,O,A=n.constructor,C=n.s==i.s?1:-1,P=n.d,M=i.d;if(!n.s)return new A(n);if(!i.s)throw Error(Yt+"Division by zero");for(c=n.e-i.e,_=M.length,y=P.length,h=new A(C),g=h.d=[],u=0;M[u]==(P[u]||0);)++u;if(M[u]>(P[u]||0)&&--c,s==null?b=s=A.precision:o?b=s+(Qe(n)-Qe(i))+1:b=s,b<0)return new A(0);if(b=b/Be+2|0,u=0,_==1)for(f=0,M=M[0],b++;(u<y||f)&&b--;u++)j=f*ot+(P[u]||0),g[u]=j/M|0,f=j%M|0;else{for(f=ot/(M[0]+1)|0,f>1&&(M=e(M,f),P=e(P,f),_=M.length,y=P.length),N=_,p=P.slice(0,_),v=p.length;v<_;)p[v++]=0;O=M.slice(),O.unshift(0),w=M[0],M[1]>=ot/2&&++w;do f=0,l=t(M,p,_,v),l<0?(x=p[0],_!=v&&(x=x*ot+(p[1]||0)),f=x/w|0,f>1?(f>=ot&&(f=ot-1),d=e(M,f),m=d.length,v=p.length,l=t(d,p,m,v),l==1&&(f--,r(d,_<m?O:M,m))):(f==0&&(l=f=1),d=M.slice()),m=d.length,m<v&&d.unshift(0),r(p,d,v),l==-1&&(v=p.length,l=t(M,p,_,v),l<1&&(f++,r(p,_<v?O:M,v))),v=p.length):l===0&&(f++,p=[0]),g[u++]=f,l&&p[0]?p[v++]=P[N]||0:(p=[P[N]],v=1);while((N++<y||p[0]!==void 0)&&b--)}return g[0]||g.shift(),h.e=c,Me(h,o?s+Qe(h)+1:s)}}();function Qy(e,t){var r,n,i,s,o,l,c=0,u=0,f=e.constructor,d=f.precision;if(Qe(e)>16)throw Error(_f+Qe(e));if(!e.s)return new f($t);for(t==null?(Ue=!1,l=d):l=t,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(mn(2,u))/Math.LN10*2+5|0,l+=n,r=i=s=new f($t),f.precision=l;;){if(i=Me(i.times(e),l),r=r.times(++c),o=s.plus($r(i,r,l)),hr(o.d).slice(0,l)===hr(s.d).slice(0,l)){for(;u--;)s=Me(s.times(s),l);return f.precision=d,t==null?(Ue=!0,Me(s,d)):s}s=o}}function Qe(e){for(var t=e.e*Be,r=e.d[0];r>=10;r/=10)t++;return t}function wc(e,t,r){if(t>e.LN10.sd())throw Ue=!0,r&&(e.precision=r),Error(Yt+"LN10 precision limit exceeded");return Me(new e(e.LN10),t)}function Wr(e){for(var t="";e--;)t+="0";return t}function Ki(e,t){var r,n,i,s,o,l,c,u,f,d=1,m=10,h=e,g=h.d,p=h.constructor,v=p.precision;if(h.s<1)throw Error(Yt+(h.s?"NaN":"-Infinity"));if(h.eq($t))return new p(0);if(t==null?(Ue=!1,u=v):u=t,h.eq(10))return t==null&&(Ue=!0),wc(p,u);if(u+=m,p.precision=u,r=hr(g),n=r.charAt(0),s=Qe(h),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=hr(h.d),n=r.charAt(0),d++;s=Qe(h),n>1?(h=new p("0."+r),s++):h=new p(n+"."+r.slice(1))}else return c=wc(p,u+2,v).times(s+""),h=Ki(new p(n+"."+r.slice(1)),u-m).plus(c),p.precision=v,t==null?(Ue=!0,Me(h,v)):h;for(l=o=h=$r(h.minus($t),h.plus($t),u),f=Me(h.times(h),u),i=3;;){if(o=Me(o.times(f),u),c=l.plus($r(o,new p(i),u)),hr(c.d).slice(0,u)===hr(l.d).slice(0,u))return l=l.times(2),s!==0&&(l=l.plus(wc(p,u+2,v).times(s+""))),l=$r(l,new p(d),u),p.precision=v,t==null?(Ue=!0,Me(l,v)):l;l=c,i+=2}}function fp(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=ii(r/Be),e.d=[],n=(r+1)%Be,r<0&&(n+=Be),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Be;n<i;)e.d.push(+t.slice(n,n+=Be));t=t.slice(n),n=Be-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),Ue&&(e.e>So||e.e<-So))throw Error(_f+r)}else e.s=0,e.e=0,e.d=[0];return e}function Me(e,t,r){var n,i,s,o,l,c,u,f,d=e.d;for(o=1,s=d[0];s>=10;s/=10)o++;if(n=t-o,n<0)n+=Be,i=t,u=d[f=0];else{if(f=Math.ceil((n+1)/Be),s=d.length,f>=s)return e;for(u=s=d[f],o=1;s>=10;s/=10)o++;n%=Be,i=n-Be+o}if(r!==void 0&&(s=mn(10,o-i-1),l=u/s%10|0,c=t<0||d[f+1]!==void 0||u%s,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?u/mn(10,o-i):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(s=Qe(e),d.length=1,t=t-s-1,d[0]=mn(10,(Be-t%Be)%Be),e.e=ii(-t/Be)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,s=1,f--):(d.length=f+1,s=mn(10,Be-n),d[f]=i>0?(u/mn(10,o-i)%mn(10,i)|0)*s:0),c)for(;;)if(f==0){(d[0]+=s)==ot&&(d[0]=1,++e.e);break}else{if(d[f]+=s,d[f]!=ot)break;d[f--]=0,s=1}for(n=d.length;d[--n]===0;)d.pop();if(Ue&&(e.e>So||e.e<-So))throw Error(_f+Qe(e));return e}function Jy(e,t){var r,n,i,s,o,l,c,u,f,d,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Ue?Me(t,h):t;if(c=e.d,d=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(f=o<0,f?(r=c,o=-o,l=d.length):(r=d,n=u,l=c.length),i=Math.max(Math.ceil(h/Be),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=d.length,f=i<l,f&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){f=c[i]<d[i];break}o=0}for(f&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>o;){if(c[--i]<d[i]){for(s=i;s&&c[--s]===0;)c[s]=ot-1;--c[s],c[i]+=ot}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Ue?Me(t,h):t):new m(0)}function Tn(e,t,r){var n,i=Qe(e),s=hr(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+Wr(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+Wr(-i-1)+s,r&&(n=r-o)>0&&(s+=Wr(n))):i>=o?(s+=Wr(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+Wr(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=Wr(n))),e.s<0?"-"+s:s}function mp(e,t){if(e.length>t)return e.length=t,!0}function Zy(e){var t,r,n;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Nn+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return fp(o,s.toString())}else if(typeof s!="string")throw Error(Nn+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,s3.test(s))fp(o,s);else throw Error(Nn+s)}if(i.prototype=ie,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Zy,i.config=i.set=o3,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function o3(e){if(!e||typeof e!="object")throw Error(Yt+"Object expected");var t,r,n,i=["precision",1,ai,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(ii(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Nn+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Nn+r+": "+n);return this}var Sf=Zy(i3);$t=new Sf(1);const Te=Sf;function l3(e){return f3(e)||d3(e)||u3(e)||c3()}function c3(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 76In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u3(e,t){if(e){if(typeof e=="string")return Au(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 Au(e,t)}}function d3(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function f3(e){if(Array.isArray(e))return Au(e)}function Au(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var m3=function(t){return t},eb={"@@functional/placeholder":!0},tb=function(t){return t===eb},hp=function(t){return function r(){return arguments.length===0||arguments.length===1&&tb(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},h3=function e(t,r){return t===1?r:hp(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var o=i.filter(function(l){return l!==eb}).length;return o>=t?r.apply(void 0,i):e(t-o,hp(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=i.map(function(d){return tb(d)?c.shift():d});return r.apply(void 0,l3(f).concat(c))}))})},Dl=function(t){return h3(t.length,t)},Ou=function(t,r){for(var n=[],i=t;i<r;++i)n[i-t]=i;return n},p3=Dl(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),g3=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return m3;var i=r.reverse(),s=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},Pu=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},rb=function(t){var r=null,n=null;return function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return r&&s.every(function(l,c){return l===r[c]})||(r=s,n=t.apply(void 0,s)),n}};function v3(e){var t;return e===0?t=1:t=Math.floor(new Te(e).abs().log(10).toNumber())+1,t}function x3(e,t,r){for(var n=new Te(e),i=0,s=[];n.lt(t)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}var y3=Dl(function(e,t,r){var n=+e,i=+t;return n+r*(i-n)}),b3=Dl(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),j3=Dl(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Il={rangeStep:x3,getDigitCount:v3,interpolateNumber:y3,uninterpolateNumber:b3,uninterpolateTruncation:j3};function Cu(e){return _3(e)||N3(e)||nb(e)||w3()}function w3(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 77In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N3(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function _3(e){if(Array.isArray(e))return ku(e)}function Gi(e,t){return O3(e)||A3(e,t)||nb(e,t)||S3()}function S3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 78In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nb(e,t){if(e){if(typeof e=="string")return ku(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 ku(e,t)}}function ku(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function A3(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function O3(e){if(Array.isArray(e))return e}function ab(e){var t=Gi(e,2),r=t[0],n=t[1],i=r,s=n;return r>n&&(i=n,s=r),[i,s]}function ib(e,t,r){if(e.lte(0))return new Te(0);var n=Il.getDigitCount(e.toNumber()),i=new Te(10).pow(n),s=e.div(i),o=n!==1?.05:.1,l=new Te(Math.ceil(s.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?c:new Te(Math.ceil(c))}function P3(e,t,r){var n=1,i=new Te(e);if(!i.isint()&&r){var s=Math.abs(e);s<1?(n=new Te(10).pow(Il.getDigitCount(e)-1),i=new Te(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new Te(Math.floor(e)))}else e===0?i=new Te(Math.floor((t-1)/2)):r||(i=new Te(Math.floor(e)));var o=Math.floor((t-1)/2),l=g3(p3(function(c){return i.add(new Te(c-o).mul(n)).toNumber()}),Ou);return l(0,t)}function sb(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Te(0),tickMin:new Te(0),tickMax:new Te(0)};var s=ib(new Te(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Te(0):(o=new Te(e).add(t).div(2),o=o.sub(new Te(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new Te(t).sub(o).div(s).toNumber()),u=l+c+1;return u>r?sb(e,t,r,n,i+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:s,tickMin:o.sub(new Te(l).mul(s)),tickMax:o.add(new Te(c).mul(s))})}function C3(e){var t=Gi(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=ab([r,n]),c=Gi(l,2),u=c[0],f=c[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(Cu(Ou(0,i-1).map(function(){return 1/0}))):[].concat(Cu(Ou(0,i-1).map(function(){return-1/0})),[f]);return r>n?Pu(d):d}if(u===f)return P3(u,i,s);var m=sb(u,f,o,s),h=m.step,g=m.tickMin,p=m.tickMax,v=Il.rangeStep(g,p.add(new Te(.1).mul(h)),h);return r>n?Pu(v):v}function k3(e,t){var r=Gi(e,2),n=r[0],i=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=ab([n,i]),l=Gi(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,i];if(c===u)return[c];var f=Math.max(t,2),d=ib(new Te(u).sub(c).div(f-1),s,0),m=[].concat(Cu(Il.rangeStep(new Te(c),new Te(u).sub(new Te(.99).mul(d)),d)),[u]);return n>i?Pu(m):m}var E3=rb(C3),$3=rb(k3),T3="Invariant failed";function Mn(e,t){throw new Error(T3)}var M3=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Oa(e){"@babel/helpers - typeof";return Oa=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},Oa(e)}function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ao.apply(this,arguments)}function D3(e,t){return F3(e)||L3(e,t)||R3(e,t)||I3()}function I3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 79In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R3(e,t){if(e){if(typeof e=="string")return pp(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 pp(e,t)}}function pp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function L3(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function F3(e){if(Array.isArray(e))return e}function B3(e,t){if(e==null)return{};var r=q3(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function q3(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z3(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cb(n.key),n)}}function W3(e,t,r){return t&&z3(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function V3(e,t,r){return t=Oo(t),K3(e,ob()?Reflect.construct(t,r||[],Oo(e).constructor):t.apply(e,r))}function K3(e,t){if(t&&(Oa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G3(e)}function G3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ob(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ob=function(){return!!e})()}function Oo(e){return Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Oo(e)}function H3(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&&Eu(e,t)}function Eu(e,t){return Eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Eu(e,t)}function lb(e,t,r){return t=cb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cb(e){var t=Y3(e,"string");return Oa(t)=="symbol"?t:t+""}function Y3(e,t){if(Oa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Oa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ns=function(e){function t(){return U3(this,t),V3(this,t,arguments)}return H3(t,e),W3(t,[{key:"render",value:function(){var n=this.props,i=n.offset,s=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,f=n.xAxis,d=n.yAxis,m=B3(n,M3),h=ue(m,!1);this.props.direction==="x"&&f.type!=="number"&&Mn();var g=c.map(function(p){var v=u(p,l),x=v.x,b=v.y,j=v.value,N=v.errorVal;if(!N)return null;var y=[],w,_;if(Array.isArray(N)){var O=D3(N,2);w=O[0],_=O[1]}else w=_=N;if(s==="vertical"){var A=f.scale,C=b+i,P=C+o,M=C-o,E=A(j-w),T=A(j+_);y.push({x1:T,y1:P,x2:T,y2:M}),y.push({x1:E,y1:C,x2:T,y2:C}),y.push({x1:E,y1:P,x2:E,y2:M})}else if(s==="horizontal"){var $=d.scale,I=x+i,B=I-o,L=I+o,X=$(j-w),z=$(j+_);y.push({x1:B,y1:z,x2:L,y2:z}),y.push({x1:I,y1:X,x2:I,y2:z}),y.push({x1:B,y1:X,x2:L,y2:X})}return k.createElement(_e,Ao({className:"recharts-errorBar",key:"bar-".concat(y.map(function(U){return"".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))},h),y.map(function(U){return k.createElement("line",Ao({},U,{key:"line-".concat(U.x1,"-").concat(U.x2,"-").concat(U.y1,"-").concat(U.y2)}))}
79))});return k.createElement(_e,{className:"recharts-errorBars"},g)}}])}(k.Component);lb(Ns,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});lb(Ns,"displayName","ErrorBar");function Hi(e){"@babel/helpers - typeof";return Hi=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},Hi(e)}function gp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ln(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gp(Object(r),!0).forEach(function(n){X3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function X3(e,t,r){return t=Q3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q3(e){var t=J3(e,"string");return Hi(t)=="symbol"?t:t+""}function J3(e,t){if(Hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ub=function(t){var r=t.children,n=t.formattedGraphicalItems,i=t.legendWidth,s=t.legendContent,o=Et(r,nr);if(!o)return null;var l=nr.defaultProps,c=l!==void 0?ln(ln({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:s==="children"?u=(n||[]).reduce(function(f,d){var m=d.item,h=d.props,g=h.sectors||h.data||[];return f.concat(g.map(function(p){return{type:o.props.iconType||m.props.legendType,value:p.name,color:p.fill,payload:p}}))},[]):u=(n||[]).map(function(f){var d=f.item,m=d.type.defaultProps,h=m!==void 0?ln(ln({},m),d.props):{}
vendor: 39,701 bytes, lines 79-102
79,g=h.dataKey,p=h.name,v=h.legendType,x=h.hide;return{inactive:x,dataKey:g,type:c.iconType||v||"square",color:Af(d),value:p||g,payload:h}}),ln(ln(ln({},c),nr.getWithHeight(o,i)),{},{payload:u,item:o})};function Yi(e){"@babel/helpers - typeof";return Yi=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},Yi(e)}function vp(e){return rL(e)||tL(e)||eL(e)||Z3()}function Z3(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 80In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eL(e,t){if(e){if(typeof e=="string")return $u(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 $u(e,t)}}function tL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rL(e){if(Array.isArray(e))return $u(e)}function $u(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xp(Object(r),!0).forEach(function(n){ca(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ca(e,t,r){return t=nL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nL(e){var t=aL(e,"string");return Yi(t)=="symbol"?t:t+""}function aL(e,t){if(Yi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Yi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ke(e,t,r){return xe(e)||xe(t)?r:at(t)?Dt(e,t,r):fe(t)?t(e):r}function Ai(e,t,r,n){var i=t3(e,function(l){return Ke(l,t)});if(r==="number"){var s=i.filter(function(l){return J(l)||parseFloat(l)});return s.length?[Ml(s),Kr(s)]:[1/0,-1/0]}var o=n?i.filter(function(l){return!xe(l)}):i;return o.map(function(l){return at(l)||l instanceof Date?l:""})}var iL=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<l;u++){var f=u>0?i[u-1].coordinate:i[l-1].coordinate,d=i[u].coordinate,m=u>=l-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(jt(d-f)!==jt(m-d)){var g=[];if(jt(m-d)===jt(c[1]-c[0])){h=m;var p=d+c[1]-c[0];g[0]=Math.min(p,(p+f)/2),g[1]=Math.max(p,(p+f)/2)}else{h=f;var v=m+c[1]-c[0];g[0]=Math.min(d,(v+d)/2),g[1]=Math.max(d,(v+d)/2)}var x=[Math.min(d,(h+d)/2),Math.max(d,(h+d)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){o=i[u].index;break}}else{var b=Math.min(f,m),j=Math.max(f,m);if(t>(b+d)/2&&t<=(j+d)/2){o=i[u].index;break}}}else for(var N=0;N<l;N++)if(N===0&&t<=(n[N].coordinate+n[N+1].coordinate)/2||N>0&&N<l-1&&t>(n[N].coordinate+n[N-1].coordinate)/2&&t<=(n[N].coordinate+n[N+1].coordinate)/2||N===l-1&&t>(n[N].coordinate+n[N-1].coordinate)/2){o=n[N].index;break}return o},Af=function(t){var r,n=t,i=n.type.displayName,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?We(We({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},sL=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var o={},l=Object.keys(s),c=0,u=l.length;c<u;c++)for(var f=s[l[c]].stackGroups,d=Object.keys(f),m=0,h=d.length;m<h;m++){var g=f[d[m]],p=g.items,v=g.cateAxisId,x=p.filter(function(_){return Er(_.type).indexOf("Bar")>=0});if(x&&x.length){var b=x[0].type.defaultProps,j=b!==void 0?We(We({},b),x[0].props):x[0].props,N=j.barSize,y=j[v];o[y]||(o[y]=[]);var w=xe(N)?r:N;o[y].push({item:x[0],stackList:x.slice(1),barSize:xe(w)?void 0:wt(w,n,0)})}}return o},oL=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=wt(r,i,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var m=!1,h=i/c,g=o.reduce(function(N,y){return N+y.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&h>0&&(m=!0,h*=.9,g=c*h);var p=(i-g)/2>>0,v={offset:p-u,size:0};f=o.reduce(function(N,y){var w={item:y.item,position:{offset:v.offset+v.size+u,size:m?h:y.barSize}},_=[].concat(vp(N),[w]);return v=_[_.length-1].position,y.stackList&&y.stackList.length&&y.stackList.forEach(function(O){_.push({item:O,position:v})}),_},d)}else{var x=wt(n,i,0,!0);i-2*x-(c-1)*u<=0&&(u=0);var b=(i-2*x-(c-1)*u)/c;b>1&&(b>>=0);var j=l===+l?Math.min(b,l):b;f=o.reduce(function(N,y,w){var _=[].concat(vp(N),[{item:y.item,position:{offset:x+(b+u)*w+(b-j)/2,size:j}}]);return y.stackList&&y.stackList.length&&y.stackList.forEach(function(O){_.push({item:O,position:_[_.length-1].position})}),_},d)}return f},lL=function(t,r,n,i){var s=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=ub({children:s,legendWidth:c});if(u){var f=i||{},d=f.width,m=f.height,h=u.align,g=u.verticalAlign,p=u.layout;if((p==="vertical"||p==="horizontal"&&g==="middle")&&h!=="center"&&J(t[h]))return We(We({},t),{},ca({},h,t[h]+(d||0)));if((p==="horizontal"||p==="vertical"&&h==="center")&&g!=="middle"&&J(t[g]))return We(We({},t),{},ca({},g,t[g]+(m||0)))}return t},cL=function(t,r,n){return xe(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},db=function(t,r,n,i,s){var o=r.props.children,l=It(o,Ns).filter(function(u){return cL(i,s,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ke(f,n);if(xe(d))return u;var m=Array.isArray(d)?[Ml(d),Kr(d)]:[d,d],h=c.reduce(function(g,p){var v=Ke(f,p,0),x=m[0]-Math.abs(Array.isArray(v)?v[0]:v),b=m[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(b,g[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},uL=function(t,r,n,i,s){var o=r.map(function(l){return db(t,l,n,s,i)}).filter(function(l){return!xe(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},fb=function(t,r,n,i,s){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&db(t,c,u,i)||Ai(t,u,n,s)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var f=0,d=u.length;f<d;f++)l[u[f]]||(l[u[f]]=!0,c.push(u[f]));return c},[])},mb=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},hb=function(t,r,n,i){if(i)return t.map(function(c){return c.coordinate});var s,o,l=t.map(function(c){return c.coordinate===r&&(s=!0),c.coordinate===n&&(o=!0),c.coordinate});return s||l.push(r),o||l.push(n),l},Cr=function(t,r,n){if(!t)return null;var i=t.scale,s=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?jt(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var m=s?s.indexOf(d):d;return{coordinate:i(m)+u,value:d,offset:u}});return f.filter(function(d){return!Za(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,m){return{coordinate:i(d)+u,value:d,index:m,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,m){return{coordinate:i(d)+u,value:s?s[d]:d,index:m,offset:u}})},Nc=new WeakMap,Ls=function(t,r){if(typeof r!="function")return t;Nc.has(t)||Nc.set(t,new WeakMap);var n=Nc.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},pb=function(t,r,n){var i=t.scale,s=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:qi(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:jo(),realScaleType:"linear"}:s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Si(),realScaleType:"point"}:s==="category"?{scale:qi(),realScaleType:"band"}:{scale:jo(),realScaleType:"linear"};if(Cn(i)){var c="scale".concat(yl(i));return{scale:(dp[c]||Si)(),realScaleType:dp[c]?c:"point"}}return fe(i)?{scale:i}:{scale:Si(),realScaleType:"point"}},yp=1e-4,gb=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),s=Math.min(i[0],i[1])-yp,o=Math.max(i[0],i[1])+yp,l=t(r[0]),c=t(r[n-1]);(l<s||l>o||c<s||c>o)&&t.domain([r[0],r[n-1]])}},dL=function(t,r){if(!t)return null;for(var n=0,i=t.length;n<i;n++)if(t[n].item===r)return t[n].position;return null},fL=function(t,r){if(!r||r.length!==2||!J(r[0])||!J(r[1]))return t;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),s=[t[0],t[1]];return(!J(t[0])||t[0]<n)&&(s[0]=n),(!J(t[1])||t[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<n&&(s[1]=n),s},mL=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var s=0,o=0,l=0;l<r;++l){var c=Za(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},hL=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var s=0,o=0;o<r;++o){var l=Za(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=s,t[o][n][1]=s+l,s=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},pL={sign:mL,expand:MO,none:ya,silhouette:DO,wiggle:IO,positive:hL},gL=function(t,r,n){var i=r.map(function(l){return l.props.dataKey}),s=pL[n],o=TO().keys(i).value(function(l,c){return+Ke(l,c,0)}).order(nu).offset(s);return o(t)},vL=function(t,r,n,i,s,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(d,m){var h,g=(h=m.type)!==null&&h!==void 0&&h.defaultProps?We(We({},m.type.defaultProps),m.props):m.props,p=g.stackId,v=g.hide;if(v)return d;var x=g[n],b=d[x]||{hasStack:!1,stackGroups:{}};if(at(p)){var j=b.stackGroups[p]||{numericAxisId:n,cateAxisId:i,items:[]};j.items.push(m),b.hasStack=!0,b.stackGroups[p]=j}else b.stackGroups[Fn("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[m]};return We(We({},d),{},ca({},x,b))},c),f={};return Object.keys(u).reduce(function(d,m){var h=u[m];if(h.hasStack){var g={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(p,v){var x=h.stackGroups[v];return We(We({},p),{},ca({},v,{numericAxisId:n,cateAxisId:i,items:x.items,stackedData:gL(t,x.items,s)}))},g)}return We(We({},d),{},ca({},m,h))},f)},vb=function(t,r){var n=r.realScaleType,i=r.type,s=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=E3(u,s,l);return t.domain([Ml(f),Kr(f)]),{niceTicks:f}}if(s&&i==="number"){var d=t.domain(),m=$3(d,s,l);return{niceTicks:m}}return null};function Po(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,s=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!xe(i[t.dataKey])){var l=Zs(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=Ke(i,xe(o)?t.dataKey:o);return xe(c)?null:t.scale(c)}var bp=function(t){var r=t.axis,n=t.ticks,i=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var c=Ke(o,r.dataKey,r.domain[l]);return xe(c)?null:r.scale(c)-s/2+i},xL=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]);return i<=0&&s>=0?0:s<0?s:i}return n[0]},yL=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?We(We({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(at(s)){var o=r[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},bL=function(t){return t.reduce(function(r,n){return[Ml(n.concat([r[0]]).filter(J)),Kr(n.concat([r[1]]).filter(J))]},[1/0,-1/0])},xb=function(t,r,n){return Object.keys(t).reduce(function(i,s){var o=t[s],l=o.stackedData,c=l.reduce(function(u,f){var d=bL(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},jp=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,wp=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Tu=function(t,r,n){if(fe(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(J(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(jp.test(t[0])){var s=+jp.exec(t[0])[1];i[0]=r[0]-s}else fe(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(J(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(wp.test(t[1])){var o=+wp.exec(t[1])[1];i[1]=r[1]+o}else fe(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Co=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var s=Zd(r,function(d){return d.coordinate}),o=1/0,l=1,c=s.length;l<c;l++){var u=s[l],f=s[l-1];o=Math.min((u.coordinate||0)-(f.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},Np=function(t,r,n){return!t||!t.length||$n(t,Dt(n,"type.defaultProps.domain"))?r:t},yb=function(t,r){var n=t.type.defaultProps?We(We({},t.type.defaultProps),t.props):t.props,i=n.dataKey,s=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,f=n.hide;return We(We({},ue(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:s||i,color:Af(t),value:Ke(r,i),type:c,payload:r,chartType:u,hide:f})};function Xi(e){"@babel/helpers - typeof";return Xi=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},Xi(e)}function _p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_p(Object(r),!0).forEach(function(n){bb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_p(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bb(e,t,r){return t=jL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jL(e){var t=wL(e,"string");return Xi(t)=="symbol"?t:t+""}function wL(e,t){if(Xi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Xi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NL(e,t){return OL(e)||AL(e,t)||SL(e,t)||_L()}function _L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 81In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SL(e,t){if(e){if(typeof e=="string")return Sp(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 Sp(e,t)}}function Sp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function AL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function OL(e){if(Array.isArray(e))return e}var ko=Math.PI/180,PL=function(t){return t*180/Math.PI},Le=function(t,r,n,i){return{x:t+Math.cos(-ko*i)*n,y:r+Math.sin(-ko*i)*n}},jb=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},CL=function(t,r,n,i,s){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,f=wt(t.cx,o,o/2),d=wt(t.cy,l,l/2),m=jb(o,l,n),h=wt(t.innerRadius,m,0),g=wt(t.outerRadius,m,m*.8),p=Object.keys(r);return p.reduce(function(v,x){var b=r[x],j=b.domain,N=b.reversed,y;if(xe(b.range))i==="angleAxis"?y=[c,u]:i==="radiusAxis"&&(y=[h,g]),N&&(y=[y[1],y[0]]);else{y=b.range;var w=y,_=NL(w,2);c=_[0],u=_[1]}var O=pb(b,s),A=O.realScaleType,C=O.scale;C.domain(j).range(y),gb(C);var P=vb(C,Ar(Ar({},b),{},{realScaleType:A})),M=Ar(Ar(Ar({},b),P),{},{range:y,radius:g,realScaleType:A,scale:C,cx:f,cy:d,innerRadius:h,outerRadius:g,startAngle:c,endAngle:u});return Ar(Ar({},v),{},bb({},x,M))},{})},kL=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return Math.sqrt(Math.pow(n-s,2)+Math.pow(i-o,2))},EL=function(t,r){var n=t.x,i=t.y,s=r.cx,o=r.cy,l=kL({x:n,y:i},{x:s,y:o});if(l<=0)return{radius:l};var c=(n-s)/l,u=Math.acos(c);return i>o&&(u=2*Math.PI-u),{radius:l,angle:PL(u),angleInRadian:u}},$L=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),s=Math.floor(n/360),o=Math.min(i,s);return{startAngle:r-o*360,endAngle:n-o*360}},TL=function(t,r){var n=r.startAngle,i=r.endAngle,s=Math.floor(n/360),o=Math.floor(i/360),l=Math.min(s,o);return t+l*360},Ap=function(t,r){var n=t.x,i=t.y,s=EL({x:n,y:i},r),o=s.radius,l=s.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var f=$L(r),d=f.startAngle,m=f.endAngle,h=l,g;if(d<=m){for(;h>m;)h-=360;for(;h<d;)h+=360;g=h>=d&&h<=m}else{for(;h>d;)h-=360;for(;h<m;)h+=360;g=h>=m&&h<=d}return g?Ar(Ar({},r),{},{radius:o,angle:TL(h,r)}):null},wb=function(t){return!S.isValidElement(t)&&!fe(t)&&typeof t!="boolean"?t.className:""};function Qi(e){"@babel/helpers - typeof";return Qi=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},Qi(e)}var ML=["offset"];function DL(e){return FL(e)||LL(e)||RL(e)||IL()}function IL(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 82In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RL(e,t){if(e){if(typeof e=="string")return Mu(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 Mu(e,t)}}function LL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FL(e){if(Array.isArray(e))return Mu(e)}function Mu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function BL(e,t){if(e==null)return{};var r=qL(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qL(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Op(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Op(Object(r),!0).forEach(function(n){UL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Op(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UL(e,t,r){return t=zL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zL(e){var t=WL(e,"string");return Qi(t)=="symbol"?t:t+""}function WL(e,t){if(Qi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ji.apply(this,arguments)}var VL=function(t){var r=t.value,n=t.formatter,i=xe(t.children)?r:t.children;return fe(n)?n(i):i},KL=function(t,r){var n=jt(r-t),i=Math.min(Math.abs(r-t),360);return n*i},GL=function(t,r,n){var i=t.position,s=t.viewBox,o=t.offset,l=t.className,c=s,u=c.cx,f=c.cy,d=c.innerRadius,m=c.outerRadius,h=c.startAngle,g=c.endAngle,p=c.clockWise,v=(d+m)/2,x=KL(h,g),b=x>=0?1:-1,j,N;i==="insideStart"?(j=h+b*o,N=p):i==="insideEnd"?(j=g-b*o,N=!p):i==="end"&&(j=g+b*o,N=p),N=x<=0?N:!N;var y=Le(u,f,v,j),w=Le(u,f,v,j+(N?1:-1)*359),_="M".concat(y.x,",").concat(y.y,` 83 A`).concat(v,",").concat(v,",0,1,").concat(N?0:1,`, 84 `).concat(w.x,",").concat(w.y),O=xe(t.id)?Fn("recharts-radial-line-"):t.id;return k.createElement("text",Ji({},n,{dominantBaseline:"central",className:je("recharts-radial-bar-label",l)}),k.createElement("defs",null,k.createElement("path",{id:O,d:_})),k.createElement("textPath",{xlinkHref:"#".concat(O)},r))},HL=function(t){var r=t.viewBox,n=t.offset,i=t.position,s=r,o=s.cx,l=s.cy,c=s.innerRadius,u=s.outerRadius,f=s.startAngle,d=s.endAngle,m=(f+d)/2;if(i==="outside"){var h=Le(o,l,u+n,m),g=h.x,p=h.y;return{x:g,y:p,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,x=Le(o,l,v,m),b=x.x,j=x.y;return{x:b,y:j,textAnchor:"middle",verticalAnchor:"middle"}},YL=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,s=t.position,o=r,l=o.x,c=o.y,u=o.width,f=o.height,d=f>=0?1:-1,m=d*i,h=d>0?"end":"start",g=d>0?"start":"end",p=u>=0?1:-1,v=p*i,x=p>0?"end":"start",b=p>0?"start":"end";if(s==="top"){var j={x:l+u/2,y:c-d*i,textAnchor:"middle",verticalAnchor:h};return tt(tt({},j),n?{height:Math.max(c-n.y,0),width:u}:{})}if(s==="bottom"){var N={x:l+u/2,y:c+f+m,textAnchor:"middle",verticalAnchor:g};return tt(tt({},N),n?{height:Math.max(n.y+n.height-(c+f),0),width:u}:{})}if(s==="left"){var y={x:l-v,y:c+f/2,textAnchor:x,verticalAnchor:"middle"};return tt(tt({},y),n?{width:Math.max(y.x-n.x,0),height:f}:{})}if(s==="right"){var w={x:l+u+v,y:c+f/2,textAnchor:b,verticalAnchor:"middle"};return tt(tt({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:f}:{})}var _=n?{width:u,height:f}:{};return s==="insideLeft"?tt({x:l+v,y:c+f/2,textAnchor:b,verticalAnchor:"middle"},_):s==="insideRight"?tt({x:l+u-v,y:c+f/2,textAnchor:x,verticalAnchor:"middle"},_):s==="insideTop"?tt({x:l+u/2,y:c+m,textAnchor:"middle",verticalAnchor:g},_):s==="insideBottom"?tt({x:l+u/2,y:c+f-m,textAnchor:"middle",verticalAnchor:h},_):s==="insideTopLeft"?tt({x:l+v,y:c+m,textAnchor:b,verticalAnchor:g},_):s==="insideTopRight"?tt({x:l+u-v,y:c+m,textAnchor:x,verticalAnchor:g},_):s==="insideBottomLeft"?tt({x:l+v,y:c+f-m,textAnchor:b,verticalAnchor:h},_):s==="insideBottomRight"?tt({x:l+u-v,y:c+f-m,textAnchor:x,verticalAnchor:h},_):Ya(s)&&(J(s.x)||gn(s.x))&&(J(s.y)||gn(s.y))?tt({x:l+wt(s.x,u),y:c+wt(s.y,f),textAnchor:"end",verticalAnchor:"end"},_):tt({x:l+u/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},XL=function(t){return"cx"in t&&J(t.cx)};function ct(e){var t=e.offset,r=t===void 0?5:t,n=BL(e,ML),i=tt({offset:r},n),s=i.viewBox,o=i.position,l=i.value,c=i.children,u=i.content,f=i.className,d=f===void 0?"":f,m=i.textBreakAll;if(!s||xe(l)&&xe(c)&&!S.isValidElement(u)&&!fe(u))return null;if(S.isValidElement(u))return S.cloneElement(u,i);var h;if(fe(u)){if(h=S.createElement(u,i),S.isValidElement(h))return h}else h=VL(i);var g=XL(s),p=ue(i,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return GL(i,h,p);var v=g?HL(i):YL(i);return k.createElement(En,Ji({className:je("recharts-label",d)},p,v,{breakAll:m}),h)}ct.displayName="Label";var Nb=function(t){var r=t.cx,n=t.cy,i=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,m=t.y,h=t.top,g=t.left,p=t.width,v=t.height,x=t.clockWise,b=t.labelViewBox;if(b)return b;if(J(p)&&J(v)){if(J(d)&&J(m))return{x:d,y:m,width:p,height:v};if(J(h)&&J(g))return{x:h,y:g,width:p,height:v}}return J(d)&&J(m)?{x:d,y:m,width:0,height:0}:J(r)&&J(n)?{cx:r,cy:n,startAngle:s||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||c||l||0,clockWise:x}:t.viewBox?t.viewBox:{}},QL=function(t,r){return t?t===!0?k.createElement(ct,{key:"label-implicit",viewBox:r}):at(t)?k.createElement(ct,{key:"label-implicit",viewBox:r,value:t}):S.isValidElement(t)?t.type===ct?S.cloneElement(t,{key:"label-implicit",viewBox:r}):k.createElement(ct,{key:"label-implicit",content:t,viewBox:r}):fe(t)?k.createElement(ct,{key:"label-implicit",content:t,viewBox:r}):Ya(t)?k.createElement(ct,Ji({viewBox:r},t,{key:"label-implicit"})):null:null},JL=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,s=Nb(t),o=It(i,ct).map(function(c,u){return S.cloneElement(c,{viewBox:r||s,key:"label-".concat(u)})});if(!n)return o;var l=QL(t.label,r||s);return[l].concat(DL(o))};ct.parseViewBox=Nb;ct.renderCallByParent=JL;function ZL(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var e5=ZL;const t5=De(e5);function Zi(e){"@babel/helpers - typeof";return Zi=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},Zi(e)}var r5=["valueAccessor"],n5=["data","dataKey","clockWise","id","textBreakAll"];function a5(e){return l5(e)||o5(e)||s5(e)||i5()}function i5(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 85In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s5(e,t){if(e){if(typeof e=="string")return Du(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 Du(e,t)}}function o5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l5(e){if(Array.isArray(e))return Du(e)}function Du(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Eo(){return Eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eo.apply(this,arguments)}function Pp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pp(Object(r),!0).forEach(function(n){c5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c5(e,t,r){return t=u5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u5(e){var t=d5(e,"string");return Zi(t)=="symbol"?t:t+""}function d5(e,t){if(Zi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kp(e,t){if(e==null)return{};var r=f5(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var m5=function(t){return Array.isArray(t.value)?t5(t.value):t.value};function vr(e){var t=e.valueAccessor,r=t===void 0?m5:t,n=kp(e,r5),i=n.data,s=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=kp(n,n5);return!i||!i.length?null:k.createElement(_e,{className:"recharts-label-list"},i.map(function(f,d){var m=xe(s)?r(f,d):Ke(f&&f.payload,s),h=xe(l)?{}:{id:"".concat(l,"-").concat(d)};return k.createElement(ct,Eo({},ue(f,!0),u,h,{parentViewBox:f.parentViewBox,value:m,textBreakAll:c,viewBox:ct.parseViewBox(xe(o)?f:Cp(Cp({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}vr.displayName="LabelList";function h5(e,t){return e?e===!0?k.createElement(vr,{key:"labelList-implicit",data:t}):k.isValidElement(e)||fe(e)?k.createElement(vr,{key:"labelList-implicit",data:t,content:e}):Ya(e)?k.createElement(vr,Eo({data:t},e,{key:"labelList-implicit"})):null:null}function p5(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=It(n,vr).map(function(o,l){return S.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return i;var s=h5(e.label,t);return[s].concat(a5(i))}vr.renderCallByParent=p5;function es(e){"@babel/helpers - typeof";return es=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},es(e)}function Iu(){return Iu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iu.apply(this,arguments)}function Ep(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ep(Object(r),!0).forEach(function(n){g5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ep(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function g5(e,t,r){return t=v5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v5(e){var t=x5(e,"string");return es(t)=="symbol"?t:t+""}function x5(e,t){if(es(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(es(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var y5=function(t,r){var n=jt(r-t),i=Math.min(Math.abs(r-t),359.999);return n*i},Fs=function(t){var r=t.cx,n=t.cy,i=t.radius,s=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,f=c*(l?1:-1)+i,d=Math.asin(c/f)/ko,m=u?s:s+o*d,h=Le(r,n,f,m),g=Le(r,n,i,m),p=u?s-o*d:s,v=Le(r,n,f*Math.cos(d*ko),p);return{center:h,circleTangency:g,lineTangency:v,theta:d}},_b=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.startAngle,l=t.endAngle,c=y5(o,l),u=o+c,f=Le(r,n,s,o),d=Le(r,n,s,u),m="M ".concat(f.x,",").concat(f.y,` 86 A `).concat(s,",").concat(s,`,0, 87 `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`, 88 `).concat(d.x,",").concat(d.y,` 89 `);if(i>0){var h=Le(r,n,i,o),g=Le(r,n,i,u);m+="L ".concat(g.x,",").concat(g.y,` 90 A `).concat(i,",").concat(i,`,0, 91 `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`, 92 `).concat(h.x,",").concat(h.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},b5=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=jt(f-u),m=Fs({cx:r,cy:n,radius:s,angle:u,sign:d,cornerRadius:o,cornerIsExternal:c}),h=m.circleTangency,g=m.lineTangency,p=m.theta,v=Fs({cx:r,cy:n,radius:s,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:c}),x=v.circleTangency,b=v.lineTangency,j=v.theta,N=c?Math.abs(u-f):Math.abs(u-f)-p-j;if(N<0)return l?"M ".concat(g.x,",").concat(g.y,` 93 a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 94 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 95 `):_b({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:u,endAngle:f});var y="M ".concat(g.x,",").concat(g.y,` 96 A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(h.x,",").concat(h.y,` 97 A`).concat(s,",").concat(s,",0,").concat(+(N>180),",").concat(+(d<0),",").concat(x.x,",").concat(x.y,` 98 A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(b.x,",").concat(b.y,` 99 `);if(i>0){var w=Fs({cx:r,cy:n,radius:i,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=w.circleTangency,O=w.lineTangency,A=w.theta,C=Fs({cx:r,cy:n,radius:i,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=C.circleTangency,M=C.lineTangency,E=C.theta,T=c?Math.abs(u-f):Math.abs(u-f)-A-E;if(T<0&&o===0)return"".concat(y,"L").concat(r,",").concat(n,"Z");y+="L".concat(M.x,",").concat(M.y,` 100 A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,` 101 A`).concat(i,",").concat(i,",0,").concat(+(T>180),",").concat(+(d>0),",").concat(_.x,",").concat(_.y,` 102 A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(O.x,",").concat(O.y,"Z")}else y+="L".concat(r,",").concat(n,"Z");return y},j5={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Sb=function(t){var r=$p($p({},j5),t),n=r.cx,i=r.cy,s=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,m=r.className;if(o<s||f===d)return null;var h=je("recharts-sector",m),g=o-s,p=wt(l,g,0,!0),v;return p>0&&Math.abs(f-d)<360?v=b5({cx:n,cy:i,innerRadius:s,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:f,endAngle:d}):v=_b({cx:n,cy:i,innerRadius:s,outerRadius:o,startAngle:f,endAngle:d}),k.createElement("path",Iu({},ue(r,!0),{className:h,d:v,role:"img"}))};function ts(e){"@babel/helpers - typeof";return ts=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},ts(e)}function Ru(){return Ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ru.apply(this,arguments)}function Tp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tp(Object(r),!0).forEach(function(n){w5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w5(e,t,r){return t=N5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N5(e){var t=_5(e,"string");return ts(t)=="symbol"?t:t+""}function _5(e,t){if(ts(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ts(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dp={curveBasisClosed:wO,curveBasisOpen:NO,curveBasis:jO,curveBumpX:oO,curveBumpY:lO,curveLinearClosed:_O,curveLinear:jl,curveMonotoneX:SO,curveMonotoneY:AO,curveNatural:OO,curveStep:PO,curveStepAfter:kO,curveStepBefore:CO},Bs=function(t){return t.x===+t.x&&t.y===+t.y},hi=function(t){return t.x},pi=function(t){return t.y},S5=function(t,r){if(fe(t))return t;var n="curve".concat(yl(t));return(n==="curveMonotone"||n==="curveBump")&&r?Dp["".concat(n).concat(r==="vertical"?"Y":"X")]:Dp[n]||jl},A5=function(t){var r=t.type,n=r===void 0?"linear":r,i=t.points,s=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,f=S5(n,l),d=u?s.filter(function(p){return Bs(p)}):s,m;if(Array.isArray(o)){var h=u?o.filter(function(p){return Bs(p)}):o,g=d.map(function(p,v){return Mp(Mp({},p),{},{base:h[v]})});return l==="vertical"?m=ks().y(pi).x1(hi).x0(function(p){return p.base.x}):m=ks().x(hi).y1(pi).y0(function(p){return p.base.y}),m.defined(Bs).curve(f),m(g)}return l==="vertical"&&J(o)?m=ks().y(pi).x1(hi).x0(o):J(o)?m=ks().x(hi).y1(pi).y0(o):m=yx().x(hi).y(pi),m.defined(Bs).curve(f),m(d)},_n=function(t){var r=t.className,n=t.points,i=t.path,s=t.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?A5(t):i;return S.createElement("path",Ru({},ue(t,!1),eo(t),{className:je("recharts-curve",r),d:o,ref:s}))},O5=Object.getOwnPropertyNames,P5=Object.getOwnPropertySymbols,C5=Object.prototype.hasOwnProperty;function Ip(e,t){return function(n,i,s){return e(n,i,s)&&t(n,i,s)}}function qs(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var s=i.cache,o=s.get(r),l=s.get(n);if(o&&l)return o===n&&l===r;s.set(r,n),s.set(n,r);var c=e(r,n,i);return s.delete(r),s.delete(n),c}}function Rp(e){return O5(e).concat(P5(e))}var k5=Object.hasOwn||function(e,t){return C5.call(e,t)};function Un(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var E5="__v",$5="__o",T5="_owner",Lp=Object.getOwnPropertyDescriptor,Fp=Object.keys;function M5(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function D5(e,t){return Un(e.getTime(),t.getTime())}function I5(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function R5(e,t){return e===t}function Bp(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),s=e.entries(),o,l,c=0;(o=s.next())&&!o.done;){for(var u=t.entries(),f=!1,d=0;(l=u.next())&&!l.done;){if(i[d]){d++;continue}var m=o.value,h=l.value;if(r.equals(m[0],h[0],c,d,e,t,r)&&r.equals(m[1],h[1],m[0],h[0],e,t,r)){f=i[d]=!0;break}d++}if(!f)return!1;c++}return!0}var L5=Un;function F5(e,t,r){var n=Fp(e),i=n.length;if(Fp(t).length!==i)return!1;for(;i-- >0;)if(!Ab(e,t,r,n[i]))return!1;return!0}function gi(e,t,r){var n=Rp(e),i=n.length;if(Rp(t).length!==i)return!1;for(var s,o,l;i-- >0;
102)if(s=n[i],!Ab(e,t,r,s)||(o=Lp(e,s),l=Lp(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function B5(e,t){return Un(e.valueOf(),t.valueOf())}function q5(e,t){return e.source===t.source&&e.flags===t.flags}function qp(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),s=e.values(),o,l;(o=s.next())&&!o.done;){for(var c=t.values(),u=!1,f=0;(l=c.next())&&!l.done;){if(!i[f]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function U5(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function z5(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 Ab(e,t,r,n){return(n===T5||n===$5||n===E5)&&(e.$$typeof||t.$$typeof)?!0:k5(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var W5="[object Arguments]",V5="[object Boolean]",K5="[object Date]",G5="[object Error]",H5="[object Map]",Y5="[object Number]",X5="[object Object]",Q5="[object RegExp]",J5="[object Set]",Z5="[object String]",eF="[object URL]",tF=Array.isArray,Up=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,zp=Object.assign,rF=Object.prototype.toString.call.bind(Object.prototype.toString);function nF(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,s=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,f=e.areSetsEqual,d=e.areTypedArraysEqual,m=e.areUrlsEqual;return function(g,p,v){if(g===p)return!0;if(g==null||p==null)return!1;var x=typeof g;if(x!==typeof p)return!1;if(x!=="object")return x==="number"?o(g,p,v):x==="function"?i(g,p,v):!1;var b=g.constructor;if(b!==p.constructor)return!1;if(b===Object)return l(g,p,v);if(tF(g))return t(g,p,v);if(Up!=null&&Up(g))return d(g,p,v);if(b===Date)return r(g,p,v);if(b===RegExp)return u(g,p,v);if(b===Map)return s(g,p,v);if(b===Set)return f(g,p,v);var j=rF(g);return j===K5?r(g,p,v):j===Q5?u(g,p,v):j===H5?s(g,p,v):j===J5?f(g,p,v):j===X5?typeof g.then!="function"&&typeof p.then!="function"&&l(g,p,v):j===eF?m(g,p,v):j===G5?n(g,p,v):j===W5?l(g,p,v):j===V5||j===Y5||j===Z5?c(g,p,v):!1}}function aF(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?gi:M5,areDatesEqual:D5,areErrorsEqual:I5,areFunctionsEqual:R5,areMapsEqual:n?Ip(Bp,gi):Bp,areNumbersEqual:L5,areObjectsEqual:n?gi:F5,arePrimitiveWrappersEqual:B5,areRegExpsEqual:q5,areSetsEqual:n?Ip(qp,gi):qp,areTypedArraysEqual:n?gi:U5,areUrlsEqual:z5};if(r&&(i=zp({},i,r(i))),t){var s=qs(i.areArraysEqual),o=qs(i.areMapsEqual),l=qs(i.areObjectsEqual),c=qs(i.areSetsEqual);i=zp({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return i}function iF(e){return function(t,r,n,i,s,o,l){return e(t,r,l)}}function sF(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,s=e.strict;if(n)return function(c,u){var f=n(),d=f.cache,m=d===void 0?t?new WeakMap:void 0:d,h=f.meta;return r(c,u,{cache:m,equals:i,meta:h,strict:s})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return r(c,u,o)}}var oF=an();an({strict:!0});an({circular:!0});an({circular:!0,strict:!0});an({createInternalComparator:function(){return Un}});an({strict:!0,createInternalComparator:function(){return Un}});an({circular:!0,createInternalComparator:function(){return Un}});an({circular:!0,createInternalComparator:function(){return Un},strict:!0});function an(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,s=e.strict,o=s===void 0?!1:s,l=aF(e),c=nF(l),u=n?n(c):iF(c);return sF({circular:r,comparator:c,createState:i,equals:u,strict:o})}function lF(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Wp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(s){r<0&&(r=s),s-r>t?(e(s),r=-1):lF(i)};requestAnimationFrame(n)}function Lu(e){"@babel/helpers - typeof";return Lu=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},Lu(e)}function cF(e){return mF(e)||fF(e)||dF(e)||uF()}
vendor: 29,580 bytes, lines 102-120
102function uF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 103In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dF(e,t){if(e){if(typeof e=="string")return Vp(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 Vp(e,t)}}function Vp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mF(e){if(Array.isArray(e))return e}function hF(){var e={},t=function(){return null},r=!1,n=function i(s){if(!r){if(Array.isArray(s)){if(!s.length)return;var o=s,l=cF(o),c=l[0],u=l.slice(1);if(typeof c=="number"){Wp(i.bind(null,u),c);return}i(c),Wp(i.bind(null,u));return}Lu(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){r=!0},start:function(s){r=!1,n(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function rs(e){"@babel/helpers - typeof";return rs=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},rs(e)}function Kp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kp(Object(r),!0).forEach(function(n){Ob(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ob(e,t,r){return t=pF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pF(e){var t=gF(e,"string");return rs(t)==="symbol"?t:String(t)}function gF(e,t){if(rs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vF=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,i){return n.filter(function(s){return i.includes(s)})})},xF=function(t){return t},yF=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Oi=function(t,r){return Object.keys(r).reduce(function(n,i){return Gp(Gp({},n),{},Ob({},i,t(i,r[i])))},{})},Hp=function(t,r,n){return t.map(function(i){return"".concat(yF(i)," ").concat(r,"ms ").concat(n)}).join(",")};function bF(e,t){return NF(e)||wF(e,t)||Pb(e,t)||jF()}function jF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 104In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function NF(e){if(Array.isArray(e))return e}function _F(e){return OF(e)||AF(e)||Pb(e)||SF()}function SF(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 105In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pb(e,t){if(e){if(typeof e=="string")return Fu(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 Fu(e,t)}}function AF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OF(e){if(Array.isArray(e))return Fu(e)}function Fu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var $o=1e-4,Cb=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},kb=function(t,r){return t.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},Yp=function(t,r){return function(n){var i=Cb(t,r);return kb(i,n)}},PF=function(t,r){return function(n){var i=Cb(t,r),s=[].concat(_F(i.map(function(o,l){return o*l}).slice(1)),[0]);return kb(s,n)}},Xp=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0],s=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,s=0,o=1,l=1;break;case"ease":i=.25,s=.1,o=.25,l=1;break;case"ease-in":i=.42,s=0,o=1,l=1;break;case"ease-out":i=.42,s=0,o=.58,l=1;break;case"ease-in-out":i=0,s=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),f=bF(u,4);i=f[0],s=f[1],o=f[2],l=f[3]}}}var d=Yp(i,o),m=Yp(s,l),h=PF(i,o),g=function(x){return x>1?1:x<0?0:x},p=function(x){for(var b=x>1?1:x,j=b,N=0;N<8;++N){var y=d(j)-b,w=h(j);if(Math.abs(y-b)<$o||w<$o)return m(j);j=g(j-y/w)}return m(j)};return p.isStepper=!1,p},CF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,s=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(f,d,m){var h=-(f-d)*n,g=m*s,p=m+(h-g)*l/1e3,v=m*l/1e3+f;return Math.abs(v-d)<$o&&Math.abs(p)<$o?[d,0]:[v,p]};return c.isStepper=!0,c.dt=l,c},kF=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Xp(i);case"spring":return CF();default:if(i.split("(")[0]==="cubic-bezier")return Xp(i)}return typeof i=="function"?i:null};function ns(e){"@babel/helpers - typeof";return ns=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},ns(e)}function Qp(e){return TF(e)||$F(e)||Eb(e)||EF()}function EF(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 106In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $F(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TF(e){if(Array.isArray(e))return qu(e)}function Jp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jp(Object(r),!0).forEach(function(n){Bu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bu(e,t,r){return t=MF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MF(e){var t=DF(e,"string");return ns(t)==="symbol"?t:String(t)}function DF(e,t){if(ns(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ns(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IF(e,t){return FF(e)||LF(e,t)||Eb(e,t)||RF()}function RF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 107In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eb(e,t){if(e){if(typeof e=="string")return qu(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 qu(e,t)}}function qu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function LF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function FF(e){if(Array.isArray(e))return e}var To=function(t,r,n){return t+(r-t)*n},Uu=function(t){var r=t.from,n=t.to;return r!==n},BF=function e(t,r,n){var i=Oi(function(s,o){if(Uu(o)){var l=t(o.from,o.to,o.velocity),c=IF(l,2),u=c[0],f=c[1];return ht(ht({},o),{},{from:u,velocity:f})}return o},r);return n<1?Oi(function(s,o){return Uu(o)?ht(ht({},o),{},{velocity:To(o.velocity,i[s].velocity,n),from:To(o.from,i[s].from,n)}):o},r):e(t,i,n-1)};const qF=function(e,t,r,n,i){var s=vF(e,t),o=s.reduce(function(v,x){return ht(ht({},v),{},Bu({},x,[e[x],t[x]]))},{}),l=s.reduce(function(v,x){return ht(ht({},v),{},Bu({},x,{from:e[x],velocity:0,to:t[x]}))},{}),c=-1,u,f,d=function(){return null},m=function(){return Oi(function(x,b){return b.from},l)},h=function(){return!Object.values(l).filter(Uu).length},g=function(x){u||(u=x);var b=x-u,j=b/r.dt;l=BF(r,l,j),i(ht(ht(ht({},e),t),m())),u=x,h()||(c=requestAnimationFrame(d))},p=function(x){f||(f=x);var b=(x-f)/n,j=Oi(function(y,w){return To.apply(void 0,Qp(w).concat([r(b)]))},o);if(i(ht(ht(ht({},e),t),j)),b<1)c=requestAnimationFrame(d);else{var N=Oi(function(y,w){return To.apply(void 0,Qp(w).concat([r(1)]))},o);i(ht(ht(ht({},e),t),N))}};return d=r.isStepper?g:p,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}};function Pa(e){"@babel/helpers - typeof";return Pa=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},Pa(e)}var UF=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function zF(e,t){if(e==null)return{};var r=WF(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WF(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function _c(e){return HF(e)||GF(e)||KF(e)||VF()}function VF(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 108In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KF(e,t){if(e){if(typeof e=="string")return zu(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 zu(e,t)}}function GF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HF(e){if(Array.isArray(e))return zu(e)}function zu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Zp(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zp(Object(r),!0).forEach(function(n){bi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zp(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bi(e,t,r){return t=$b(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$b(n.key),n)}}function QF(e,t,r){return t&&XF(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $b(e){var t=JF(e,"string");return Pa(t)==="symbol"?t:String(t)}function JF(e,t){if(Pa(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Pa(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZF(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&&Wu(e,t)}function Wu(e,t){return Wu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Wu(e,t)}function eB(e){var t=tB();return function(){var n=Mo(e),i;if(t){var s=Mo(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return Vu(this,i)}}function Vu(e,t){if(t&&(Pa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ku(e)}function Ku(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tB(){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 Mo(e){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mo(e)}var or=function(e){ZF(r,e);var t=eB(r);function r(n,i){var s;YF(this,r),s=t.call(this,n,i);var o=s.props,l=o.isActive,c=o.attributeName,u=o.from,f=o.to,d=o.steps,m=o.children,h=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(Ku(s)),s.changeStyle=s.changeStyle.bind(Ku(s)),!l||h<=0)return s.state={style:{}},typeof m=="function"&&(s.state={style:f}),Vu(s);if(d&&d.length)s.state={style:d[0].style};else if(u){if(typeof m=="function")return s.state={style:u},Vu(s);s.state={style:c?bi({},c,u):u}}else s.state={style:{}};return s}return QF(r,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,o=i.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,f=s.to,d=s.from,m=this.state.style;if(l){if(!o){var h={style:c?bi({},c,f):f};this.state&&m&&(c&&m[c]!==f||!c&&m!==f)&&this.setState(h);return}if(!(oF(i.to,f)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=g||u?d:i.to;if(this.state&&m){var v={style:c?bi({},c,p):p};(c&&m[c]!==p||!c&&m!==p)&&this.setState(v)}this.runAnimation(Jt(Jt({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,o=i.from,l=i.to,c=i.duration,u=i.easing,f=i.begin,d=i.onAnimationEnd,m=i.onAnimationStart,h=qF(o,l,kF(u),c,this.changeStyle),g=function(){s.stopJSAnimation=h()};this.manager.start([m,f,g,c,d])}},{key:"runStepAnimation",value:function(i){var s=this,o=i.steps,l=i.begin,c=i.onAnimationStart,u=o[0],f=u.style,d=u.duration,m=d===void 0?0:d,h=function(p,v,x){if(x===0)return p;var b=v.duration,j=v.easing,N=j===void 0?"ease":j,y=v.style,w=v.properties,_=v.onAnimationEnd,O=x>0?o[x-1]:v,A=w||Object.keys(y);if(typeof N=="function"||N==="spring")return[].concat(_c(p),[s.runJSAnimation.bind(s,{from:O.style,to:y,duration:b,easing:N}),b]);var C=Hp(A,b,N),P=Jt(Jt(Jt({},O.style),y),{},{transition:C});return[].concat(_c(p),[P,b,_]).filter(xF)};return this.manager.start([c].concat(_c(o.reduce(h,[f,Math.max(m,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=hF());var s=i.begin,o=i.duration,l=i.attributeName,c=i.to,u=i.easing,f=i.onAnimationStart,d=i.onAnimationEnd,m=i.steps,h=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(m.length>1){this.runStepAnimation(i);return}var p=l?bi({},l,c):c,v=Hp(Object.keys(p),o,u);g.start([f,s,Jt(Jt({},p),{},{transition:v}),o,d])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=zF(i,UF),u=S.Children.count(s),f=this.state.style;if(typeof s=="function")return s(f);if(!l||u===0||o<=0)return s;var d=function(h){var g=h.props,p=g.style,v=p===void 0?{}:p,x=g.className,b=S.cloneElement(h,Jt(Jt({},c),{},{style:Jt(Jt({},v),f),className:x}));return b};return u===1?d(S.Children.only(s)):k.createElement("div",null,S.Children.map(s,function(m){return d(m)}))}}]),r}(S.PureComponent);or.displayName="Animate";or.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};or.propTypes={from:Pe.oneOfType([Pe.object,Pe.string]),to:Pe.oneOfType([Pe.object,Pe.string]),attributeName:Pe.string,duration:Pe.number,begin:Pe.number,easing:Pe.oneOfType([Pe.string,Pe.func]),steps:Pe.arrayOf(Pe.shape({duration:Pe.number.isRequired,style:Pe.object.isRequired,easing:Pe.oneOfType([Pe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Pe.func]),properties:Pe.arrayOf("string"),onAnimationEnd:Pe.func})),children:Pe.oneOfType([Pe.node,Pe.func]),isActive:Pe.bool,canBegin:Pe.bool,onAnimationEnd:Pe.func,shouldReAnimate:Pe.bool,onAnimationStart:Pe.func,onAnimationReStart:Pe.func};function as(e){"@babel/helpers - typeof";return as=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},as(e)}function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Do.apply(this,arguments)}function rB(e,t){return sB(e)||iB(e,t)||aB(e,t)||nB()}function nB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 109In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aB(e,t){if(e){if(typeof e=="string")return eg(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 eg(e,t)}}function eg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function sB(e){if(Array.isArray(e))return e}function tg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tg(Object(r),!0).forEach(function(n){oB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oB(e,t,r){return t=lB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lB(e){var t=cB(e,"string");return as(t)=="symbol"?t:t+""}function cB(e,t){if(as(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(as(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ng=function(t,r,n,i,s){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),l=i>=0?1:-1,c=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&s instanceof Array){for(var d=[0,0,0,0],m=0,h=4;m<h;m++)d[m]=s[m]>o?o:s[m];f="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(r)),f+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, 110 `).concat(t+n,",").concat(r+l*d[1])),f+="L ".concat(t+n,",").concat(r+i-l*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, 111 `).concat(t+n-c*d[2],",").concat(r+i)),f+="L ".concat(t+c*d[3],",").concat(r+i),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, 112 `).concat(t,",").concat(r+i-l*d[3])),f+="Z"}else if(o>0&&s===+s&&s>0){var g=Math.min(o,s);f="M ".concat(t,",").concat(r+l*g,` 113 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(r,` 114 L `).concat(t+n-c*g,",").concat(r,` 115 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*g,` 116 L `).concat(t+n,",").concat(r+i-l*g,` 117 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-c*g,",").concat(r+i,` 118 L `).concat(t+c*g,",").concat(r+i,` 119 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+i-l*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},uB=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,s=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(s,s+l),f=Math.max(s,s+l),d=Math.min(o,o+c),m=Math.max(o,o+c);return n>=u&&n<=f&&i>=d&&i<=m}return!1},dB={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Of=function(t){var r=rg(rg({},dB),t),n=S.useRef(),i=S.useState(-1),s=rB(i,2),o=s[0],l=s[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&l(N)}catch{}},[]);var c=r.x,u=r.y,f=r.width,d=r.height,m=r.radius,h=r.className,g=r.animationEasing,p=r.animationDuration,v=r.animationBegin,x=r.isAnimationActive,b=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var j=je("recharts-rectangle",h);return b?k.createElement(or,{canBegin:o>0,from:{width:f,height:d,x:c,y:u},to:{width:f,height:d,x:c,y:u},duration:p,animationEasing:g,isActive:b},function(N){var y=N.width,w=N.height,_=N.x,O=N.y;return k.createElement(or,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:p,isActive:x,easing:g},k.createElement("path",Do({},ue(r,!0),{className:j,d:ng(_,O,y,w,m),ref:n})))}):k.createElement("path",Do({},ue(r,!0),{className:j,d:ng(c,u,f,d,m)}))},fB=["points","className","baseLinePoints","connectNulls"];function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ta.apply(this,arguments)}function mB(e,t){if(e==null)return{};var r=hB(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ag(e){return xB(e)||vB(e)||gB(e)||pB()}function pB(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 120In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gB(e,t){if(e){if(typeof e=="string")return Gu(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 Gu(e,t)}}function vB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xB(e){if(Array.isArray(e))return Gu(e)}function Gu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ig=function(t){return t&&t.x===+t.x&&t.y===+t.y},yB=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){ig(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),ig(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Pi=function(t,r){var n=yB(t);r&&(n=[n.reduce(function(s,o){return[].concat(ag(s),ag(o))},[])]);var i=n.map(function(s){return s.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},bB=function(t,r,n){var i=Pi(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Pi(r.reverse(),n).slice(1))},jB=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,s=t.connectNulls,o=mB(t,fB);if(!r||!r.length)return null;var l=je("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",u=bB(r,i,s);return k.createElement("g",{className:l},k.createElement("path",ta({},ue(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?k.createElement("path",ta({},ue(o,!0),{fill:"none",d:Pi(r,s)})):null,c?k.createElement("path",ta({},ue(o,!0),{fill:"none",d:Pi(i,s)})):null)}var f=Pi(r,s);return k.createElement("path",ta({},ue(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:l,d:f}))};function Hu(){return Hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hu.apply(this,arguments)}var _s=function(t){var r=t.cx,n=t.cy,i=t.r,s=t.className,o=je("recharts-dot",s);return r===+r&&n===+n&&i===+i?S.createElement("circle",Hu({},ue(t,!1),eo(t),{className:o,cx:r,cy:n,r:i})):null};function is(e){"@babel/helpers - typeof";return is=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},is(e)}var wB=["x","y","top","left","width","height","className"];function Yu(){return Yu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yu.apply(this,arguments)}function sg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sg(Object(r),!0).forEach(function(n){_B(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _B(e,t,r){return t=SB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SB(e){var t=AB(e,"string");return is(t)=="symbol"?t:t+""}function AB(e,t){if(is(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(is(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OB(e,t){if(e==null)return{};var r=PB(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var CB=function(t,r,n,i,s,o){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},kB=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.to
120p,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,f=t.width,d=f===void 0?0:f,m=t.height,h=m===void 0?0:m,g=t.className,p=OB(t,wB),v=NB({x:n,y:s,top:l,left:u,width:d,height:h},p);return!J(n)||!J(s)||!J(d)||!J(h)||!J(l)||!J(u)?null:k.createElement("path",Yu({},ue(v,!0),{className:je("recharts-cross",g),d:CB(n,s,d,h,l,u)}))},EB=Tl,$B=Gy,TB=Nr;function MB(e,t){return e&&e.length?EB(e,TB(t),$B):void 0}var DB=MB;const IB=De(DB);var RB=Tl,LB=Nr,FB=Hy;function BB(e,t){return e&&e.length?RB(e,LB(t),FB):void 0}var qB=BB;const UB=De(qB);var zB=["cx","cy","angle","ticks","axisLine"],WB=["ticks","tick","angle","tickFormatter","stroke"];function Ca(e){"@babel/helpers - typeof";return Ca=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},Ca(e)}function Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ci.apply(this,arguments)}function og(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?og(Object(r),!0).forEach(function(n){Rl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):og(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lg(e,t){if(e==null)return{};var r=VB(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VB(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function KB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mb(n.key),n)}}function GB(e,t,r){return t&&cg(e.prototype,t),r&&cg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function HB(e,t,r){return t=Io(t),YB(e,Tb()?Reflect.construct(t,r||[],Io(e).constructor):t.apply(e,r))}function YB(e,t){if(t&&(Ca(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XB(e)}function XB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tb=function(){return!!e})()}function Io(e){return Io=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Io(e)}function QB(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&&Xu(e,t)}function Xu(e,t){return Xu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Xu(e,t)}function Rl(e,t,r){return t=Mb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mb(e){var t=JB(e,"string");return Ca(t)=="symbol"?t:t+""}function JB(e,t){if(Ca(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ca(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ll=function(e){function t(){return KB(this,t),HB(this,t,arguments)}return QB(t,e),GB(t,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,
vendor: 6,508 bytes, line 120
120s=this.props,o=s.angle,l=s.cx,c=s.cy;return Le(l,c,i,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.angle,l=n.ticks,c=IB(l,function(f){return f.coordinate||0}),u=UB(l,function(f){return f.coordinate||0});return{cx:i,cy:s,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,u=lg(n,zB),f=l.reduce(function(g,p){return[Math.min(g[0],p.coordinate),Math.max(g[1],p.coordinate)]},[1/0,-1/0]),d=Le(i,s,f[0],o),m=Le(i,s,f[1],o),h=cn(cn(cn({},ue(u,!1)),{},{fill:"none"},ue(c,!1)),{},{x1:d.x,y1:d.y,x2:m.x,y2:m.y});return k.createElement("line",Ci({className:"recharts-polar-radius-axis-line"},h))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,o=i.tick,l=i.angle,c=i.tickFormatter,u=i.stroke,f=lg(i,WB),d=this.getTickTextAnchor(),m=ue(f,!1),h=ue(o,!1),g=s.map(function(p,v){var x=n.getTickValueCoord(p),b=cn(cn(cn(cn({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(x.x,", ").concat(x.y,")")},m),{},{stroke:"none",fill:u},h),{},{index:v},x),{},{payload:p});return k.createElement(_e,Ci({className:je("recharts-polar-radius-axis-tick",wb(o)),key:"tick-".concat(p.coordinate)},kn(n.props,p,v)),t.renderTickItem(o,b,c?c(p.value,v):p.value))});return k.createElement(_e,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.axisLine,o=n.tick;return!i||!i.length?null:k.createElement(_e,{className:je("recharts-polar-radius-axis",this.props.className)},s&&this.renderAxisLine(),o&&this.renderTicks(),ct.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,i,s){var o;return k.isValidElement(n)?o=k.cloneElement(n,i):fe(n)?o=n(i):o=k.createElement(En,Ci({},i,{className:"recharts-polar-radius-axis-tick-value"}),s),o}}])}(S.PureComponent);Rl(Ll,"displayName","PolarRadiusAxis");Rl(Ll,"axisType","radiusAxis");Rl(Ll,"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 ka(e){"@babel/helpers - typeof";return ka=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},ka(e)}function pn(){return pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pn.apply(this,arguments)}function ug(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ug(Object(r),!0).forEach(function(n){Fl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ug(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ib(n.key),n)}}function eq(e,t,r){return t&&dg(e.prototype,t),r&&dg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tq(e,t,r){return t=Ro(t),rq(e,Db()?Reflect.construct(t,r||[],Ro(e).constructor):t.apply(e,r))}function rq(e,t){if(t&&(ka(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nq(e)}function nq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Db(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Db=function(){return!!e})()}function Ro(e){return Ro=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ro(e)}function aq(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&&Qu(e,t)}function Qu(e,t){return Qu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qu(e,t)}function Fl(e,t,r){return t=Ib(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ib(e){var t=iq(e,"string");return ka(t)=="symbol"?t:t+""}function iq(e,t){if(ka(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ka(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sq=Math.PI/180,fg=1e-5,Bl=function(e){function t(){return ZB(this,t),tq(this,t,arguments)}return aq(t,e),eq(t,[{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.cx,o=i.cy,l=i.radius,c=i.orientation,u=i.tickSize,f=u||8,d=Le(s,o,l,n.coordinate),m=Le(s,o,l+(c==="inner"?-1:1)*f,n.coordinate);return{x1:d.x,y1:d.y,x2:m.x,y2:m.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,s=Math.cos(-n.coordinate*sq),o;return s>fg?o=i==="outer"?"start":"end":s<-fg?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=un(un({},ue(this.props,!1)),{},{fill:"none"},ue(l,!1));if(c==="circle")return k.createElement(_s,pn({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:s,r:o}));var f=this.props.ticks,d=f.map(function(m){return Le(i,s,o,m.coordinate)});return k.createElement(jB,pn({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,o=i.tick,l=i.tickLine,c=i.tickFormatter,u=i.stroke,f=ue(this.props,!1),d=ue(o,!1),m=un(un({},f),{},{fill:"none"}
120,ue(l,!1)),h=s.map(function(g,p){var v=n.getTickLineCoord(g),x=n.getTickTextAnchor(g),b=un(un(un({textAnchor:x},f),{},{stroke:"none",fill:u},d),{},{index:p,payload:g,x:v.x2,y:v.y2});return k.createElement(_e,pn({className:je("recharts-polar-angle-axis-tick",wb(o)),key:"tick-".concat(g.coordinate)},kn(n.props,g,p)),l&&k.createElement("line",pn({className:"recharts-polar-angle-axis-tick-line"},m,v)),o&&t.renderTickItem(o,b,c?c(g.value,p):g.value))});return k.createElement(_e,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.radius,o=n.axisLine;return s<=0||!i||!i.length?null:k.createElement(_e,{className:je("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,s){var o;return k.isValidElement(n)?o=k.cloneElement(n,i):fe(n)?o=n(i):o=k.createElement(En,pn({},i,{className:"recharts-polar-angle-axis-tick-value"}),s),o}}])}(S.PureComponent);Fl(Bl,"displayName","PolarAngleAxis");Fl(Bl,"axisType","angleAxis");Fl(Bl,"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 oq=zx,lq=oq(Object.getPrototypeOf,Object),cq=lq,uq=Fr,dq=cq,fq=Br,mq="[object Object]",hq=Function.prototype,pq=Object.prototype,Rb=hq.toString,gq=pq.hasOwnProperty,vq=Rb.call(Object);function xq(e){if(!fq(e)||uq(e)!=mq)return!1;var t=dq(e);if(t===null)return!0;var r=gq.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Rb.call(r)==vq}var yq=xq;const bq=De(yq);var jq=Fr,wq=Br,Nq="[object Boolean]";function _q(e){return e===!0||e===!1||wq(e)&&jq(e)==Nq}var Sq=_q;const Aq=De(Sq);function ss(e){"@babel/helpers - typeof";return ss=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},ss(e)}function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lo.apply(this,arguments)}function Oq(e,t){return Eq(e)||kq(e,t)||Cq(e,t)||Pq()}function Pq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 121In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cq(e,t){if(e){if(typeof e=="string")return mg(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 mg(e,t)}}function mg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kq(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function Eq(e){if(Array.isArray(e))return e}function hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hg(Object(r),!0).forEach(function(n){$q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $q(e,t,r){return t=Tq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tq(e){var t=Mq(e,"string");return ss(t)=="symbol"?t:t+""}function Mq(e,t){if(ss(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gg=function(t,r,n,i,s){var o=n-i,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+s),l+="L ".concat(t+n-o/2-i,",").concat(r+s),l+="L ".concat(t,",").concat(r," Z"),l}
vendor: 15,375 bytes, lines 121-122
121,Dq={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Iq=function(t){var r=pg(pg({},Dq),t),n=S.useRef(),i=S.useState(-1),s=Oq(i,2),o=s[0],l=s[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var j=n.current.getTotalLength();j&&l(j)}catch{}},[]);var c=r.x,u=r.y,f=r.upperWidth,d=r.lowerWidth,m=r.height,h=r.className,g=r.animationEasing,p=r.animationDuration,v=r.animationBegin,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||m!==+m||f===0&&d===0||m===0)return null;var b=je("recharts-trapezoid",h);return x?k.createElement(or,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:u},to:{upperWidth:f,lowerWidth:d,height:m,x:c,y:u},duration:p,animationEasing:g,isActive:x},function(j){var N=j.upperWidth,y=j.lowerWidth,w=j.height,_=j.x,O=j.y;return k.createElement(or,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:p,easing:g},k.createElement("path",Lo({},ue(r,!0),{className:b,d:gg(_,O,N,y,w),ref:n})))}):k.createElement("g",null,k.createElement("path",Lo({},ue(r,!0),{className:b,d:gg(c,u,f,d,m)})))},Rq=["option","shapeType","propTransformer","activeClassName","isActive"];function os(e){"@babel/helpers - typeof";return os=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},os(e)}function Lq(e,t){if(e==null)return{};var r=Fq(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vg(Object(r),!0).forEach(function(n){Bq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bq(e,t,r){return t=qq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qq(e){var t=Uq(e,"string");return os(t)=="symbol"?t:t+""}function Uq(e,t){if(os(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(os(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zq(e,t){return Fo(Fo({},t),e)}function Wq(e,t){return e==="symbols"}function xg(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return k.createElement(Of,r);case"trapezoid":return k.createElement(Iq,r);case"sector":return k.createElement(Sb,r);case"symbols":if(Wq(t))return k.createElement(Vd,r);break;default:return null}}function Vq(e){return S.isValidElement(e)?e.props:e}function Lb(e){var t=e.option,r=e.shapeType,n=e.propTransformer,i=n===void 0?zq:n,s=e.activeClassName,o=s===void 0?"recharts-active-shape":s,l=e.isActive,c=Lq(e,Rq),u;if(S.isValidElement(t))u=S.cloneElement(t,Fo(Fo({},c),Vq(t)));else if(fe(t))u=t(c);else if(bq(t)&&!Aq(t)){var f=i(t,c);u=k.createElement(xg,{shapeType:r,elementProps:f})}else{var d=c;u=k.createElement(xg,{shapeType:r,elementProps:d})}return l?k.createElement(_e,{className:o},u):u}function ql(e,t){return t!=null&&"trapezoids"in e.props}function Ul(e,t){return t!=null&&"sectors"in e.props}function ls(e,t){return t!=null&&"points"in e.props}function Kq(e,t){var r,n,i=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,s=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return i&&s}function Gq(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Hq(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Yq(e,t){var r;return ql(e,t)?r=Kq:Ul(e,t)?r=Gq:ls(e,t)&&(r=Hq),r}function Xq(e,t){var r;return ql(e,t)?r="trapezoids":Ul(e,t)?r="sectors":ls(e,t)&&(r="points"),r}function Qq(e,t){if(ql(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(Ul(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return ls(e,t)?t.payload:{}}function Jq(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=Xq(r,t),s=Qq(r,t),o=n.filter(function(c,u){var f=$n(s,c),d=r.props[i].filter(function(g){var p=Yq(r,t);return p(g,t)}),m=r.props[i].indexOf(d[d.length-1]),h=u===m;return f&&h}),l=n.indexOf(o[o.length-1]);return l}var Hs;function Ea(e){"@babel/helpers - typeof";return Ea=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},Ea(e)}function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ra.apply(this,arguments)}function yg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yg(Object(r),!0).forEach(function(n){Ut(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bb(n.key),n)}}function e8(e,t,r){return t&&bg(e.prototype,t),r&&bg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t8(e,t,r){return t=Bo(t),r8(e,Fb()?Reflect.construct(t,r||[],Bo(e).constructor):t.apply(e,r))}function r8(e,t){if(t&&(Ea(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n8(e)}function n8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fb=function(){return!!e})()}function Bo(e){return Bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bo(e)}function a8(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&&Ju(e,t)}function Ju(e,t){return Ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ju(e,t)}function Ut(e,t,r){return t=Bb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bb(e){var t=i8(e,"string");return Ea(t)=="symbol"?t:t+""}function i8(e,t){if(Ea(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ea(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ur=function(e){function t(r){var n;return Zq(this,t),n=t8(this,t,[r]),Ut(n,"pieRef",null),Ut(n,"sectorRefs",[]),Ut(n,"id",Fn("recharts-pie-")),Ut(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),fe(i)&&i()}),Ut(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),fe(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return a8(t,e),e8(t,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.label,l=s.labelLine,c=s.dataKey,u=s.valueKey,f=ue(this.props,!1),d=ue(o,!1),m=ue(l,!1),h=o&&o.offsetRadius||20,g=n.map(function(p,v){var x=(p.startAngle+p.endAngle)/2,b=Le(p.cx,p.cy,p.outerRadius+h,x),j=Ie(Ie(Ie(Ie({},f),p),{},{stroke:"none"},d),{},{index:v,textAnchor:t.getTextAnchor(b.x,p.cx)},b),N=Ie(Ie(Ie(Ie({},f),p),{},{fill:"none",stroke:p.fill},m),{},{index:v,points:[Le(p.cx,p.cy,p.outerRadius,x),b]}),y=c;return xe(c)&&xe(u)?y="value":xe(c)&&(y=u),k.createElement(_e,{key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(v)},l&&t.renderLabelLineItem(l,N,"line"),t.renderLabelItem(o,j,Ke(p,y)))});return k.createElement(_e,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(n){var i=this,s=this.props,o=s.activeShape,l=s.blendStroke,c=s.inactiveShape;return n.map(function(u,f){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var d=i.isActiveIndex(f),m=c&&i.hasActiveIndex()?c:null,h=d?o:m,g=Ie(Ie({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return k.createElement(_e,ra({ref:function(v){v&&!i.sectorRefs.includes(v)&&i.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},kn(i.props,u,f),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(f)}),k.createElement(Lb,ra({option:h,isActive:d,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,s=i.sectors,o=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,f=i.animationId,d=this.state,m=d.prevSectors,h=d.prevIsAnimationActive;return k.createElement(or,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(f,"-").concat(h),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var p=g.t,v=[],x=s&&s[0],b=x.startAngle;return s.forEach(function(j,N){var y=m&&m[N],w=N>0?Dt(j,"paddingAngle",0):0;if(y){var _=rt(y.endAngle-y.startAngle,j.endAngle-j.startAngle),O=Ie(Ie({},j),{},{startAngle:b+w,endAngle:b+_(p)+w});v.push(O),b=O.endAngle}else{var A=j.endAngle,C=j.startAngle,P=rt(0,A-C),M=P(p),E=Ie(Ie({},j),{},{startAngle:b+w,endAngle:b+M+w});v.push(E),b=E.endAngle}}),k.createElement(_e,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(s){if(!s.altKey)switch(s.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,s=n.isAnimationActive,o=this.state.prevSectors;return s&&i&&i.length&&(!o||!$n(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,s=i.hide,o=i.sectors,l=i.className,c=i.label,u=i.cx,f=i.cy,d=i.innerRadius,m=i.outerRadius,h=i.isAnimationActive,g=this.state.isAnimationFinished;if(s||!o||!o.length||!J(u)||!J(f)||!J(d)||!J(m))return null;var p=je("recharts-pie",l);return k.createElement(_e,{tabIndex:this.props.rootTabIndex,className:p,ref:function(x){n.pieRef=x}},this.renderSectors(),c&&this.renderLabels(o),ct.renderCallByParent(this.props,null,!1),(!h||g)&&vr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,s){if(k.isValidElement(n))return k.cloneElement(n,i);if(fe(n))return n(i);var o=je("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return k.createElement(_n,ra({},i,{key:s,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,i,s){if(k.isValidElement(n))return k.cloneElement(n,i);var o=s;if(fe(n)&&(o=n(i),k.isValidElement(o)))return o;var l=je("recharts-pie-label-text",typeof n!="boolean"&&!fe(n)?n.className:"");return k.createElement(En,ra({},i,{alignmentBaseline:"middle",className:l}),o)}}])}(S.PureComponent);Hs=Ur;Ut(Ur,"displayName","Pie");Ut(Ur,"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:!ar.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Ut(Ur,"parseDeltaAngle",function(e,t){var r=jt(t-e),n=Math.min(Math.abs(t-e),360);return r*n});Ut(Ur,"getRealPieData",function(e){var t=e.data,r=e.children,n=ue(e,!1),i=It(r,Al);return t&&t.length?t.map(function(s,o){return Ie(Ie(Ie({payload:s},n),s),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(s){return Ie(Ie({},n),s.props)}):[]});Ut(Ur,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,i=t.width,s=t.height,o=jb(i,s),l=n+wt(e.cx,i,i/2),c=r+wt(e.cy,s,s/2),u=wt(e.innerRadius,o,0),f=wt(e.outerRadius,o,o*.8),d=e.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:f,maxRadius:d}});Ut(Ur,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?Ie(Ie({},t.type.defaultProps),t.props):t.props,i=Hs.getRealPieData(n);if(!i||!i.length)return null;var s=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,f=n.nameKey,d=n.valueKey,m=n.tooltipType,h=Math.abs(n.minAngle),g=Hs.parseCoordinateOfPie(n,r),p=Hs.parseDeltaAngle(o,l),v=Math.abs(p),x=u;xe(u)&&xe(d)?(rr(!1,`Use "dataKey" to specify the value of pie, 122 the props "valueKey" will be deprecated
122in 1.1.0`),x="value"):xe(u)&&(rr(!1,`Use "dataKey" to specify the value of pie, 123 the props "valueKey" will be deprecated in 1.1.0`),x=d);var b=i.filter(function(O){return Ke(O,x,0)!==0}).length,j=(v>=360?b:b-1)*c,N=v-b*h-j,y=i.reduce(function(O,A){var C=Ke(A,x,0);return O+(J(C)?C:0)},0),w;if(y>0){var _;w=i.map(function(O,A){var C=Ke(O,x,0),P=Ke(O,f,A),M=(J(C)?C:0)/y,E;A?E=_.endAngle+jt(p)*c*(C!==0?1:0):E=o;var T=E+jt(p)*((C!==0?h:0)+M*N),$=(E+T)/2,I=(g.innerRadius+g.outerRadius)/2,B=[{name:P,value:C,payload:O,dataKey:x,type:m}],L=Le(g.cx,g.cy,I,$);return _=Ie(Ie(Ie({percent:M,cornerRadius:s,name:P,tooltipPayload:B,midAngle:$,middleRadius:I,tooltipPosition:L},O),g),{},{value:Ke(O,x),startAngle:E,endAngle:T,payload:O,paddingAngle:jt(p)*c}),_})}return Ie(Ie({},g),{},{sectors:w,data:i})});var s8=Math.ceil,o8=Math.max;function l8(e,t,r,n){for(var i=-1,s=o8(s8((t-e)/(r||1)),0),o=Array(s);s--;)o[n?s:++i]=e,e+=r;return o}var c8=l8,u8=ly,jg=1/0,d8=17976931348623157e292;function f8(e){if(!e)return e===0?e:0;if(e=u8(e),e===jg||e===-jg){var t=e<0?-1:1;return t*d8}return e===e?e:0}var qb=f8,m8=c8,h8=Sl,Sc=qb;function p8(e){return function(t,r,n){return n&&typeof n!="number"&&h8(t,r,n)&&(r=n=void 0),t=Sc(t),r===void 0?(r=t,t=0):r=Sc(r),n=n===void 0?t<r?1:-1:Sc(n),m8(t,r,n,e)}}var g8=p8,v8=g8,x8=v8(),y8=x8;const qo=De(y8);function cs(e){"@babel/helpers - typeof";return cs=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},cs(e)}function wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ng(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wg(Object(r),!0).forEach(function(n){Ub(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ub(e,t,r){return t=b8(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b8(e){var t=j8(e,"string");return cs(t)=="symbol"?t:t+""}function j8(e,t){if(cs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(cs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var w8=["Webkit","Moz","O","ms"],N8=function(t,r){var n=t.replace(/(\w)/,function(s){return s.toUpperCase()}),i=w8.reduce(function(s,o){return Ng(Ng({},s),{},Ub({},o+n,r))},{});return i[t]=r,i};function $a(e){"@babel/helpers - typeof";return $a=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},$a(e)}function Uo(){return Uo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uo.apply(this,arguments)}function _g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ac(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_g(Object(r),!0).forEach(function(n){kt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_g(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wb(n.key),n)}}function S8(e,t,r){return t&&Sg(e.prototype,t),r&&Sg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function A8(e,t,r){return t=zo(t),O8(e,zb()?Reflect.construct(t,r||[],zo(e).constructor):t.apply(e,r))}function O8(e,t){if(t&&($a(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P8(e)}function P8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zb=function(){return!!e})()}
vendor: 9,753 bytes, line 123
123function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zo(e)}function C8(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&&Zu(e,t)}function Zu(e,t){return Zu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zu(e,t)}function kt(e,t,r){return t=Wb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wb(e){var t=k8(e,"string");return $a(t)=="symbol"?t:t+""}function k8(e,t){if($a(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($a(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E8=function(t){var r=t.data,n=t.startIndex,i=t.endIndex,s=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Si().domain(qo(0,c)).range([s,s+o-l]),f=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:f}},Ag=function(t){return t.changedTouches&&!!t.changedTouches.length},Ta=function(e){function t(r){var n;return _8(this,t),n=A8(this,t,[r]),kt(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),kt(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),kt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,s=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:s,startIndex:l})}),n.detachDragEndListener()}),kt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),kt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),kt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),kt(n,"handleSlideDragStart",function(i){var s=Ag(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return C8(t,e),S8(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,s=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(i,s),m=Math.max(i,s),h=t.getIndexInRange(o,d),g=t.getIndexInRange(o,m);return{startIndex:h-h%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,s=i.data,o=i.tickFormatter,l=i.dataKey,c=Ke(s[n],l,n);return fe(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,s=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,m=c.startIndex,h=c.endIndex,g=c.onChange,p=n.pageX-s;p>0?p=Math.min(p,u+f-d-l,u+f-d-o):p<0&&(p=Math.max(p,u-o,u-l));var v=this.getIndex({startX:o+p,endX:l+p});(v.startIndex!==m||v.endIndex!==h)&&g&&g(v),this.setState({startX:o+p,endX:l+p,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var s=Ag(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,s=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[o],f=this.props,d=f.x,m=f.width,h=f.travellerWidth,g=f.onChange,p=f.gap,v=f.data,x={startX:this.state.startX,endX:this.state.endX},b=n.pageX-s;b>0?b=Math.min(b,d+m-h-u):b<0&&(b=Math.max(b,d-u)),x[o]=u+b;var j=this.getIndex(x),N=j.startIndex,y=j.endIndex,w=function(){var O=v.length-1;return o==="startX"&&(l>c?N%p===0:y%p===0)||l<c&&y===O||o==="endX"&&(l>c?y%p===0:N%p===0)||l>c&&y===O};this.setState(kt(kt({},o,u+b),"brushMoveStartX",n.pageX),function(){g&&w()&&g(j)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var s=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,f=this.state[i],d=l.indexOf(f);if(d!==-1){var m=d+n;if(!(m===-1||m>=l.length)){var h=l[m];i==="startX"&&h>=u||i==="endX"&&h<=c||this.setState(kt({},i,h),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return k.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.data,u=n.children,f=n.padding,d=S.Children.only(u);return d?k.cloneElement(d,{x:i,y:s,width:o,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var s,o,l=this,c=this.props,u=c.y,f=c.travellerWidth,d=c.height,m=c.traveller,h=c.ariaLabel,g=c.data,p=c.startIndex,v=c.endIndex,x=Math.max(n,this.props.x),b=Ac(Ac({},ue(this.props,!1)),{},{x,y:u,width:f,height:d}),j=h||"Min value: ".concat((s=g[p])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=g[v])===null||o===void 0?void 0:o.name);return k.createElement(_e,{tabIndex:0,role:"slider","aria-label":j,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(y){["ArrowLeft","ArrowRight"].includes(y.key)&&(y.preventDefault(),y.stopPropagation(),l.handleTravellerMoveKeyboard(y.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,b))}},{key:"renderSlide",value:function(n,i){var s=this.props,o=s.y,l=s.height,c=s.stroke,u=s.travellerWidth,f=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return k.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:o,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,s=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,m=f.endX,h=5,g={pointerEvents:"none",fill:u};return k.createElement(_e,{className:"recharts-brush-texts"},k.createElement(En,Uo({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,m)-h,y:o+l/2},g),this.getTextOfTick(i)),k.createElement(En,Uo({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,m)+c+h,y:o+l/2},g),this.getTextOfTick(s)))}},{key:"render",value:function(){var n=this.props,i=n.data,s=n.className,o=n.children,l=n.x,c=n.y,u=n.width,f=n.height,d=n.alwaysShowText,m=this.state,h=m.startX,g=m.endX,p=m.isTextActive,v=m.isSlideMoving,x=m.isTravellerMoving,b=m.isTravellerFocused;if(!i||!i.length||!J(l)||!J(c)||!J(u)||!J(f)||u<=0||f<=0)return null;var j=je("recharts-brush",s),N=k.Children.count(o)===1,y=N8("userSelect","none");return k.createElement(_e,{className:j,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:y},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(p||v||x||b||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,s=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(s+l/2)-1;return k.createElement(k.Fragment,null,k.createElement("rect",{x:i,y:s,width:o,height:l,fill:c,stroke:"none"}),k.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),k.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var s;return k.isValidElement(n)?s=k.cloneElement(n,i):fe(n)?s=n(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(n,i){var s=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return Ac({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},s&&s.length?E8({data:s,width:o,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var m=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,i){for(var s=n.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>i?l=c:o=c}return i>=n[l]?l:o}}])}(S.PureComponent);
123kt(Ta,"displayName","Brush");kt(Ta,"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 $8=Jd;function T8(e,t){var r;return $8(e,function(n,i,s){return r=t(n,i,s),!r}),!!r}var M8=T8,D8=Dx,I8=Nr,R8=M8,L8=Pt,F8=Sl;function B8(e,t,r){var n=L8(e)?D8:R8;return r&&F8(e,t,r)&&(t=void 0),n(e,I8(t))}var q8=B8;const U8=De(q8);var xr=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},Og=ny;function z8(e,t,r){t=="__proto__"&&Og?Og(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var W8=z8,V8=W8,K8=ty,G8=Nr;function H8(e,t){var r={};return t=G8(t),K8(e,function(n,i,s){V8(r,i,t(n,i,s))}),r}var Y8=H8;const X8=De(Y8);function Q8(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var J8=Q8,Z8=Jd;function eU(e,t){var r=!0;return Z8(e,function(n,i,s){return r=!!t(n,i,s),r}),r}var tU=eU,rU=J8,nU=tU,aU=Nr,iU=Pt,sU=Sl;function oU(e,t,r){var n=iU(e)?rU:nU;return r&&sU(e,t,r)&&(t=void 0),n(e,aU(t))}var lU=oU;const Vb=De(lU);var cU=["x","y"];function us(e){"@babel/helpers - typeof";return us=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},us(e)}function ed(){return ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ed.apply(this,arguments)}function Pg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pg(Object(r),!0).forEach(function(n){uU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uU(e,t,r){return t=dU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dU(e){var t=fU(e,"string");return us(t)=="symbol"?t:t+""}function fU(e,t){if(us(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(us(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mU(e,t){if(e==null)return{};var r=hU(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pU(e,t){var r=e.x,n=e.y,i=mU(e,cU),s="".concat(r),o=parseInt(s,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||i.height),f=parseInt(u,10),d="".concat(t.width||i.width),m=parseInt(d,10);return vi(vi(vi(vi(vi({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:f,width:m,name:t.name,radius:t.radius})}function Cg(e){return k.createElement(Lb,ed({shapeType:"rectangle",propTransformer:pU,activeClassName:"recharts-active-bar"},e))}var gU=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var s=J(n)||GS(n);return s?t(n,i):(s||Mn(),r)}},vU=["value","background"],Kb;function Ma(e){"@babel/helpers - typeof";return Ma=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},Ma(e)}function xU(e,t){if(e==null)return{};var r=yU(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wo(){return Wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 116,827 bytes, lines 123-128
123for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wo.apply(this,arguments)}function kg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kg(Object(r),!0).forEach(function(n){Gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hb(n.key),n)}}function jU(e,t,r){return t&&Eg(e.prototype,t),r&&Eg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wU(e,t,r){return t=Vo(t),NU(e,Gb()?Reflect.construct(t,r||[],Vo(e).constructor):t.apply(e,r))}function NU(e,t){if(t&&(Ma(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _U(e)}function _U(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gb=function(){return!!e})()}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vo(e)}function SU(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&&td(e,t)}function td(e,t){return td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},td(e,t)}function Gr(e,t,r){return t=Hb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hb(e){var t=AU(e,"string");return Ma(t)=="symbol"?t:t+""}function AU(e,t){if(Ma(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ma(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yr=function(e){function t(){var r;bU(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=wU(this,t,[].concat(i)),Gr(r,"state",{isAnimationFinished:!1}),Gr(r,"id",Fn("recharts-bar-")),Gr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Gr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return SU(t,e),jU(t,[{key:"renderRectanglesStatically",value:function(n){var i=this,s=this.props,o=s.shape,l=s.dataKey,c=s.activeIndex,u=s.activeBar,f=ue(this.props,!1);return n&&n.map(function(d,m){var h=m===c,g=h?u:o,p=Ye(Ye(Ye({},f),d),{},{isActive:h,option:g,index:m,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return k.createElement(_e,Wo({className:"recharts-bar-rectangle"},kn(i.props,d,m),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value,"-").concat(m)}),k.createElement(Cg,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,s=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,f=i.animationEasing,d=i.animationId,m=this.state.prevData;return k.createElement(or,{begin:c,duration:u,isActive:l,easing:f,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var g=h.t,p=s.map(function(v,x){var b=m&&m[x];if(b){var j=rt(b.x,v.x),N=rt(b.y,v.y),y=rt(b.width,v.width),w=rt(b.height,v.height);return Ye(Ye({},v),{},{x:j(g),y:N(g),width:y(g),height:w(g)})}if(o==="horizontal"){var _=rt(0,v.height),O=_(g);return Ye(Ye({},v),{},{y:v.y+v.height-O,height:O})}var A=rt(0,v.width),C=A(g);return Ye(Ye({},v),{},{width:C})});return k.createElement(_e,null,n.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,s=n.isAnimationActive,o=this.state.prevData;return s&&i&&i.length&&(!o||!$n(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,s=i.data,o=i.dataKey,l=i.activeIndex,c=ue(this.props.background,!1);return s.map(function(u,f){u.value;var d=u.background,m=xU(u,vU);if(!d)return null;var h=Ye(Ye(Ye(Ye(Ye({},m),{},{fill:"#eee"},d),c),kn(n.props,u,f)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:f,className:"recharts-bar-background-rectangle"});return k.createElement(Cg,Wo({key:"background-bar-".concat(f),option:n.props.background,isActive:f===l},h))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.data,l=s.xAxis,c=s.yAxis,u=s.layout,f=s.children,d=It(f,Ns);if(!d)return null;var m=u==="vertical"?o[0].height/2:o[0].width/2,h=function(v,x){var b=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:b,errorVal:Ke(v,x)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return k.createElement(_e,g,d.map(function(p){return k.cloneElement(p,{key:"error-bar-".concat(i,"-").concat(p.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:m,dataPointFormatter:h})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,s=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,f=n.top,d=n.width,m=n.height,h=n.isAnimationActive,g=n.background,p=n.id;if(i||!s||!s.length)return null;var v=this.state.isAnimationFinished,x=je("recharts-bar",o),b=l&&l.allowDataOverflow,j=c&&c.allowDataOverflow,N=b||j,y=xe(p)?this.id:p;return k.createElement(_e,{className:x},b||j?k.createElement("defs",null,k.createElement("clipPath",{id:"clipPath-".concat(y)},k.createElement("rect",{x:b?u:u-d/2,y:j?f:f-m/2,width:b?d:d*2,height:j?m:m*2}))):null,k.createElement(_e,{className:"recharts-bar-rectangles",clipPath:N?"url(#clipPath-".concat(y,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(N,y),(!h||v)&&vr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])}(S.PureComponent);Kb=yr;Gr(yr,"displayName","Bar");Gr(yr,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ar.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Gr(yr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,s=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,m=e.offset,h=dL(n,r);if(!h)return null;var g=t.layout,p=r.type.defaultProps,v=p!==void 0?Ye(Ye({},p),r.props):r.props,x=v.dataKey,b=v.children,j=v.minPointSize,N=g==="horizontal"?o:s,y=u?N.scale.domain():null,w=xL({numericAxis:N}),_=It(b,Al),O=d.map(function(A,C){var P,M,E,T,$,I;u?P=fL(u[f+C],y):(P=Ke(A,x),Array.isArray(P)||(P=[w,P]));var B=gU(j,Kb.defaultProps.minPointSize)(P[1],C);if(g==="horizontal"){var L,X=[o.scale(P[0]),o.scale(P[1])],z=X[0],U=X[1];M=bp({axis:s,ticks:l,bandSize:i,offset:h.offset,entry:A,index:C}),E=(L=U??z)!==null&&L!==void 0?L:void 0,T=h.size;var D=z-U;if($=Number.isNaN(D)?0:D,I={x:M,y:o.y,width:T,height:o.height},Math.abs(B)>0&&Math.abs($)<Math.abs(B)){var Q=jt($||B)*(Math.abs(B)-Math.abs($));E-=Q,$+=Q}}else{var ae=[s.scale(P[0]),s.scale(P[1])],te=ae[0],pe=ae[1];if(M=te,E=bp({axis:o,ticks:c,bandSize:i,offset:h.offset,entry:A,index:C}),T=pe-te,$=h.size,I={x:s.x,y:E,width:s.width,height:$},Math.abs(B)>0&&Math.abs(T)<Math.abs(B)){var Ne=jt(T||B)*(Math.abs(B)-Math.abs(T));T+=Ne}}return Ye(Ye(Ye({},A),{},{x:M,y:E,width:T,height:$,value:u?P:P[1],payload:A,background:I},_&&_[C]&&_[C].props),{},{tooltipPayload:[yb(r,A)],tooltipPosition:{x:M+T/2,y:E+$/2}})});return Ye({data:O,layout:g},m)});function ds(e){"@babel/helpers - typeof";return ds=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},ds(e)}function OU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yb(n.key),n)}}function PU(e,t,r){return t&&$g(e.prototype,t),r&&$g(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tg(Object(r),!0).forEach(function(n){zl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zl(e,t,r){return t=Yb(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yb(e){var t=CU(e,"string");return ds(t)=="symbol"?t:t+""}function CU(e,t){if(ds(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ds(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pf=function(t,r,n,i,s){var o=t.width,l=t.height,c=t.layout,u=t.children,f=Object.keys(r),d={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},m=!!Et(u,yr);return f.reduce(function(h,g){var p=r[g],v=p.orientation,x=p.domain,b=p.padding,j=b===void 0?{}:b,N=p.mirror,y=p.reversed,w="".concat(v).concat(N?"Mirror":""),_,O,A,C,P;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var M=x[1]-x[0],E=1/0,T=p.categoricalDomain.sort(XS);if(T.forEach(function(ae,te){te>0&&(E=Math.min((ae||0)-(T[te-1]||0),E))}),Number.isFinite(E)){var $=E/M,I=p.layout==="vertical"?n.height:n.width;if(p.padding==="gap"&&(_=$*I/2),p.padding==="no-gap"){var B=wt(t.barCategoryGap,$*I),L=$*I/2;_=L-B-(L-B)/I*B}}}i==="xAxis"?O=[n.left+(j.left||0)+(_||0),n.left+n.width-(j.right||0)-(_||0)]:i==="yAxis"?O=c==="horizontal"?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(_||0),n.top+n.height-(j.bottom||0)-(_||0)]:O=p.range,y&&(O=[O[1],O[0]]);var X=pb(p,s,m),z=X.scale,U=X.realScaleType;z.domain(x).range(O),gb(z);var D=vb(z,Zt(Zt({},p),{},{realScaleType:U}));i==="xAxis"?(P=v==="top"&&!N||v==="bottom"&&N,A=n.left,C=d[w]-P*p.height):i==="yAxis"&&(P=v==="left"&&!N||v==="right"&&N,A=d[w]-P*p.width,C=n.top);var Q=Zt(Zt(Zt({},p),D),{},{realScaleType:U,x:A,y:C,scale:z,width:i==="xAxis"?n.width:p.width,height:i==="yAxis"?n.height:p.height});return Q.bandSize=Co(Q,D),!p.hide&&i==="xAxis"?d[w]+=(P?-1:1)*Q.height:p.hide||(d[w]+=(P?-1:1)*Q.width),Zt(Zt({},h),{},zl({},g,Q))},{})},Xb=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return{x:Math.min(n,s),y:Math.min(i,o),width:Math.abs(s-n),height:Math.abs(o-i)}},kU=function(t){var r=t.x1,n=t.y1,i=t.x2,s=t.y2;return Xb({x:r,y:n},{x:i,y:s})},Qb=function(){function e(t){OU(this,e),this.scale=t}return PU(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 n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,s=n.position;if(r!==void 0){if(s)switch(s){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],s=n[n.length-1];return i<=s?r>=i&&r<=s:r>=s&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();zl(Qb,"EPS",1e-4);var Cf=function(t){var r=Object.keys(t).reduce(function(n,i){return Zt(Zt({},n),{},zl({},i,Qb.create(t[i])))},{});return Zt(Zt({},r),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return X8(i,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return Vb(i,function(s,o){return r[o].isInRange(s)})}})};function EU(e){return(e%180+180)%180}var $U=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=EU(i),o=s*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},TU=Nr,MU=xs,DU=Nl;function IU(e){return function(t,r,n){var i=Object(t);if(!MU(t)){var s=TU(r);t=DU(t),r=function(l){return s(i[l],l,i)}}var o=e(t,r,n);return o>-1?i[s?t[o]:o]:void 0}}var RU=IU,LU=qb;function FU(e){var t=LU(e),r=t%1;return t===t?r?t-r:t:0}var BU=FU,qU=Yx,UU=Nr,zU=BU,WU=Math.max;function VU(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:zU(r);return i<0&&(i=WU(n+i,0)),qU(e,UU(t),i)}var KU=VU,GU=RU,HU=KU,YU=GU(HU),XU=YU;const QU=De(XU);var JU=Q_(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("")}),kf=S.createContext(void 0),Ef=S.createContext(void 0),Jb=S.createContext(void 0),Zb=S.createContext({}),ej=S.createContext(void 0),tj=S.createContext(0),rj=S.createContext(0),Mg=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,s=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,f=JU(s);return k.createElement(kf.Provider,{value:n},k.createElement(Ef.Provider,{value:i},k.createElement(Zb.Provider,{value:s},k.createElement(Jb.Provider,{value:f},k.createElement(ej.Provider,{value:o},k.createElement(tj.Provider,{value:u},k.createElement(rj.Provider,{value:c},l)))))))},ZU=function(){return S.useContext(ej)},nj=function(t){var r=S.useContext(kf);r==null&&Mn();var n=r[t];return n==null&&Mn(),n},e6=function(){var t=S.useContext(kf);return Vr(t)},t6=function(){var t=S.useContext(Ef),r=QU(t,function(n){return Vb(n.domain,Number.isFinite)});return r||Vr(t)},aj=function(t){var r=S.useContext(Ef);r==null&&Mn();var n=r[t];return n==null&&Mn(),n},r6=function(){var t=S.useContext(Jb);return t},n6=function(){return S.useContext(Zb)},$f=function(){return S.useContext(rj)},Tf=function(){return S.useContext(tj)};function Da(e){"@babel/helpers - typeof";return Da=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},Da(e)}function a6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sj(n.key),n)}}function s6(e,t,r){return t&&i6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o6(e,t,r){return t=Ko(t),l6(e,ij()?Reflect.construct(t,r||[],Ko(e).constructor):t.apply(e,r))}function l6(e,t){if(t&&(Da(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c6(e)}function c6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ij(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ij=function(){return!!e})()}function Ko(e){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ko(e)}function u6(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&&rd(e,t)}function rd(e,t){return rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rd(e,t)}function Dg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ig(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Dg(Object(r),!0).forEach(function(n){Mf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mf(e,t,r){return t=sj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sj(e){var t=d6(e,"string");return Da(t)=="symbol"?t:t+""}function d6(e,t){if(Da(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Da(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function f6(e,t){return g6(e)||p6(e,t)||h6(e,t)||m6()}function m6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 124In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h6(e,t){if(e){if(typeof e=="string")return Rg(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 Rg(e,t)}}function Rg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p6(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function g6(e){if(Array.isArray(e))return e}function nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nd.apply(this,arguments)}var v6=function(t,r){var n;return k.isValidElement(t)?n=k.cloneElement(t,r):fe(t)?n=t(r):n=k.createElement("line",nd({},r,{className:"recharts-reference-line-line"})),n},x6=function(t,r,n,i,s,o,l,c,u){var f=s.x,d=s.y,m=s.width,h=s.height;if(n){var g=u.y,p=t.y.apply(g,{position:o});if(xr(u,"discard")&&!t.y.isInRange(p))return null;var v=[{x:f+m,y:p},{x:f,y:p}];return c==="left"?v.reverse():v}if(r){var x=u.x,b=t.x.apply(x,{position:o});if(xr(u,"discard")&&!t.x.isInRange(b))return null;var j=[{x:b,y:d+h},{x:b,y:d}];return l==="top"?j.reverse():j}if(i){var N=u.segment,y=N.map(function(w){return t.apply(w,{position:o})});return xr(u,"discard")&&U8(y,function(w){return!t.isInRange(w)})?null:y}return null};function y6(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxisId,s=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=ZU(),f=nj(i),d=aj(s),m=r6();if(!u||!m)return null;rr(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Cf({x:f.scale,y:d.scale}),g=at(t),p=at(r),v=n&&n.length===2,x=x6(h,g,p,v,m,e.position,f.orientation,d.orientation,e);if(!x)return null;var b=f6(x,2),j=b[0],N=j.x,y=j.y,w=b[1],_=w.x,O=w.y,A=xr(e,"hidden")?"url(#".concat(u,")"):void 0,C=Ig(Ig({clipPath:A},ue(e,!0)),{},{x1:N,y1:y,x2:_,y2:O});return k.createElement(_e,{className:je("recharts-reference-line",l)},v6(o,C),ct.renderCallByParent(e,kU({x1:N,y1:y,x2:_,y2:O})))}var Df=function(e){function t(){return a6(this,t),o6(this,t,arguments)}return u6(t,e),s6(t,[{key:"render",value:function(){return k.createElement(y6,this.props)}}])}(k.Component);Mf(Df,"displayName","ReferenceLine");Mf(Df,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ad(){return ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ad.apply(this,arguments)}function Ia(e){"@babel/helpers - typeof";return Ia=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},Ia(e)}function Lg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lg(Object(r),!0).forEach(function(n){Wl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function b6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lj(n.key),n)}}function w6(e,t,r){return t&&j6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function N6(e,t,r){return t=Go(t),_6(e,oj()?Reflect.construct(t,r||[],Go(e).constructor):t.apply(e,r))}function _6(e,t){if(t&&(Ia(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S6(e)}function S6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oj=function(){return!!e})()}function Go(e){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Go(e)}function A6(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&&id(e,t)}function id(e,t){return id=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},id(e,t)}function Wl(e,t,r){return t=lj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lj(e){var t=O6(e,"string");return Ia(t)=="symbol"?t:t+""}function O6(e,t){if(Ia(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ia(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var P6=function(t){var r=t.x,n=t.y,i=t.xAxis,s=t.yAxis,o=Cf({x:i.scale,y:s.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return xr(t,"discard")&&!o.isInRange(l)?null:l},Vl=function(e){function t(){return b6(this,t),N6(this,t,arguments)}return A6(t,e),w6(t,[{key:"render",value:function(){var n=this.props,i=n.x,s=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=at(i),f=at(s);if(rr(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!f)return null;var d=P6(this.props);if(!d)return null;var m=d.x,h=d.y,g=this.props,p=g.shape,v=g.className,x=xr(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=Fg(Fg({clipPath:x},ue(this.props,!0)),{},{cx:m,cy:h});return k.createElement(_e,{className:je("recharts-reference-dot",v)},t.renderDot(p,b),ct.renderCallByParent(this.props,{x:m-o,y:h-o,width:2*o,height:2*o}))}}])}(k.Component);Wl(Vl,"displayName","ReferenceDot");Wl(Vl,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Wl(Vl,"renderDot",function(e,t){var r;return k.isValidElement(e)?r=k.cloneElement(e,t):fe(e)?r=e(t):r=k.createElement(_s,ad({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sd.apply(this,arguments)}function Ra(e){"@babel/helpers - typeof";return Ra=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},Ra(e)}function Bg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bg(Object(r),!0).forEach(function(n){Kl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function C6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k6(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uj(n.key),n)}}function E6(e,t,r){return t&&k6(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $6(e,t,r){return t=Ho(t),T6(e,cj()?Reflect.construct(t,r||[],Ho(e).constructor):t.apply(e,r))}function T6(e,t){if(t&&(Ra(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M6(e)}function M6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cj=function(){return!!e})()}function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ho(e)}function D6(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&&od(e,t)}function od(e,t){return od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},od(e,t)}function Kl(e,t,r){return t=uj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uj(e){var t=I6(e,"string");return Ra(t)=="symbol"?t:t+""}function I6(e,t){if(Ra(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ra(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R6=function(t,r,n,i,s){var o=s.x1,l=s.x2,c=s.y1,u=s.y2,f=s.xAxis,d=s.yAxis;if(!f||!d)return null;var m=Cf({x:f.scale,y:d.scale}),h={x:t?m.x.apply(o,{position:"start"}):m.x.rangeMin,y:n?m.y.apply(c,{position:"start"}):m.y.rangeMin},g={x:r?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:i?m.y.apply(u,{position:"end"}):m.y.rangeMax};return xr(s,"discard")&&(!m.isInRange(h)||!m.isInRange(g))?null:Xb(h,g)},Gl=function(e){function t(){return C6(this,t),$6(this,t,arguments)}return D6(t,e),E6(t,[{key:"render",value:function(){var n=this.props,i=n.x1,s=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,f=n.clipPathId;rr(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=at(i),m=at(s),h=at(o),g=at(l),p=this.props.shape;if(!d&&!m&&!h&&!g&&!p)return null;var v=R6(d,m,h,g,this.props);if(!v&&!p)return null;var x=xr(this.props,"hidden")?"url(#".concat(f,")"):void 0;return k.createElement(_e,{className:je("recharts-reference-area",c)},t.renderRect(p,qg(qg({clipPath:x},ue(this.props,!0)),v)),ct.renderCallByParent(this.props,v))}}])}(k.Component);Kl(Gl,"displayName","ReferenceArea");Kl(Gl,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Kl(Gl,"renderRect",function(e,t){var r;return k.isValidElement(e)?r=k.cloneElement(e,t):fe(e)?r=e(t):r=k.createElement(Of,sd({},t,{className:"recharts-reference-area-rect"})),r});function dj(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function L6(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return $U(n,r)}function F6(e,t,r){var n=r==="width",i=e.x,s=e.y,o=e.width,l=e.height;return t===1?{start:n?i:s,end:n?i+o:s+l}:{start:n?i+o:s+l,end:n?i:s}}function Yo(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var s=r();return e*(t-e*s/2-n)>=0&&e*(t+e*s/2-i)<=0}function B6(e,t){return dj(e,t+1)}function q6(e,t,r,n,i){for(var s=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,f=o,d=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:dj(n,u)};var p=c,v,x=function(){return v===void 0&&(v=r(g,p)),v},b=g.coordinate,j=c===0||Yo(e,b,x,f,l);j||(c=0,f=o,u+=1),j&&(f=b+e*(x()/2+i),c+=u)},m;u<=s.length;)if(m=d(),m)return m.v;return[]}function fs(e){"@babel/helpers - typeof";return fs=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},fs(e)}function Ug(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ug(Object(r),!0).forEach(function(n){U6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ug(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function U6(e,t,r){return t=z6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z6(e){var t=W6(e,"string");return fs(t)=="symbol"?t:t+""}function W6(e,t){if(fs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V6(e,t,r,n,i){for(var s=(n||[]).slice(),o=s.length,l=t.start,c=t.end,u=function(m){var h=s[m],g,p=function(){return g===void 0&&(g=r(h,m)),g};if(m===o-1){var v=e*(h.coordinate+e*p()/2-c);s[m]=h=pt(pt({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate})}else s[m]=h=pt(pt({},h),{},{tickCoord:h.coordinate});var x=Yo(e,h.tickCoord,p,l,c);x&&(c=h.tickCoord-e*(p()/2+i),s[m]=pt(pt({},h),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return s}function K6(e,t,r,n,i,s){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(s){var f=n[l-1],d=r(f,l-1),m=e*(f.coordinate+e*d/2-u);o[l-1]=f=pt(pt({},f),{},{tickCoord:m>0?f.coordinate-m*e:f.coordinate});var h=Yo(e,f.tickCoord,function(){return d},c,u);h&&(u=f.tickCoord-e*(d/2+i),o[l-1]=pt(pt({},f),{},{isShow:!0}))}for(var g=s?l-1:l,p=function(b){var j=o[b],N,y=function(){return N===void 0&&(N=r(j,b)),N};if(b===0){var w=e*(j.coordinate-e*y()/2-c);o[b]=j=pt(pt({},j),{},{tickCoord:w<0?j.coordinate-w*e:j.coordinate})}else o[b]=j=pt(pt({},j),{},{tickCoord:j.coordinate});var _=Yo(e,j.tickCoord,y,c,u);_&&(c=j.tickCoord+e*(y()/2+i),o[b]=pt(pt({},j),{},{isShow:!0}))},v=0;v<g;v++)p(v);return o}function If(e,t,r){var n=e.tick,i=e.ticks,s=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,f=e.unit,d=e.angle;if(!i||!i.length||!n)return[];if(J(c)||ar.isSsr)return B6(i,typeof c=="number"&&J(c)?c:0);var m=[],h=l==="top"||l==="bottom"?"width":"height",g=f&&h==="width"?_i(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},p=function(j,N){var y=fe(u)?u(j.value,N):j.value;return h==="width"?L6(_i(y,{fontSize:t,letterSpacing:r}),g,d):_i(y,{fontSize:t,letterSpacing:r})[h]},v=i.length>=2?jt(i[1].coordinate-i[0].coordinate):1,x=F6(s,v,h);return c==="equidistantPreserveStart"?q6(v,x,p,i,o):(c==="preserveStart"||c==="preserveStartEnd"?m=K6(v,x,p,i,o,c==="preserveStartEnd"):m=V6(v,x,p,i,o),m.filter(function(b){return b.isShow}))}var G6=["viewBox"],H6=["viewBox"],Y6=["ticks"];function La(e){"@babel/helpers - typeof";return La=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},La(e)}function na(){return na=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},na.apply(this,arguments)}function zg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zg(Object(r),!0).forEach(function(n){Rf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oc(e,t){if(e==null)return{};var r=X6(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function X6(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Q6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mj(n.key),n)}}function J6(e,t,r){return t&&Wg(e.prototype,t),r&&Wg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z6(e,t,r){return t=Xo(t),ez(e,fj()?Reflect.construct(t,r||[],Xo(e).constructor):t.apply(e,r))}function ez(e,t){if(t&&(La(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tz(e)}function tz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fj=function(){return!!e})()}function Xo(e){return Xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xo(e)}function rz(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&&ld(e,t)}function ld(e,t){return ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ld(e,t)}function Rf(e,t,r){return t=mj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mj(e){var t=nz(e,"string");return La(t)=="symbol"?t:t+""}function nz(e,t){if(La(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(La(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var si=function(e){function t(r){var n;return Q6(this,t),n=Z6(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return rz(t,e),J6(t,[{key:"shouldComponentUpdate",value:function(n,i){var s=n.viewBox,o=Oc(n,G6),l=this.props,c=l.viewBox,u=Oc(l,H6);return!oa(s,c)||!oa(o,u)||!oa(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.x,o=i.y,l=i.width,c=i.height,u=i.orientation,f=i.tickSize,d=i.mirror,m=i.tickMargin,h,g,p,v,x,b,j=d?-1:1,N=n.tickSize||f,y=J(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":h=g=n.coordinate,v=o+ +!d*c,p=v-j*N,b=p-j*m,x=y;break;case"left":p=v=n.coordinate,g=s+ +!d*l,h=g-j*N,x=h-j*m,b=y;break;case"right":p=v=n.coordinate,g=s+ +d*l,h=g+j*N,x=h+j*m,b=y;break;default:h=g=n.coordinate,v=o+ +d*c,p=v+j*N,b=p+j*m,x=y;break}return{line:{x1:h,y1:p,x2:g,y2:v},tick:{x,y:b}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,o;switch(i){case"left":o=s?"start":"end";break;case"right":o=s?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=s?"start":"end";break;default:o=s?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,f=n.axisLine,d=et(et(et({},ue(this.props,!1)),ue(f,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!u||c==="bottom"&&u);d=et(et({},d),{},{x1:i,y1:s+m*l,x2:i+o,y2:s+m*l})}else{var h=+(c==="left"&&!u||c==="right"&&u);d=et(et({},d),{},{x1:i+h*o,y1:s,x2:i+h*o,y2:s+l})}return k.createElement("line",na({},d,{className:je("recharts-cartesian-axis-line",Dt(f,"className"))}))}},{key:"renderTicks",value:function(n,i,s){var o=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,m=l.unit,h=If(et(et({},this.props),{},{ticks:n}),i,s),g=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),v=ue(this.props,!1),x=ue(f,!1),b=et(et({},v),{},{fill:"none"},ue(c,!1)),j=h.map(function(N,y){var w=o.getTickLineCoord(N),_=w.line,O=w.tick,A=et(et(et(et({textAnchor:g,verticalAnchor:p},v),{},{stroke:"none",fill:u},x),O),{},{index:y,payload:N,visibleTicksCount:h.length,tickFormatter:d});return k.createElement(_e,na({className:"recharts-cartesian-axis-tick",key:"tick-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},kn(o.props,N,y)),c&&k.createElement("line",na({},b,_,{className:je("recharts-cartesian-axis-tick-line",Dt(c,"className"))})),f&&t.renderTickItem(f,A,"".concat(fe(d)?d(N.value,y):N.value).concat(m||"")))});return k.createElement("g",{className:"recharts-cartesian-axis-ticks"},j)}},{key:"render",value:function(){var n=this,i=this.props,s=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,u=i.className,f=i.hide;if(f)return null;var d=this.props,m=d.ticks,h=Oc(d,Y6),g=m;return fe(c)&&(g=m&&m.length>0?c(this.props):c(h)),o<=0||l<=0||!g||!g.length?null:k.createElement(_e,{className:je("recharts-cartesian-axis",u),ref:function(v){n.layerReference=v}},s&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),ct.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,s){var o,l=je(i.className,"recharts-cartesian-axis-tick-value");return k.isValidElement(n)?o=k.cloneElement(n,et(et({},i),{},{className:l})):fe(n)?o=n(et(et({},i),{},{className:l})):o=k.createElement(En,na({},i,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])}(S.Component);Rf(si,"displayName","CartesianAxis");Rf(si,"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 az=["x1","y1","x2","y2","key"],iz=["offset"];function Dn(e){"@babel/helpers - typeof";return Dn=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},Dn(e)}function Vg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vg(Object(r),!0).forEach(function(n){sz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sz(e,t,r){return t=oz(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oz(e){var t=lz(e,"string");return Dn(t)=="symbol"?t:t+""}function lz(e,t){if(Dn(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yn(){return yn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yn.apply(this,arguments)}function Kg(e,t){if(e==null)return{};var r=cz(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var uz=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return k.createElement("rect",{x:i,y:s,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function hj(e,t){var r;if(k.isValidElement(e))r=k.cloneElement(e,t);else if(fe(e))r=e(t);else{var n=t.x1,i=t.y1,s=t.x2,o=t.y2,l=t.key,c=Kg(t,az),u=ue(c,!1);u.offset;var f=Kg(u,iz);r=k.createElement("line",yn({},f,{x1:n,y1:i,x2:s,y2:o,fill:"none",key:l}))}return r}function dz(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var u=vt(vt({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return hj(i,u)});return k.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function fz(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,s=e.verticalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var u=vt(vt({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return hj(i,u)});return k.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function mz(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var f=l.map(function(m){return Math.round(m+i-i)}).sort(function(m,h){return m-h});i!==f[0]&&f.unshift(0);var d=f.map(function(m,h){var g=!f[h+1],p=g?i+o-m:f[h+1]-m;if(p<=0)return null;var v=h%t.length;return k.createElement("rect",{key:"react-".concat(h),y:m,x:n,height:p,width:s,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return k.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function hz(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(m){return Math.round(m+s-s)}).sort(function(m,h){return m-h});s!==f[0]&&f.unshift(0);var d=f.map(function(m,h){var g=!f[h+1],p=g?s+l-m:f[h+1]-m;if(p<=0)return null;var v=h%n.length;return k.createElement("rect",{key:"react-".concat(h),x:m,y:o,width:p,height:c,stroke:"none",fill:n[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return k.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var pz=function(t,r){var n=t.xAxis,i=t.width,s=t.height,o=t.offset;return hb(If(vt(vt(vt({},si.defaultProps),n),{},{ticks:Cr(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.left,o.left+o.width,r)},gz=function(t,r){var n=t.yAxis,i=t.width,s=t.height,o=t.offset;return hb(If(vt(vt(vt({},si.defaultProps),n),{},{ticks:Cr(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.top,o.top+o.height,r)},Kn={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Sn(e){var t,r,n,i,s,o,l=$f(),c=Tf(),u=n6(),f=vt(vt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Kn.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Kn.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Kn.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Kn.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:Kn.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Kn.verticalFill,x:J(e.x)?e.x:u.left,y:J(e.y)?e.y:u.top,width:J(e.width)?e.width:u.width,height:J(e.height)?e.height:u.height}),d=f.x,m=f.y,h=f.width,g=f.height,p=f.syncWithTicks,v=f.horizontalValues,x=f.verticalValues,b=e6(),j=t6();if(!J(h)||h<=0||!J(g)||g<=0||!J(d)||d!==+d||!J(m)||m!==+m)return null;var N=f.verticalCoordinatesGenerator||pz,y=f.horizontalCoordinatesGenerator||gz,w=f.horizontalPoints,_=f.verticalPoints;if((!w||!w.length)&&fe(y)){var O=v&&v.length,A=y({yAxis:j?vt(vt({},j),{},{ticks:O?v:j.ticks}):void 0,width:l,height:c,offset:u},O?!0:p);rr(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Dn(A),"]")),Array.isArray(A)&&(w=A)}if((!_||!_.length)&&fe(N)){var C=x&&x.length,P=N({xAxis:b?vt(vt({},b),{},{ticks:C?x:b.ticks}):void 0,width:l,height:c,offset:u},C?!0:p);rr(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Dn(P),"]")),Array.isArray(P)&&(_=P)}return k.createElement("g",{className:"recharts-cartesian-grid"},k.createElement(uz,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),k.createElement(dz,yn({},f,{offset:u,horizontalPoints:w,xAxis:b,yAxis:j})),k.createElement(fz,yn({},f,{offset:u,verticalPoints:_,xAxis:b,yAxis:j})),k.createElement(mz,yn({},f,{horizontalPoints:w})),k.createElement(hz,yn({},f,{verticalPoints:_})))}Sn.displayName="CartesianGrid";var vz=["type","layout","connectNulls","ref"],xz=["key"];function Fa(e){"@babel/helpers - typeof";return Fa=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},Fa(e)}function Gg(e,t){if(e==null)return{};var r=yz(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ki.apply(this,arguments)}function Hg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hg(Object(r),!0).forEach(function(n){er(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gn(e){return Nz(e)||wz(e)||jz(e)||bz()}function bz(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 125In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jz(e,t){if(e){if(typeof e=="string")return cd(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 cd(e,t)}}function wz(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nz(e){if(Array.isArray(e))return cd(e)}function cd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gj(n.key),n)}}function Sz(e,t,r){return t&&Yg(e.prototype,t),r&&Yg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Az(e,t,r){return t=Qo(t),Oz(e,pj()?Reflect.construct(t,r||[],Qo(e).constructor):t.apply(e,r))}function Oz(e,t){if(t&&(Fa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pz(e)}function Pz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pj=function(){return!!e})()}function Qo(e){return Qo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qo(e)}function Cz(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&&ud(e,t)}function ud(e,t){return ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ud(e,t)}function er(e,t,r){return t=gj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gj(e){var t=kz(e,"string");return Fa(t)=="symbol"?t:t+""}function kz(e,t){if(Fa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var An=function(e){function t(){var r;_z(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=Az(this,t,[].concat(i)),er(r,"state",{isAnimationFinished:!0,totalLength:0}),er(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),er(r,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(x,b){return x+b});if(!u)return r.generateSimpleStrokeDasharray(l,o);for(var f=Math.floor(o/u),d=o%u,m=l-o,h=[],g=0,p=0;g<c.length;p+=c[g],++g)if(p+c[g]>d){h=[].concat(Gn(c.slice(0,g)),[d-p]);break}var v=h.length%2===0?[0,m]:[m];return[].concat(Gn(t.repeat(c,f)),Gn(h),v).map(function(x){return"".concat(x,"px")}).join(", ")}),er(r,"id",Fn("recharts-line-")),er(r,"pathRef",function(o){r.mainCurve=o}),er(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),er(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Cz(t,e),Sz(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.points,l=s.xAxis,c=s.yAxis,u=s.layout,f=s.children,d=It(f,Ns);if(!d)return null;var m=function(p,v){return{x:p.x,y:p.y,value:p.value,errorVal:Ke(p.payload,v)}},h={clipPath:n?"url(#clipPath-".concat(i,")"):null};return k.createElement(_e,h,d.map(function(g){return k.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,i,s){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,f=l.dataKey,d=ue(this.props,!1),m=ue(c,!0),h=u.map(function(p,v){var x=Ct(Ct(Ct({key:"dot-".concat(v),r:3},d),m),{},{index:v,cx:p.x,cy:p.y,value:p.value,dataKey:f,payload:p.payload,points:u});return t.renderDotItem(c,x)}),g={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return k.createElement(_e,ki({className:"recharts-line-dots",key:"dots"},g),h)}},{key:"renderCurveStatically",value:function(n,i,s,o){var l=this.props,c=l.type,u=l.layout,f=l.connectNulls;l.ref;var d=Gg(l,vz),m=Ct(Ct(Ct({},ue(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:n},o),{},{type:c,layout:u,connectNulls:f});return k.createElement(_n,ki({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var s=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,m=o.animationEasing,h=o.animationId,g=o.animateNewValues,p=o.width,v=o.height,x=this.state,b=x.prevPoints,j=x.totalLength;return k.createElement(or,{begin:f,duration:d,isActive:u,easing:m,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var y=N.t;if(b){var w=b.length/l.length,_=l.map(function(M,E){var T=Math.floor(E*w);if(b[T]){var $=b[T],I=rt($.x,M.x),B=rt($.y,M.y);return Ct(Ct({},M),{},{x:I(y),y:B(y)})}if(g){var L=rt(p*2,M.x),X=rt(v/2,M.y);return Ct(Ct({},M),{},{x:L(y),y:X(y)})}return Ct(Ct({},M),{},{x:M.x,y:M.y})});return s.renderCurveStatically(_,n,i)}var O=rt(0,j),A=O(y),C;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(M){return parseFloat(M)});C=s.getStrokeDasharray(A,j,P)}else C=s.generateSimpleStrokeDasharray(j,A);return s.renderCurveStatically(l,n,i,{strokeDasharray:C})})}},{key:"renderCurve",value:function(n,i){var s=this.props,o=s.points,l=s.isAnimationActive,c=this.state,u=c.prevPoints,f=c.totalLength;return l&&o&&o.length&&(!u&&f>0||!$n(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,o=i.dot,l=i.points,c=i.className,u=i.xAxis,f=i.yAxis,d=i.top,m=i.left,h=i.width,g=i.height,p=i.isAnimationActive,v=i.id;if(s||!l||!l.length)return null;var x=this.state.isAnimationFinished,b=l.length===1,j=je("recharts-line",c),N=u&&u.allowDataOverflow,y=f&&f.allowDataOverflow,w=N||y,_=xe(v)?this.id:v,O=(n=ue(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=O.r,C=A===void 0?3:A,P=O.strokeWidth,M=P===void 0?2:P,E=sx(o)?o:{},T=E.clipDot,$=T===void 0?!0:T,I=C*2+M;return k.createElement(_e,{className:j},N||y?k.createElement("defs",null,k.createElement("clipPath",{id:"clipPath-".concat(_)},k.createElement("rect",{x:N?m:m-h/2,y:y?d:d-g/2,width:N?h:h*2,height:y?g:g*2})),!$&&k.createElement("clipPath",{id:"clipPath-dots-".concat(_)},k.createElement("rect",{x:m-I/2,y:d-I/2,width:h+I,height:g+I}))):null,!b&&this.renderCurve(w,_),this.renderErrorBar(w,_),(b||o)&&this.renderDots(w,$,_),(!p||x)&&vr.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var s=n.length%2!==0?[].concat(Gn(n),[0]):n,o=[],l=0;l<i;++l)o=[].concat(Gn(o),Gn(s));return o}},{key:"renderDotItem",value:function(n,i){var s;if(k.isValidElement(n))s=k.cloneElement(n,i);else if(fe(n))s=n(i);else{var o=i.key,l=Gg(i,xz),c=je("recharts-line-dot",typeof n!="boolean"?n.className:"");s=k.createElement(_s,ki({key:o},l,{className:c}))}return s}}])}(S.PureComponent);er(An,"displayName","Line");er(An,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!ar.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});er(An,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,f=t.layout,d=c.map(function(m,h){var g=Ke(m,o);return f==="horizontal"?{x:Po({axis:r,ticks:i,bandSize:l,entry:m,index:h}),y:xe(g)?null:n.scale(g),value:g,payload:m}:{x:xe(g)?null:r.scale(g),y:Po({axis:n,ticks:s,bandSize:l,entry:m,index:h}),value:g,payload:m}});return Ct({points:d,layout:f},u)});var Ez=["layout","type","stroke","connectNulls","isRange","ref"],$z=["key"],vj;function Ba(e){"@babel/helpers - typeof";return Ba=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},Ba(e)}function xj(e,t){if(e==null)return{};var r=Tz(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tz(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bn(){return bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bn.apply(this,arguments)}function Xg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xg(Object(r),!0).forEach(function(n){pr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bj(n.key),n)}}function Dz(e,t,r){return t&&Qg(e.prototype,t),r&&Qg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iz(e,t,r){return t=Jo(t),Rz(e,yj()?Reflect.construct(t,r||[],Jo(e).constructor):t.apply(e,r))}function Rz(e,t){if(t&&(Ba(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lz(e)}function Lz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yj=function(){return!!e})()}function Jo(e){return Jo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jo(e)}function Fz(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&&dd(e,t)}function dd(e,t){return dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dd(e,t)}function pr(e,t,r){return t=bj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bj(e){var t=Bz(e,"string");return Ba(t)=="symbol"?t:t+""}function Bz(e,t){if(Ba(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ba(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lr=function(e){function t(){var r;Mz(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=Iz(this,t,[].concat(i)),pr(r,"state",{isAnimationFinished:!0}),pr(r,"id",Fn("recharts-area-")),pr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),fe(o)&&o()}),pr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),fe(o)&&o()}),r}return Fz(t,e),Dz(t,[{key:"renderDots",value:function(n,i,s){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,f=c.points,d=c.dataKey,m=ue(this.props,!1),h=ue(u,!0),g=f.map(function(v,x){var b=zr(zr(zr({key:"dot-".concat(x),r:3},m),h),{},{index:x,cx:v.x,cy:v.y,dataKey:d,value:v.value,payload:v.payload,points:f});return t.renderDotItem(u,b)}),p={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return k.createElement(_e,bn({className:"recharts-area-dots"},p),g)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,s=i.baseLine,o=i.points,l=i.strokeWidth,c=o[0].x,u=o[o.length-1].x,f=n*Math.abs(c-u),d=Kr(o.map(function(m){return m.y||0}));return J(s)&&typeof s=="number"?d=Math.max(s,d):s&&Array.isArray(s)&&s.length&&(d=Math.max(Kr(s.map(function(m){return m.y||0})),d)),J(d)?k.createElement("rect",{x:c<u?c:c-f,y:0,width:f,height:Math.floor(d+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,s=i.baseLine,o=i.points,l=i.strokeWidth,c=o[0].y,u=o[o.length-1].y,f=n*Math.abs(c-u),d=Kr(o.map(function(m){return m.x||0}));return J(s)&&typeof s=="number"?d=Math.max(s,d):s&&Array.isArray(s)&&s.length&&(d=Math.max(Kr(s.map(function(m){return m.x||0})),d)),J(d)?k.createElement("rect",{x:0,y:c<u?c:c-f,width:d+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,s,o){var l=this.props,c=l.layout,u=l.type,f=l.stroke,d=l.connectNulls,m=l.isRange;l.ref;var h=xj(l,Ez);return k.createElement(_e,{clipPath:s?"url(#clipPath-".concat(o,")"):null},k.createElement(_n,bn({},ue(h,!0),{points:n,connectNulls:d,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),f!=="none"&&k.createElement(_n,bn({},ue(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:n})),f!=="none"&&m&&k.createElement(_n,bn({},ue(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var s=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,m=o.animationEasing,h=o.animationId,g=this.state,p=g.prevPoints,v=g.prevBaseLine;return k.createElement(or,{begin:f,duration:d,isActive:u,easing:m,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var b=x.t;if(p){var j=p.length/l.length,N=l.map(function(O,A){var C=Math.floor(A*j);if(p[C]){var P=p[C],M=rt(P.x,O.x),E=rt(P.y,O.y);return zr(zr({},O),{},{x:M(b),y:E(b)})}return O}),y;if(J(c)&&typeof c=="number"){var w=rt(v,c);y=w(b)}else if(xe(c)||Za(c)){var _=rt(v,0);y=_(b)}else y=c.map(function(O,A){var C=Math.floor(A*j);if(v[C]){var P=v[C],M=rt(P.x,O.x),E=rt(P.y,O.y);return zr(zr({},O),{},{x:M(b),y:E(b)})}return O});return s.renderAreaStatically(N,y,n,i)}return k.createElement(_e,null,k.createElement("defs",null,k.createElement("clipPath",{id:"animationClipPath-".concat(i)},s.renderClipRect(b))),k.createElement(_e,{clipPath:"url(#animationClipPath-".concat(i,")")},s.renderAreaStatically(l,c,n,i)))})}},{key:"renderArea",value:function(n,i){var s=this.props,o=s.points,l=s.baseLine,c=s.isAnimationActive,u=this.state,f=u.prevPoints,d=u.prevBaseLine,m=u.totalLength;return c&&o&&o.length&&(!f&&m>0||!$n(f,o)||!$n(d,l))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,l,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,o=i.dot,l=i.points,c=i.className,u=i.top,f=i.left,d=i.xAxis,m=i.yAxis,h=i.width,g=i.height,p=i.isAnimationActive,v=i.id;if(s||!l||!l.length)return null;var x=this.state.isAnimationFinished,b=l.length===1,j=je("recharts-area",c),N=d&&d.allowDataOverflow,y=m&&m.allowDataOverflow,w=N||y,_=xe(v)?this.id:v,O=(n=ue(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=O.r,C=A===void 0?3:A,P=O.strokeWidth,M=P===void 0?2:P,E=sx(o)?o:{},T=E.clipDot,$=T===void 0?!0:T,I=C*2+M;return k.createElement(_e,{className:j},N||y?k.createElement("defs",null,k.createElement("clipPath",{id:"clipPath-".concat(_)},k.createElement("rect",{x:N?f:f-h/2,y:y?u:u-g/2,width:N?h:h*2,height:y?g:g*2})),!$&&k.createElement("clipPath",{id:"clipPath-dots-".concat(_)},k.createElement("rect",{x:f-I/2,y:u-I/2,width:h+I,height:g+I}))):null,b?null:this.renderArea(w,_),(o||b)&&this.renderDots(w,$,_),(!p||x)&&vr.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(S.PureComponent);vj=lr;pr(lr,"displayName","Area");pr(lr,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ar.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});pr(lr,"getBaseValue",function(e,t,r,n){var i=e.layout,s=e.baseValue,o=t.props.baseValue,l=o??s;if(J(l)&&typeof l=="number")return l;var c=i==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return l==="dataMin"?d:l==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});pr(lr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,s=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,m=e.offset,h=t.layout,g=u&&u.length,p=vj.getBaseValue(t,r,n,i),v=h==="horizontal",x=!1,b=d.map(function(N,y){var w;g?w=u[f+y]:(w=Ke(N,c),Array.isArray(w)?x=!0:w=[p,w]);var _=w[1]==null||g&&Ke(N,c)==null;return v?{x:Po({axis:n,ticks:s,bandSize:l,entry:N,index:y}),y:_?null:i.scale(w[1]),value:w,payload:N}:{x:_?null:n.scale(w[1]),y:Po({axis:i,ticks:o,bandSize:l,entry:N,index:y}),value:w,payload:N}}),j;return g||x?j=b.map(function(N){var y=Array.isArray(N.value)?N.value[0]:null;return v?{x:N.x,y:y!=null&&N.y!=null?i.scale(y):null}:{x:y!=null?n.scale(y):null,y:N.y}}):j=v?i.scale(p):n.scale(p),zr({points:b,baseLine:j,layout:h,isRange:x},m)});pr(lr,"renderDotItem",function(e,t){var r;if(k.isValidElement(e))r=k.cloneElement(e,t);else if(fe(e))r=e(t);else{var n=je("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,s=xj(t,$z);r=k.createElement(_s,bn({},s,{key:i,className:n}))}return r});function qa(e){"@babel/helpers - typeof";return qa=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},qa(e)}function qz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nj(n.key),n)}}function zz(e,t,r){return t&&Uz(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wz(e,t,r){return t=Zo(t),Vz(e,jj()?Reflect.construct(t,r||[],Zo(e).constructor):t.apply(e,r))}function Vz(e,t){if(t&&(qa(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kz(e)}function Kz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jj=function(){return!!e})()}function Zo(e){return Zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zo(e)}function Gz(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&&fd(e,t)}function fd(e,t){return fd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fd(e,t)}function wj(e,t,r){return t=Nj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nj(e){var t=Hz(e,"string");return qa(t)=="symbol"?t:t+""}function Hz(e,t){if(qa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},md.apply(this,arguments)}function Yz(e){var t=e.xAxisId,r=$f(),n=Tf(),i=nj(t);return i==null?null:S.createElement(si,md({},i,{className:je("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Cr(o,!0)}}))}var ir=function(e){function t(){return qz(this,t),Wz(this,t,arguments)}return Gz(t,e),zz(t,[{key:"render",value:function(){return S.createElement(Yz,this.props)}}])}(S.Component);wj(ir,"displayName","XAxis");wj(ir,"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 Ua(e){"@babel/helpers - typeof";return Ua=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},Ua(e)}function Xz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Aj(n.key),n)}}function Jz(e,t,r){return t&&Qz(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zz(e,t,r){return t=el(t),eW(e,_j()?Reflect.construct(t,r||[],el(e).constructor):t.apply(e,r))}function eW(e,t){if(t&&(Ua(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tW(e)}function tW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_j=function(){return!!e})()}function el(e){return el=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},el(e)}function rW(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&&hd(e,t)}function hd(e,t){return hd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hd(e,t)}function Sj(e,t,r){return t=Aj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aj(e){var t=nW(e,"string");return Ua(t)=="symbol"?t:t+""}function nW(e,t){if(Ua(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ua(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pd.apply(this,arguments)}var aW=function(t){var r=t.yAxisId,n=$f(),i=Tf(),s=aj(r);return s==null?null:S.createElement(si,pd({},s,{className:je("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(l){return Cr(l,!0)}}))},sr=function(e){function t(){return Xz(this,t),Zz(this,t,arguments)}return rW(t,e),Jz(t,[{key:"render",value:function(){return S.createElement(aW,this.props)}}])}(S.Component);Sj(sr,"displayName","YAxis");Sj(sr,"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 Jg(e){return lW(e)||oW(e)||sW(e)||iW()}function iW(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 126In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sW(e,t){if(e){if(typeof e=="string")return gd(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 gd(e,t)}}function oW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lW(e){if(Array.isArray(e))return gd(e)}function gd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vd=function(t,r,n,i,s){var o=It(t,Df),l=It(t,Vl),c=[].concat(Jg(o),Jg(l)),u=It(t,Gl),f="".concat(i,"Id"),d=i[0],m=r;if(c.length&&(m=c.reduce(function(p,v){if(v.props[f]===n&&xr(v.props,"extendDomain")&&J(v.props[d])){var x=v.props[d];return[Math.min(p[0],x),Math.max(p[1],x)]}return p},m)),u.length){var h="".concat(d,"1"),g="".concat(d,"2");m=u.reduce(function(p,v){if(v.props[f]===n&&xr(v.props,"extendDomain")&&J(v.props[h])&&J(v.props[g])){var x=v.props[h],b=v.props[g];return[Math.min(p[0],x,b),Math.max(p[1],x,b)]}return p},m)}return s&&s.length&&(m=s.reduce(function(p,v){return J(v)?[Math.min(p[0],v),Math.max(p[1],v)]:p},m)),m},Oj={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function s(c,u,f,d,m){if(typeof f!="function")throw new TypeError("The listener must be a function");var h=new i(f,d||c,m),g=r?r+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],h]:c._events[g].push(h):(c._events[g]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var m=0,h=d.length,g=new Array(h);m<h;m++)g[m]=d[m].fn;return g},l.prototype.listenerCount=function(u){var f=r?r+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,m,h,g){var p=r?r+u:u;if(!this._events[p])return!1;var v=this._events[p],x=arguments.length,b,j;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,f),!0;case 3:return v.fn.call(v.context,f,d),!0;case 4:return v.fn.call(v.context,f,d,m),!0;case 5:return v.fn.call(v.context,f,d,m,h),!0;case 6:return v.fn.call(v.context,f,d,m,h,g),!0}for(j=1,b=new Array(x-1);j<x;j++)b[j-1]=arguments[j];v.fn.apply(v.context,b)}else{var N=v.length,y;for(j=0;j<N;j++)switch(v[j].once&&this.removeListener(u,v[j].fn,void 0,!0),x){case 1:v[j].fn.call(v[j].context);break;case 2:v[j].fn.call(v[j].context,f);break;case 3:v[j].fn.call(v[j].context,f,d);break;case 4:v[j].fn.call(v[j].context,f,d,m);break;default:if(!b)for(y=1,b=new Array(x-1);y<x;y++)b[y-1]=arguments[y];v[j].fn.apply(v[j].context,b)}}return!0},l.prototype.on=function(u,f,d){return s(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return s(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,m){var h=r?r+u:u;if(!this._events[h])return this;if(!f)return o(this,h),this;var g=this._events[h];if(g.fn)g.fn===f&&(!m||g.once)&&(!d||g.context===d)&&o(this,h);else{for(var p=0,v=[],x=g.length;p<x;p++)(g[p].fn!==f||m&&!g[p].once||d&&g[p].context!==d)&&v.push(g[p]);v.length?this._events[h]=v.length===1?v[0]:v:o(this,h)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&o(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(Oj);var cW=Oj.exports;const uW=De(cW);var Pc=new uW,Cc="recharts.syncMouseEvents";function ms(e){"@babel/helpers - typeof";return ms=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},ms(e)}function dW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Pj(n.key),n)}}function mW(e,t,r){return t&&fW(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function kc(e,t,r){return t=Pj(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pj(e){var t=hW(e,"string");return ms(t)=="symbol"?t:t+""}function hW(e,t){if(ms(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ms(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pW=function(){function e(){dW(this,e),kc(this,"activeIndex",0),kc(this,"coordinateList",[]),kc(this,"layout","horizontal")}return mW(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,s=i===void 0?null:i,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,f=r.offset,d=f===void 0?null:f,m=r.mouseHandlerCallback,h=m===void 0?null:m;this.coordinateList=(n=s??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=h??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,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,o=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=s+c+u,m=o+this.offset.top+l/2+f;this.mouseHandlerCallback({pageX:d,pageY:m})}}}])}();function gW(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&J(n)&&J(i))return!0}return!1}function vW(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function Cj(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,s=e.endAngle,o=Le(t,r,n,i),l=Le(t,r,n,s);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:s}}function xW(e,t,r){var n,i,s,o;if(e==="horizontal")n=t.x,s=n,i=r.top,o=r.top+r.height;else if(e==="vertical")i=t.y,o=i,n=r.left,s=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,f=t.outerRadius,d=t.angle,m=Le(l,c,u,d),h=Le(l,c,f,d);n=m.x,i=m.y,s=h.x,o=h.y}else return Cj(t);return[{x:n,y:i},{x:s,y:o}]}function hs(e){"@babel/helpers - typeof";return hs=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},hs(e)}function Zg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Us(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zg(Object(r),!0).forEach(function(n){yW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yW(e,t,r){return t=bW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bW(e){var t=jW(e,"string");return hs(t)=="symbol"?t:t+""}function jW(e,t){if(hs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wW(e){var t,r,n=e.element,i=e.tooltipEventType,s=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,f=e.tooltipAxisBandSize,d=e.layout,m=e.chartName,h=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!h||!s||!o||m!=="ScatterChart"&&i!=="axis")return null;var g,p=_n;if(m==="ScatterChart")g=o,p=kB;else if(m==="BarChart")g=vW(d,o,c,f),p=Of;else if(d==="radial"){var v=Cj(o),x=v.cx,b=v.cy,j=v.radius,N=v.startAngle,y=v.endAngle;g={cx:x,cy:b,startAngle:N,endAngle:y,innerRadius:j,outerRadius:j},p=Sb}else g={points:xW(d,o,c)},p=_n;var w=Us(Us(Us(Us({stroke:"#ccc",pointerEvents:"none"},c),g),ue(h,!1)),{},{payload:l,payloadIndex:u,className:je("recharts-tooltip-cursor",h.className)});return S.isValidElement(h)?S.cloneElement(h,w):S.createElement(p,w)}var NW=["item"],_W=["children","className","width","height","style","compact","title","desc"];function za(e){"@babel/helpers - typeof";return za=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},za(e)}function aa(){return aa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aa.apply(this,arguments)}function ev(e,t){return OW(e)||AW(e,t)||Ej(e,t)||SW()}function SW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 127In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AW(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,u=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}function OW(e){if(Array.isArray(e))return e}function tv(e,t){if(e==null)return{};var r=PW(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function CW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$j(n.key),n)}}function EW(e,t,r){return t&&kW(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $W(e,t,r){return t=tl(t),TW(e,kj()?Reflect.construct(t,r||[],tl(e).constructor):t.apply(e,r))}function TW(e,t){if(t&&(za(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MW(e)}function MW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kj=function(){return!!e})()}function tl(e){return tl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tl(e)}function DW(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&&xd(e,t)}function xd(e,t){return xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xd(e,t)}function Wa(e){return LW(e)||RW(e)||Ej(e)||IW()}function IW(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 128In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ej(e,t){if(e){if(typeof e=="string")return yd(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 yd(e,t)}}function RW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function LW(e){if(Array.isArray(e))return yd(e)}function yd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rv(Object(r),!0).forEach(function(n){de(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function de(e,t,r){return t=$j(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $j(e){var t=FW(e,"string");return za(t)=="symbol"?t:t+""}function FW(e,t){if(za(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(za(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BW={xAxis:["bottom","top"],yAxis:["left","right"]},qW={width:"100%",height:"100%"},Tj={x:0,y:0};function zs(e){return e}var UW=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},zW=function(t,r,n,i){var s=r.find(function(f){return f&&f.index===n});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var o=s.coordinate,l=i.radius;return W(W(W({},i),Le(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=s.coordinate,u=i.angle;return W(W(W({},i),Le(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return Tj},Hl=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,s=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Wa(l),Wa(u)):l},[]);return o.length>0?o:t&&t.length&&J(i)&&J(s)?t.slice(i,s+1):[]};function Mj(e){return e==="number"?[0,"auto"]:void 0}var bd=function(t,r,n,i){var s=t.graphicalItems,o=t.tooltipAxis,l=Hl(r,t);return n<0||!s||!s.length||n>=l.length?null:s.reduce(function(c,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var h=d===void 0?l:d;m=Zs(h,o.dataKey,i)}else m=d&&d[n]||l[n];return m?[].concat(Wa(c),[yb(u,m)]):c},[])},nv=function(t,r,n,i){var s=i||{x:t.chartX,y:t.chartY},o=UW(s,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,f=iL(o,l,u,c);if(f>=0&&u){var d=u[f]&&u[f].value,m=bd(t,r,f,d),h=zW(n,l,f,s);return{activeTooltipIndex:f,activeLabel:d,activePayload:m,activeCoordinate:h}}return null},WW=function(t,r){var n=r.axes,i=r.graphicalItems,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,m=t.stackOffset,h=mb(f,s);return n.reduce(function(g,p){var v,x=p.type.defaultProps!==void 0?W(W({},p.type.defaultProps),p.props):p.props,b=x.type,j=x.dataKey,N=x.allowDataOverflow,y=x.allowDuplicatedCategory,w=x.scale,_=x.ticks,O=x.includeHidden,A=x[o];if(g[A])return g;var C=Hl(t.data,{graphicalItems:i.filter(function(D){var Q,ae=o in D.props?D.props[o]:(Q=D.type.defaultProps)===null||Q===void 0?void 0:Q[o];return ae===A}),dataStartIndex:c,dataEndIndex:u}),P=C.length,M,E,T;gW(x.domain,N,b)&&(M=Tu(x.domain,null,N),h&&(b==="number"||w!=="auto")&&(T=Ai(C,j,"category")));var $=Mj(b);if(!M||M.length===0){var I,B=(I=x.domain)!==null&&I!==void 0?I:$;if(j){if(M=Ai(C,j,b),b==="category"&&h){var L=YS(M);y&&L?(E=M,M=qo(0,P)):y||(M=Np(B,M,p).reduce(function(D,Q){return D.indexOf(Q)>=0?D:[].concat(Wa(D),[Q])},[]))}else if(b==="category")y?M=M.filter(function(D){return D!==""&&!xe(D)}):M=Np(B,M,p).reduce(function(D,Q){return D.indexOf(Q)>=0||Q===""||xe(Q)?D:[].concat(Wa(D),[Q])},[]);else if(b==="number"){var X=uL(C,i.filter(function(D){var Q,ae,te=o in D.props?D.props[o]:(Q=D.type.defaultProps)===null||Q===void 0?void 0:Q[o],pe="hide"in D.props?D.props.hide:(ae=D.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return te===A&&(O||!pe)}),j,s,f);X&&(M=X)}h&&(b==="number"||w!=="auto")&&(T=Ai(C,j,"category"))}else h?M=qo(0,P):l&&l[A]&&l[A].hasStack&&b==="number"?M=m==="expand"?[0,1]:xb(l[A].stackGroups,c,u):M=fb(C,i.filter(function(D){var Q=o in D.props?D.props[o]:D.type.defaultProps[o],ae="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return Q===A&&(O||!ae)}),b,f,!0);if(b==="number")M=vd(d,M,A,s,_),B&&(M=Tu(B,M,N));else if(b==="category"&&B){var z=B,U=M.every(function(D){return z.indexOf(D)>=0});U&&(M=z)}}return W(W({},g),{},de({},A,W(W({},x),{},{axisType:s,domain:M,categoricalDomain:T,duplicateDomain:E,originalDomain:(v=x.domain)!==null&&v!==void 0?v:$,isCategorical:h,layout:f})))},{})},VW=function(t,r){var n=r.graphicalItems,i=r.Axis,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,m=Hl(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),h=m.length,g=mb(f,s),p=-1;return n.reduce(function(v,x){var b=x.type.defaultProps!==void 0?W(W({},x.type.defaultProps),x.props):x.props,j=b[o],N=Mj("number");if(!v[j]){p++;var y;return g?y=qo(0,h):l&&l[j]&&l[j].hasStack?(y=xb(l[j].stackGroups,c,u),y=vd(d,y,j,s)):(y=Tu(N,fb(m,n.filter(function(w){var _,O,A=o in w.props?w.props[o]:(_=w.type.defaultProps)===null||_===void 0?void 0:_[o],C="hide"in w.props?w.props.hide:(O=w.type.defaultProps)===null||O===void 0?void 0:O.hide;return A===j&&!C}),"number",f),i.defaultProps.allowDataOverflow),y=vd(d,y,j,s)),W(W({},v),{},de({},j,W(W({axisType:s},i.defaultProps),{},{hide:!0,orientation:Dt(BW,"".concat(s,".").concat(p%2),null),domain:y,originalDomain:N,isCategorical:g,layout:f})))}return v},{})},KW=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,s=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(i,"Id"),m=It(f,s),h={};return m&&m.length?h=WW(t,{axes:m,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(h=VW(t,{Axis:s,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),h},GW=function(t){var r=Vr(t),n=Cr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Zd(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Co(r,n)}},av=function(t){var r=t.children,n=t.defaultShowTooltip,i=Et(r,Ta),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},HW=function(t){return!t||!t.length?!1:t.some(function(r){var n=Er(r&&r.type);return n&&n.indexOf("Bar")>=0})},iv=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"}},YW=function(t,r){var n=t.props,i=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,f=n.height,d=n.children,m=n.margin||{},h=Et(d,Ta),g=Et(d,nr),p=Object.keys(c).reduce(function(y,w){var _=c[w],O=_.orientation;return!_.mirror&&!_.hide?W(W({},y),{},de({},O,y[O]+_.width)):y},{left:m.left||0,right:m.right||0}),v=Object.keys(o).reduce(function(y,w){var _=o[w],O=_.orientation;return!_.mirror&&!_.hide?W(W({},y),{},de({},O,Dt(y,"".concat(O))+_.height)):y},{top:m.top||0,bottom:m.bottom||0}),x=W(W({},v),p),b=x.bottom;h&&(x.bottom+=h.props.height||Ta.defaultProps.height),g&&r&&(x=lL(x,i,n,r));var j=u-x.left-x.right,N=f-x.top-x.bottom;return W(W({brushBottom:b},x),{},{width:Math.max(j,0),height:Math.max(N,0)})},XW=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Yl=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,m=function(x,b){var j=b.graphicalItems,N=b.stackGroups,y=b.offset,w=b.updateId,_=b.dataStartIndex,O=b.dataEndIndex,A=x.barSize,C=x.layout,P=x.barGap,M=x.barCategoryGap,E=x.maxBarSize,T=iv(C),$=T.numericAxisName,I=T.cateAxisName,B=HW(j),L=[];return j.forEach(function(X,z){var U=Hl(x.data,{graphicalItems:[X],dataStartIndex:_,dataEndIndex:O}),D=X.type.defaultProps!==void 0?W(W({},X.type.defaultProps),X.props):X.props,Q=D.dataKey,ae=D.maxBarSize,te=D["".concat($,"Id")],pe=D["".concat(I,"Id")],Ne={},Z=c.reduce(function(sn,on){var Xl=b["".concat(on.axisType,"Map")],Lf=D["".concat(on.axisType,"Id")];Xl&&Xl[Lf]||on.axisType==="zAxis"||Mn();var Ff=Xl[Lf];return W(W({},sn),{},de(de({},on.axisType,Ff),"".concat(on.axisType,"Ticks"),Cr(Ff)))},Ne),R=Z[I],re=Z["".concat(I,"Ticks")],se=N&&N[te]&&N[te].hasStack&&yL(X,N[te].stackGroups),V=Er(X.type).indexOf("Bar")>=0,Ae=Co(R,re),ce=[],we=B&&sL({barSize:A,stackGroups:N,totalSize:XW(Z,I)});if(V){var $e,ze,Rt=xe(ae)?E:ae,zn=($e=(ze=Co(R,re,!0))!==null&&ze!==void 0?ze:Rt)!==null&&$e!==void 0?$e:0;ce=oL({barGap:P,barCategoryGap:M,bandSize:zn!==Ae?zn:Ae,sizeList:we[pe],maxBarSize:Rt}),zn!==Ae&&(ce=ce.map(function(sn){return W(W({},sn),{},{position:W(W({},sn.position),{},{offset:sn.position.offset-zn/2})})}))}var Ss=X&&X.type&&X.type.getComposedData;Ss&&L.push({props:W(W({},Ss(W(W({},Z),{},{displayedData:U,props:x,dataKey:Q,item:X,bandSize:Ae,barPosition:ce,offset:y,stackedData:se,layout:C,dataStartIndex:_,dataEndIndex:O}))),{},de(de(de({key:X.key||"item-".concat(z)},$,Z[$]),I,Z[I]),"animationId",w)),childIndex:oA(X,x.children),item:X})}),L},h=function(x,b){var j=x.props,N=x.dataStartIndex,y=x.dataEndIndex,w=x.updateId;if(!vm({props:j}))return null;var _=j.children,O=j.layout,A=j.stackOffset,C=j.data,P=j.reverseStackOrder,M=iv(O),E=M.numericAxisName,T=M.cateAxisName,$=It(_,n),I=vL(C,$,"".concat(E,"Id"),"".concat(T,"Id"),A,P),B=c.reduce(function(D,Q){var ae="".concat(Q.axisType,"Map");return W(W({},D),{},de({},ae,KW(j,W(W({},Q),{},{graphicalItems:$,stackGroups:Q.axisType===E&&I,dataStartIndex:N,dataEndIndex:y}))))},{}),L=YW(W(W({},B),{},{props:j,graphicalItems:$}),b==null?void 0:b.legendBBox);Object.keys(B).forEach(function(D){B[D]=f(j,B[D],L,D.replace("Map",""),r)});var X=B["".concat(T,"Map")],z=GW(X),U=m(j,W(W({},B),{},{dataStartIndex:N,dataEndIndex:y,updateId:w,graphicalItems:$,stackGroups:I,offset:L}));return W(W({formattedGraphicalItems:U,graphicalItems:$,offset:L,stackGroups:I},z),B)},g=function(v){function x(b){var j,N,y;return CW(this,x),y=$W(this,x,[b]),de(y,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),de(y,"accessibilityManager",new pW),de(y,"handleLegendBBoxUpdate",function(w){if(w){var _=y.state,O=_.dataStartIndex,A=_.dataEndIndex,C=_.updateId;y.setState(W({legendBBox:w},h({props:y.props,dataStartIndex:O,dataEndIndex:A,updateId:C},W(W({},y.state),{},{legendBBox:w}))))}}),de(y,"handleReceiveSyncEvent",function(w,_,O){if(y.props.syncId===w){if(O===y.eventEmitterSymbol&&typeof y.props.syncMethod!="function")return;y.applySyncEvent(_)}}),de(y,"handleBrushChange",function(w){var _=w.startIndex,O=w.endIndex;if(_!==y.state.dataStartIndex||O!==y.state.dataEndIndex){var A=y.state.updateId;y.setState(function(){return W({dataStartIndex:_,dataEndIndex:O},h({props:y.props,dataStartIndex:_,dataEndIndex:O,updateId:A},y.state))}),y.triggerSyncEvent({dataStartIndex:_,dataEndIndex:O})}}),de(y,"handleMouseEnter",function(w){var _=y.getMouseInfo(w);if(_){var O=W(W({},_),{},{isTooltipActive:!0});y.setState(O),y.triggerSyncEvent(O);var A=y.props.onMouseEnter;fe(A)&&A(O,w)}}),de(y,"triggeredAfterMouseMove",function(w){var _=y.getMouseInfo(w),O=_?W(W({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};y.setState(O),y.triggerSyncEvent(O);var A=y.props.onMouseMove;fe(A)&&A(O,w)}),de(y,"handleItemMouseEnter",function(w){y.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),de(y,"handleItemMouseLeave",function(){y.setState(function(){return{isTooltipActive:!1}})}),de(y,"handleMouseMove",function(w){w.persist(),y.throttleTriggeredAfterMouseMove(w)}),de(y,"handleMouseLeave",function(w){y.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};y.setState(_),y.triggerSyncEvent(_);var O=y.props.onMouseLeave;fe(O)&&O(_,w)}),de(y,"handleOuterEvent",function(w){var _=sA(w),O=Dt(y.props,"".concat(_));if(_&&fe(O)){var A,C;/.*touch.*/i.test(_)?C=y.getMouseInfo(w.changedTouches[0]):C=y.getMouseInfo(w),O((A=C)!==null&&A!==void 0?A:{},w)}}),de(y,"handleClick",function(w){var _=y.getMouseInfo(w);if(_){var O=W(W({},_),{},{isTooltipActive:!0});y.setState(O),y.triggerSyncEvent(O);var A=y.props.onClick;fe(A)&&A(O,w)}}),de(y,"handleMouseDown",function(w){var _=y.props.onMouseDown;if(fe(_)){var O=y.getMouseInfo(w);_(O,w)}}),de(y,"handleMouseUp",function(w){var _=y.props.onMouseUp;if(fe(_)){var O=y.getMouseInfo(w);_(O,w)}}),de(y,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&y.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),de(y,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&y.handleMouseDown(w.changedTouches[0])}),de(y,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&y.handleMouseUp(w.changedTouches[0])}),de(y,"handleDoubleClick",function(w){var _=y.props.onDoubleClick;if(fe(_)){var O=y.getMouseInfo(w);_(O,w)}}),de(y,"handleContextMenu",function(w){var _=y.props.onContextMenu;if(fe(_)){var O=y.getMouseInfo(w);_(O,w)}}),de(y,"triggerSyncEvent",function(w){y.props.syncId!==void 0&&Pc.emit(Cc,y.props.syncId,w,y.eventEmitterSymbol)}),de(y,"applySyncEvent",function(w){var _=y.props,O=_.layout,A=_.syncMethod,C=y.state.updateId,P=w.dataStartIndex,M=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)y.setState(W({dataStartIndex:P,dataEndIndex:M},h({props:y.props,dataStartIndex:P,dataEndIndex:M,updateId:C},y.state)));else if(w.activeTooltipIndex!==void 0){var E=w.chartX,T=w.chartY,$=w.activeTooltipIndex,I=y.state,B=I.offset,L=I.tooltipTicks;if(!B)return;if(typeof A=="function")$=A(L,w);else if(A==="value"){$=-1;for(var X=0;X<L.length;X++)if(L[X].value===w.activeLabel){$=X;break}}var z=W(W({},B),{},{x:B.left,y:B.top}),U=Math.min(E,z.x+z.width),D=Math.min(T,z.y+z.height),Q=L[$]&&L[$].value,ae=bd(y.state,y.props.data,$),te=L[$]?{x:O==="horizontal"?L[$].coordinate:U,y:O==="horizontal"?D:L[$].coordinate}:Tj;y.setState(W(W({},w),{},{activeLabel:Q,activeCoordinate:te,activePayload:ae,activeTooltipIndex:$}))}else y.setState(w)}),de(y,"renderCursor",function(w){var _,O=y.state,A=O.isTooltipActive,C=O.activeCoordinate,P=O.activePayload,M=O.offset,E=O.activeTooltipIndex,T=O.tooltipAxisBandSize,$=y.getTooltipEventType(),I=(_=w.props.active)!==null&&_!==void 0?_:A,B=y.props.layout,L=w.key||"_recharts-cursor";return k.createElement(wW,{key:L,activeCoordinate:C,activePayload:P,activeTooltipIndex:E,chartName:r,element:w,isActive:I,layout:B,offset:M,tooltipAxisBandSize:T,tooltipEventType:$})}),de(y,"renderPolarAxis",function(w,_,O){var A=Dt(w,"type.axisType"),C=Dt(y.state,"".concat(A,"Map")),P=w.type.defaultProps,M=P!==void 0?W(W({},P),w.props):w.props,E=C&&C[M["".concat(A,"Id")]];return S.cloneElement(w,W(W({},E),{},{className:je(A,E.className),key:w.key||"".concat(_,"-").concat(O),ticks:Cr(E,!0)}))}),de(y,"renderPolarGrid",function(w){var _=w.props,O=_.radialLines,A=_.polarAngles,C=_.polarRadius,P=y.state,M=P.radiusAxisMap,E=P.angleAxisMap,T=Vr(M),$=Vr(E),I=$.cx,B=$.cy,L=$.innerRadius,X=$.outerRadius;return S.cloneElement(w,{polarAngles:Array.isArray(A)?A:Cr($,!0).map(function(z){return z.coordinate}),polarRadius:Array.isArray(C)?C:Cr(T,!0).map(function(z){return z.coordinate}),cx:I,cy:B,innerRadius:L,outerRadius:X,key:w.key||"polar-grid",radialLines:O})}),de(y,"renderLegend",function(){var w=y.state.formattedGraphicalItems,_=y.props,O=_.children,A=_.width,C=_.height,P=y.props.margin||{},M=A-(P.left||0)-(P.right||0),E=ub({children:O,formattedGraphicalItems:w,legendWidth:M,legendContent:u});if(!E)return null;var T=E.item,$=tv(E,NW);return S.cloneElement(T,W(W({},$),{},{chartWidth:A,chartHeight:C,margin:P,onBBoxUpdate:y.handleLegendBBoxUpdate}))}),de(y,"renderTooltip",function(){var w,_=y.props,O=_.children,A=_.accessibilityLayer,C=Et(O,gt);if(!C)return null;var P=y.state,M=P.isTooltipActive,E=P.activeCoordinate,T=P.activePayload,$=P.activeLabel,I=P.offset,B=(w=C.props.active)!==null&&w!==void 0?w:M;return S.cloneElement(C,{viewBox:W(W({},I),{},{x:I.left,y:I.top}),active:B,label:$,payload:B?T:[],coordinate:E,accessibilityLayer:A})}),de(y,"renderBrush",function(w){var _=y.props,O=_.margin,A=_.data,C=y.state,P=C.offset,M=C.dataStartIndex,E=C.dataEndIndex,T=C.updateId;return S.cloneElement(w,{key:w.key||"_recharts-brush",onChange:Ls(y.handleBrushChange,w.props.onChange),data:A,x:J(w.props.x)?w.props.x:P.left,y:J(w.props.y)?w.props.y:P.top+P.height+P.brushBottom-(O.bottom||0),width:J(w.props.width)?w.props.width:P.width,startIndex:M,endIndex:E,updateId:"brush-".concat(T)})}),de(y,"renderReferenceElement",function(w,_,O){if(!w)return null;var A=y,C=A.clipPathId,P=y.state,M=P.xAxisMap,E=P.yAxisMap,T=P.offset,$=w.type.defaultProps||{},I=w.props,B=I.xAxisId,L=B===void 0?$.xAxisId:B,X=I.yAxisId,z=X===void 0?$.yAxisId:X;return S.cloneElement(w,{key:w.key||"".concat(_,"-").concat(O),xAxis:M[L],yAxis:E[z],viewBox:{x:T.left,y:T.top,width:T.width,height:T.height},clipPathId:C})}),de(y,"renderActivePoints",function(w){var _=w.item,O=w.activePoint,A=w.basePoint,C=w.childIndex,P=w.isRange,M=[],E=_.props.key,T=_.item.type.defaultProps!==void 0?W(W({},_.item.type.defaultProps),_.item.props):_.item.props,$=T.activeDot,I=T.dataKey,B=W(W({index:C,dataKey:I,cx:O.x,cy:O.y,r:4,fill:Af(_.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},ue($,!1)),eo($));return M.push(x.renderActiveDot($,B,"".concat(E,"-activePoint-").concat(C))),A?M.push(x.renderActiveDot($,W(W({},B),{},{cx:A.x,cy:A.y}),"".concat(E,"-basePoint-").concat(C))):P&&M.push(null),M}),de(y,"renderGraphicChild",function(w,_,O){var A=y.filterFormatItem(w,_,O);if(!A)return null;var C=y.getTooltipEventType(),P=y.state,M=P.isTooltipActive,E=P.tooltipAxis,T=P.activeTooltipIndex,$=P.activeLabel,I=y.props.children,B=Et(I,gt),L=A.props,X=L.points,z=L.isRange,U=L.baseLine,D=A.item.type.defaultProps!==void 0?W(W({},A.item.type.defaultProps),A.item.props):A.item.props,Q=D.activeDot,ae=D.hide,te=D.activeBar,pe=D.activeShape,Ne=!!(!ae&&M&&B&&(Q||te||pe)),Z={};C!=="axis"&&B&&B.props.trigger==="click"?Z={onClick:Ls(y.handleItemMouseEnter,w.props.onClick)}:C!=="axis"&&(Z={onMouseLeave:Ls(y.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:Ls(y.handleItemMouseEnter,w.props.onMouseEnter)});var R=S.cloneElement(w,W(W({},A.props),Z));function re(on){return typeof E.dataKey=="function"?E.dataKey(on.payload):null}if(Ne)if(T>=0){var se,V;if(E.dataKey&&!E.allowDuplicatedCategory){var Ae=typeof E.dataKey=="function"?re:"payload.".concat(E.dataKey.toString());se=Zs(X,Ae,$),V=z&&U&&Zs(U,Ae,$)}else se=X==null?void 0:X[T],V=z&&U&&U[T];if(pe||te){var ce=w.props.activeIndex!==void 0?w.props.activeIndex:T;return[S.cloneElement(w,W(W(W({},A.props),Z),{},{activeIndex:ce})),null,null]}if(!xe(se))return[R].concat(Wa(y.renderActivePoints({item:A,activePoint:se,basePoint:V,childIndex:T,isRange:z})))}else{var we,$e=(we=y.getItemByXY(y.state.activeCoordinate))!==null&&we!==void 0?we:{graphicalItem:R},ze=$e.graphicalItem,Rt=ze.item,zn=Rt===void 0?w:Rt,Ss=ze.childIndex,sn=W(W(W({},A.props),Z),{},{activeIndex:Ss});return[S.cloneElement(zn,sn),null,null]}return z?[R,null,null]:[R,null]}),de(y,"renderCustomized",function(w,_,O){return S.cloneElement(w,W(W({key:"recharts-customized-".concat(O)},y.props),y.state))}),de(y,"renderMap",{CartesianGrid:{handler:zs,once:!0},ReferenceArea:{handler:y.renderReferenceElement},ReferenceLine:{handler:zs},ReferenceDot:{handler:y.renderReferenceElement},XAxis:{handler:zs},YAxis:{handler:zs},Brush:{handler:y.renderBrush,once:!0},Bar:{handler:y.renderGraphicChild},Line:{handler:y.renderGraphicChild},Area:{handler:y.renderGraphicChild},Radar:{handler:y.renderGraphicChild},RadialBar:{handler:y.renderGraphicChild},Scatter:{handler:y.renderGraphicChild},Pie:{handler:y.renderGraphicChild},Funnel:{handler:y.renderGraphicChild},Tooltip:{handler:y.renderCursor,once:!0},PolarGrid:{handler:y.renderPolarGrid,once:!0},PolarAngleAxis:{handler:y.renderPolarAxis},PolarRadiusAxis:{handler:y.renderPolarAxis},Customized:{handler:y.renderCustomized}}),y.clipPathId="".concat((j=b.id)!==null&&j!==void 0?j:Fn("recharts"),"-clip"),y.throttleTriggeredAfterMouseMove=cy(y.triggeredAfterMouseMove,(N=b.throttleDelay)!==null&&N!==void 0?N:1e3/60),y.state={},y}return DW(x,v),EW(x,[{key:"componentDidMount",value:function(){var j,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,N=j.children,y=j.data,w=j.height,_=j.layout,O=Et(N,gt);if(O){var A=O.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var C=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,P=bd(this.state,y,A,C),M=this.state.tooltipTicks[A].coordinate,E=(this.state.offset.top+w)/2,T=_==="horizontal",$=T?{x:M,y:E}:{y:M,x:E},I=this.state.formattedGraphicalItems.find(function(L){var X=L.item;return X.type.name==="Scatter"});I&&($=W(W({},$),I.props.points[A].tooltipPosition),P=I.props.points[A].tooltipPayload);var B={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:C,activePayload:P,activeCoordinate:$};this.setState(B),this.renderCursor(O),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var y,w;this.accessibilityManager.setDetails({offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(j){Hc([Et(j.children,gt)],[Et(this.props.children,gt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=Et(this.props.children,gt);if(j&&typeof j.props.shared=="boolean"){var N=j.props.shared?"axis":"item";return l.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var N=this.container,y=N.getBoundingClientRect(),w=TD(y),_={chartX:Math.round(j.pageX-w.left),chartY:Math.round(j.pageY-w.top)},O=y.width/N.offsetWidth||1,A=this.inRange(_.chartX,_.chartY,O);if(!A)return null;var C=this.state,P=C.xAxisMap,M=C.yAxisMap,E=this.getTooltipEventType(),T=nv(this.state,this.props.data,this.props.layout,A);if(E!=="axis"&&P&&M){var $=Vr(P).scale,I=Vr(M).scale,B=$&&$.invert?$.invert(_.chartX):null,L=I&&I.invert?I.invert(_.chartY):null;return W(W({},_),{},{xValue:B,yValue:L},T)}return T?W(W({},_),T):null}},{key:"inRange",value:function(j,N){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=j/y,O=N/y;if(w==="horizontal"||w==="vertical"){var A=this.state.offset,C=_>=A.left&&_<=A.left+A.width&&O>=A.top&&O<=A.top+A.height;return C?{x:_,y:O}:null}var P=this.state,M=P.angleAxisMap,E=P.radiusAxisMap;if(M&&E){var T=Vr(M);return Ap({x:_,y:O},T)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,N=this.getTooltipEventType(),y=Et(j,gt),w={};y&&N==="axis"&&(y.props.trigger==="click"?w={onClick:this.handleClick}:w={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 _=eo(this.props,this.handleOuterEvent);return W(W({},_),w)}},{key:"addListener",value:function(){Pc.on(Cc,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Pc.removeListener(Cc,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,N,y){for(var w=this.state.formattedGraphicalItems,_=0,O=w.length;_<O;_++){var A=w[_];if(A.item===j||A.props.key===j.key||N===Er(A.item.type)&&y===A.childIndex)return A}return null}},{key:"renderClipPath",value:function(){var j=this.clipPathId,N=this.state.offset,y=N.left,w=N.top,_=N.height,O=N.width;return k.createElement("defs",null,k.createElement("clipPath",{id:j},k.createElement("rect",{x:y,y:w,height:_,width:O})))}},{key:"getXScales",value:function(){var j=this.state.xAxisMap;return j?Object.entries(j).reduce(function(N,y){var w=ev(y,2),_=w[0],O=w[1];return W(W({},N),{},de({},_,O.scale))},{}):null}},{key:"getYScales",value:function(){var j=this.state.yAxisMap;return j?Object.entries(j).reduce(function(N,y){var w=ev(y,2),_=w[0],O=w[1];return W(W({},N),{},de({},_,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(j){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[j])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(j){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[j])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(j){var N=this.state,y=N.formattedGraphicalItems,w=N.activeItem;if(y&&y.length)for(var _=0,O=y.length;_<O;_++){var A=y[_],C=A.props,P=A.item,M=P.type.defaultProps!==void 0?W(W({},P.type.defaultProps),P.props):P.props,E=Er(P.type);if(E==="Bar"){var T=(C.data||[]).find(function(L){return uB(j,L)});if(T)return{graphicalItem:A,payload:T}}else if(E==="RadialBar"){var $=(C.data||[]).find(function(L){return Ap(j,L)});if($)return{graphicalItem:A,payload:$}}else if(ql(A,w)||Ul(A,w)||ls(A,w)){var I=Jq({graphicalItem:A,activeTooltipItem:w,itemData:M.data}),B=M.activeIndex===void 0?I:M.activeIndex;return{graphicalItem:W(W({},A),{},{childIndex:B}),payload:ls(A,w)?M.data[I]:A.props.data[I]}}}return null}},{key:"render",value:function(){var j=this;if(!vm(this))return null;var N=this.props,y=N.children,w=N.className,_=N.width,O=N.height,A=N.style,C=N.compact,P=N.title,M=N.desc,E=tv(N,_W),T=ue(E,!1);if(C)return k.createElement(Mg,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},k.createElement(Xc,aa({},T,{width:_,height:O,title:P,desc:M}),this.renderClipPath(),ym(y,this.renderMap)));if(this.props.accessibilityLayer){var $,I;T.tabIndex=($=this.props.tabIndex)!==null&&$!==void 0?$:0,T.role=(I=this.props.role)!==null&&I!==void 0?I:"application",T.onKeyDown=function(L){j.accessibilityManager.keyboardEvent(L)},T.onFocus=function(){j.accessibilityManager.focus()}}var B=this.parseEventsOfWrapper();return k.createElement(Mg,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},k.createElement("div",aa({className:je("recharts-wrapper",w),style:W({position:"relative",curs
128or:"default",width:_,height:O},A)},B,{ref:function(X){j.container=X}}),k.createElement(Xc,aa({},T,{width:_,height:O,title:P,desc:M,style:qW}),this.renderClipPath(),ym(y,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(S.Component);de(g,"displayName",r),de(g,"defaultProps",W({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),de(g,"getDerivedStateFromProps",function(v,x){var b=v.dataKey,j=v.data,N=v.children,y=v.width,w=v.height,_=v.layout,O=v.stackOffset,A=v.margin,C=x.dataStartIndex,P=x.dataEndIndex;if(x.updateId===void 0){var M=av(v);return W(W(W({},M),{},{updateId:0},h(W(W({props:v},M),{},{updateId:0}),x)),{},{prevDataKey:b,prevData:j,prevWidth:y,prevHeight:w,prevLayout:_,prevStackOffset:O,prevMargin:A,prevChildren:N})}if(b!==x.prevDataKey||j!==x.prevData||y!==x.prevWidth||w!==x.prevHeight||_!==x.prevLayout||O!==x.prevStackOffset||!oa(A,x.prevMargin)){var E=av(v),T={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},$=W(W({},nv(x,j,_)),{},{updateId:x.updateId+1}),I=W(W(W({},E),T),$);return W(W(W({},I),h(W({props:v},I),x)),{},{prevDataKey:b,prevData:j,prevWidth:y,prevHeight:w,prevLayout:_,prevStackOffset:O,prevMargin:A,prevChildren:N})}if(!Hc(N,x.prevChildren)){var B,L,X,z,U=Et(N,Ta),D=U&&(B=(L=U.props)===null||L===void 0?void 0:L.startIndex)!==null&&B!==void 0?B:C,Q=U&&(X=(z=U.props)===null||z===void 0?void 0:z.endIndex)!==null&&X!==void 0?X:P,ae=D!==C||Q!==P,te=!xe(j),pe=te&&!ae?x.updateId:x.updateId+1;return W(W({updateId:pe},h(W(W({props:v},x),{},{updateId:pe,dataStartIndex:D,dataEndIndex:Q}),x)),{},{prevChildren:N,dataStartIndex:D,dataEndIndex:Q})}return null}),de(g,"renderActiveDot",function(v,x,b){var j;return S.isValidElement(v)?j=S.cloneElement(v,x):fe(v)?j=v(x):j=k.createElement(_s,x),k.createElement(_e,{className:"recharts-active-dot",key:b},j)});var p=S.forwardRef(function(x,b){return k.createElement(g,aa({},x,{ref:b}))});return p.displayName=g.displayName,p},QW=Yl({chartName:"LineChart",GraphicalChild:An,axisComponents:[{axisType:"xAxis",AxisComp:ir},{axisType:"yAxis",AxisComp:sr}],formatAxisMap:Pf}),jd=Yl({chartName:"BarChart",GraphicalChild:yr,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ir},{axisType:"yAxis",AxisComp:sr}],formatAxisMap:Pf}),JW=Yl({chartName:"PieChart",GraphicalChild:Ur,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Bl},{axisType:"radiusAxis",AxisComp:Ll}],formatAxisMap:CL,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Dj=Yl({chartName:"AreaChart",GraphicalChild:lr,axisComponents:[{axisType:"xAxis",AxisComp:ir},{axisType:"yAxis",AxisComp:sr}],formatAxisMap:Pf});const Ws=({title:e,value:t,icon:r,description:n})=>a.jsx(K,{children:a.jsx(H,{className:"p-6",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(r,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:e}),a.jsx("p",{className:"text-2xl font-bold",children:t}),n&&a.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]})})}),ZW=({supplierId:e})=>{const{data:t,isLoading:r}=hN(e);if(r)return a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})});const n=t&&(t.totalViews>0||t.totalEnquiries>0||t.totalSaves>0);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(Ws,{title:"Profile Views",value:(t==null?void 0:t.totalViews)||0,icon:br,description:"Last 6 months"}),a.jsx(Ws,{title:"Enquiries Received",value:(t==null?void 0:t.totalEnquiries)||0,icon:Tt,description:"Last 6 months"}),a.jsx(Ws,{title:"Saved by Couples",value:(t==null?void 0:t.totalSaves)||0,icon:mr,description:"Last 6 months"}),a.jsx(Ws,{title:"Conversion Rate",value:`${((t==null?void 0:t.conversionRate)||0).toFixed(1)}%`,icon:_t,description:"Views to enquiries"})]}),n?a.jsxs(a.Fragment,{children:[a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsx(le,{children:"Profile Views Over Time"}),a.jsx(he,{children:"Track how many couples have viewed your profile"})]}),a.jsx(H,{children:a.jsx("div",{className:"h-[300px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(jd,{data:(t==null?void 0:t.monthlyData)||[],children:[a.jsx(Sn,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(ir,{dataKey:"month",tick:{fill:"hsl(var(--muted-foreground))"},tickLine:{stroke:"hsl(var(--muted-foreground))"}}
128),a.jsx(sr,{tick:{fill:"hsl(var(--muted-foreground))"},tickLine:{stroke:"hsl(var(--muted-foreground))"}}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(yr,{dataKey:"views",fill:"hsl(var(--primary))",radius:[4,4,0,0]})]})})})})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsx(le,{children:"Engagement Trends"}),a.jsx(he,{children:"Compare views, enquiries, and saves over time"})]}),a.jsx(H,{children:a.jsx("div",{className:"h-[300px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(QW,{data:(t==null?void 0:t.monthlyData)||[],children:[a.jsx(Sn,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(ir,{dataKey:"month",tick:{fill:"hsl(var(--muted-foreground))"},tickLine:{stroke:"hsl(var(--muted-foreground))"}}),a.jsx(sr,{tick:{fill:"hsl(var(--muted-foreground))"},tickLine:{stroke:"hsl(var(--muted-foreground))"}}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(nr,{}),a.jsx(An,{type:"monotone",dataKey:"views",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{fill:"hsl(var(--primary))"}}),a.jsx(An,{type:"monotone",dataKey:"enquiries",stroke:"hsl(var(--gold))",strokeWidth:2,dot:{fill:"hsl(var(--gold))"}}),a.jsx(An,{type:"monotone",dataKey:"saves",stroke:"hsl(var(--destructive))",strokeWidth:2,dot:{fill:"hsl(var(--destructive))"}})]})})})})]})]}):a.jsx(K,{children:a.jsxs(H,{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(br,{className:"w-12 h-12 text-muted-foreground mb-4"}),a.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No Analytics Data Yet"}),a.jsx("p",{className:"text-muted-foreground max-w-md",children:"Once couples start viewing your profile and sending enquiries, you'll see your analytics here. Make sure your listing is complete to attract more visitors!"})]})})]})},Ij=e=>{const t=ur(),{data:r,isLoading:n}=Ge({queryKey:["supplier-promotions",e],queryFn:async()=>{if(!e)return[];const{data:l,error:c}=await Y.from("supplier_promotions").select("*").eq("supplier_id",e).order("created_at",{ascending:!1});if(c)throw c;return l},enabled:!!e}),i=Xe({mutationFn:async l=>{if(!e)throw new Error("No supplier ID");const{error:c}=await Y.from("supplier_promotions").insert({...l,supplier_id:e});if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-promotions",e]}),G.success("Promotion created")},onError:()=>{G.error("Failed to create promotion")}}),s=Xe({mutationFn:async({id:l,...c})=>{const{error:u}=await Y.from("supplier_promotions").update(c).eq("id",l);if(u)throw u},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-promotions",e]}),G.success("Promotion updated")},onError:()=>{G.error("Failed to update promotion")}}),o=Xe({mutationFn:async l=>{const{error:c}=await Y.from("supplier_promotions").delete().eq("id",l);if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-promotions",e]}),G.success("Promotion deleted")},onError:()=>{G.error("Failed to delete promotion")}});return{promotions:r||[],isLoading:n,createPromotion:i,updatePromotion:s,deletePromotion:o}},sv={title:"",description:"",discount_percentage:"",discount_amount:"",promo_code:"",valid_from:me(new Date,"yyyy-MM-dd"),valid_until:"",terms:"",is_active:!0},eV=({supplierId:e})=>{const{promotions:t,isLoading:r,createPromotion:n,updatePromotion:i,deletePromotion:s}=Ij(e),[o,l]=S.useState(!1),[c,u]=S.useState(null),[f,d]=S.useState(sv),m=()=>{u(null),d(sv),l(!0)},h=x=>{var b,j;
128u(x),d({title:x.title,description:x.description||"",discount_percentage:((b=x.discount_percentage)==null?void 0:b.toString())||"",discount_amount:((j=x.discount_amount)==null?void 0:j.toString())||"",promo_code:x.promo_code||"",valid_from:x.valid_from,valid_until:x.valid_until,terms:x.terms||"",is_active:x.is_active}),l(!0)},g=()=>{const x={title:f.title,description:f.description||null,discount_percentage:f.discount_percentage?parseInt(f.discount_percentage):null,discount_amount:f.discount_amount?parseFloat(f.discount_amount):null,promo_code:f.promo_code||null,valid_from:f.valid_from,valid_until:f.valid_until,terms:f.terms||null,is_active:f.is_active};c?i.mutate({id:c.id,...x}):n.mutate(x),l(!1)},p=x=>{s.mutate(x)},v=x=>x.is_active?U0(Ql(x.valid_until))?{label:"Expired",variant:"destructive"}:{label:"Active",variant:"default"}:{label:"Inactive",variant:"secondary"};return r?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Qr,{className:"w-5 h-5 text-primary"}),"Promotions Manager"]}),a.jsx(he,{children:"Create special offers and discounts for couples"})]}),a.jsxs(F,{onClick:m,className:"bg-gold text-secondary hover:bg-gold/90",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"New Promotion"]})]})}),a.jsxs(H,{children:[t.length===0?a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx(Qr,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),a.jsx("p",{children:"No promotions yet"}),a.jsx("p",{className:"text-sm",children:"Create your first promotion to attract more couples"})]}):a.jsx("div",{className:"space-y-4",children:t.map(x=>{const b=v(x);return a.jsxs("div",{className:"border rounded-lg p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("h4",{className:"font-semibold",children:x.title}),a.jsx(ne,{variant:b.variant,children:b.label})]}),x.description&&a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:x.description}),a.jsxs("div",{className:"flex flex-wrap gap-3 text-sm",children:[x.discount_percentage&&a.jsxs("span",{className:"flex items-center gap-1 text-green-600",children:[a.jsx(Rc,{className:"w-3 h-3"}),x.discount_percentage,"% off"]}),x.discount_amount&&a.jsxs("span",{className:"flex items-center gap-1 text-green-600",children:["£",x.discount_amount," off"]}),x.promo_code&&a.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:x.promo_code}),a.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[a.jsx(qe,{className:"w-3 h-3"}),me(Ql(x.valid_from),"MMM d")," - ",me(Ql(x.valid_until),"MMM d, yyyy")]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(F,{variant:"outline",size:"sm",onClick:()=>h(x),children:a.jsx(q0,{className:"w-4 h-4"})}),a.jsxs(da,{children:[a.jsx($c,{asChild:!0,children:a.jsx(F,{variant:"outline",size:"sm",className:"text-destructive",children:a.jsx(dr,{className:"w-4 h-4"})})}),a.jsxs(fa,{children:[a.jsxs(ma,{children:[a.jsx(ha,{children:"Delete Promotion"}),a.jsxs(pa,{children:['Are you sure you want to delete "',x.title,'"? This action cannot be undone.']})]}),a.jsxs(ga,{children:[a.jsx(va,{children:"Cancel"}),a.jsx(xa,{onClick:()=>p(x.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]},x.id)})}),a.jsx(Je,{open:o,onOpenChange:l,children:a.jsxs(Ze,{className:"max-w-lg",children:[a.jsx(dt,{children:a.jsx(ft,{children:c?"Edit Promotion":"Create New Promotion"})}),a.jsxs("div",{className:"space-y-4 max-h-[60vh] overflow-y-auto pr-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"title",children:"Title *"}),a.jsx(ee,{id:"title",value:f.title,onChange:x=>d(b=>({...b,title:x.target.value})),placeholder:"e.g., Early Bird Discount"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"description",children:"Description"}),a.jsx(Ce,{id:"description",value:f.description,onChange:x=>d(b=>({...b,description:x.target.value})),placeholder:"Describe your offer...",rows:3})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"discount_percentage",children:"Discount %"}),a.jsx(ee,{id:"discount_percentage",type:"number",min:"0",max:"100",value:f.discount_percentage,onChange:x=>d(b=>({...b,discount_percentage:x.target.value})),placeholder:"e.g., 10"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"discount_amount",children:"OR Fixed Amount (£)"}),a.jsx(ee,{id:"discount_amount",type:"number",min:"0",value:f.discount_amount,onChange:x=>d(b=>({...b,discount_amount:x.target.value})),placeholder:"e.g., 50"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"promo_code",children:"Promo Code (optional)"}),a.jsx(ee,{id:"promo_code",value:f.promo_code,onChange:x=>d(b=>({...b,promo_code:x.target.value.toUpperCase()})),placeholder:"e.g., EARLYBIRD2024"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"valid_from",children:"Valid From *"}),a.jsx(ee,{id:"valid_from",type:"date",value:f.valid_from,onChange:x=>d(b=>({...b,valid_from:x.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"valid_until",children:"Valid Until *"}),a.jsx(ee,{id:"valid_until",type:"date",value:f.valid_until,onCh
128ange:x=>d(b=>({...b,valid_until:x.target.value}))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"terms",children:"Terms & Conditions"}),a.jsx(Ce,{id:"terms",value:f.terms,onChange:x=>d(b=>({...b,terms:x.target.value})),placeholder:"Any conditions that apply...",rows:2})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{htmlFor:"is_active",children:"Active"}),a.jsx(bt,{id:"is_active",checked:f.is_active,onCheckedChange:x=>d(b=>({...b,is_active:x}))})]})]}),a.jsxs(Ga,{children:[a.jsx(F,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),a.jsx(F,{onClick:g,disabled:!f.title||!f.valid_from||!f.valid_until,className:"bg-gold text-secondary hover:bg-gold/90",children:c?"Save Changes":"Create Promotion"})]})]})})]})]})},tV=()=>{const{data:e,isLoading:t}=N0(),r=_0(),n=S0(),i=A0(),[s,o]=S.useState(!1),[l,c]=S.useState(null),[u,f]=S.useState(""),[d,m]=S.useState(""),[h,g]=S.useState(""),[p,v]=S.useState("fixed"),[x,b]=S.useState(""),[j,N]=S.useState(!1),y=()=>{f(""),m(""),g(""),v("fixed"),b(""),N(!1),c(null)},w=A=>{c(A),f(A.name),m(A.description||""),g(A.price.toString()),v(A.price_type),b(A.features.join(` 129`)),N(A.is_popular),o(!0)},_=async()=>{const A={name:u,description:d||null,price:parseFloat(h),price_type:p,features:x.split(` 130`).filter(C=>C.trim()),is_popular:j,is_active:!0,display_order:(e==null?void 0:e.length)||0};l?await n.mutateAsync({id:l.id,...A}):await r.mutateAsync(A),o(!1),y()},O=A=>{const C=A.price_type==="starting_from"?"From ":"",P=A.price_type==="hourly"?"/hr":A.price_type==="per_person"?"/person":"";return`${C}£${A.price.toLocaleString()}${P}`};return t?a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading packages..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-semibold flex items-center gap-2",children:[a.jsx(Qs,{className:"w-5 h-5 text-gold"}),"Service Packages"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create packages to showcase your services and pricing"})]}),a.jsxs(Je,{open:s,onOpenChange:A=>{o(A),A||y()},children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{className:"bg-gold hover:bg-gold/90 text-secondary",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Add Package"]})}),a.jsxs(Ze,{className:"max-w-md",children:[a.jsx(dt,{children:a.jsx(ft,{children:l?"Edit Package":"Create Package"})}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Package Name *"}),a.jsx(ee,{value:u,onChange:A=>f(A.target.value),placeholder:"e.g., Full Day Coverage"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Description"}),a.jsx(Ce,{value:d,onChange:A=>m(A.target.value),placeholder:"Describe what's included...",rows:3})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Price (£) *"}),a.jsx(ee,{type:"number",value:h,onChange:A=>g(A.target.value),placeholder:"0",min:"0"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Price Type"}),a.jsxs(Vt,{value:p,onValueChange:v,children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"fixed",children:"Fixed Price"}),a.jsx(ve,{value:"starting_from",children:"Starting From"}),a.jsx(ve,{value:"hourly",children:"Per Hour"}),a.jsx(ve,{value:"per_person",children:"Per Person"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Features (one per line)"}),a.jsx(Ce,{value:x,onChange:A=>b(A.target.value),placeholder:`Up to 8 hours coverage 131500+ edited photos 132Online gallery...`,rows:4})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{children:"Mark as Popular"}),a.jsx(bt,{checked:j,onCheckedChange:N})]}),a.jsx(F,{onClick:_,disabled:!u||!h||r.isPending||n.isPending,className:"w-full bg-gold hover:bg-gold/90 text-secondary",children:l?"Update Package":"Create Package"})]})]})]})]}),e&&e.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(A=>a.jsxs(K,{className:`relative ${A.is_popular?"border-gold":""}`,children:[A.is_popular&&a.jsxs(ne,{className:"absolute -top-2 left-4 bg-gold text-secondary",children:[a.jsx(lt,{className:"w-3 h-3 mr-1"}),"Popular"]}),a.jsxs(oe,{className:"pb-2",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsx(le,{className:"text-lg",children:A.name}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>w(A),children:a.jsx(Sd,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>i.mutate(A.id),children:a.jsx(dr,{className:"w-4 h-4"})})]})]}),a.jsx("p",{className:"text-2xl font-bold text-gold",children:O(A)})]}
132),a.jsxs(H,{children:[A.description&&a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:A.description}),A.features.length>0&&a.jsx("ul",{className:"space-y-2",children:A.features.map((C,P)=>a.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[a.jsx(it,{className:"w-4 h-4 text-green-500 mt-0.5 shrink-0"}),a.jsx("span",{children:C})]},P))}),!A.is_active&&a.jsx(ne,{variant:"secondary",className:"mt-4",children:"Inactive"})]})]},A.id))}):a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-12 text-center",children:[a.jsx(Qs,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h4",{className:"font-semibold mb-2",children:"No packages yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create service packages to showcase your offerings and pricing"}),a.jsxs(F,{variant:"outline",onClick:()=>o(!0),children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Create Your First Package"]})]})})]})},rV=({highlightedBookingId:e,onBookingOpened:t}={})=>{const{data:r,isLoading:n}=O0(),i=P0(),[s,o]=S.useState(null),[l,c]=S.useState(""),[u,f]=S.useState(50),[d,m]=S.useState(!1),h=j=>{o(j),c(j.notes||""),f(j.lead_score)};S.useEffect(()=>{if(e&&r&&!d){const j=r.find(N=>N.id===e);j&&(h(j),m(!0),t==null||t())}},[e,r,d]);const g=async(j,N)=>{await i.mutateAsync({id:j,status:N})},p=async()=>{s&&(await i.mutateAsync({id:s.id,notes:l,lead_score:u}),o(null))},v=j=>{switch(j){case"confirmed":return"bg-green-500";case"declined":return"bg-destructive";case"cancelled":return"bg-muted";default:return"bg-amber-500"}},x=j=>j>=80?"text-green-500":j>=60?"text-amber-500":"text-muted-foreground",b=r==null?void 0:r.sort((j,N)=>j.status==="pending"&&N.status!=="pending"?-1:j.status!=="pending"&&N.status==="pending"?1:N.lead_score-j.lead_score);return n?a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading booking requests..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-semibold flex items-center gap-2",children:[a.jsx(qe,{className:"w-5 h-5 text-gold"}),"Booking Requests"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage date requests from couples, sorted by lead score"})]}),r&&r.length>0&&a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-500"}),"Pending: ",r.filter(j=>j.status==="pending").length]}),a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),"Confirmed: ",r.filter(j=>j.status==="confirmed").length]})]})]}),b&&b.length>0?a.jsx("div",{className:"space-y-4",children:b.map(j=>a.jsx(K,{className:"hover:shadow-md transition-shadow",children:a.jsx(H,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ji,{className:"w-4 h-4 text-muted-foreground"}),a.jsx("span",{className:"font-semibold",children:j.couple_name})]}),a.jsx(ne,{className:v(j.status),children:j.status}),j.package&&a.jsx(ne,{variant:"outline",children:j.package.name})]}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(qe,{className:"w-4 h-4"}),me(new Date(j.requested_date),"PPP")]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Tt,{className:"w-4 h-4"}),j.couple_email]}),j.couple_phone&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Xr,{className:"w-4 h-4"}),j.couple_phone]})]}),j.message&&a.jsxs("p",{className:"text-sm text-muted-foreground line-clamp-2",children:[a.jsx(Mr,{className:"w-4 h-4 inline mr-1"}),j.message]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_t,{className:`w-4 h-4 ${x(j.lead_score)}`}),a.jsxs("span",{className:`font-bold ${x(j.lead_score)}`,children:[j.lead_score,"%"]})]}),a.jsxs("div",{className:"flex gap-2",children:[j.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsx(F,{size:"sm",variant:"outline",className:"text-green-600 hover:text-green-700",onClick:()=>g(j.id,"confirmed"),children:a.jsx(it,{className:"w-4 h-4"})}),a.jsx(F,{size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>g(j.id,"declined"),children:a.jsx(Va,{className:"w-4 h-4"})})]}),a.jsxs(zj,{children:[a.jsx(Wj,{asChild:!0,children:a.jsx(F,{size:"sm",variant:"ghost",children:a.jsx(ww,{className:"w-4 h-4"})})}),a.jsxs(Vj,{align:"end",children:[a.jsx(Ps,{onClick:()=>h(j),children:"View Details & Notes"}),a.jsx(Ps,{onClick:()=>window.location.href=`mailto:${j.couple_email}`,children:"Send Email"}),j.status!=="confirmed"&&a.jsx(Ps,{onClick:()=>g(j.id,"confirmed"),children:"Mark as Confirmed"}),j.status!=="declined"&&a.jsx(Ps,{onClick:()=>g(j.id,"declined"),children:"Mark as Declined"})]})]})]})]})]})})},j.id))}
132):a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-12 text-center",children:[a.jsx(qe,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h4",{className:"font-semibold mb-2",children:"No booking requests yet"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Booking requests from couples will appear here"})]})}),a.jsx(Je,{open:!!s,onOpenChange:()=>o(null),children:a.jsxs(Ze,{className:"max-w-md",children:[a.jsx(dt,{children:a.jsx(ft,{children:"Booking Request Details"})}),s&&a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Couple"}),a.jsx("p",{className:"font-medium",children:s.couple_name})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Date Requested"}),a.jsx("p",{className:"font-medium",children:me(new Date(s.requested_date),"PPP")})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Email"}),a.jsx("p",{className:"font-medium",children:s.couple_email})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-muted-foreground",children:"Phone"}),a.jsx("p",{className:"font-medium",children:s.couple_phone||"Not provided"})]})]}),s.message&&a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Message"}),a.jsx("p",{className:"mt-1 p-3 bg-muted rounded-lg text-sm",children:s.message})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{children:["Lead Score: ",u,"%"]}),a.jsx(z0,{value:[u],onValueChange:([j])=>f(j),min:0,max:100,step:5}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Adjust based on likelihood to book"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Your Notes"}),a.jsx(Ce,{value:l,onChange:j=>c(j.target.value),placeholder:"Add private notes about this request...",rows:3})]}),a.jsx(F,{onClick:p,disabled:i.isPending,className:"w-full bg-gold hover:bg-gold/90 text-secondary",children:"Save Changes"})]})]})})]})},ov=({membershipType:e="standard"})=>{const{data:t,isLoading:r}=X0(),n=Q0(),i=J0(),s=Z0(),[o,l]=S.useState(!1),[c,u]=S.useState(null),[f,d]=S.useState("youtube"),[m,h]=S.useState(""),[g,p]=S.useState(""),[v,x]=S.useState(!1),[b,j]=S.useState(""),[N,y]=S.useState("url"),w=S.useRef(null),_=e==="elite",O=E=>{if(!E){j("");return}const T=tw(E);j(T?"":"Please enter a valid YouTube or Vimeo URL")},A=async()=>{!g||b||(await n.mutateAsync({title:m||void 0,video_url:g,is_featured:v}),P())},C=async E=>{var $;const T=($=E.target.files)==null?void 0:$[0];T&&T.type.startsWith("video/")&&(T.size>100*1024*1024||(await s.mutateAsync({file:T,title:m||void 0,is_featured:v}),P()))},P=()=>{l(!1),h(""),p(""),x(!1),y("url"),w.current&&(w.current.value="")},M=(E,T)=>{u(E),d(T)};return r?a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading videos..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-semibold flex items-center gap-2",children:[a.jsx(Hr,{className:"w-5 h-5 text-gold"}),"Portfolio Videos"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:_?"Add YouTube/Vimeo links or upload your own videos":"Add YouTube or Vimeo videos to showcase your work"})]}),a.jsxs(Je,{open:o,onOpenChange:l,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{className:"bg-gold hover:bg-gold/90 text-secondary",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Add Video"]})}),a.jsxs(Ze,{className:"max-w-md",children:[a.jsx(dt,{children:a.jsx(ft,{children:"Add Video"})}),a.jsxs("div",{className:"space-y-4 mt-4",children:[_?a.jsxs(Ka,{value:N,onValueChange:y,children:[a.jsxs(On,{className:"grid w-full grid-cols-2",children:[a.jsxs(ge,{value:"url",className:"gap-2",children:[a.jsx(jv,{className:"w-4 h-4"}),"URL"]}),a.jsxs(ge,{value:"upload",className:"gap-2",children:[a.jsx(Fc,{className:"w-4 h-4"}),"Upload"]})]}
132),a.jsx(ye,{value:"url",className:"space-y-4 mt-4",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Video URL *"}),a.jsx(ee,{value:g,onChange:E=>{p(E.target.value),O(E.target.value)},placeholder:"https://youtube.com/watch?v=... or https://vimeo.com/..."}),b&&a.jsx("p",{className:"text-sm text-destructive",children:b}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports YouTube and Vimeo links"})]})}),a.jsx(ye,{value:"upload",className:"space-y-4 mt-4",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Upload Video"}),a.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-6 text-center cursor-pointer hover:border-primary hover:bg-muted/50 transition-colors",onClick:()=>{var E;return(E=w.current)==null?void 0:E.click()},children:[a.jsx(Fc,{className:"w-8 h-8 mx-auto text-muted-foreground mb-2"}),a.jsx("p",{className:"text-sm font-medium",children:"Click to upload video"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"MP4, MOV, WebM (max 100MB)"})]}),a.jsx(ee,{ref:w,type:"file",accept:"video/*",onChange:C,className:"hidden"}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400",children:[a.jsx(be,{className:"w-3 h-3"}),"Elite exclusive feature"]})]})})]}):a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Video URL *"}),a.jsx(ee,{value:g,onChange:E=>{p(E.target.value),O(E.target.value)},placeholder:"https://youtube.com/watch?v=... or https://vimeo.com/..."}),b&&a.jsx("p",{className:"text-sm text-destructive",children:b}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports YouTube and Vimeo links"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Title (Optional)"}),a.jsx(ee,{value:m,onChange:E=>h(E.target.value),placeholder:"e.g., Wedding Highlights 2024"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{children:"Feature on Profile"}),a.jsx(bt,{checked:v,onCheckedChange:x})]}),N==="url"&&a.jsx(F,{onClick:A,disabled:!g||!!b||n.isPending,className:"w-full bg-gold hover:bg-gold/90 text-secondary",children:n.isPending?"Adding...":"Add Video"}),N==="upload"&&s.isPending&&a.jsxs("div",{className:"text-center py-4",children:[a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading video..."})]})]})]})]})]}),t&&t.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(E=>a.jsxs(K,{className:"overflow-hidden group",children:[a.jsxs("div",{className:"relative aspect-video bg-muted",children:[E.thumbnail_url?a.jsx("img",{src:E.thumbnail_url,alt:E.title||"Video thumbnail",className:"w-full h-full object-cover"}):E.video_type==="uploaded"?a.jsx("video",{src:E.video_url,className:"w-full h-full object-cover",muted:!0,preload:"metadata"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center",children:a.jsx(Hr,{className:"w-12 h-12 text-muted-foreground"})}),a.jsxs("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[a.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>M(E.video_url,E.video_type),children:[a.jsx(Ad,{className:"w-4 h-4 mr-1"}),"Play"]}),E.video_type!=="uploaded"&&a.jsx(F,{size:"sm",variant:"secondary",onClick:()=>window.open(E.video_url,"_blank"),children:a.jsx(In,{className:"w-4 h-4"})})]}),E.is_featured&&a.jsxs(ne,{className:"absolute top-2 left-2 bg-gold text-secondary",children:[a.jsx(lt,{className:"w-3 h-3 mr-1"}),"Featured"]}),E.video_type==="uploaded"&&a.jsxs(ne,{className:"absolute top-2 right-2 bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200",children:[a.jsx(be,{className:"w-3 h-3 mr-1"}),"Uploaded"]})]}),a.jsx(H,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium line-clamp-1",children:E.title||"Untitled Video"}),a.jsx("p",{className:"text-sm text-muted-foreground capitalize",children:E.video_type})]}),a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>i.mutate(E.id),children:a.jsx(dr,{className:"w-4 h-4"})})]})})]},E.id))}
132):a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-12 text-center",children:[a.jsx(Hr,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h4",{className:"font-semibold mb-2",children:"No videos yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:_?"Add YouTube/Vimeo links or upload your own videos":"Add YouTube or Vimeo videos to showcase your work"}),a.jsxs(F,{variant:"outline",onClick:()=>l(!0),children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Add Your First Video"]})]})}),a.jsx(Je,{open:!!c,onOpenChange:()=>u(null),children:a.jsx(Ze,{className:"max-w-3xl p-0 overflow-hidden",children:a.jsx("div",{className:"aspect-video",children:c&&(f==="uploaded"?a.jsx("video",{src:c,className:"w-full h-full",controls:!0,autoPlay:!0}):a.jsx("iframe",{src:ew(c)||"",className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))})})})]})},nV=()=>{const{data:e,isLoading:t}=C0(),r=k0(),n=E0(),i=$0(),[s,o]=S.useState(!1),[l,c]=S.useState(null),[u,f]=S.useState(""),[d,m]=S.useState(""),[h,g]=S.useState(""),[p,v]=S.useState(!1),x=()=>{f(""),m(""),g(""),v(!1),c(null)},b=y=>{c(y),f(y.title),m(y.content),g(y.excerpt||""),v(y.published),o(!0)},j=async()=>{!u.trim()||!d.trim()||(l?await n.mutateAsync({id:l.id,title:u,content:d,excerpt:h||void 0,published:p}):await r.mutateAsync({title:u,content:d,excerpt:h||void 0,published:p}),o(!1),x())},N=async y=>{await n.mutateAsync({id:y.id,published:!y.published})};return t?a.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading articles..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-semibold flex items-center gap-2",children:[a.jsx(nt,{className:"w-5 h-5 text-gold"}),"Advice Articles"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Share your expertise with couples planning their wedding"})]}),a.jsxs(Je,{open:s,onOpenChange:y=>{o(y),y||x()},children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{className:"bg-gold hover:bg-gold/90 text-secondary",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Write Article"]})}),a.jsxs(Ze,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(dt,{children:a.jsx(ft,{children:l?"Edit Article":"Write New Article"})}),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Title *"}),a.jsx(ee,{value:u,onChange:y=>f(y.target.value),placeholder:"e.g., 10 Tips for Choosing Your Wedding Photographer"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Excerpt (Optional)"}),a.jsx(Ce,{value:h,onChange:y=>g(y.target.value),placeholder:"A short summary to appear in article previews...",rows:2})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Content *"}),a.jsx(Ce,{value:d,onChange:y=>m(y.target.value),placeholder:"Write your article content here...",rows:12,className:"min-h-[300px]"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Share your professional advice and insights"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted rounded-lg",children:[a.jsxs("div",{children:[a.jsx(q,{children:"Publish Immediately"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Make this article visible to couples"})]}),a.jsx(bt,{checked:p,onCheckedChange:v})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(F,{onClick:j,disabled:!u.trim()||!d.trim()||r.isPending||n.isPending,className:"flex-1 bg-gold hover:bg-gold/90 text-secondary",children:l?"Update Article":"Save Article"}),a.jsx(F,{variant:"outline",onClick:()=>{o(!1),x()},children:"Cancel"})]})]})]})]})]}),e&&e.length>0?a.jsx("div",{className:"space-y-4",children:e.map(y=>a.jsx(K,{className:"overflow-hidden",children:a.jsx(H,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("h4",{className:"font-semibold text-lg truncate",children:y.title}),y.published?a.jsxs(ne,{className:"bg-green-100 text-green-800",children:[a.jsx(br,{className:"w-3 h-3 mr-1"}),"Published"]}):a.jsxs(ne,{variant:"secondary",children:[a.jsx(Bc,{className:"w-3 h-3 mr-1"}),"Draft"]})]}),y.excerpt&&a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:y.excerpt}),a.jsx("p",{className:"text-xs text-muted-foreground",children:y.published_at?`Published ${me(new Date(y.published_at),"dd MMM yyyy")}`:`Created ${me(new Date(y.created_at),"dd MMM yyyy")}`})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>N(y),title:y.published?"Unpublish":"Publish",children:y.published?a.jsx(Bc,{className:"w-4 h-4"}):a.jsx(br,{className:"w-4 h-4"})}),y.published&&a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>window.open(`/advice/${y.slug}`,"_blank"),title:"View article",children:a.jsx(In,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>b(y),children:a.jsx(rw,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",onClick:()=>i.mutate(y.id),children:a.jsx(dr,{className:"w-4 h-4"})})]})]})})},y.id))}
132):a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-12 text-center",children:[a.jsx(nt,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h4",{className:"font-semibold mb-2",children:"No articles yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Share your expertise by writing helpful articles for couples"}),a.jsxs(F,{variant:"outline",onClick:()=>o(!0),children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Write Your First Article"]})]})})]})},aV=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vs=[{month:"Jan",bookings:15,popularity:"low"},{month:"Feb",bookings:25,popularity:"medium"},{month:"Mar",bookings:35,popularity:"medium"},{month:"Apr",bookings:55,popularity:"high"},{month:"May",bookings:75,popularity:"high"},{month:"Jun",bookings:90,popularity:"peak"},{month:"Jul",bookings:95,popularity:"peak"},{month:"Aug",bookings:85,popularity:"peak"},{month:"Sep",bookings:70,popularity:"high"},{month:"Oct",bookings:45,popularity:"medium"},{month:"Nov",bookings:20,popularity:"low"},{month:"Dec",bookings:30,popularity:"medium"}],iV=({supplierId:e,categoryId:t})=>{var h,g,p,v;const{data:r,isLoading:n}=Ge({queryKey:["category-benchmarks",t],queryFn:async()=>{if(!t)return{avgViews:0,avgEnquiries:0,avgRating:0,totalSuppliers:0,topPerformerViews:0};const{data:x,error:b}=await Y.from("suppliers").select("id").eq("category_id",t);if(b)throw b;const j=(x==null?void 0:x.map(E=>E.id))||[];if(j.length===0)return{avgViews:0,avgEnquiries:0,avgRating:0,totalSuppliers:0,topPerformerViews:0};const N=me(Ys(new Date,6),"yyyy-MM-dd"),{data:y}=await Y.from("supplier_stats").select("supplier_id, profile_views, enquiries_received").in("supplier_id",j).gte("date",N),{data:w}=await Y.from("reviews").select("supplier_id, rating").in("supplier_id",j),_=new Map;y==null||y.forEach(E=>{const T=_.get(E.supplier_id)||{views:0,enquiries:0};_.set(E.supplier_id,{views:T.views+(E.profile_views||0),enquiries:T.enquiries+(E.enquiries_received||0)})});const O=Array.from(_.values()),A=O.length>0?O.reduce((E,T)=>E+T.views,0)/O.length:0,C=O.length>0?O.reduce((E,T)=>E+T.enquiries,0)/O.length:0,P=O.length>0?Math.max(...O.map(E=>E.views)):0,M=w&&w.length>0?w.reduce((E,T)=>E+T.rating,0)/w.length:0;return{avgViews:Math.round(A),avgEnquiries:Math.round(C),avgRating:Number(M.toFixed(1)),totalSuppliers:j.length,topPerformerViews:Math.round(P)}},enabled:!!t}),{data:i,isLoading:s}=Ge({queryKey:["my-position",e],queryFn:async()=>{const x=me(Ys(new Date,6),"yyyy-MM-dd"),{data:b}=await Y.from("supplier_stats").select("profile_views, enquiries_received").eq("supplier_id",e).gte("date",x),{data:j}=await Y.from("reviews").select("rating").eq("supplier_id",e),{data:N}=await Y.from("supplier_packages").select("price").eq("supplier_id",e).eq("is_active",!0),y=(b==null?void 0:b.reduce((A,C)=>A+(C.profile_views||0),0))||0,w=(b==null?void 0:b.reduce((A,C)=>A+(C.enquiries_received||0),0))||0,_=j&&j.length>0?j.reduce((A,C)=>A+C.rating,0)/j.length:0,O=N&&N.length>0?N.reduce((A,C)=>A+Number(C.price),0)/N.length:0;return{views:y,enquiries:w,rating:Number(_.toFixed(1)),avgPackagePrice:O}},enabled:!!e}),{data:o,isLoading:l}=Ge({queryKey:["market-prices",t],queryFn:async()=>{if(!t)return{avgPrice:0,minPrice:0,maxPrice:0,priceRanges:[]};const{data:x}=await Y.from("suppliers").select("id").eq("category_id",t),b=(x==null?void 0:x.map(A=>A.id))||[];if(b.length===0)return{avgPrice:0,minPrice:0,maxPrice:0,priceRanges:[]};const{data:j}=await Y.from("supplier_packages").select("price").in("supplier_id",b).eq("is_active",!0);if(!j||j.length===0)return{avgPrice:0,minPrice:0,maxPrice:0,priceRanges:[]};const N=j.map(A=>Number(A.price)),y=N.reduce((A,C)=>A+C,0)/N.length,w=Math.min(...N),_=Math.max(...N),O=[{range:"Budget",min:0,max:y*.5,count:0},{range:"Mid-Range",min:y*.5,max:y*1.5,count:0},{range:"Premium",min:y*1.5,max:1/0,count:0}];return N.forEach(A=>{A<y*.5?O[0].count++:A<y*1.5?O[1].count++:O[2].count++}),{avgPrice:Math.round(y),minPrice:w,maxPrice:_,priceRanges:O}},enabled:!!t}),{data:c,isLoading:u}=Ge({queryKey:["booking-trends",e],queryFn:async()=>{const{data:x}=await Y.from("booking_requests").select("requested_date, created_at").eq("supplier_id",e),{data:b}=await Y.from("enquiries").select("wedding_date, created_at").eq("supplier_id",e),j=new Array(12).fill(0);return x==null||x.forEach(N=>{if(N.requested_date){const y=em(new Date(N.requested_date));j[y]++}}),b==null||b.forEach(N=>{if(N.wedding_date){const y=em(new Date(N.wedding_date));j[y]++}}),aV.map((N,y)=>({month:N,yourBookings:j[y],marketTrend:Vs[y].bookings}))},enabled:!!e});if(n||s||l||u)return a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})});const d=r&&r.topPerformerViews>0?Math.round(((i==null?void 0:i.views)||0)/r.topPerformerViews*100):0,m=o&&o.avgPrice>0&&i?i.avgPackagePrice>o.avgPrice*1.5?"Premium":i.avgPackagePrice>o.avgPrice*.5?"Mid-Range":"Budget":"Unknown";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(be,{className:"w-5 h-5 text-gold"}),a.jsx("h2",{className:"text-lg font-semibold",children:"Business Insights"}),a.jsx(ne,{variant:"outline",className:"text-gold border-gold",children:"Elite"})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Xs,{className:"w-5 h-5"}),"Competitor Benchmarking"]}),a.jsx(he,{children:"See how you compare to other suppliers in your category"})]}
132),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Views"}),a.jsx("p",{className:"text-2xl font-bold",children:(i==null?void 0:i.views)||0}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Category avg: ",(r==null?void 0:r.avgViews)||0]}),a.jsxs("div",{className:"mt-2",children:[a.jsx(en,{value:Math.min(d,100),className:"h-2"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d>100?"Top performer!":`${d}% of top performer`})]})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Enquiries"}),a.jsx("p",{className:"text-2xl font-bold",children:(i==null?void 0:i.enquiries)||0}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Category avg: ",(r==null?void 0:r.avgEnquiries)||0]}),i&&r&&i.enquiries>=r.avgEnquiries&&a.jsx(ne,{className:"mt-2 bg-green-500",children:"Above Average"})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Rating"}),a.jsx("p",{className:"text-2xl font-bold",children:(i==null?void 0:i.rating)||"N/A"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Category avg: ",(r==null?void 0:r.avgRating)||"N/A"]}),i&&r&&i.rating>=r.avgRating&&i.rating>0&&a.jsx(ne,{className:"mt-2 bg-green-500",children:"Above Average"})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Category Size"}),a.jsx("p",{className:"text-2xl font-bold",children:(r==null?void 0:r.totalSuppliers)||0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"suppliers in category"})]})]}),a.jsx("div",{className:"h-[250px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(jd,{data:[{metric:"Views",you:(i==null?void 0:i.views)||0,categoryAvg:(r==null?void 0:r.avgViews)||0},{metric:"Enquiries",you:(i==null?void 0:i.enquiries)||0,categoryAvg:(r==null?void 0:r.avgEnquiries)||0}],layout:"vertical",children:[a.jsx(Sn,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(ir,{type:"number"}),a.jsx(sr,{type:"category",dataKey:"metric",width:80}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(nr,{}),a.jsx(yr,{dataKey:"you",fill:"hsl(var(--primary))",name:"You",radius:[0,4,4,0]}),a.jsx(yr,{dataKey:"categoryAvg",fill:"hsl(var(--muted-foreground))",name:"Category Avg",radius:[0,4,4,0]})]})})})]})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-5 h-5"}),"Booking Trends & Seasonal Patterns"]}),a.jsx(he,{children:"Compare your bookings to market demand throughout the year"})]}),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Peak seasons:"}),Vs.filter(x=>x.popularity==="peak").map(x=>a.jsx(ne,{className:"bg-gold text-secondary",children:x.month},x.month)),Vs.filter(x=>x.popularity==="high").map(x=>a.jsx(ne,{variant:"secondary",children:x.month},x.month))]}),a.jsx("div",{className:"h-[300px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(Dj,{data:c||Vs.map(x=>({month:x.month,marketTrend:x.bookings,yourBookings:0})),children:[a.jsx(Sn,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(ir,{dataKey:"month"}),a.jsx(sr,{}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(nr,{}),a.jsx(lr,{type:"monotone",dataKey:"marketTrend",stroke:"hsl(var(--muted-foreground))",fill:"hsl(var(--muted-foreground))",fillOpacity:.2,name:"Market Trend"}),a.jsx(lr,{type:"monotone",dataKey:"yourBookings",stroke:"hsl(var(--primary))",fill:"hsl(var(--primary))",fillOpacity:.4,name:"Your Bookings"})]})})}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"ð¡ Insights"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsx("li",{children:"⢠June, July, and August are peak wedding season with highest demand"}),a.jsx("li",{children:"⢠Consider promotional pricing for off-peak months (Nov-Feb) to fill gaps"}),a.jsx("li",{children:"⢠Spring weddings (Apr-May) are increasingly popular"})]})]})]})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(nw,{className:"w-5 h-5"}),"Price Position Analysis"]}),a.jsx(he,{children:"Where your pricing sits compared to the market average"})]}
132),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Avg Price"}),a.jsxs("p",{className:"text-2xl font-bold",children:["£",((h=i==null?void 0:i.avgPackagePrice)==null?void 0:h.toLocaleString())||"N/A"]})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Market Avg"}),a.jsxs("p",{className:"text-2xl font-bold",children:["£",((g=o==null?void 0:o.avgPrice)==null?void 0:g.toLocaleString())||"N/A"]})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Market Range"}),a.jsxs("p",{className:"text-2xl font-bold",children:["£",((p=o==null?void 0:o.minPrice)==null?void 0:p.toLocaleString())||0," - £",((v=o==null?void 0:o.maxPrice)==null?void 0:v.toLocaleString())||0]})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Position"}),a.jsx(ne,{className:m==="Premium"?"bg-gold text-secondary text-lg":m==="Mid-Range"?"bg-primary text-lg":"bg-muted-foreground text-lg",children:m})]})]}),o&&o.priceRanges&&o.priceRanges.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-3",children:"Market Price Distribution"}),a.jsx("div",{className:"h-[200px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(jd,{data:o.priceRanges,children:[a.jsx(Sn,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(ir,{dataKey:"range"}),a.jsx(sr,{}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(yr,{dataKey:"count",fill:"hsl(var(--primary))",radius:[4,4,0,0],name:"Suppliers"})]})})})]}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"ð¡ Pricing Insights"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[m==="Premium"&&a.jsxs(a.Fragment,{children:[a.jsx("li",{children:"⢠Your pricing is in the premium tier - emphasize quality and unique value"}),a.jsx("li",{children:"⢠Ensure your profile showcases awards, testimonials, and premium imagery"})]}),m==="Mid-Range"&&a.jsxs(a.Fragment,{children:[a.jsx("li",{children:"⢠You're competitively priced - focus on value proposition"}),a.jsx("li",{children:"⢠Consider tiered packages to capture different budget levels"})]}),m==="Budget"&&a.jsxs(a.Fragment,{children:[a.jsx("li",{children:"⢠Your pricing attracts budget-conscious couples"}),a.jsx("li",{children:"⢠Consider upsells and add-ons to increase average order value"})]}),m==="Unknown"&&a.jsx("li",{children:"⢠Add packages to your profile to see pricing insights"})]})]})]})]})]})},Rj=({supplierId:e,supplierName:t})=>{const[r,n]=S.useState("light"),[i,s]=S.useState("medium"),[o,l]=S.useState(!1),{data:c}=Ge({queryKey:["supplier-rating",e],queryFn:async()=>{const{data:g}=await Y.from("reviews").select("rating").eq("supplier_id",e);if(!g||g.length===0)return{avgRating:0,reviewCount:0};const p=g.reduce((v,x)=>v+x.rating,0)/g.length;return{avgRating:Number(p.toFixed(1)),reviewCount:g.length}}}),f={small:{width:200,height:80,fontSize:12,starSize:14},medium:{width:280,height:100,fontSize:14,starSize:18},large:{width:350,height:120,fontSize:16,starSize:22}}[i],d=g=>String(g).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),m=()=>{const g=r==="light"?"#ffffff":"#1a1a1a",p=r==="light"?"#333333":"#ffffff",v=r==="light"?"#666666":"#aaaaaa",x="#c9a86c",b=d(t),j=d((c==null?void 0:c.avgRating)||0),N=d((c==null?void 0:c.reviewCount)||0),y=`${window.location.origin}/suppliers/${encodeURIComponent(e)}`;return`<!-- Elite Weddings Review Widget --> 133<div id="elite-weddings-widget" style=" 134 width: ${f.width}px; 135 padding: 16px; 136 background: ${g}; 137 border: 1px solid ${r==="light"?"#e5e5e5":"#333"}; 138 border-radius: 12px; 139 font-family: system-ui, -apple-system, sans-serif; 140 box-shadow: 0 2px 8px rgba(0,0,0,0.1); 141"> 142 <div style="display: flex; align-items: center; gap: 12px;"> 143 <div style="flex: 1;"> 144 <div style="font-size: ${f.fontSize}px; font-weight: 600; color: ${p}; margin-bottom: 4px;"> 145 ${b} 146 </div> 147 <div style="display: flex; align-items: center; gap: 4px; margin-bottom: 4px;"> 148 ${Array(5).fill(0).map((w,_)=>`<svg width="${f.starSize}" height="${f.starSize}
148" viewBox="0 0 24 24" fill="${_<Math.round((c==null?void 0:c.avgRating)||0)?x:"#ddd"}"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>`).join("")} 149 </div> 150 <div style="font-size: ${f.fontSize-2}px; color: ${v};"> 151 ${j} stars ⢠${N} reviews 152 </div> 153 </div> 154 </div> 155 <a href="${y}" target="_blank" rel="noopener" style=" 156 display: block; 157 margin-top: 12px; 158 padding: 8px 12px; 159 background: ${x}; 160 color: #1a1a1a; 161 text-decoration: none; 162 border-radius: 6px; 163 font-size: ${f.fontSize-2}px; 164 font-weight: 500; 165 text-align: center; 166 ">View on Elite Weddings</a> 167</div>`},h=()=>{navigator.clipboard.writeText(m()),l(!0),G.success("Widget code copied to clipboard!"),setTimeout(()=>l(!1),2e3)};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ti,{className:"w-5 h-5"}),"Review Widget"]}),a.jsx(he,{children:"Embed your ratings on your own website to build trust with visitors"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsx("div",{className:"p-4 bg-muted/50 rounded-lg",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"flex items-center gap-1",children:Array(5).fill(0).map((g,p)=>a.jsx(lt,{className:`w-5 h-5 ${p<Math.round((c==null?void 0:c.avgRating)||0)?"fill-gold text-gold":"text-muted-foreground"}`},p))}),a.jsx("span",{className:"text-lg font-semibold",children:(c==null?void 0:c.avgRating)||0}),a.jsxs("span",{className:"text-muted-foreground",children:["(",(c==null?void 0:c.reviewCount)||0," reviews)"]})]})}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Theme"}),a.jsxs(Vt,{value:r,onValueChange:g=>n(g),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"light",children:"Light"}),a.jsx(ve,{value:"dark",children:"Dark"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Size"}),a.jsxs(Vt,{value:i,onValueChange:g=>s(g),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"small",children:"Small"}),a.jsx(ve,{value:"medium",children:"Medium"}),a.jsx(ve,{value:"large",children:"Large"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Preview"}),a.jsx("div",{className:`p-6 rounded-lg border ${r==="dark"?"bg-zinc-900":"bg-zinc-100"}`,dangerouslySetInnerHTML:{__html:m()}})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Embed Code"}),a.jsx(Ce,{value:m(),readOnly:!0,className:"font-mono text-xs h-32"}),a.jsx(F,{onClick:h,className:"w-full gap-2",children:o?a.jsxs(a.Fragment,{children:[a.jsx(ke,{className:"w-4 h-4"}),"Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(Mt,{className:"w-4 h-4"}),"Copy Embed Code"]})})]}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"ð¡ How to use"}),a.jsxs("ol",{className:"text-sm text-muted-foreground space-y-1 list-decimal list-inside",children:[a.jsx("li",{children:"Copy the embed code above"}),a.jsx("li",{children:"Paste it into your website's HTML where you want the widget to appear"}),a.jsx("li",{children:"The widget will automatically display your current rating"})]})]})]})]})},sV=({supplierSlug:e,supplierName:t})=>{const[r,n]=S.useState(200),[i,s]=S.useState("#1a1a1a"),[o,l]=S.useState("#ffffff"),[c,u]=S.useState(!0),f=S.useRef(null),d=`${window.location.origin}/suppliers/${e}`,m=()=>{var N;const p=(N=f.current)==null?void 0:N.querySelector("svg");if(!p)return;const v=document.createElement("canvas"),x=v.getContext("2d"),b=new XMLSerializer().serializeToString(p),j=new Image;v.width=r,v.height=r,j.onload=()=>{x==null||x.drawImage(j,0,0);const y=v.toDataURL("image/png"),w=document.createElement("a");w.download=`${t.replace(/\s+/g,"-").toLowerCase()}-qr-code.png`,w.href=y,w.click(),G.success("QR code downloaded!")},j.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(b)))},h=()=>{var N;const p=(N=f.current)==null?void 0:N.querySelector("svg");if(!p)return;const v=new XMLSerializer().serializeToString(p),x=new Blob([v],{type:"image/svg+xml"}),b=URL.createObjectURL(x),j=document.createElement("a");j.download=`${t.replace(/\s+/g,"-").toLowerCase()}-qr-code.svg`,j.href=b,j.click(),URL.revokeObjectURL(b),G.success("QR code downloaded!")},g=()=>{navigator.clipboard.writeText(d),G.success("Profile URL copied to clipboard!")};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(_v,{className:"w-5 h-5"}),"QR Code Generator"]}),a.jsx(he,{children:"Generate QR codes for business cards, flyers, and marketing materials"})]}
167),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Your Profile URL"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{value:d,readOnly:!0,className:"font-mono text-sm"}),a.jsx(F,{variant:"outline",size:"icon",onClick:g,children:a.jsx(Mt,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Size"}),a.jsxs(Vt,{value:r.toString(),onValueChange:p=>n(parseInt(p)),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"150",children:"Small (150px)"}),a.jsx(ve,{value:"200",children:"Medium (200px)"}),a.jsx(ve,{value:"300",children:"Large (300px)"}),a.jsx(ve,{value:"400",children:"Extra Large (400px)"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"QR Color"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{type:"color",value:i,onChange:p=>s(p.target.value),className:"w-12 h-10 p-1 cursor-pointer"}),a.jsx(ee,{value:i,onChange:p=>s(p.target.value),className:"font-mono uppercase"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Backgroun
167d"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{type:"color",value:o,onChange:p=>l(p.target.value),className:"w-12 h-10 p-1 cursor-pointer"}),a.jsx(ee,{value:o,onChange:p=>l(p.target.value),className:"font-mono uppercase"})]})]})]}),a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx("div",{ref:f,className:"p-6 bg-white rounded-lg border shadow-sm",style:{backgroundColor:o},children:a.jsx(Nv,{value:d,size:r,fgColor:i,bgColor:o,level:"H",includeMargin:c})}),a.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Scan to view your profile"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsxs(F,{onClick:m,className:"flex-1 gap-2",children:[a.jsx(ua,{className:"w-4 h-4"}),"Download PNG"]}),a.jsxs(F,{onClick:h,variant:"outline",className:"flex-1 gap-2",children:[a.jsx(ua,{className:"w-4 h-4"}),"Download SVG"]})]}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"ð¡ Usage Ideas"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(aw,{className:"w-4 h-4"}),"Add to business cards for easy profile access"]}),a.jsx("li",{children:"⢠Print on flyers, brochures, and marketing materials"}),a.jsx("li",{children:"⢠Display at wedding fairs and exhibitions"}),a.jsx("li",{children:"⢠Include in email signatures"}),a.jsx("li",{children:"⢠Add to social media posts and stories"})]})]})]})]})},oV=({supplierId:e,supplierName:t})=>{const[r,n]=S.useState(`Exciting news from ${t}!`),[i,s]=S.useState(""),[o,l]=S.useState([]),[c,u]=S.useState(!1),{data:f,isLoading:d}=Ge({queryKey:["saved-couples",e],queryFn:async()=>{const{data:v,error:x}=await Y.from("saved_suppliers").select(` 168 id, 169 user_id, 170 created_at 171 `).eq("supplier_id",e);if(x)throw x;if(!v||v.length===0)return[];const b=v.map(N=>N.user_id),{data:j}=await Y.from("couple_profiles").select("user_id, partner1_name, partner2_name, wedding_date").in("user_id",b);return v.map(N=>({id:N.id,user_id:N.user_id,created_at:N.created_at,couple_profile:(j==null?void 0:j.find(y=>y.user_id===N.user_id))||null}))}}),m=()=>{f&&(o.length===f.length?l([]):l(f.map(v=>v.user_id)))},h=v=>{l(x=>x.includes(v)?x.filter(b=>b!==v):[...x,v])},g=async()=>{if(o.length===0){G.error("Please select at least one recipient");return}if(!r.trim()||!i.trim()){G.error("Please enter a subject and message");return}u(!0);try{const{error:v}=await Y.functions.invoke("send-supplier-campaign",{body:{supplierId:e,supplierName:t,recipientUserIds:o,subject:r,message:i}});if(v)throw v;G.success(`Campaign sent to ${o.length} couple(s)!`),l([]),s("")}catch(v){console.error("Error sending campaign:",v),G.error(v.message||"Failed to send campaign")}finally{u(!1)}},p=v=>{var j,N;const x=(j=v.couple_profile)==null?void 0:j.partner1_name,b=(N=v.couple_profile)==null?void 0:N.partner2_name;return x&&b?`${x} & ${b}`:x||"Anonymous Couple"};return d?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Tt,{className:"w-5 h-5"}),"Email Campaigns"]}),a.jsx(he,{children:"Reach out to couples who have saved your profile to their favourites"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 text-center",children:[a.jsx(mr,{className:"w-6 h-6 mx-auto mb-2 text-destructive"}),a.jsx("p",{className:"text-2xl font-bold",children:(f==null?void 0:f.length)||0}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Couples Saved You"})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 text-center",children:[a.jsx(xt,{className:"w-6 h-6 mx-auto mb-2 text-primary"}),a.jsx("p",{className:"text-2xl font-bold",children:o.length}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Selected"})]}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted/50 text-center",children:[a.jsx(qe,{className:"w-6 h-6 mx-auto mb-2 text-gold"}),a.jsx("p",{className:"text-2xl font-bold",children:(f==null?void 0:f.filter(v=>{var x;return(x=v.couple_profile)==null?void 0:x.wedding_date}).length)||0}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"With Wedding Date"})]})]}),f&&f.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{children:"Select Recipients"}),a.jsx(F,{variant:"ghost",size:"sm",onClick:m,children:o.length===f.length?"Deselect All":"Select All"})]}),a.jsx("div",{className:"border rounded-lg divide-y max-h-[200px] overflow-y-auto",children:f.map(v=>{var x;return a.jsxs("div",{className:"flex items-center gap-3 p-3 hover:bg-muted/50 cursor-pointer",onClick:()=>h(v.user_id),children:[a.jsx(xi,{checked:o.includes(v.user_id),onCheckedChange:()=>h(v.user_id)}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"font-medium",children:p(v)}),((x=v.couple_profile)==null?void 0:x.wedding_date)&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wedding: ",new Date(v.couple_profile.wedding_date).toLocaleDateString()]})]}),a.jsxs(ne,{variant:"outline",className:"text-xs",children:["Saved ",new Date(v.created_at).toLocaleDateString()]})]},v.id)})})]}),a.jsxs("div",{className:"space-y-4 border-t pt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Email Subject"}),a.jsx(ee,{value:r,onChange:v=>n(v.target.value),placeholder:"Enter email subject..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Message"}),a.jsx(Ce,{value:i,onChange:v=>s(v.target.value),placeholder:"Write your message to couples...",rows:6}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Tip: Personalize your message, share updates, new packages, or special offers!"})]}),a.jsx(F,{onClick:g,disabled:c||o.length===0||!r||!i,className:"w-full gap-2 bg-gold text-secondary hover:bg-gold/90",children:c?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"w-4 h-4 animate-spin"}),"Sending..."]}):a.jsxs(a.Fragment,{children:[a.jsx(_d,{className:"w-4 h-4"}),"Send to ",o.length," Couple",o.length!==1?"s":""]})})]})]}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(mr,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground opacity-50"}),a.jsx("h3",{className:"font-semibold mb-2",children:"No Saved Couples Yet"}),a.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Once couples start saving your profile to their favourites, you'll be able to send them email campaigns with updates, promotions, and more."})]}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg flex gap-3",children:[a.jsx(Od,{className:"w-5 h-5 text-muted-foreground shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsx("p",{className:"font-medium text-foreground",children:"GDPR Compliance"}
171),a.jsx("p",{children:"Couples who save your profile have opted in to receive communications. Always include an unsubscribe option and respect their privacy preferences."})]})]})]})]})},lV=[{id:"winter",name:"Winter Wedding Special",icon:W0,color:"bg-blue-100 text-blue-700 border-blue-200",title:"Winter Wedding Discount",description:"Book your winter wedding and enjoy exclusive savings during our quieter season.",discount:15,months:[11,0,1],terms:"Valid for weddings between November and February. Cannot be combined with other offers."},{id:"spring",name:"Spring Booking Bonus",icon:Xf,color:"bg-green-100 text-green-700 border-green-200",title:"Spring Early Bird Offer",description:"Start your wedding planning this spring with a special early booking discount.",discount:10,months:[2,3,4],terms:"Must book by end of May. Deposit required to secure offer."},{id:"summer",name:"Summer Peak Season",icon:iw,color:"bg-yellow-100 text-yellow-700 border-yellow-200",title:"Summer Booking Incentive",description:"Limited availability for our most popular season - book early for best dates!",discount:5,months:[5,6,7],terms:"Subject to availability. Early booking recommended."},{id:"autumn",name:"Autumn Romance",icon:Xf,color:"bg-orange-100 text-orange-700 border-orange-200",title:"Autumn Wedding Savings",description:"Beautiful autumn weddings at beautiful prices.",discount:12,months:[8,9,10],terms:"Valid for autumn bookings. Minimum spend may apply."},{id:"valentines",name:"Valentine's Special",icon:mr,color:"bg-pink-100 text-pink-700 border-pink-200",title:"Valentine's Day Offer",description:"Celebrate love with a special February discount.",discount:14,months:[1],terms:"Book during February to receive discount. Valid for any wedding date."},{id:"newyear",name:"New Year, New Wedding",icon:Pd,color:"bg-purple-100 text-purple-700 border-purple-200",title:"New Year Booking Bonus",description:"Start the new year with your wedding planning - enjoy our January sale!",discount:20,months:[0],terms:"Book in January for any 2025/2026 wedding date."}],cV=({supplierId:e})=>{const{createPromotion:t}=Ij(e),[r,n]=S.useState(null),[i,s]=S.useState(!1),[o,l]=S.useState({title:"",description:"",discount:0,validFrom:"",validUntil:"",terms:"",promoCode:""}),c=d=>{const m=new Date,h=me(m,"yyyy-MM-dd"),g=me(F0(m,2),"yyyy-MM-dd");n(d),l({title:d.title,description:d.description,discount:d.discount,validFrom:h,validUntil:g,terms:d.terms,promoCode:d.id.toUpperCase()+new Date().getFullYear()}),s(!0)},u=()=>{t.mutate({title:o.title,description:o.description,discount_percentage:o.discount,discount_amount:null,valid_from:o.validFrom,valid_until:o.validUntil,terms:o.terms,promo_code:o.promoCode,is_active:!0},{onSuccess:()=>{G.success("Seasonal promotion created!"),s(!1)}})},f=new Date().getMonth();return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(yt,{className:"w-5 h-5"}),"Seasonal Promotion Creator"]}),a.jsx(he,{children:"Quick-start promotions with seasonal templates designed to attract more bookings"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:lV.map(d=>{const m=d.icon,h=d.months.includes(f);return a.jsxs("div",{className:`relative p-4 rounded-lg border-2 cursor-pointer transition-all hover:shadow-md ${h?"ring-2 ring-gold ring-offset-2":""} ${d.color}`,onClick:()=>c(d),children:[h&&a.jsxs(ne,{className:"absolute -top-2 -right-2 bg-gold text-secondary",children:[a.jsx(bw,{className:"w-3 h-3 mr-1"}),"Now"]}),a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx(m,{className:"w-6 h-6"}),a.jsx("h4",{className:"font-semibold",children:d.name})]}),a.jsx("p",{className:"text-sm opacity-80 mb-3",children:d.description}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs(ne,{variant:"outline",className:"font-bold",children:[d.discount,"% OFF"]}),a.jsx(F,{size:"sm",variant:"secondary",children:"Use Template"})]})]},d.id)})}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"ð¡ Seasonal Marketing Tips"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsxs("li",{children:["⢠",a.jsx("strong",{children:"Winter weddings"})," are growing in popularity - offer attractive discounts"]}),a.jsxs("li",{children:["⢠",a.jsx("strong",{children:"Peak season"})," (Jun-Aug) may need smaller discounts due to high demand"]}),a.jsxs("li",{children:["⢠",a.jsx("strong",{children:"Off-peak offers"})," help fill your calendar during quieter months"]}),a.jsxs("li",{children:["⢠Create urgency with ",a.jsx("strong",{children:"limited-time"})," promotional periods"]})]})]}),a.jsx(Je,{open:i,onOpenChange:s,children:a.jsxs(Ze,{className:"max-w-lg",children:[a.jsx(dt,{children:a.jsxs(ft,{className:"flex items-center gap-2",children:[r&&a.jsx(r.icon,{className:"w-5 h-5"}),"Customise ",r==null?void 0:r.name]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Promotion Title"}),a.jsx(ee,{value:o.title,onChange:d=>l(m=>({...m,title:d.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Description"}),a.jsx(Ce,{value:o.description,onChange:d=>l(m=>({...m,description:d.target.value})),rows:3})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Discount %"}),a.jsx(ee,{type:"number",min:"0",max:"100",value:o.discount,onChange:d=>l(m=>({...m,discount:parseInt(d.target.value)||0}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Promo Code"}),a.jsx(ee,{value:o.promoCode,onChange:d=>l(m=>({...m,promoCode:d.target.value.toUpperCase()}))})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Valid From"}),a.jsx(ee,{type:"date",value:o.validFrom,onChange:d=>l(m=>({...m,validFrom:d.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Valid Until"}
171),a.jsx(ee,{type:"date",value:o.validUntil,onChange:d=>l(m=>({...m,validUntil:d.target.value}))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Terms & Conditions"}),a.jsx(Ce,{value:o.terms,onChange:d=>l(m=>({...m,terms:d.target.value})),rows:2})]})]}),a.jsxs(Ga,{children:[a.jsx(F,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(F,{onClick:u,className:"bg-gold text-secondary hover:bg-gold/90",disabled:t.isPending,children:"Create Promotion"})]})]})})]})]})};function uV({supplierId:e}){var c;const{tiers:t,signupCount:r,claimReward:n,claimedTierIds:i,claims:s}=sw(e);if(!t.length)return null;(c=t[t.length-1])!=null&&c.signups_required;const o=[...t].reverse().find(u=>r>=u.signups_required),l=t.find(u=>r<u.signups_required);return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(wv,{className:"w-5 h-5 text-gold"}),"Referral Rewards"]}),a.jsx(he,{children:"Refer couples using your link & QR code to unlock rewards"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"text-center p-4 bg-primary/5 rounded-lg",children:[a.jsx("p",{className:"text-4xl font-bold text-primary",children:r}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Couples Referred"}),o&&a.jsxs(ne,{className:"mt-2 bg-gold text-secondary",children:[o.icon," ",o.tier_name," Tier"]})]}),l&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsxs("span",{className:"text-muted-foreground",children:[l.signups_required-r," more to ",l.tier_name]}),a.jsxs("span",{className:"font-medium",children:[r," / ",l.signups_required]})]}),a.jsx(en,{value:r/l.signups_required*100,className:"h-3"})]}),a.jsx("div",{className:"space-y-3",children:t.map(u=>{const f=r>=u.signups_required,d=i.has(u.id),m=s.find(g=>g.tier_id===u.id),h=(m==null?void 0:m.status)==="fulfilled";return a.jsxs("div",{className:He("flex items-start gap-4 p-4 rounded-lg border transition-all",f?"bg-gold/5 border-gold/30":"bg-muted/30 border-muted opacity-70"),children:[a.jsx("span",{className:"text-3xl",children:u.icon}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h4",{className:"font-semibold",children:u.tier_name}),a.jsxs(ne,{variant:"outline",className:"text-xs",children:[u.signups_required," referrals"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:u.reward_description})]}),a.jsx("div",{className:"flex-shrink-0",children:h?a.jsxs(ne,{variant:"outline",className:"gap-1 text-green-600 border-green-300",children:[a.jsx(ke,{className:"w-3 h-3"}),"Fulfilled"]}):d?a.jsxs(ne,{variant:"secondary",className:"gap-1",children:[a.jsx(St,{className:"w-3 h-3"}),"Pending"]}):f?a.jsxs(F,{size:"sm",onClick:()=>n.mutate(u.id),disabled:n.isPending,className:"bg-gold text-secondary hover:bg-gold/90",children:[a.jsx(Pd,{className:"w-3 h-3 mr-1"}),"Claim"]}):a.jsx(ne,{variant:"outline",className:"text-muted-foreground",children:"Locked"})})]},u.id)})})]})]})}const dV=({supplierId:e,supplierName:t})=>{const[r,n]=S.useState(null),[i,s]=S.useState(0),[o,l]=S.useState(!0),c=S.useRef(null);S.useEffect(()=>{u(),f()},[e]);const u=async()=>{const{data:p}=await Y.from("supplier_referral_codes").select("referral_code").eq("supplier_id",e).maybeSingle();p&&n(p.referral_code),l(!1)},f=async()=>{const{count:p}=await Y.from("couple_referral_signups").select("*",{count:"exact",head:!0}).eq("supplier_id",e);s(p||0)},d=async()=>{const p=t.toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,12)+"-"+Math.random().toString(36).substring(2,8),{error:v}=await Y.from("supplier_referral_codes").insert({supplier_id:e,referral_code:p});if(v){G.error("Failed to generate referral code");return}n(p),G.success("Referral code created!")},m=r?`${window.location.origin}/couple-auth?ref=${r}`:"",h=()=>{navigator.clipboard.writeText(m),G.success("Referral link copied!")},g=()=>{var N;const p=(N=c.current)==null?void 0:N.querySelector("svg");if(!p)return;const v=document.createElement("canvas"),x=v.getContext("2d"),b=new XMLSerializer().serializeToString(p),j=new Image;v.width=400,v.height=400,j.onload=()=>
171{x==null||x.drawImage(j,0,0);const y=document.createElement("a");y.download=`${t.replace(/\s+/g,"-").toLowerCase()}-referral-qr.png`,y.href=v.toDataURL("image/png"),y.click(),G.success("QR code downloaded!")},j.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(b)))};return o?null:a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Lc,{className:"w-5 h-5 text-primary"}),"Couple Referral Programme"]}),a.jsx(he,{children:"Share your unique link with couples â when they sign up, you get credit and they get a personalised experience"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 bg-primary/5 rounded-lg text-center",children:[a.jsx(xt,{className:"w-6 h-6 text-primary mx-auto mb-1"}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:i}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Couples Referred"})]}),a.jsxs("div",{className:"p-4 bg-accent/10 rounded-lg text-center",children:[a.jsx(_t,{className:"w-6 h-6 text-accent mx-auto mb-1"}),a.jsx("p",{className:"text-2xl font-bold text-foreground",children:i>0?"Active":"Ready"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Referral Status"})]})]}),r?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium",children:"Your Referral Link"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{value:m,readOnly:!0,className:"font-mono text-xs"}),a.jsx(F,{variant:"outline",size:"icon",onClick:h,children:a.jsx(Mt,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx("div",{ref:c,className:"p-4 bg-white rounded-lg border shadow-sm",children:a.jsx(Nv,{value:m,size:200,fgColor:"#1a1a1a",bgColor:"#ffffff",level:"H",includeMargin:!0})}),a.jsxs(F,{variant:"outline",onClick:g,className:"gap-2",children:[a.jsx(ua,{className:"w-4 h-4"}),"Download QR Code"]})]}),a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg",children:[a.jsx("h4",{className:"font-medium mb-2",children:"ð¡ How to use your referral link"}),a.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[a.jsx("li",{children:"⢠Print the QR code on your business cards & flyers"}),a.jsx("li",{children:"⢠Share the link in your email footer"}),a.jsx("li",{children:"⢠Post on your social media profiles"}),a.jsx("li",{children:"⢠Display at your wedding fair stand"}),a.jsx("li",{children:"⢠Add to your invoices & contracts"})]})]})]}):a.jsxs(F,{onClick:d,className:"w-full gap-2",children:[a.jsx(Lc,{className:"w-4 h-4"}),"Generate My Referral Link"]}),a.jsx(uV,{supplierId:e})]})]})},fV=({supplierId:e,supplierSlug:t,supplierName:r})=>{const[n,i]=S.useState("referral");return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(be,{className:"w-5 h-5 text-gold"}),a.jsx("h2",{className:"text-lg font-semibold",children:"Marketing Tools"}),a.jsx(ne,{variant:"outline",className:"text-gold border-gold",children:"Elite"})]}),a.jsxs(Ka,{value:n,onValueChange:i,children:[a.jsxs(On,{className:"mb-4 flex-wrap",children:[a.jsxs(ge,{value:"referral",className:"gap-2",children:[a.jsx(Lc,{className:"w-4 h-4"}),"Referral Link"]}),a.jsxs(ge,{value:"widget",className:"gap-2",children:[a.jsx(Ti,{className:"w-4 h-4"}),"Review Widget"]}),a.jsxs(ge,{value:"qrcode",className:"gap-2",children:[a.jsx(_v,{className:"w-4 h-4"}),"QR Code"]}),a.jsxs(ge,{value:"seasonal",className:"gap-2",children:[a.jsx(yt,{className:"w-4 h-4"}),"Seasonal Promos"]}),a.jsxs(ge,{value:"email",className:"gap-2",children:[a.jsx(Tt,{className:"w-4 h-4"}),"Email Campaigns"]})]}),a.jsx(ye,{value:"referral",children:a.jsx(dV,{supplierId:e,supplierName:r})}),a.jsx(ye,{value:"widget",children:a.jsx(Rj,{supplierId:e,supplierName:r})}),a.jsx(ye,{value:"qrcode",children:a.jsx(sV,{supplierSlug:t,supplierName:r})}),a.jsx(ye,{value:"seasonal",children:a.jsx(cV,{supplierId:e})}),a.jsx(ye,{value:"email",children:a.jsx(oV,{supplierId:e,supplierName:r})})]})]})}
171,mV={photography:wi,videographers:Hr,catering:ow,florists:lw,entertainment:cw,transport:uw,jewellery:dw,venues:kr,"venue-stylists":yt,"bridal-wear":fw,cakes:Kj,"hair-makeup":yt,celebrants:mr,"travel-specialists":Y0,stationery:hw,photobooths:mw},hV=e=>Ge({queryKey:["supplier-categories-with-details",e],queryFn:async()=>{const{data:t,error:r}=await Y.from("supplier_categories").select(` 172 id, 173 supplier_id, 174 category_id, 175 custom_description, 176 categories ( 177 id, 178 name, 179 slug, 180 description 181 ) 182 `).eq("supplier_id",e);if(r)throw r;return t.map(n=>({id:n.id,supplier_id:n.supplier_id,category_id:n.category_id,custom_description:n.custom_description,category:n.categories}))},enabled:!!e}),pV=()=>{const e=ur();return Xe({mutationFn:async({supplierCategoryId:t,customDescription:r,supplierId:n})=>{const{error:i}=await Y.from("supplier_categories").update({custom_description:r||null}).eq("id",t);if(i)throw i},onSuccess:(t,r)=>{e.invalidateQueries({queryKey:["supplier-categories-with-details",r.supplierId]}),e.invalidateQueries({queryKey:["supplier-services-details",r.supplierId]})}})},gV=({supplierId:e})=>{const{data:t,isLoading:r}=hV(e),n=pV(),[i,s]=S.useState({}),[o,l]=S.useState(null);S.useEffect(()=>{if(t){const u={};t.forEach(f=>{u[f.id]=f.custom_description||""}),s(u)}},[t]);const c=async u=>{var f;l(u);try{await n.mutateAsync({supplierCategoryId:u,customDescription:((f=i[u])==null?void 0:f.trim())||null,supplierId:e}),G.success("Service description saved!")}catch{G.error("Failed to save description")}l(null)};return r?a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(nt,{className:"w-5 h-5"}),"Service Descriptions"]})}),a.jsx(H,{children:a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(Se,{className:"w-6 h-6 animate-spin text-muted-foreground"})})})]}):!t||t.length===0?a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(nt,{className:"w-5 h-5"}),"Service Descriptions"]})}),a.jsx(H,{children:a.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No service categories selected. Add categories to your listing first."})})]}):a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(nt,{className:"w-5 h-5"}),"Service Descriptions"]}),a.jsx(he,{children:"Add custom descriptions for each of your services to stand out to potential clients"})]}),a.jsx(H,{className:"space-y-6",children:t.map(u=>{const f=mV[u.category.slug]||kr,d=i[u.id]!==(u.custom_description||"");return a.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:a.jsx(f,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h4",{className:"font-semibold text-foreground",children:u.category.name}),a.jsx(ne,{variant:"outline",className:"text-xs",children:u.category.slug.replace(/-/g," ")})]}),u.category.description&&a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Default: ",u.category.description]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:`desc-${u.id}`,children:"Custom Description"}),a.jsx(Ce,{id:`desc-${u.id}`,placeholder:`Describe your ${u.category.name.toLowerCase()} services...`,value:i[u.id]||"",onChange:m=>s(h=>({...h,[u.id]:m.target.value})),rows:3,className:"resize-none"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"This will be shown on your profile instead of the default category description"})]}),a.jsx(F,{size:"sm",onClick:()=>c(u.id),disabled:o===u.id||!d,children:o===u.id?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Description"]})})]},u.id)})})]})},vV=({listing:e,categoryCount:t,onNavigateToTab:r})=>
182{const n=[{id:"basic",label:"Business Name",description:"Add your business name",icon:kr,isComplete:!!(e!=null&&e.name&&e.name.trim()!==""),isRequired:!0,tabValue:"listing"},{id:"categories",label:"Service Categories",description:"Select what services you offer",icon:Qr,isComplete:t>0,isRequired:!0,tabValue:"listing"},{id:"location",label:"Location",description:"Where are you based?",icon:Tr,isComplete:!!(e!=null&&e.location&&e.location.trim()!==""),isRequired:!0,tabValue:"listing"},{id:"contact",label:"Contact Info",description:"Add phone or email",icon:Xr,isComplete:!!(e!=null&&e.phone||e!=null&&e.email),isRequired:!0,tabValue:"listing"},{id:"photo",label:"Main Photo",description:"Upload a profile image",icon:sa,isComplete:!!(e!=null&&e.image_url),isRequired:!0,tabValue:"gallery"},{id:"description",label:"Description",description:"Tell couples about your services",icon:nt,isComplete:!!(e!=null&&e.short_description||e!=null&&e.description),isRequired:!1,tabValue:"listing"}],i=n.filter(f=>f.isRequired),s=i.filter(f=>f.isComplete).length,o=i.length,l=Math.round(s/o*100),c=s===o,u=n.find(f=>!f.isComplete&&f.isRequired);return c?null:a.jsx(K,{className:"mb-8 border-primary/20 bg-gradient-to-r from-primary/5 to-transparent",children:a.jsx(H,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start gap-6",children:[a.jsxs("div",{className:"lg:w-1/3",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(yt,{className:"w-6 h-6 text-primary"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-display text-lg font-semibold text-foreground",children:"Complete Your Profile"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[s," of ",o," required steps done"]})]})]}),a.jsx(en,{value:l,className:"h-2 mb-2"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[l,"% complete â finish setup to appear in search results"]}),u&&r&&a.jsxs(F,{className:"mt-4 w-full sm:w-auto",onClick:()=>r(u.tabValue||"listing"),children:["Continue Setup",a.jsx(pv,{className:"w-4 h-4 ml-2"})]})]}),a.jsx("div",{className:"lg:w-2/3 grid sm:grid-cols-2 gap-2",children:n.map(f=>{const d=f.icon;return a.jsxs("button",{onClick:()=>f.tabValue&&(r==null?void 0:r(f.tabValue)),className:He("flex items-center gap-3 p-3 rounded-lg text-left transition-colors","hover:bg-muted/50",f.isComplete?"bg-green-500/5":f.isRequired?"bg-amber-500/5":"bg-muted/30"),children:[a.jsx("div",{className:He("w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0",f.isComplete?"bg-green-500/10":f.isRequired?"bg-amber-500/10":"bg-muted"),children:f.isComplete?a.jsx(ps,{className:"w-4 h-4 text-green-600"}):a.jsx(d,{className:He("w-4 h-4",f.isRequired?"text-amber-600":"text-muted-foreground")})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:He("text-sm font-medium",f.isComplete?"text-green-700 dark:text-green-400":"text-foreground"),children:f.label}),f.isRequired&&!f.isComplete&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-700 dark:text-amber-400",children:"Required"}),!f.isRequired&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"Optional"})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.description})]})]},f.id)})})]})})})},xV=({membershipType:e})=>{const[t,r]=S.useState([]),[n,i]=S.useState(!0);if(S.useEffect(()=>{(async()=>{const{data:c,error:u}=await Y.rpc("get_demand_signals",{p_days:30});!u&&c&&r(c),i(!1)})()},[]),n)return null;const s=t.reduce((l,c)=>l+Number(c.lead_count),0),o=t.slice(0,10);return a.jsxs(K,{className:"border-primary/20",children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2 text-lg",children:[a.jsx(_t,{className:"w-5 h-5 text-primary"}),"Live Demand Signals",a.jsx(ne,{variant:"secondary",className:"ml-auto text-xs",children:"Last 30 days"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:s>0?`${s} couples have submitted The Elite Shortlist in the last 30 days. Here's where the demand is.`:"No couples have submitted The Elite Shortlist yet in the last 30 days. Check back soon."})]}
182),a.jsxs(H,{className:"space-y-2",children:[o.map((l,c)=>a.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/40 border border-border",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[a.jsx(Tr,{className:"w-3.5 h-3.5 text-primary flex-shrink-0"}),a.jsx("span",{className:"truncate",children:l.county}),a.jsx("span",{className:"text-muted-foreground",children:"·"}),a.jsx("span",{className:"truncate",children:l.service_type})]}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Budget: ",l.budget_range]})]}),a.jsxs(ne,{className:"bg-primary/15 text-primary border-0",children:[l.lead_count," ",Number(l.lead_count)===1?"couple":"couples"]})]},`${l.county}-${l.service_type}-${l.budget_range}-${c}`)),e!=="elite"&&a.jsx("div",{className:"mt-4 p-4 rounded-lg bg-gradient-to-r from-amber-50 to-amber-100 border border-amber-200",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(Sv,{className:"w-5 h-5 text-amber-700 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm font-semibold text-amber-900",children:e==="free"?"Want to receive these leads directly?":"Want full contact details the moment couples submit?"}),a.jsx("p",{className:"text-xs text-amber-800 mt-1",children:e==="free"?"Standard members receive masked lead details 24 hours after submission. Elite members get full contact details immediately.":"You currently receive masked details 24 hours after submission. Elite members get full name, email and mobile within minutes."}),a.jsx(F,{asChild:!0,size:"sm",className:"mt-3 bg-gradient-to-r from-primary to-primary/80",children:a.jsxs(Gj,{to:"/upgrade",children:[a.jsx(yt,{className:"w-3.5 h-3.5 mr-1"}),"Upgrade now"]})})]})]})})]})]})},yV=e=>{const t=ur(),{data:r=[],isLoading:n}=Ge({queryKey:["supplier-leads",e],queryFn:async()=>{if(!e)return[];const{data:l,error:c}=await Y.from("supplier_leads").select("*").eq("supplier_id",e).order("score",{ascending:!1});if(c)throw c;return l.map(u=>({...u,notes:Array.isArray(u.notes)?u.notes:[]}))},enabled:!!e}),i=Xe({mutationFn:async l=>{if(!e)throw new Error("No supplier ID");const{data:c,error:u}=await Y.from("supplier_leads").insert({supplier_id:e,name:l.name,email:l.email,phone:l.phone,source:l.source}).select().single();if(u)throw u;return c},onSuccess:()=>t.invalidateQueries({queryKey:["supplier-leads"]})}),s=Xe({mutationFn:async({id:l,...c})=>{const{data:u,error:f}=await Y.from("supplier_leads").update(c).eq("id",l).select().single();if(f)throw f;return u},onSuccess:()=>t.invalidateQueries({queryKey:["supplier-leads"]})}),o=Xe({mutationFn:async({leadId:l,note:c})=>{const u=r.find(m=>m.id===l);if(!u)throw new Error("Lead not found");const{data:f,error:d}=await Y.from("supplier_leads").update({notes:[...u.notes,c],last_contact:new Date().toISOString().split("T")[0]}).eq("id",l).select().single();if(d)throw d;return f},onSuccess:()=>t.invalidateQueries({queryKey:["supplier-leads"]})});return{leads:r,isLoading:n,addLead:i,updateLead:s,addNote:o}},bV=[{name:"Wedding date within 6 months",points:20},{name:"Responded to initial contact",points:15},{name:"Asked about pricing",points:15},{name:"Visited profile multiple times",points:10},{name:"Saved to shortlist",points:10},{name:"Complete contact info",points:10},{name:"Specific requirements shared",points:10},{name:"Budget mentioned",points:10}],jV=({supplierId:e})=>{const{leads:t,isLoading:r,updateLead:n,addNote:i}=yV(e),[s,o]=S.useState(null),[l,c]=S.useState(""),u=t.find(p=>p.id===s),f=p=>p>=80?{label:"Hot",color:"bg-red-500"}:p>=60?{label:"Warm",color:"bg-orange-500"}:p>=40?{label:"Cool",color:"bg-blue-500"}:{label:"Cold",color:"bg-gray-500"},d=p=>{switch(p){case"won":return"bg-green-500";case"proposal":return"bg-purple-500";case"qualified":return"bg-blue-500";case"contacted":return"bg-yellow-500";case"lost":return"bg-gray-500";default:return"bg-gray-400"}},m=async(p,v)=>{try{await n.mutateAsync({id:p,status:v}),G.success("Lead status updated")}catch{G.error("Failed to update status")}},h=async p=>{if(l.trim())try{await i.mutateAsync({leadId:p,note:l}),c(""),G.success("Note added")}catch{G.error("Failed to add note")}},g=p=>t.filter(v=>v.status===p);return r?a.jsx(K,{className:"elite-card",children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Se,{className:"h-8 w-8 animate-spin text-gold mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading leads..."})]})})}):a.jsxs("div",{className:"space-y-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"elite-icon",children:a.jsx(Xs,{className:"w-6 h-6"})}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["Lead Scoring & CRM",a.jsx(yt,{className:"w-4 h-4 text-gold animate-crown-pulse"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Track and manage your leads with intelligent scoring"})]})]}),a.jsxs(ne,{className:"elite-badge",children:[a.jsx(be,{className:"w-3 h-3 mr-1"}),"Elite"]})]}),a.jsx("div",{className:"elite-divider"}),a.jsx("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:["new","contacted","qualified","proposal","won","lost"].map(p=>a.jsx("div",{className:"elite-stat-card text-center",children:a.jsxs("div",{className:"relative z-10",children:[a.jsx("p",{className:"elite-stat-value text-2xl",children:g(p).length}),a.jsx("p",{className:"text-xs text-muted-foreground capitalize mt-1",children:p})]})},p))}),t.length===0?a.jsx(K,{className:"elite-card",children:a.jsxs(H,{
182className:"text-center py-12",children:[a.jsx("div",{className:"elite-icon mx-auto mb-4",children:a.jsx(Xs,{className:"w-6 h-6"})}),a.jsx("h3",{className:"font-semibold mb-2",children:"No Leads Yet"}),a.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Leads from enquiries and bookings will appear here for tracking. Start engaging with couples to build your pipeline."})]})}):a.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2",children:a.jsxs(K,{className:"elite-card",children:[a.jsxs(oe,{className:"elite-header rounded-t-xl",children:[a.jsx(le,{className:"text-lg",children:"All Leads"}),a.jsx(he,{children:"Click a lead to view details and take action"})]}),a.jsx(H,{className:"pt-4",children:a.jsx("div",{className:"space-y-3",children:t.sort((p,v)=>v.score-p.score).map(p=>{const v=f(p.score);return a.jsxs("div",{className:`p-4 border rounded-lg cursor-pointer transition-all ${s===p.id?"ring-2 ring-primary":"hover:bg-muted/50"}`,onClick:()=>o(p.id),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center ${v.color} text-white font-bold`,children:p.score}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold",children:p.name}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(Tt,{className:"h-3 w-3"}),p.email]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ne,{className:d(p.status),children:p.status}),p.next_action_date&&a.jsxs("div",{className:"text-xs text-muted-foreground",children:[a.jsx(St,{className:"h-3 w-3 inline mr-1"}),p.next_action_date]})]})]}),p.next_action&&a.jsxs("div",{className:"mt-2 text-sm text-primary flex items-center gap-1",children:[a.jsx(ps,{className:"h-3 w-3"}),"Next: ",p.next_action]})]},p.id)})})})]})}),a.jsxs("div",{children:[u?a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(le,{children:u.name}),a.jsxs(ne,{className:f(u.score).color,children:["Score: ",u.score]})]})}),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Tt,{className:"h-4 w-4 text-muted-foreground"}),u.email]}),u.phone&&a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Xr,{className:"h-4 w-4 text-muted-foreground"}),u.phone]}),u.wedding_date&&a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(qe,{className:"h-4 w-4 text-muted-foreground"}),"Wedding: ",u.wedding_date]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium",children:"Status"}),a.jsxs(Vt,{value:u.status,onValueChange:p=>m(u.id,p),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"new",children:"New"}),a.jsx(ve,{value:"contacted",children:"Contacted"}),a.jsx(ve,{value:"qualified",children:"Qualified"}),a.jsx(ve,{value:"proposal",children:"Proposal Sent"}),a.jsx(ve,{value:"won",children:"Won"}),a.jsx(ve,{value:"lost",children:"Lost"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium",children:"Score Breakdown"}),a.jsx(en,{value:u.score,className:"h-2"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Based on engagement, timing, and completeness"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium",children:"Notes"}),a.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto",children:u.notes.map((p,v)=>a.jsx("p",{className:"text-sm p-2 bg-muted rounded",children:p},v))}),a.jsx(Ce,{value:l,onChange:p=>c(p.target.value),placeholder:"Add a note...",rows:2}),a.jsxs(F,{size:"sm",onClick:()=>h(u.id),className:"w-full",disabled:i.isPending,children:[i.isPending?a.jsx(Se,{className:"h-4 w-4 animate-spin mr-1"}):a.jsx(ut,{className:"h-4 w-4 mr-1"}),"Add Note"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(F,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:a.jsxs("a",{href:`mailto:${u.email}`,children:[a.jsx(Tt,{className:"h-4 w-4 mr-1"}),"Email"]})}),u.phone&&a.jsx(F,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:a.jsxs("a",{href:`tel:${u.phone}`,children:[a.jsx(Xr,{className:"h-4 w-4 mr-1"}),"Call"]})})]})]})]}):a.jsx(K,{children:a.jsx(H,{className:"pt-6",children:a.jsx("p",{className:"text-center text-muted-foreground",children:"Select a lead to view details"})})}),a.jsxs(K,{className:"mt-4",children:[a.jsx(oe,{children:a.jsx(le,{className:"text-sm",children:"How Scores Are Calculated"})}),a.jsx(H,{children:a.jsx("div",{className:"space-y-2",children:bV.map((p,v)=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:p.name}),a.jsxs(ne,{variant:"outline",children:["+",p.points]})]},v))})})]})]})]})]})},wV=e=>{const t=ur(),{data:r,isLoading:n}=Ge({queryKey:["booking-settings",e],queryFn:async()=>
182{if(!e)return null;const{data:c,error:u}=await Y.from("supplier_booking_settings").select("*").eq("supplier_id",e).maybeSingle();if(u)throw u;return c},enabled:!!e}),{data:i=[],isLoading:s}=Ge({queryKey:["instant-bookings",e],queryFn:async()=>{if(!e)return[];const{data:c,error:u}=await Y.from("instant_bookings").select("*").eq("supplier_id",e).order("created_at",{ascending:!1});if(u)throw u;return c},enabled:!!e}),o=Xe({mutationFn:async c=>{if(!e)throw new Error("No supplier ID");if(r!=null&&r.id){const{data:u,error:f}=await Y.from("supplier_booking_settings").update(c).eq("id",r.id).select().single();if(f)throw f;return u}else{const{data:u,error:f}=await Y.from("supplier_booking_settings").insert({supplier_id:e,...c}).select().single();if(f)throw f;return u}},onSuccess:()=>t.invalidateQueries({queryKey:["booking-settings"]})}),l=Xe({mutationFn:async({bookingId:c,status:u})=>{const{data:f,error:d}=await Y.from("instant_bookings").update({status:u}).eq("id",c).select().single();if(d)throw d;return f},onSuccess:()=>t.invalidateQueries({queryKey:["instant-bookings"]})});return{settings:r,bookings:i,isLoading:n||s,saveSettings:o,updateBookingStatus:l}},NV=({supplierId:e})=>{const{settings:t,bookings:r,isLoading:n,saveSettings:i}=wV(e),[s,o]=S.useState({enabled:!1,require_deposit:!0,deposit_amount:25,deposit_type:"percentage",instant_confirmation:!0,lead_time_days:14,cancellation_policy:"14-day",max_advance_months:24});S.useEffect(()=>{t&&o({enabled:t.enabled,require_deposit:t.require_deposit,deposit_amount:t.deposit_amount,deposit_type:t.deposit_type,instant_confirmation:t.instant_confirmation,lead_time_days:t.lead_time_days,cancellation_policy:t.cancellation_policy,max_advance_months:t.max_advance_months})},[t]);const l=async()=>{try{await i.mutateAsync(s),G.success("Booking settings saved!")}catch{G.error("Failed to save settings")}},c=d=>{switch(d){case"confirmed":return"bg-green-500";case"pending":return"bg-yellow-500";case"cancelled":return"bg-red-500";default:return"bg-gray-500"}},u=r.filter(d=>d.status==="confirmed").reduce((d,m)=>d+Number(m.amount),0),f=r.filter(d=>d.status==="confirmed").reduce((d,m)=>d+Number(m.deposit_paid),0);return n?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}):a.jsxs("div",{className:"space-y-6",children:[a.jsx(K,{children:a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(yi,{className:"h-5 w-5 text-primary"}),"Instant Booking"]}),a.jsx(he,{children:"Let couples book and pay deposits directly without waiting for responses"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(bt,{checked:s.enabled,onCheckedChange:d=>o({...s,enabled:d})}),a.jsx(q,{children:s.enabled?"Enabled":"Disabled"})]})]})})}),a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsx(K,{children:a.jsx(H,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-500/10 rounded-lg",children:a.jsx(ke,{className:"h-5 w-5 text-green-500"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold",children:r.filter(d=>d.status==="confirmed").length}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Confirmed"})]})]})})}),a.jsx(K,{children:a.jsx(H,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-yellow-500/10 rounded-lg",children:a.jsx(St,{className:"h-5 w-5 text-yellow-500"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold",children:r.filter(d=>d.status==="pending").length}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending"})]})]})})}),a.jsx(K,{children:a.jsx(H,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-primary/10 rounded-lg",children:a.jsx(Av,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-2xl font-bold",children:["£",f.toLocaleStr
182ing()]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Deposits Received"})]})]})})}),a.jsx(K,{children:a.jsx(H,{className:"pt-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg",children:a.jsx(qe,{className:"h-5 w-5 text-blue-500"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-2xl font-bold",children:["£",u.toLocaleString()]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Booked Value"})]})]})})})]}),a.jsxs(Ka,{defaultValue:"bookings",children:[a.jsxs(On,{children:[a.jsx(ge,{value:"bookings",children:"Recent Bookings"}),a.jsx(ge,{value:"settings",children:"Settings"})]}),a.jsx(ye,{value:"bookings",children:a.jsxs(K,{children:[a.jsx(oe,{children:a.jsx(le,{children:"Instant Bookings"})}),a.jsx(H,{children:r.length===0?a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No bookings yet. Enable instant booking and couples can book directly."}):a.jsx("div",{className:"space-y-4",children:r.map(d=>a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(ne,{className:c(d.status),children:d.status}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold",children:d.couple_name}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[d.package_name||"Custom Booking"," ⢠",d.date]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsxs("p",{className:"font-semibold",children:["£",Number(d.amount).toLocaleString()]}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Deposit: £",Number(d.deposit_paid).toLocaleString()]})]})]},d.id))})})]})}),a.jsx(ye,{value:"settings",children:a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(bv,{className:"h-5 w-5"}),"Booking Settings"]})}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-semibold",children:"Deposit Requirements"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(q,{children:"Require deposit to book"}),a.jsx(bt,{checked:s.require_deposit,onCheckedChange:d=>o({...s,require_deposit:d})})]}),s.require_deposit&&a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Deposit Amount"}),a.jsx(ee,{type:"number",value:s.deposit_amount,onChange:d=>o({...s,deposit_amount:parseInt(d.target.value)||0})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Type"}),a.jsxs(Vt,{value:s.deposit_type,onValueChange:d=>o({...s,deposit_type:d}),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"percentage",children:"Percentage (%)"}),a.jsx(ve,{value:"fixed",children:"Fixed Amount (£)"})]})]})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-semibold",children:"Confirmation"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(q,{children:"Instant Confirmation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically confirm bookings when deposit is paid"})]}),a.jsx(bt,{checked:s.instant_confirmation,onCheckedChange:d=>o({...s,instant_confirmation:d})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-semibold",children:"Booking Windows"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Minimum Lead Time (days)"}),a.jsx(ee,{type:"number",value:s.lead_time_days,onChange:d=>o({...s,lead_time_days:parseInt(d.target.value)||0})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Couples must book at least this many days in advance"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Maximum Advance Booking (months)"}),a.jsx(ee,{type:"number",value:s.max_advance_months,onChange:d=>o({...s,max_advance_months:parseInt(d.target.value)||0})}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"How far in advance couples can book"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"font-semibold",children:"Cancellation Policy"}),a.jsxs(Vt,{value:s.cancellation_policy,onValueChange:d=>o({...s,cancellation_policy:d}),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"flexible",children:"Flexible - Full refund up to 7 days before"}),a.jsx(ve,{value:"14-day",children:"Moderate - Full refund up to 14 days before"}),a.jsx(ve,{value:"30-day",children:"Strict - Full refund up to 30 days before"}),a.jsx(ve,{value:"non-refundable",children:"Non-refundable - No refunds"})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 p-4 bg-yellow-500/10 rounded-lg",children:[a.jsx(Od,{className:"h-5 w-5 text-yellow-500"}),a.jsx("p",{className:"text-sm",children:"Payment processing requires a connected payment account. Contact support to set up."})]}),a.jsxs(F,{onClick:l,className:"w-full",disabled:i.isPending,children:[i.isPending?a.jsx(Se,{className:"h-4 w-4 animate-spin mr-2"}):null,"Save Settings"]})]})]})})]})]})},_V=({supplierId:e})=>{const[t,r]=S.useState({today:0,thisWeek:0,thisMonth:0,trend:0}),[n,i]=S.useState([]),[s,o]=S.useState(!0);return S.useEffect(()=>{e&&(async()=>{const c=new Date,u=qt(c),f=Ni(c,7),d=Ni(c,30),m=Ni(c,60),{data:h,error:g}=await Y.from("supplier_profile_views").select("*").eq("supplier_id",e).gte("viewed_at",m.toISOString()).order("viewed_at",{ascending:!1});if(g){console.error("Error fetching views:",g),o(!1);return}const p=(h==null?void 0:h.filter(N=>new Date(N.viewed_at)>=u).length)||0,v=(h==null?void 0:h.filter(N=>new Date(N.viewed_at)>=f).length)||0,x=(h==null?void 0:h.filter(N=>new Date(N.viewed_at)>=d).length)||0,b=(h==null?void 0:h.filter(N=>new Date(N.viewed_at)>=m&&new Date(N.viewed_at)<d).length)||0,j=b>0?Math.round((x-b)/b*100):0;r({today:p,thisWeek:v,thisMonth:x,trend:j}),i((h==null?void 0:h.slice(0,10))||[]),o(!1)})()},[e]),s?a.jsx(K,{children:a.jsx(H,{className:"py-8 text-center text-muted-foreground",children:"Loading view statistics..."})}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsx(K,{children:a.jsxs(H,{
182className:"pt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(br,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Today"})]}),a.jsx("p",{className:"text-2xl font-bold mt-1",children:t.today})]})}),a.jsx(K,{children:a.jsxs(H,{className:"pt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(St,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This Week"})]}),a.jsx("p",{className:"text-2xl font-bold mt-1",children:t.thisWeek})]})}),a.jsx(K,{children:a.jsxs(H,{className:"pt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xt,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This Month"})]}),a.jsx("p",{className:"text-2xl font-bold mt-1",children:t.thisMonth})]})}),a.jsx(K,{children:a.jsxs(H,{className:"pt-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_t,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Trend"})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsxs("p",{className:"text-2xl font-bold",children:[t.trend>0?"+":"",t.trend,"%"]}),a.jsx(ne,{variant:t.trend>=0?"default":"secondary",children:t.trend>=0?"Up":"Down"})]})]})})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsx(le,{className:"text-lg",children:"Recent Profile Views"}),a.jsx(he,{children:"Latest visitors to your profile"})]}),a.jsx(H,{children:n.length===0?a.jsx("p",{className:"text-muted-foreground text-center py-4",children:"No views recorded yet"}):a.jsx("div",{className:"space-y-2",children:n.map(l=>a.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center",children:a.jsx(br,{className:"w-4 h-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:l.viewer_user_id?"Logged-in user":"Anonymous visitor"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["via ",l.source||"direct"]})]})]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:me(new Date(l.viewed_at),"MMM d, h:mm a")})]},l.id))})})]})]})},lv=`Hi {couple_name}, 183 184I hope this message finds you well! I wanted to follow up on the enquiry you sent regarding your upcoming wedding. 185 186I'd love to help make your special day perfect. If you have any questions or would like to discuss your requirements in more detail, please don't hesitate to reach out. 187 188Looking forward to hearing from you! 189 190Best regards, 191{business_name}`,SV=({supplierId:e})=>{const[t,r]=S.useState({enabled:!1,days_after_enquiry:3,followup_template:lv}),[n,i]=S.useState(!1),[s,o]=S.useState(!0);S.useEffect(()=>{e&&(async()=>{const{data:u,error:f}=await Y.from("supplier_followup_settings").select("*").eq("supplier_id",e).maybeSingle();!f&&u&&r({enabled:u.enabled||!1,days_after_enquiry:u.days_after_enquiry||3,followup_template:u.followup_template||lv}),o(!1)})()},[e]);const l=async()=>{i(!0);const{error:c}=await Y.from("supplier_followup_settings").upsert({supplier_id:e,enabled:t.enabled,days_after_enquiry:t.days_after_enquiry,followup_template:t.followup_template,updated_at:new Date().toISOString()},{onConflict:"supplier_id"});c?G.error("Failed to save settings"):G.success("Follow-up settings saved!"),i(!1)};return s?a.jsx(K,{children:a.jsx(H,{className:"py-8 text-center text-muted-foreground",children:"Loading settings..."})}):a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Tt,{className:"w-5 h-5 text-primary"}),"Automated Follow-ups"]}),a.jsx(he,{children:"Automatically send follow-up emails to couples who haven't responded to their enquiry"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(q,{children:"Enable Automated Follow-ups"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Send reminders to couples who haven't heard back"})]}),a.jsx(bt,{checked:t.enabled,onCheckedChange:c=>r(u=>({...u,enabled:c}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{className:"flex items-center gap-2",children:[a.jsx(St,{className:"w-4 h-4"}),"Days After Enquiry"]}),a.jsx(ee,{type:"number",min:1,max:14,value:t.days_after_enquiry,onChange:c=>r(u=>({...u,days_after_enquiry:parseInt(c.target.value)||3})),className:"w-32"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Send follow-up if no response after this many days"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Follow-up Email Template"}),a.jsx(Ce,{value:t.followup_template,onChange:c=>r(u=>({...u,followup_template:c.target.value})),rows:10,placeholder:"Enter your follow-up email template..."}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Available placeholders: ","{couple_name}",", ","{business_name}",", ","{wedding_date}"]})]}),a.jsxs(F,{onClick:l,disabled:n,children:[n?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Settings"]})]})]})},cv=`Dear {couple_name}, 192 193Congratulations on your wedding! We hope your special day was everything you dreamed of. 194 195We would be incredibly grateful if you could take a moment to share your experience with us. Your review helps other couples find reliable wedding suppliers and helps us continue to improve. 196 197Click the link below to leave a review: 198{review_link} 199 200Thank you so much for choosing us to be part of your wedding journey! 201 202With warm wishes, 203{business_name}`,AV=({supplierId:e})=>{const[t,r]=S.useState({enabled:!1,days_after_wedding:7,email_template:cv}),[n,i]=S.useState(!1),[s,o]=S.useState(!0);S.useEffect(()=>{e&&(async()=>{const{data:u,error:f}=await Y.from("supplier_review_request_settings").select("*").eq("supplier_id",e).maybeSingle();!f&&u&&r({enabled:u.enabled||!1,days_after_wedding:u.days_after_wedding||7,email_template:u.email_template||cv}),o(!1)})()},[e]);const l=async()=>{i(!0);const{error:c}=await Y.from("supplier_review_request_settings").upsert({supplier_id:e,enabled:t.enabled,days_after_wedding:t.days_after_wedding,email_template:t.email_template,updated_at:new Date().toISOString()},{onConflict:"supplier_id"});c?G.error("Failed to save settings"):G.success("Review request settings saved!"),i(!1)};return s?a.jsx(K,{children:a.jsx(H,{className:"py-8 text-center text-muted-foreground",children:"Loading settings..."})}):a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(lt,{className:"w-5 h-5 text-primary"}),"Automated Review Requests"]}),a.jsx(he,{children:"Automatically request reviews from couples after their wedding"})]}
203),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(q,{children:"Enable Automated Review Requests"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Send review requests after wedding date"})]}),a.jsx(bt,{checked:t.enabled,onCheckedChange:c=>r(u=>({...u,enabled:c}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-4 h-4"}),"Days After Wedding"]}),a.jsx(ee,{type:"number",min:1,max:30,value:t.days_after_wedding,onChange:c=>r(u=>({...u,days_after_wedding:parseInt(c.target.value)||7})),className:"w-32"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Send review request this many days after the wedding"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Review Request Email Template"}),a.jsx(Ce,{value:t.email_template,onChange:c=>r(u=>({...u,email_template:c.target.value})),rows:12,placeholder:"Enter your review request template..."}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Available placeholders: ","{couple_name}",", ","{business_name}",", ","{review_link}",", ","{wedding_date}"]})]}),a.jsxs(F,{onClick:l,disabled:n,children:[n?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Settings"]})]})]})},OV=({businessName:e,currentDescription:t,category:r,onApply:n})=>{const[i,s]=S.useState(""),[o,l]=S.useState("professional"),[c,u]=S.useState(""),[f,d]=S.useState(!1),[m,h]=S.useState(!1),g=async()=>{if(!e){G.error("Business name is required");return}d(!0);try{const{data:x,error:b}=await Y.functions.invoke("generate-supplier-description",{body:{businessName:e,category:r,keywords:i.split(",").map(j=>j.trim()).filter(Boolean),tone:o,currentDescription:t}});if(b)throw b;u(x.description)}catch(x){console.error("Error generating description:",x),G.error("Failed to generate description. Please try again.")}finally{d(!1)}},p=async()=>{await navigator.clipboard.writeText(c),h(!0),G.success("Copied to clipboard!"),setTimeout(()=>h(!1),2e3)},v=()=>{n&&c&&(n(c),G.success("Description applied!"))};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(yt,{className:"w-5 h-5 text-primary"}),"AI Description Writer"]}),a.jsx(he,{children:"Generate an optimized, SEO-friendly business description using AI"})]}),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Keywords (comma-separated)"}),a.jsx(ee,{placeholder:"luxury, bespoke, award-winning...",value:i,onChange:x=>s(x.target.value)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Key features or specialties to highlight"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Tone"}),a.jsxs(Vt,{value:o,onValueChange:l,children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"professional",children:"Professional"}),a.jsx(ve,{value:"friendly",children:"Warm & Friendly"}),a.jsx(ve,{value:"luxury",children:"Luxury & Elegant"}),a.jsx(ve,{value:"creative",children:"Creative & Unique"}),a.jsx(ve,{value:"romantic",children:"Romantic"})]})]})]})]}),a.jsx(F,{onClick:g,disabled:f,className:"w-full",children:f?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(yt,{className:"w-4 h-4 mr-2"}),"Generate Description"]})}),c&&a.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[a.jsx(q,{children:"Generated Description"}),a.jsx(Ce,{value:c,onChange:x=>u(x.target.value),rows:6,className:"resize-none"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(F,{variant:"outline",size:"sm",onClick:p,children:[m?a.jsx(it,{className:"w-4 h-4 mr-1"}):a.jsx(Mt,{className:"w-4 h-4 mr-1"}),m?"Copied":"Copy"]}),a.jsxs(F,{variant:"outline",size:"sm",onClick:g,disabled:f,children:[a.jsx($i,{className:`w-4 h-4 mr-1 ${f?"animate-spin":""}`}),"Regenerate"]}),n&&a.jsx(F,{size:"sm",onClick:v,children:"Apply to Profile"})]})]})]})]})},PV=({supplierId:e,businessName:t})=>{const{items:r,setItems:n}=rl("quote-manager"),[i,s]=S.useState(!0),[o,l]=S.useState(!1),[c,u]=S.useState(!1),[f,d]=S.useState({couple_name:"",couple_email:"",event_date:"",items:[{description:"",quantity:1,price:0}],discount_amount:0,notes:"",valid_until:""});S.useEffect(()=>{m()},[e]);const m=async()=>{const{data:w,error:_}=await Y.from("supplier_quotes").select("*").eq("supplier_id",e).order("created_at",{ascending:!1});!_&&w&&n(w.map(O=>({...O,items:O.items||[]}))),s(!1)},h=(w,_)=>{const O=w.reduce((C,P)=>C+P.quantity*P.price,0),A=O-_;return{subtotal:O,total:A}},g=()=>{d(w=>({...w,items:[...w.items,{description:"",quantity:1,price:0}]}))},p=w=>{d(_=>({..._,items:_.items.filter((O,A)=>A!==w)}))},v=(w,_,O)=>{d(A=>({...A,items:A.items.map((C,P)=>P===w?{...C,[_]:O}:C)}))},x=async()=>
203{if(!f.couple_name||!f.couple_email){G.error("Please fill in couple's name and email");return}u(!0);const{subtotal:w,total:_}=h(f.items,f.discount_amount),{error:O}=await Y.from("supplier_quotes").insert([{supplier_id:e,couple_name:f.couple_name,couple_email:f.couple_email,event_date:f.event_date||null,items:f.items,subtotal:w,discount_amount:f.discount_amount,total:_,notes:f.notes||null,valid_until:f.valid_until||null,status:"draft"}]);O?G.error("Failed to create quote"):(G.success("Quote created!"),l(!1),d({couple_name:"",couple_email:"",event_date:"",items:[{description:"",quantity:1,price:0}],discount_amount:0,notes:"",valid_until:""}),m()),u(!1)},b=w=>{const _=new Ov;_.setFontSize(24),_.setTextColor(139,115,85),_.text(t,20,30),_.setFontSize(18),_.setTextColor(0,0,0),_.text("QUOTE",20,45),_.setFontSize(10),_.text(`Quote #: ${w.id.slice(0,8).toUpperCase()}`,20,60),_.text(`Date: ${me(new Date(w.created_at),"MMMM d, yyyy")}`,20,67),w.valid_until&&_.text(`Valid Until: ${me(new Date(w.valid_until),"MMMM d, yyyy")}`,20,74),_.text(`To: ${w.couple_name}`,120,60),_.text(w.couple_email,120,67),w.event_date&&_.text(`Event Date: ${me(new Date(w.event_date),"MMMM d, yyyy")}`,120,74),pw(_,{startY:90,head:[["Description","Qty","Unit Price","Total"]],body:w.items.map(A=>[A.description,A.quantity.toString(),`£${A.price.toFixed(2)}`,`£${(A.quantity*A.price).toFixed(2)}`]),theme:"striped",headStyles:{fillColor:[139,115,85]}});const O=_.lastAutoTable.finalY+10;_.text(`Subtotal: £${w.subtotal.toFixed(2)}`,140,O),w.discount_amount>0&&_.text(`Discount: -£${w.discount_amount.toFixed(2)}`,140,O+7),_.setFontSize(12),_.setFont("helvetica","bold"),_.text(`Total: £${w.total.toFixed(2)}`,140,O+(w.discount_amount>0?17:10)),w.notes&&(_.setFontSize(10),_.setFont("helvetica","normal"),_.text("Notes:",20,O+30),_.text(w.notes,20,O+37,{maxWidth:170})),_.save(`quote-${w.couple_name.replace(/\s+/g,"-").toLowerCase()}.pdf`),G.success("Quote PDF downloaded!")},j=w=>{switch(w){case"sent":return"bg-blue-500/10 text-blue-600";case"viewed":return"bg-amber-500/10 text-amber-600";case"accepted":return"bg-green-500/10 text-green-600";case"declined":return"bg-red-500/10 text-red-600";default:return"bg-muted text-muted-foreground"}},{subtotal:N,total:y}=h(f.items,f.discount_amount);return a.jsxs(K,{children:[a.jsxs(oe,{className:"flex flex-row items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(nt,{className:"w-5 h-5 text-primary"}),"Quote Manager"]}),a.jsx(he,{children:"Create and send branded PDF quotes to couples"})]}),a.jsxs(Je,{open:o,onOpenChange:l,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"New Quote"]})}),a.jsxs(Ze,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsx(dt,{children:a.jsx(ft,{children:"Create New Quote"})}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Couple's Name *"}),a.jsx(ee,{value:f.couple_name,onChange:w=>d(_=>({..._,couple_name:w.target.value})),placeholder:"John & Jane Smith"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Email *"}),a.jsx(ee,{type:"email",value:f.couple_email,onChange:w=>d(_=>({..._,couple_email:w.target.value})),placeholder:"[email protected]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Event Date"}),a.jsx(ee,{type:"date",value:f.event_date,onChange:w=>d(_=>({..._,event_date:w.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Valid Until"}),a.jsx(ee,{type:"date",value:f.valid_until,onChange:w=>d(_=>({..._,valid_until:w.target.value}))})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(q,{children:"Items"}),f.items.map((w,_)=>a.jsxs("div",{className:"flex gap-2 items-start",children:[a.jsx(ee,{placeholder:"Description",value:w.description,onChange:O=>v(_,"description",O.target.value),className:"flex-1"}),a.jsx(ee,{type:"number",min:1,value:w.quantity,onChange:O=>v(_,"quantity",parseInt(O.target.value)||1),className:"w-20"}
203),a.jsx(ee,{type:"number",min:0,step:.01,value:w.price,onChange:O=>v(_,"price",parseFloat(O.target.value)||0),className:"w-28",placeholder:"Price"}),f.items.length>1&&a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>p(_),children:a.jsx(dr,{className:"w-4 h-4 text-destructive"})})]},_)),a.jsxs(F,{variant:"outline",size:"sm",onClick:g,children:[a.jsx(ut,{className:"w-4 h-4 mr-1"})," Add Item"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Discount (£)"}),a.jsx(ee,{type:"number",min:0,step:.01,value:f.discount_amount,onChange:w=>d(_=>({..._,discount_amount:parseFloat(w.target.value)||0})),className:"w-32"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Notes"}),a.jsx(Ce,{value:f.notes,onChange:w=>d(_=>({..._,notes:w.target.value})),placeholder:"Additional notes or terms...",rows:3})]}),a.jsxs("div",{className:"bg-muted p-4 rounded-lg",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Subtotal:"}),a.jsxs("span",{children:["£",N.toFixed(2)]})]}),f.discount_amount>0&&a.jsxs("div",{className:"flex justify-between text-sm text-green-600",children:[a.jsx("span",{children:"Discount:"}),a.jsxs("span",{children:["-£",f.discount_amount.toFixed(2)]})]}),a.jsxs("div",{className:"flex justify-between font-bold text-lg border-t mt-2 pt-2",children:[a.jsx("span",{children:"Total:"}),a.jsxs("span",{children:["£",y.toFixed(2)]})]})]}),a.jsxs(F,{onClick:x,disabled:c,className:"w-full",children:[c?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(nt,{className:"w-4 h-4 mr-2"}),"Create Quote"]})]})]})]})]}),a.jsx(H,{children:i?a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Loading quotes..."}):r.length===0?a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No quotes yet. Create your first quote!"}):a.jsx("div",{className:"space-y-3",children:r.map(w=>a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:w.couple_name}),a.jsx(ne,{className:j(w.status),children:w.status})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:w.couple_email}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["£",w.total.toFixed(2)," ⢠",me(new Date(w.created_at),"MMM d, yyyy")]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>b(w),children:a.jsx(ua,{className:"w-4 h-4"})})})]},w.id))})})]})},CV=({supplierId:e,categoryId:t})=>{const{items:r,setItems:n}=rl("competitor-alerts"),[i,s]=S.useState([]),[o,l]=S.useState(""),[c,u]=S.useState(!0);S.useEffect(()=>{f()},[e,t]);const f=async()=>{const{data:g}=await Y.from("supplier_competitor_tracking").select("competitor_id").eq("supplier_id",e),p=(g==null?void 0:g.map(v=>v.competitor_id))||[];if(p.length>0){const{data:v}=await Y.from("suppliers").select("id, name, location, image_url").in("id",p);n(v||[])}if(t){const{data:v}=await Y.from("suppliers").select("id, name, location, image_url").eq("category_id",t).neq("id",e).limit(20);s((v||[]).filter(x=>!p.includes(x.id)))}u(!1)},d=async g=>{const{error:p}=await Y.from("supplier_competitor_tracking").insert({supplier_id:e,competitor_id:g});p?G.error("Failed to track competitor"):(G.success("Now tracking competitor!"),f())},m=async g=>{const{error:p}=await Y.from("supplier_competitor_tracking").delete().eq("supplier_id",e).eq("competitor_id",g);p?G.error("Failed to untrack competitor"):(G.success("Competitor removed from tracking"),f())},h=i.filter(g=>g.name.toLowerCase().includes(o.toLowerCase()));return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Js,{className:"w-5 h-5 text-primary"}),"Competitor Tracking"]}),a.jsx(he,{children:"Monitor competitors in your category and get alerts when they update their profiles"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium mb-3",children:["Tracking (",r.length,"/5)"]}),r.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"You're not tracking any competitors yet"}):a.jsx("div",{className:"space-y-2",children:r.map(g=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-muted overflow-hidden",children:g.image_url?a.jsx("img",{src:g.image_url,alt:"",className:"w-full h-full object-cover"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:a.jsx(br,{className:"w-4 h-4"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:g.name}),a.jsx("p",{className:"text-xs text-muted-foreground",children:g.location||"No location"})]})]}),a.jsx(F,{variant:"ghost",size:"sm",onClick:()=>m(g.id),children:a.jsx(dr,{className:"w-4 h-4 text-destructive"})})]},g.id))})]}),r.length<5&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-3",children:"Add Competitors"}),a.jsxs("div",{className:"relative mb-3",children:[a.jsx(Nd,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground"}),a.jsx(ee,{placeholder:"Search competitors...",value:o,onChange:g=>l(g.target.value),className:"pl-10"})]}),h.length===0?a.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No competitors found in your category"}):a.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:h.slice(0,10).map(g=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-muted overflow-hidden",children:g.image_url?a.jsx("img",{src:g.image_url,alt:"",className:"w-full h-full object-cover"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:a.jsx(_t,{className:"w-4 h-4"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:g.name}),a.jsx("p",{className:"text-xs text-muted-foreground",children:g.location||"No location"})]})]}),a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>d(g.id),children:[a.jsx(ut,{className:"w-4 h-4 mr-1"})," Track"]})]},g.id))})]}),a.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg text-sm",children:[a.jsxs("p",{className:"text-muted-foreground",children:[a.jsx("strong",{children:"Coming soon:"})," You'll receive notifications when tracked competitors:"]}),a.jsxs("ul",{className:"list-disc list-inside mt-2 text-muted-foreground space-y-1",children:[a.jsx("li",{children:"Update their pricing or packages"}),a.jsx("li",{children:"Add new promotions"}),a.jsx("li",{children:"Receive new reviews"}),a.jsx("li",{children:"Update their profile content"})]})]})]})]})},uv=({supplierId:e,categoryId:t})=>{const[r,n]=S.useState(null),[i,s]=S.useState(!0),[o,l]=S.useState(!1),c=async()=>
203{l(!0);const{data:m}=await Y.from("supplier_packages").select("price").eq("supplier_id",e).eq("is_active",!0),{data:h}=await Y.from("supplier_packages").select("price, supplier_id").eq("is_active",!0).neq("supplier_id",e);if(!m||m.length===0){n(null),s(!1),l(!1);return}const g=m.reduce((w,_)=>w+Number(_.price),0)/m.length;if(!h||h.length===0){n({yourAvg:g,marketAvg:0,marketMin:0,marketMax:0,position:"at",suggestion:"Not enough market data to compare. Add more packages to get insights."}),s(!1),l(!1);return}const p=h.map(w=>Number(w.price)),v=p.reduce((w,_)=>w+_,0)/p.length,x=Math.min(...p),b=Math.max(...p),j=(g-v)/v*100;let N,y;j<-15?(N="below",y="Your prices are significantly below market average. Consider raising prices to increase revenue, or emphasize value to justify competitive pricing."):j>15?(N="above",y="Your prices are above market average. Ensure your profile highlights premium features and quality to justify the higher price point."):(N="at",y="Your pricing is competitive with the market. Focus on differentiating through service quality and unique offerings."),n({yourAvg:g,marketAvg:v,marketMin:x,marketMax:b,position:N,suggestion:y}),s(!1),l(!1)};S.useEffect(()=>{c()},[e,t]);const u=()=>{c(),G.success("Pricing analysis refreshed!")},f=m=>{switch(m){case"below":return a.jsx(Uc,{className:"w-5 h-5 text-amber-500"});case"above":return a.jsx(_t,{className:"w-5 h-5 text-blue-500"});default:return a.jsx(qc,{className:"w-5 h-5 text-green-500"})}},d=m=>{switch(m){case"below":return a.jsx(ne,{className:"bg-amber-500/10 text-amber-600",children:"Below Market"});case"above":return a.jsx(ne,{className:"bg-blue-500/10 text-blue-600",children:"Above Market"});default:return a.jsx(ne,{className:"bg-green-500/10 text-green-600",children:"Market Rate"})}};return i?a.jsx(K,{children:a.jsx(H,{className:"py-8 text-center text-muted-foreground",children:"Analyzing market data..."})}):r?a.jsxs(K,{children:[a.jsxs(oe,{className:"flex flex-row items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(_t,{className:"w-5 h-5 text-primary"}),"Smart Pricing Suggestions"]}),a.jsx(he,{children:"AI-powered analysis of your pricing vs. the market"})]}),a.jsx(F,{variant:"ghost",size:"icon",onClick:u,disabled:o,children:a.jsx($i,{className:`w-4 h-4 ${o?"animate-spin":""}`})})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[f(r.position),d(r.position)]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"p-3 bg-muted rounded-lg text-center",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Your Average"}),a.jsxs("p",{className:"text-xl font-bold",children:["£",r.yourAvg.toFixed(0)]})]}),a.jsxs("div",{className:"p-3 bg-muted rounded-lg text-center",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Market Average"}),a.jsxs("p",{className:"text-xl font-bold",children:["£",r.marketAvg.toFixed(0)]})]}),a.jsxs("div",{className:"p-3 bg-muted rounded-lg text-center",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Market Min"}),a.jsxs("p",{className:"text-xl font-bold",children:["£",r.marketMin.toFixed(0)]})]}),a.jsxs("div",{className:"p-3 bg-muted rounded-lg text-center",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Market Max"}),a.jsxs("p",{className:"text-xl font-bold",children:["£",r.marketMax.toFixed(0)]})]})]}),a.jsxs("div",{className:"relative h-8 bg-gradient-to-r from-green-500/20 via-amber-500/20 to-red-500/20 rounded-full",children:[a.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4 bg-primary rounded-full border-2 border-white shadow-lg",style:{left:`${Math.min(Math.max((r.yourAvg-r.marketMin)/(r.marketMax-r.marketMin)*100,5),95)}%`,transform:"translateX(-50%) translateY(-50%)"}}),a.jsxs("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:["£",r.marketMin.toFixed(0)]}),a.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:["£",r.marketMax.toFixed(0)]})]}),a.jsx("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(V0,{className:"w-5 h-5 text-primary flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-1",children:"AI Recommendation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:r.suggestion})]})]})})]})]}):a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(_t,{className:"w-5 h-5 text-primary"}),"Smart Pricing Suggestions"]})}),a.jsx(H,{children:a.jsx("p",{className:"text-muted-foreground text-center py-4",children:"Add packages to your profile to get AI-powered pricing suggestions."})})]})},kV=({supplierId:e})=>{const[t,r]=S.useState([]),[n,i]=S.useState(!0),[s,o]=S.useState(!1),[l,c]=S.useState(!1),[u,f]=S.useState({couple_name:"",couple_email:"",wedding_date:"",notes:""});S.useEffect(()=>{d()},[e]);const d=async()=>{const{data:p,error:v}=await Y.from("client_portal_access").select("*").eq("supplier_id",e).order("created_at",{ascending:!1});!v&&p&&r(p),i(!1)},m=()=>Array.from(crypto.getRandomValues(new Uint8Array(24))).map(p=>p.toString(16).padStart(2,"0")).join(""),h=async()=>
203{if(!u.couple_name||!u.couple_email){G.error("Please fill in couple's name and email");return}c(!0);const{error:p}=await Y.from("client_portal_access").insert({supplier_id:e,couple_name:u.couple_name,couple_email:u.couple_email,wedding_date:u.wedding_date||null,notes:u.notes||null,access_token:m(),timeline:[],documents:[]});p?G.error("Failed to create client portal"):(G.success("Client portal created!"),o(!1),f({couple_name:"",couple_email:"",wedding_date:"",notes:""}),d()),c(!1)},g=p=>{const v=`${window.location.origin}/client-portal/${p}`;navigator.clipboard.writeText(v),G.success("Portal link copied to clipboard!")};return a.jsxs(K,{children:[a.jsxs(oe,{className:"flex flex-row items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(xt,{className:"w-5 h-5 text-primary"}),"Client Portals"]}),a.jsx(he,{children:"Create dedicated portals for your booked couples"})]}),a.jsxs(Je,{open:s,onOpenChange:o,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"New Portal"]})}),a.jsxs(Ze,{children:[a.jsx(dt,{children:a.jsx(ft,{children:"Create Client Portal"})}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Couple's Names *"}),a.jsx(ee,{value:u.couple_name,onChange:p=>f(v=>({...v,couple_name:p.target.value})),placeholder:"John & Jane Smith"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Email *"}),a.jsx(ee,{type:"email",value:u.couple_email,onChange:p=>f(v=>({...v,couple_email:p.target.value})),placeholder:"[email protected]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Wedding Date"}),a.jsx(ee,{type:"date",value:u.wedding_date,onChange:p=>f(v=>({...v,wedding_date:p.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Notes"}),a.jsx(Ce,{value:u.notes,onChange:p=>f(v=>({...v,notes:p.target.value})),placeholder:"Internal notes about this client...",rows:3})]}),a.jsxs(F,{onClick:h,disabled:l,className:"w-full",children:[l?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(xt,{className:"w-4 h-4 mr-2"}),"Create Portal"]})]})]})]})]}),a.jsxs(H,{children:[n?a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Loading portals..."}):t.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(xt,{className:"w-12 h-12 text-muted-foreground mx-auto mb-4"}),a.jsx("p",{className:"text-muted-foreground mb-2",children:"No client portals yet"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a portal for booked couples to view their timeline, documents, and more"})]}):a.jsx("div",{className:"space-y-3",children:t.map(p=>a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center",children:a.jsx(xt,{className:"w-5 h-5 text-primary"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:p.couple_name}),a.jsx("p",{className:"text-sm text-muted-foreground",children:p.couple_email}),p.wedding_date&&a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-1",children:[a.jsx(qe,{className:"w-3 h-3"}),me(new Date(p.wedding_date),"MMMM d, yyyy")]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{variant:"secondary",children:"Active"}),a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>g(p.access_token),children:a.jsx(Mt,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>window.open(`/client-portal/${p.access_token}`,"_blank"),children:a.jsx(In,{className:"w-4 h-4"})})]})]},p.id))}),a.jsxs("div",{className:"mt-6 bg-muted/50 p-4 rounded-lg text-sm",children:[a.jsx("h4",{className:"font-medium mb-2",children:"What clients can access:"}),a.jsxs("ul",{className:"grid grid-cols-2 gap-2 text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-4 h-4"})," Wedding timeline"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(nt,{className:"w-4 h-4"})," Contracts & documents"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(xt,{className:"w-4 h-4"})," Contact information"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(nt,{className:"w-4 h-4"})," Payment status"]})]})]})]})]})},dv=({supplierId:e,supplierSlug:t})=>{const[r,n]=S.useState(!1),[i,s]=S.useState({primaryColor:"#8B7355",buttonText:"Check Availability",width:"300"}),o=window.location.origin,l=`<iframe 204 src="${o}/supplier/${t}/availability-widget" 205 width="${i.width}" 206 height="400" 207 style="border: none; border-radius: 8px;" 208 title="Check Availability" 209></iframe>`,c=`<a 210 href="${o}/supplier/${t}#availability" 211 target="_blank" 212 style="display: inline-block; background: ${i.primaryColor}; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600;" 213> 214 ${i.buttonText} 215</a>`,u=`<div id="availability-widget" data-supplier="${e}"></div> 216<script src="${o}/widget.js"><\/script>`,f=d=>
216{navigator.clipboard.writeText(d),n(!0),G.success("Code copied to clipboard!"),setTimeout(()=>n(!1),2e3)};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Ti,{className:"w-5 h-5 text-primary"}),"Embeddable Availability Widget"]}),a.jsx(he,{children:"Add a real-time availability checker to your website"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Primary Color"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{type:"color",value:i.primaryColor,onChange:d=>s(m=>({...m,primaryColor:d.target.value})),className:"w-12 h-10 p-1"}),a.jsx(ee,{value:i.primaryColor,onChange:d=>s(m=>({...m,primaryColor:d.target.value}))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Button Text"}),a.jsx(ee,{value:i.buttonText,onChange:d=>s(m=>({...m,buttonText:d.target.value}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Width (px)"}),a.jsx(ee,{type:"number",value:i.width,onChange:d=>s(m=>({...m,width:d.target.value}))})]})]}),a.jsxs("div",{className:"p-6 border rounded-lg bg-muted/30",children:[a.jsx("h4",{className:"text-sm font-medium mb-4",children:"Preview"}),a.jsxs("div",{className:"inline-flex items-center gap-2 px-6 py-3 rounded-lg text-white font-semibold",style:{backgroundColor:i.primaryColor},children:[a.jsx(qe,{className:"w-4 h-4"}),i.buttonText]})]}),a.jsxs(Ka,{defaultValue:"button",children:[a.jsxs(On,{className:"grid w-full grid-cols-3",children:[a.jsx(ge,{value:"button",children:"Simple Button"}),a.jsx(ge,{value:"iframe",children:"iFrame Widget"}),a.jsx(ge,{value:"script",children:"JavaScript"})]}),a.jsxs(ye,{value:"button",className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"A simple button that links to your availability page"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ce,{value:c,readOnly:!0,rows:8,className:"font-mono text-xs"}),a.jsx(F,{variant:"ghost",size:"sm",className:"absolute top-2 right-2",onClick:()=>f(c),children:r?a.jsx(it,{className:"w-4 h-4"}):a.jsx(Mt,{className:"w-4 h-4"})})]})]}),a.jsxs(ye,{value:"iframe",className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Embed an interactive calendar widget on your site"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ce,{value:l,readOnly:!0,rows:8,className:"font-mono text-xs"}),a.jsx(F,{variant:"ghost",size:"sm",className:"absolute top-2 right-2",onClick:()=>f(l),children:r?a.jsx(it,{className:"w-4 h-4"}):a.jsx(Mt,{className:"w-4 h-4"})})]})]}),a.jsxs(ye,{value:"script",className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Advanced: Load the widget dynamically with JavaScript"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ce,{value:u,readOnly:!0,rows:4,className:"font-mono text-xs"}),a.jsx(F,{variant:"ghost",size:"sm",className:"absolute top-2 right-2",onClick:()=>f(u),children:r?a.jsx(it,{className:"w-4 h-4"}):a.jsx(Mt,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(In,{className:"w-4 h-4"}),a.jsx("span",{children:"Copy the code and paste it into your website's HTML"})]})]})]})},EV=({supplierId:e,currentSettings:t})=>{const[r,n]=S.useState({enabled:t.watermark_enabled||!1,text:t.watermark_text||"",position:t.watermark_position||"bottom-right"}),[i,s]=S.useState(!1),o=async()=>{s(!0);const{error:l}=await Y.from("suppliers").update({watermark_enabled:r.enabled,watermark_text:r.text||null,watermark_position:r.position}).eq("id",e);l?G.error("Failed to save watermark settings"):G.success("Watermark settings saved!"),s(!1)};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Pv,{className:"w-5 h-5 text-primary"}),"Photo Watermarking"]}),a.jsx(he,{children:"Automatically add your branding to gallery images"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(q,{children:"Enable Watermarking"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add watermark to new gallery uploads"})]}),a.jsx(bt,{checked:r.enabled,onCheckedChange:l=>n(c=>({...c,enabled:l}))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Watermark Text"}),a.jsx(ee,{value:r.text,onChange:l=>n(c=>({...c,text:l.target.value}
216)),placeholder:"© Your Business Name"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Your business name or copyright notice"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Position"}),a.jsxs(Vt,{value:r.position,onValueChange:l=>n(c=>({...c,position:l})),children:[a.jsx(Kt,{children:a.jsx(Gt,{})}),a.jsxs(Ht,{children:[a.jsx(ve,{value:"top-left",children:"Top Left"}),a.jsx(ve,{value:"top-right",children:"Top Right"}),a.jsx(ve,{value:"bottom-left",children:"Bottom Left"}),a.jsx(ve,{value:"bottom-right",children:"Bottom Right"}),a.jsx(ve,{value:"center",children:"Center"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Preview"}),a.jsxs("div",{className:"relative w-full h-48 bg-muted rounded-lg overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground",children:"Sample Image"}),r.enabled&&r.text&&a.jsx("div",{className:`absolute text-white/70 text-sm font-medium px-2 py-1 bg-black/30 backdrop-blur-sm rounded ${r.position==="top-left"?"top-2 left-2":r.position==="top-right"?"top-2 right-2":r.position==="bottom-left"?"bottom-2 left-2":r.position==="bottom-right"?"bottom-2 right-2":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}`,children:r.text})]})]}),a.jsxs(F,{onClick:o,disabled:i,children:[i?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Settings"]}),a.jsx("div",{className:"bg-muted/50 p-4 rounded-lg text-sm text-muted-foreground",children:a.jsxs("p",{children:[a.jsx("strong",{children:"Note:"})," Watermarks will be applied to new images uploaded after enabling this feature. Existing images won't be affected."]})})]})]})},$V=({supplierId:e,currentSlug:t,customSlug:r})=>{const[n,i]=S.useState(r||""),[s,o]=S.useState(!1),[l,c]=S.useState(!1),[u,f]=S.useState(null),[d,m]=S.useState(!1),h=window.location.origin,g=`${h}/supplier/${r||t}`,p=j=>j.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),v=async j=>{if(!j||j.length<3){f(null);return}o(!0);const{data:N,error:y}=await Y.from("suppliers").select("id").or(`slug.eq.${j},custom_slug.eq.${j}`).neq("id",e).limit(1);y||f(!N||N.length===0),o(!1)};S.useEffect(()=>{const j=setTimeout(()=>{n&&v(n)},500);return()=>clearTimeout(j)},[n]);const x=async()=>{if(!n||!u){G.error("Please enter a valid, available URL");return}c(!0);const{error:j}=await Y.from("suppliers").update({custom_slug:n}).eq("id",e);j?G.error("Failed to save custom URL"):G.success("Custom URL saved!"),c(!1)},b=()=>{navigator.clipboard.writeText(g),m(!0),G.success("URL copied to clipboard!"),setTimeout(()=>m(!1),2e3)};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(jv,{className:"w-5 h-5 text-primary"}),"Custom Profile URL"]}),a.jsx(he,{children:"Create a memorable, branded URL for your profile"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Your Current URL"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{value:g,readOnly:!0,className:"font-mono text-sm"}),a.jsx(F,{variant:"outline",size:"icon",onClick:b,children:d?a.jsx(it,{className:"w-4 h-4"}):a.jsx(Mt,{className:"w-4 h-4"})}),a.jsx(F,{variant:"outline",size:"icon",onClick:()=>window.open(g,"_blank"),children:a.jsx(In,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Custom URL"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:[h,"/supplier/"]}),a.jsxs("div",{className:"relative flex-1",children:[a.jsx(ee,{value:n,onChange:j=>i(p(j.target.value)),placeholder:"your-business-name",className:`pr-10 ${u===!0?"border-green-500":u===!1?"border-red-500":""}`}),n&&a.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:s?a.jsx(Se,{className:"w-4 h-4 animate-spin text-muted-foreground"}):u===!0?a.jsx(it,{className:"w-4 h-4 text-green-500"}):u===!1?a.jsx(Va,{className:"w-4 h-4 text-red-500"}):null})]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[u===!0&&"â This URL is available!",u===!1&&"â This URL is already taken",u===null&&"Enter at least 3 characters"]})]}),a.jsxs(F,{onClick:x,disabled:l||!u,children:[l?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Custom URL"]}),a.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg text-sm space-y-2",children:[a.jsx("p",{className:"font-medium",children:"Tips for a great custom URL:"}),a.jsxs("ul",{className:"list-disc list-inside text-muted-foreground space-y-1",children:[a.jsx("li",{children:"Use your business name or brand"}),a.jsx("li",{children:"Keep it short and memorable"}),a.jsx("li",{children:"Avoid numbers and special characters"}),a.jsx("li",{children:"Make it easy to type and share"})]})]})]})]})},TV=e=>{const t=ur(),{data:r,isLoading:n}=Ge({queryKey:["supplier-referrals",e],queryFn:async()=>
216{if(!e)return[];const{data:l,error:c}=await Y.from("supplier_referrals").select("*").eq("referrer_supplier_id",e).order("created_at",{ascending:!1});if(c)throw c;return l},enabled:!!e}),i=Xe({mutationFn:async l=>{if(!e)throw new Error("No supplier ID");const{error:c}=await Y.from("supplier_referrals").insert({referrer_supplier_id:e,referred_email:l.referred_email,referred_business_name:l.referred_business_name||null});if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-referrals",e]}),G.success("Referral sent successfully!")},onError:()=>{G.error("Failed to send referral")}}),s=Xe({mutationFn:async l=>{const{error:c}=await Y.from("supplier_referrals").update({reward_claimed:!0}).eq("id",l);if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-referrals",e]}),G.success("Reward claimed!")}}),o={total:(r==null?void 0:r.length)||0,pending:(r==null?void 0:r.filter(l=>l.status==="pending").length)||0,converted:(r==null?void 0:r.filter(l=>l.status==="converted").length)||0,unclaimed:(r==null?void 0:r.filter(l=>l.status==="converted"&&!l.reward_claimed).length)||0};return{referrals:r||[],isLoading:n,createReferral:i,claimReward:s,stats:o}};function MV({supplierId:e,supplierName:t}){const{referrals:r,isLoading:n,createReferral:i,claimReward:s,stats:o}=TV(e),[l,c]=S.useState(!1),[u,f]=S.useState(""),[d,m]=S.useState(""),h=`${window.location.origin}/supplier-auth?ref=${e}`,g=()=>{navigator.clipboard.writeText(h),G.success("Referral link copied!")},p=async v=>{v.preventDefault(),await i.mutateAsync({referred_email:u,referred_business_name:d}),c(!1),f(""),m("")};return n?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(xt,{className:"w-5 h-5 text-primary"}),"Referral Program"]}),a.jsx(he,{children:"Refer other suppliers and earn rewards when they sign up"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"text-center p-4 bg-muted/50 rounded-lg",children:[a.jsx("p",{className:"text-2xl font-bold text-primary",children:o.total}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Referrals"})]}),a.jsxs("div",{className:"text-center p-4 bg-muted/50 rounded-lg",children:[a.jsx("p",{className:"text-2xl font-bold text-amber-500",children:o.pending}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending"})]}),a.jsxs("div",{className:"text-center p-4 bg-muted/50 rounded-lg",children:[a.jsx("p",{className:"text-2xl font-bold text-green-500",children:o.converted}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Converted"})]}),a.jsxs("div",{className:"text-center p-4 bg-muted/50 rounded-lg",children:[a.jsx("p",{className:"text-2xl font-bold text-gold",children:o.unclaimed}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Rewards to Claim"})]})]}),a.jsxs("div",{className:"p-4 border rounded-lg bg-muted/30",children:[a.jsx(q,{className:"text-sm font-medium mb-2 block",children:"Your Referral Link"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ee,{value:h,readOnly:!0,className:"font-mono text-sm"}),a.jsx(F,{variant:"outline",onClick:g,children:a.jsx(Mt,{className:"w-4 h-4"})})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Share this link with other suppliers. You'll earn a reward when they sign up!"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(F,{onClick:()=>c(!0),className:"bg-gold text-secondary hover:bg-gold/90",children:[a.jsx(_d,{className:"w-4 h-4 mr-2"}),"Send Invite"]})}),r.length>0&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"font-medium",children:"Your Referrals"}),r.map(v=>a.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:v.referred_business_name||v.referred_email}),a.jsx("p",{className:"text-sm text-muted-foreground",children:v.referred_email})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[v.status==="pending"&&a.jsxs(ne,{variant:"secondary",className:"gap-1",children:[a.jsx(St,{className:"w-3 h-3"}),"Pending"]}),v.status==="converted"&&!v.reward_claimed&&a.jsxs(F,{size:"sm",onClick:()=>s.mutate(v.id),className:"bg-gold text-secondary hover:bg-gold/90",children:[a.jsx(Pd,{className:"w-3 h-3 mr-1"}),"Claim Reward"]}),v.reward_claimed&&a.jsxs(ne,{variant:"outline",className:"gap-1 text-green-600",children:[a.jsx(ke,{className:"w-3 h-3"}),"Claimed"]})]})]},v.id))]}),a.jsx(Je,{open:l,onOpenChange:c,children:a.jsxs(Ze,{children:[a.jsx(dt,{children:a.jsx(ft,{children:"Invite a Supplier"})}),a.jsxs("form",{onSubmit:p,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"email",children:"Email Address *"}),a.jsx(ee,{id:"email",type:"email",value:u,onChange:v=>f(v.target.value),placeholder:"[email protected]",required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"businessName",children:"Business N
216ame (optional)"}),a.jsx(ee,{id:"businessName",value:d,onChange:v=>m(v.target.value),placeholder:"e.g., Amazing Photography"})]}),a.jsxs(Ga,{children:[a.jsx(F,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),a.jsx(F,{type:"submit",disabled:i.isPending,children:i.isPending?"Sending...":"Send Invite"})]})]})]})})]})]})}function DV({supplierId:e}){const t=ur(),[r,n]=S.useState(null),[i,s]=S.useState(""),{data:o,isLoading:l}=Ge({queryKey:["supplier-reviews-responses",e],queryFn:async()=>{const{data:m,error:h}=await Y.from("reviews").select("id, rating, title, content, reviewer_name, wedding_date, created_at, supplier_response, supplier_response_at").eq("supplier_id",e).order("created_at",{ascending:!1});if(h)throw h;return m}}),c=Xe({mutationFn:async({reviewId:m,response:h})=>{const{error:g}=await Y.from("reviews").update({supplier_response:h,supplier_response_at:new Date().toISOString()}).eq("id",m);if(g)throw g},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-reviews-responses",e]}),G.success("Response posted successfully!"),n(null),s("")},onError:()=>{G.error("Failed to post response")}}),u=m=>{n(m),s(m.supplier_response||"")},f=()=>{r&&i.trim()&&c.mutate({reviewId:r.id,response:i.trim()})},d=(o==null?void 0:o.filter(m=>!m.supplier_response).length)||0;return l?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Mr,{className:"w-5 h-5 text-primary"}),"Review Responses"]}),a.jsx(he,{children:"Respond to couple reviews to show you care"})]}),d>0&&a.jsxs(ne,{variant:"secondary",children:[d," awaiting response"]})]})}),a.jsxs(H,{children:[!o||o.length===0?a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx(Mr,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),a.jsx("p",{children:"No reviews yet"}),a.jsx("p",{className:"text-sm",children:"Reviews will appear here once couples leave feedback"})]}):a.jsx("div",{className:"space-y-4",children:o.map(m=>a.jsxs("div",{className:"border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-medium",children:m.reviewer_name}),a.jsx(Yf,{rating:m.rating,size:"sm"})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:me(new Date(m.created_at),"MMMM d, yyyy")})]}),m.supplier_response?a.jsxs(ne,{variant:"outline",className:"text-green-600 gap-1",children:[a.jsx(ke,{className:"w-3 h-3"}),"Replied"]}):a.jsx(ne,{variant:"secondary",children:"Awaiting Reply"})]}),a.jsx("h4",{className:"font-semibold text-sm mb-1",children:m.title}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:m.content}),m.supplier_response&&a.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 mb-3",children:[a.jsx("p",{className:"text-xs font-medium text-primary mb-1",children:"Your Response:"}),a.jsx("p",{className:"text-sm",children:m.supplier_response}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:m.supplier_response_at&&me(new Date(m.supplier_response_at),"MMMM d, yyyy")})]}),a.jsxs(F,{variant:"outline",size:"sm",onClick:()=>u(m),children:[a.jsx(Sw,{className:"w-3 h-3 mr-1"}),m.supplier_response?"Edit Response":"Reply"]})]},m.id))}),a.jsx(Je,{open:!!r,onOpenChange:m=>!m&&n(null),children:a.jsxs(Ze,{children:[a.jsx(dt,{children:a.jsx(ft,{children:r!=null&&r.supplier_response?"Edit Your Response":"Reply to Review"})}),r&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-muted/50 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-medium text-sm",children:r.reviewer_name}),a.jsx(Yf,{rating:r.rating,size:"sm"})]}),a.jsx("p",{className:"text-sm",children:r.content})]}),a.jsx(Ce,{value:i,onChange:m=>s(m.target.value),placeholder:"Write a thoughtful response...",rows:4}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Your response will be visible to everyone viewing this review."})]}),a.jsxs(Ga,{children:[a.jsx(F,{variant:"outline",onClick:()=>n(null),children:"Cancel"}),a.jsx(F,{onClick:f,disabled:!i.trim()||c.isPending,children:c.isPending?"Posting...":"Post Response"})]})]})})]})]})}function IV({supplierId:e}){const{data:t,isLoading:r}=T0(e),n=M0(),i=D0(),s=I0(),[o,l]=S.useState(!1),[c,u]=S.useState(null),[f,d]=S.useState(null),[m,h]=S.useState({client_name:"",client_location:"",wedding_date:"",rating:5,title:"",content:""}),g=()=>{h({client_name:"",client_location:"",wedding_date:"",rating:5,title:"",content:""}),u(null)},p=b=>{b?(u(b),h({client_name:b.client_name,client_location:b.client_location||"",wedding_date:b.wedding_date||"",rating:b.rating,title:b.title||"",content:b.content})):g(),l(!0)},v=async b=>{if(b.preventDefault(),!m.client_name.trim()||!m.content.trim()){G.error("Please fill in required fields");return}try{c?(await i.mutateAsync({id:c.id,supplier_id:e,client_name:m.client_name.trim(),client_location:m.client_location.trim()||null,wedding_date:m.wedding_date||null,rating:m.rating,title:m.title.trim()||null,content:m.content.trim()}),G.success("Testimonial updated!")):(await n.mutateAsync({supplier_id:e,client_name:m.client_name.trim(),client_location:m.client_location.trim()||null,wedding_date:m.wedding_date||null,rating:m.rating,title:m.title.trim()||null,content:m.content.trim()}),G.success("Testimonial added!")),l(!1),g()}catch{G.error("Failed to save testimonial")}},x=async()=>
216{if(f)try{await s.mutateAsync({id:f,supplierId:e}),G.success("Testimonial deleted"),d(null)}catch{G.error("Failed to delete testimonial")}};return r?a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"h-8 w-8 animate-spin text-primary"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Client Testimonials"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add testimonials from past clients to showcase on your profile"})]}),a.jsxs(Je,{open:o,onOpenChange:l,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{onClick:()=>p(),children:[a.jsx(ut,{className:"h-4 w-4 mr-2"}),"Add Testimonial"]})}),a.jsxs(Ze,{className:"max-w-lg",children:[a.jsx(dt,{children:a.jsx(ft,{children:c?"Edit Testimonial":"Add Testimonial"})}),a.jsxs("form",{onSubmit:v,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"client_name",children:"Client Name *"}),a.jsx(ee,{id:"client_name",value:m.client_name,onChange:b=>h({...m,client_name:b.target.value}),placeholder:"e.g., Sarah & James",required:!0})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"client_location",children:"Location"}),a.jsx(ee,{id:"client_location",value:m.client_location,onChange:b=>h({...m,client_location:b.target.value}),placeholder:"e.g., Chester"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"wedding_date",children:"Wedding Date"}),a.jsx(ee,{id:"wedding_date",type:"date",value:m.wedding_date,onChange:b=>h({...m,wedding_date:b.target.value})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Rating *"}),a.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(b=>a.jsx("button",{type:"button",onClick:()=>h({...m,rating:b}),className:"focus:outline-none",children:a.jsx(lt,{className:`h-6 w-6 transition-colors ${b<=m.rating?"fill-yellow-400 text-yellow-400":"text-gray-300"}`})},b))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"title",children:"Review Title"}),a.jsx(ee,{id:"title",value:m.title,onChange:b=>h({...m,title:b.target.value}),placeholder:"e.g., Amazing photographer!"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"content",children:"Testimonial *"}),a.jsx(Ce,{id:"content",value:m.content,onChange:b=>h({...m,content:b.target.value}),placeholder:"Enter the client's testimonial...",rows:4,required:!0})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[a.jsx(F,{type:"button",variant:"outline",onClick:()=>{l(!1),g()},children:"Cancel"}),a.jsxs(F,{type:"submit",disabled:n.isPending||i.isPending,children:[(n.isPending||i.isPending)&&a.jsx(Se,{className:"h-4 w-4 mr-2 animate-spin"}),c?"Update":"Add"," Testimonial"]})]})]})]})]})]}),t&&t.length>0?a.jsx("div",{className:"grid gap-4",children:t.map(b=>a.jsx(K,{children:a.jsx(H,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Uf,{className:"h-4 w-4 text-primary"}),a.jsx("span",{className:"font-medium",children:b.client_name}),a.jsx("div",{className:"flex",children:[...Array(5)].map((j,N)=>a.jsx(lt,{className:`h-4 w-4 ${N<b.rating?"fill-yellow-400 text-yellow-400":"text-gray-300"}`},N))})]}),a.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-3",children:[b.client_location&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Tr,{className:"h-3 w-3"}),b.client_location]}),b.wedding_date&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(qe,{className:"h-3 w-3"}),me(new Date(b.wedding_date),"MMMM yyyy")]})]}),b.title&&a.jsx("p",{className:"font-medium mb-1",children:b.title}),a.jsx("p",{className:"text-muted-foreground",children:b.content})]}),a.jsxs("div",{className:"flex gap-2 ml-4",children:[a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>p(b),children:a.jsx(Sd,{className:"h-4 w-4"})}),a.jsx(F,{variant:"ghost",size:"icon",className:"text-destructive hover:text-destructive",onClick:()=>d(b.id),children:a.jsx(dr,{className:"h-4 w-4"})})]})]})})},b.id))}
216):a.jsx(K,{children:a.jsxs(H,{className:"py-12 text-center",children:[a.jsx(Uf,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),a.jsx("h4",{className:"font-medium mb-2",children:"No testimonials yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Add testimonials from past clients to build trust with potential customers"}),a.jsxs(F,{onClick:()=>p(),children:[a.jsx(ut,{className:"h-4 w-4 mr-2"}),"Add Your First Testimonial"]})]})}),a.jsx(da,{open:!!f,onOpenChange:()=>d(null),children:a.jsxs(fa,{children:[a.jsxs(ma,{children:[a.jsx(ha,{children:"Delete Testimonial?"}),a.jsx(pa,{children:"This action cannot be undone. The testimonial will be permanently removed."})]}),a.jsxs(ga,{children:[a.jsx(va,{children:"Cancel"}),a.jsx(xa,{onClick:x,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function fv({supplierName:e,supplierData:t,packages:r=[],reviews:n=[]}){const[i,s]=S.useState(!1),[o,l]=S.useState({description:!0,contact:!0,packages:!0,reviews:!0}),c=async()=>{s(!0);try{const u=new Ov,f=u.internal.pageSize.getWidth();let d=20;if(u.setFontSize(24),u.setFont("helvetica","bold"),u.text(e,f/2,d,{align:"center"}),d+=15,t.location&&(u.setFontSize(12),u.setFont("helvetica","normal"),u.setTextColor(100),u.text(t.location,f/2,d,{align:"center"}),d+=15),u.setTextColor(0),o.description&&t.description){u.setFontSize(14),u.setFont("helvetica","bold"),u.text("About Us",20,d),d+=8,u.setFontSize(10),u.setFont("helvetica","normal");const h=u.splitTextToSize(t.description,f-40);u.text(h,20,d),d+=h.length*5+10}o.contact&&(u.setFontSize(14),u.setFont("helvetica","bold"),u.text("Contact Information",20,d),d+=8,u.setFontSize(10),u.setFont("helvetica","normal"),t.email&&(u.text(`Email: ${t.email}`,20,d),d+=6),t.phone&&(u.text(`Phone: ${t.phone}`,20,d),d+=6),t.website&&(u.text(`Website: ${t.website}`,20,d),d+=6),d+=10),o.packages&&r.length>0&&(d>240&&(u.addPage(),d=20),u.setFontSize(14),u.setFont("helvetica","bold"),u.text("Our Packages",20,d),d+=10,r.forEach(h=>{if(d>260&&(u.addPage(),d=20),u.setFontSize(12),u.setFont("helvetica","bold"),u.text(`${h.name} - £${h.price.toLocaleString()}`,20,d),d+=6,h.description){u.setFontSize(10),u.setFont("helvetica","normal");const g=u.splitTextToSize(h.description,f-40);u.text(g,20,d),d+=g.length*5}h.features&&h.features.length>0&&(u.setFontSize(9),h.features.forEach(g=>{u.text(`⢠${g}`,25,d),d+=5})),d+=8})),o.reviews&&n.length>0&&(d>220&&(u.addPage(),d=20),u.setFontSize(14),u.setFont("helvetica","bold"),u.text("Client Reviews",20,d),d+=10,n.slice(0,3).forEach(h=>{d>250&&(u.addPage(),d=20),u.setFontSize(10),u.setFont("helvetica","bold"),u.text(`${h.reviewer_name} - ${"â ".repeat(h.rating)}`,20,d),d+=6,u.setFont("helvetica","italic");const g=u.splitTextToSize(`"${h.content}"`,f-40);u.text(g,20,d),d+=g.length*5+8}));const m=u.getNumberOfPages();for(let h=1;h<=m;h++)u.setPage(h),u.setFontSize(8),u.setTextColor(150),u.text(`${e} - Media Kit | Page ${h} of ${m}`,f/2,u.internal.pageSize.getHeight()-10,{align:"center"});u.save(`${e.replace(/\s+/g,"-")}-Media-Kit.pdf`)}catch(u){console.error("Error generating PDF:",u)}finally{s(!1)}};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Qf,{className:"w-5 h-5"}),"Export Media Kit"]}),a.jsx(he,{children:"Generate a professional PDF portfolio to share with potential clients"})]}),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(q,{className:"text-sm font-medium",children:"Include in PDF:"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xi,{id:"include-description",checked:o.description,onCheckedChange:u=>l({...o,description:!!u})}),a.jsx(q,{htmlFor:"include-description",className:"text-sm",children:"About/Description"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xi,{id:"include-contact",checked:o.contact,onCheckedChange:u=>l({...o,contact:!!u})}),a.jsx(q,{htmlFor:"include-contact",className:"text-sm",children:"Contact Information"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xi,{id:"include-packages",checked:o.packages,onCheckedChange:u=>l({...o,packages:!!u})}),a.jsxs(q,{htmlFor:"include-packages",className:"text-sm",children:["Packages (",r.length,")"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xi,{id:"include-reviews",checked:o.reviews,onCheckedChange:u=>l({...o,reviews:!!u})}),a.jsxs(q,{htmlFor:"include-reviews",className:"text-sm",children:["Reviews (",n.length,")"]})]})]}),a.jsx(F,{onClick:c,disabled:i,className:"w-full gap-2",children:i?a.jsxs(a.Fragment,{children:[a.jsx(Se,{className:"w-4 h-4 animate-spin"}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Qf,{className:"w-4 h-4"}),"Download Media Kit PDF"]})})]})]})}function mv({supplierId:e,supplierName:t,bookings:r=[],availability:n=[]}){const i=()=>{const c=[];r.forEach(h=>{if(h.status==="confirmed"){const g=new Date(h.date),p=me(g,"yyyyMMdd");c.push("BEGIN:VEVENT",`DTSTART;VALUE=DATE:${p}`,`DTEND;VALUE=DATE:${p}`,`SUMMARY:Wedding - ${h.couple_name}`,`DESCRIPTION:Confirmed booking for ${h.couple_name}`,"STATUS:CONFIRMED",`UID:${h.id}@eliteweddings.co.uk`,"END:VEVENT")}}),n.filter(h=>h.status==="booked"||h.status==="unavailable").forEach(h=>{const g=new Date(h.date),p=me(g,"yyyyMMdd");c.push("BEGIN:VEVENT",`DTSTART;VALUE=DATE:${p}`,`DTEND;VALUE=DATE:${p}`,`SUMMARY:${h.status==="booked"?"Booked":"Unavailable"}`,`DESCRIPTION:${h.notes||"Date marked as "+h.status}`,"STATUS:CONFIRMED",`UID:${h.id}@eliteweddings.co.uk`,"END:VEVENT")});const u=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//Elite Weddings//Calendar//EN","CALSCALE:GREGORIAN","METHOD:PUBLISH",`X-WR-CALNAME:${t} - Bookings`,...c,"END:VCALENDAR"].join(`\r 217`),f=new Blob([u],{type:"text/calendar;charset=utf-8"}),d=URL.createObjectURL(f),m=document.createElement("a");m.href=d,m.download=`${t.replace(/\s+/g,"-")}-calendar.ics`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(d)},s=c=>{const u=new Date(c.date),f=me(u,"yyyyMMdd"),d=encodeURIComponent(`Wedding - ${c.couple_name}`),m=encodeURIComponent("Wedding booking via Elite Weddings & Events");return`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${d}&dates=${f}/${f}&details=${m}`},o=r.filter(c=>c.status==="confirmed"),l=n.filter(c=>c.status==="booked"||c.status==="unavailable");return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-5 h-5"}),"Calendar Export"]}),a.jsx(he,{children:"Sync your bookings with Google Calendar, Outlook, or Apple Calendar"})]}
217),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsxs("p",{children:[o.length," confirmed bookings"]}),a.jsxs("p",{children:[l.length," blocked dates"]})]}),a.jsxs(F,{onClick:i,className:"w-full gap-2",children:[a.jsx(ua,{className:"w-4 h-4"}),"Download ICS File"]}),a.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Import the .ics file into your calendar app to sync all dates"}),o.length>0&&a.jsxs("div",{className:"border-t pt-4",children:[a.jsx("p",{className:"text-sm font-medium mb-2",children:"Quick Add to Google Calendar:"}),a.jsx("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:o.slice(0,5).map(c=>a.jsxs("a",{href:s(c),target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-2 rounded-md hover:bg-muted text-sm",children:[a.jsxs("span",{children:[c.couple_name," - ",me(new Date(c.date),"d MMM yyyy")]}),a.jsx(In,{className:"w-3 h-3"})]},c.id))})]})]})]})}const wd={profile_complete:{name:"Profile Pro",icon:"ð¤",description:"Complete your profile 100%"},first_enquiry:{name:"First Contact",icon:"ð",description:"Receive your first enquiry"},five_enquiries:{name:"Popular Choice",icon:"ð¥",description:"Receive 5 enquiries"},first_review:{name:"Star Performer",icon:"â",description:"Get your first review"},five_reviews:{name:"Crowd Favorite",icon:"ð",description:"Get 5 reviews"},first_booking:{name:"Deal Maker",icon:"ð¤",description:"Get your first booking"},fast_responder:{name:"Lightning Fast",icon:"â¡",description:"Respond within 2 hours"},first_referral:{name:"Team Player",icon:"ð¤",description:"Refer another supplier"},gallery_uploaded:{name:"Picture Perfect",icon:"ð¸",description:"Upload 5+ gallery images"},package_created:{name:"Package Pro",icon:"ð¦",description:"Create your first package"}},RV=e=>{const t=ur(),{data:r,isLoading:n}=Ge({queryKey:["supplier-achievements",e],queryFn:async()=>{if(!e)return[];const{data:l,error:c}=await Y.from("supplier_achievements").select("*").eq("supplier_id",e);if(c)throw c;return l},enabled:!!e}),i=Xe({mutationFn:async l=>{if(!e)throw new Error("No supplier ID");const{error:c}=await Y.from("supplier_achievements").insert({supplier_id:e,achievement_type:l});if(c&&!c.message.includes("duplicate"))throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-achievements",e]})}}),s=new Set((r==null?void 0:r.map(l=>l.achievement_type))||[]),o={earned:s.size,total:Object.keys(wd).length,percentage:Math.round(s.size/Object.keys(wd).length*100)};return{achievements:r||[],isLoading:n,unlockAchievement:i,earnedTypes:s,progress:o}};function LV({supplierId:e}){const{isLoading:t,earnedTypes:r,progress:n}=RV(e);return t?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(wv,{className:"w-5 h-5 text-gold"}),"Achievements"]}),a.jsx(he,{children:"Complete actions to earn badges and boost your profile visibility"})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{className:"text-muted-foreground",children:"Progress"}),a.jsxs("span",{className:"font-medium",children:[n.earned," / ",n.total," badges earned"]})]}),a.jsx(en,{value:n.percentage,className:"h-2"})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-3",children:Object.entries(wd).map(([i,s])=>{const o=r.has(i);return a.jsxs("div",{className:He("flex flex-col items-center text-center p-3 rounded-lg border transition-all",o?"bg-gold/10 border-gold/30":"bg-muted/30 border-muted opacity-60"),children:[a.jsx("span",{className:"text-2xl mb-1",children:s.icon}),a.jsx("span",{className:He("text-xs font-medium",o&&"text-gold"),children:s.name}),a.jsx("span",{className:"text-[10px] text-muted-foreground mt-0.5 line-clamp-2",children:s.description})]},i)})}),a.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Earn all badges to become a Top Supplier and get featured in search results!"})]})]})}const FV=({supplierId:e})=>{const{items:t,setItems:r}=rl("virtual-tours"),[n,i]=S.useState(!1),[s,o]=S.useState(null),[l,c]=S.useState(""),[u,f]=S.useState(""),d=g=>g.includes("matterport.com")?"Matterport":g.includes("kuula.co")?"Kuula":g.includes("google.com/maps")?"Google Street View":g.includes("my.matterport")?"Matterport":g.includes("360cities")?"360Cities":g.includes("roundme")?"Roundme":"Custom",m=()=>{if(!u||!l){G.error("Please fill in all fields");return}const g={id:Date.now().toString(),title:l,tour_url:u,platform:d(u)};r([...t,g]),i(!1),c(""),f(""),G.success("Virtual tour added successfully")},h=g=>{r(t.filter(p=>p.id!==g)),G.success("Tour removed")};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-semibold flex items-center gap-2",children:[a.jsx(wi,{className:"w-5 h-5 text-gold"}),"Virtual Tours"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Add 360° virtual tours to showcase your venue or services"})]}),a.jsxs(Je,{open:n,onOpenChange:i,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{className:"bg-gold hover:bg-gold/90 text-secondary",children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Add Tour"]})}),a.jsxs(Ze,{className:"max-w-md",children:[a.jsx(dt,{children:a.jsx(ft,{children:"Add Virtual Tour"})}
217),a.jsxs("div",{className:"space-y-4 mt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Tour Title *"}),a.jsx(ee,{value:l,onChange:g=>c(g.target.value),placeholder:"e.g., Wedding Barn 360° Tour"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Tour URL *"}),a.jsx(ee,{value:u,onChange:g=>f(g.target.value),placeholder:"https://my.matterport.com/show/?m=..."}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports Matterport, Kuula, Google Street View, 360Cities, and more"})]}),a.jsx(F,{onClick:m,className:"w-full bg-gold hover:bg-gold/90 text-secondary",children:"Add Tour"})]})]})]})]}),t.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:t.map(g=>a.jsxs(K,{className:"overflow-hidden",children:[a.jsxs("div",{className:"relative aspect-video bg-gradient-to-br from-gold/10 to-primary/10 flex items-center justify-center",children:[a.jsx(wi,{className:"w-16 h-16 text-gold/30"}),a.jsxs(ne,{className:"absolute top-2 left-2 bg-muted text-muted-foreground",children:[a.jsx(vv,{className:"w-3 h-3 mr-1"}),g.platform]})]}),a.jsx(H,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"font-medium truncate",children:g.title}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:g.tour_url})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>o(g.tour_url),children:a.jsx(br,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>
217h(g.id),children:a.jsx(dr,{className:"w-4 h-4"})})]})]})})]},g.id))}):a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-12 text-center",children:[a.jsx(wi,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h4",{className:"font-semibold mb-2",children:"No virtual tours yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-md mx-auto",children:"Add 360° virtual tours from Matterport, Kuula, or other platforms to give couples an immersive experience"}),a.jsxs(F,{variant:"outline",onClick:()=>i(!0),children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"Add Your First Tour"]})]})}),a.jsx(Je,{open:!!s,onOpenChange:()=>o(null),children:a.jsx(Ze,{className:"max-w-4xl p-0 overflow-hidden",children:a.jsx("div",{className:"aspect-video",children:s&&a.jsx("iframe",{src:s,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; vr",allowFullScreen:!0})})})})]})},BV=({supplierName:e})=>{const t={name:"Cara Williams",role:"Elite Member Success Manager",email:"[email protected]",phone:"+44 1234 567890",image:"/placeholder.svg"};return a.jsxs("div",{className:"space-y-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"elite-icon",children:a.jsx(be,{className:"w-6 h-6"})}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["Your Dedicated Account Manager",a.jsx(yt,{className:"w-4 h-4 text-gold animate-crown-pulse"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Direct support for Elite members"})]})]}),a.jsxs(ne,{className:"elite-badge",children:[a.jsx(be,{className:"w-3 h-3 mr-1"}),"Elite"]})]}),a.jsx("div",{className:"elite-divider"}),a.jsxs(K,{className:"elite-card overflow-hidden",children:[a.jsx(oe,{className:"elite-header pb-4",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-20 h-20 rounded-full bg-gradient-to-br from-gold/20 to-elite/20 flex items-center justify-center ring-2 ring-gold/30",children:a.jsx(be,{className:"w-8 h-8 text-gold"})}),a.jsxs("div",{children:[a.jsx(le,{className:"text-xl",children:t.name}),a.jsx(he,{className:"text-base",children:t.role}),a.jsxs(ne,{className:"mt-2 bg-gold/10 text-gold border-gold/30",variant:"outline",children:["Dedicated to ",e]})]})]})}),a.jsxs(H,{className:"space-y-4",children:[a.jsx("p",{className:"text-muted-foreground",children:"As an Elite Vow Collective member, you have direct access to a dedicated account manager who can help you maximize your membership benefits, troubleshoot issues, and grow your business."}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsxs("a",{href:`mailto:${t.email}`,className:"elite-quick-action flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-gold/10 rounded-lg",children:a.jsx(Tt,{className:"w-5 h-5 text-gold"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Email"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:t.email})]})]}),a.jsxs("a",{href:`tel:${t.phone}`,className:"elite-quick-action flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-gold/10 rounded-lg",children:a.jsx(Xr,{className:"w-5 h-5 text-gold"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"Phone"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:t.phone})]})]})]}),a.jsxs("div",{className:"pt-4 border-t space-y-3",children:[a.jsx("h4",{className:"font-medium",children:"How your account manager can help:"}),a.jsxs("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-gold"}),"Profile optimization advice"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-gold"}),"Wedding show booth placement"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-gold"}),"Magazine feature opportunities"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-gold"}),"Lead generation strategies"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-gold"}),"Technical support escalation"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-gold"}),"Networking event invitations"]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-3 pt-4",children:[a.jsxs(F,{className:"elite-button",children:[a.jsx(Mr,{className:"w-4 h-4 mr-2"}),"Send Message"]}),a.jsxs(F,{variant:"outline",className:"border-gold/30 hover:bg-gold/5 hover:border-gold/50",children:[a.jsx(qe,{className:"w-4 h-4 mr-2"}),"Book a Call"]})]})]})]})]})},Ec=[{id:"1",title:"Creating a 5-Star Profile",description:"Learn how to craft a profile that converts views into enquiries",type:"guide",duration:"15 min read",completed:!1,category:"profile",content:[`## Why Your Profile Matters 218Your supplier profile is often the first impression couples have of your business. A well-crafted profile can increase enquiry rates by up to 300%.`,`## Step 1: Choose a Compelling Profile Photo 219- Use a high-resolution, professional image that represents your best work 220- Ensure good lighting and composition 221- Avoid overly edited or filtered images 222- Update your photo seasonally to keep things fresh`,`## Step 2: Write an Engaging Business Description 223- Lead with your unique selling point â what makes you different? 224- Mention your experience and any awards or recognitions 225- Keep it conversational but professional 226- Include the areas you cover and your availability`,`## Step 3: Showcase Your Best Work 227- Upload your strongest portfolio images first â couples often only view the first few 228- Include a variety of wedding styles and venues 229- Add captions to give context to each image 230- Elite members: Upload video content to stand out even more`,`## Step 4: Set Your Pricing Transparency 231- Couples appreciate knowing ballpark pricing upfront 232- Use the packages feature to outline what's included 233- Highlight your most popular package 234- Be clear about any additional costs`,`## Step 5: Collect & Display Reviews 235- Ask happy couples to leave a review after their wedding 236- Respond to every review â it shows you care 237- Pin your best reviews to the top of your profile 238- Aim for at least 5 reviews to build credibility`,`## Pro Tips 239- Complete every section of your profile â incomplete profiles rank lower in search 240- Update your availability calendar regularly 241- Respond to enquiries within 24 hours to earn a 'Quick Responder' badge 242- Use the AI Description Writer to help craft compelling copy`]},{id:"2",title:"Photography Tips for Suppliers",description:"Professional tips for capturing your work beautifully",type:"guide",duration:"22 min read",completed:!1,category:"profile",content:[`## The Power of Great Photography 243In the wedding industry, visual presentation is everything. Couples make decisions based on what they see, so investing in quality photography of your work pays dividends.`,`## Lighting Fundamentals 244- Natural light is your best friend â shoot near windows or outdoors during golden hour 245- Avoid harsh midday sun which creates unflattering shadows 246- Use a reflector to bounce light into shadowed areas 247- For indoor setups, position work near the largest light source`,`## Composition Techniques 248- Use the rule of thirds to create balanced, engaging shots 249- Include context shots showing your work in a real wedding setting 250- Capture both wide-angle scenes and close-up details 251- Shoot from multiple angles to give couples a complete picture`,`## Smartphone Photography Tips 252- Clean your lens before shooting (seriously, it makes a huge difference!) 253- Use portrait mode for product shots with blurred backgrounds 254- Enable grid lines to help with composition 255- Avoid using digital zoom â move closer instead
256- Edit photos for consistency in tone and brightness`,`## Working with a Professional Photographer 257- Consider hiring a photographer for a portfolio shoot â the investment is worth it 258- Brief them on the specific shots you need for your profile 259- Ask for both landscape and portrait orientations 260- Request images in high resolution for maximum flexibility`,`## Image Preparation for Your Profile 261- Resize images to at least 1200px wide for crisp display 262- Keep file sizes reasonable (under 5MB) for fast loading 263- Use consistent editing styles across your portfolio 264- Name files descriptively for easy organisation`]},{id:"3",title:"Writing Compelling Descriptions",description:"Copywriting techniques that resonate with couples",type:"guide",duration:"10 min read",completed:!1,category:"profile",content:[`## Words That Win Bookings 265Your business description is your elevator pitch to every couple browsing the directory. Make every word count.`,`## Know Your Audience 266- Remember you're speaking to excited, sometimes overwhelmed couples 267- Use warm, reassuring language 268- Address common concerns proactively 269- Show empathy â you understand how important their day is`,`## Structure Your Description 2701. **Hook** â Start with something attention-grabbing 2712. **Credentials** â Briefly mention experience, awards, training 2723. **Services** â What you offer and what makes it special 2734. **Process** â How working with you looks 2745. **Call to Action** â Encourage them to get in touch`,`## Power Words for Wedding Suppliers 275- Use words like: bespoke, tailored, unforgettable, seamless, effortless, personal, dedicated 276- Avoid overused words like: amazing, awesome, best, cheap 277- Be specific rather than generic â 'hand-tied seasonal bouquets' beats 'beautiful flowers'`,`## Common Mistakes to Avoid 278- Don't write in the third person â 'We create...' is warmer than 'They create...' 279- Avoid jargon couples won't understand 280- Don't list every service â highlight what you're known for 281- Keep paragraphs short for easy scanning on mobile 282- Proofread! Typos undermine professionalism`,`## Using the AI Description Writer 283- Our AI tool can help generate a professional description based on your details 284- Use it as a starting point, then personalise with your own voice 285- It's available in your dashboard under Profile settings`]},{id:"4",title:"Social Media for Wedding Suppliers",description:"Build your brand on Instagram and Facebook",type:"guide",duration:"20 min read",completed:!1,category:"marketing",content:[`## Why Social Media Matters 286Over 80% of couples use social media during their wedding planning. Being active on the right platforms puts you in front of your ideal clients.`,`## Choosing Your Platforms 287- **Instagram**: The #1 platform for wedding inspiration â visual-first, ideal for showcasing work 288- **Facebook**: Great for local groups, reviews, and community engagement 289- **Pinterest**: Long-term discovery â pins can drive traffic for years 290- **TikTok**: Growing rapidly for behind-the-scenes and personality-driven content`,`## Content Ideas That Work 291- Behind-the-scenes of your setup process 292- Before and after transformations 293- Real wedding features with couple testimonials 294- Tips and advice related to your service 295- Team introductions and personal stories 296- Seasonal inspiration and trend updates`,`## Posting Strategy 297- Aim for 3-5 posts per week on Instagram 298- Post at peak engagement times (typically evenings and weekends) 299- Use a mix of feed posts, Stories, and Reels 300- Batch create content to save time 301- Schedule posts in advance using tools like Later or Buffer`,`## Hashtag Strategy 302- Use a mix of broad (#wedding) and specific (#NorthWalesWedding) hashtags 303- Include location-based hashtags to attract local couples 304- Create a branded hashtag for your business 305- Research what hashtags your target couples are following 306- Use 15-20 hashtags per post for maximum reach`,`## Engaging With Your Audience 307- Respond to comments and DMs promptly 308- Engage with other wedding suppliers' content 309- Join local wedding planning groups on Facebook 310- Collaborate with other suppliers for cross-promotion 311- Share and tag venues and suppliers you work with`]},{id:"5",title:"Email Marketing Essentials",description:"Create campaigns that nurture leads",type:"guide",duration:"18 min read",completed:!1,category:"marketing",content:[`## The Power of Email Marketing 312Email remains one of the most effective marketing channels with an average ROI of £36 for every £1 spent. For wedding suppliers, it's a direct line to interested couples.`,`## Building Your Email List 313- Add a signup form to your website and social media profiles 314- Offer something valuable in exchange â a planning checklist, style guide, or discount 315- Collect emails at wedding shows (with GDPR consent) 316- Ask past couples if they'd like to stay in touch for anniversary offers`,`## Types of Emails to Send 317- **Welcome sequence**: Introduce your business over 3-4 emails 318- **Seasonal inspiration**: Share trends and ideas relevant to their wedding date 319- **Social proof**: Feature recent weddings and testimonials 320- **Limited-time offers**: Create urgency with early booking discounts 321- **Educational content**: Tips related to your service area`,`## Writing Effective Subject Lines 322- Keep them under 50 characters for mobile 323- Create curiosity: '3 things most couples forget about...' 324- Use personalisation: 'Your [Month] wedding â our top picks' 325- Avoid spam trigger words: free, guarantee, act now 326- Test different approaches and track open rates`,`## GDPR Compliance 327- Always get explicit consent before adding someone to your list 328- Include an easy unsubscribe link in every email
329- Keep records of when and how consent was given 330- Don't purchase email lists â ever 331- Review and clean your list regularly`,`## Elite Feature: Email Campaigns 332As an Elite member, you can send email campaigns directly to couples who've saved your profile. This puts your promotions directly in front of your warmest leads.`]},{id:"6",title:"Getting More 5-Star Reviews",description:"Strategies to encourage happy couples to leave reviews",type:"guide",duration:"8 min read",completed:!1,category:"marketing",content:[`## Why Reviews Matter 333Reviews are the single most influential factor in a couple's booking decision. Suppliers with 5+ reviews receive 4x more enquiries than those without.`,`## When to Ask for Reviews 334- 2-3 weeks after the wedding, once the honeymoon excitement has settled 335- After receiving positive feedback or a thank-you message 336- When sharing their professional wedding photos with them 337- During a follow-up call or check-in`,`## How to Ask 338- Make it personal â reference specific moments from their day 339- Keep it easy â send them a direct link to your review page 340- Be specific about what to include: 'We'd love to hear about your experience working with us' 341- A simple email template works well â don't overthink it`,`## Responding to Reviews 342- Thank every reviewer personally and promptly 343- Reference specific details they mentioned 344- For negative reviews, respond professionally and offer to discuss offline 345- Your responses show future couples how you handle feedback`,`## Leveraging Your Reviews 346- Pin your best reviews to the top of your profile (Elite feature) 347- Share reviews on social media with the couple's permission 348- Include quotes in your email marketing 349- Use the Review Widget Generator to display reviews on your own website`,`## Review Request Automation 350Elite members can use the automated review request system to send professionally crafted review requests at the perfect time after each wedding.`]},{id:"7",title:"Pricing Your Services",description:"How to price competitively while maintaining profit",type:"guide",duration:"25 min read",completed:!1,category:"business",content:[`## Getting Your Pricing Right 351Pricing is one of the most challenging aspects of running a wedding business. Too high and you lose bookings; too low and you undervalue your expertise.`,`## Understanding Your Costs 352- Calculate all direct costs: materials, labour, travel, insurance 353- Factor in overheads: equipment, marketing, subscriptions, training 354- Don't forget to pay yourself a proper wage 355- Include hidden costs: admin time, consultations, setup/teardown`,`## Pricing Strategies 356- **Cost-plus pricing**: Calculate costs + desired profit margin 357- **Value-based pricing**: Price based on the value you deliver, not just your costs 358- **Tiered packages**: Offer good/better/best options to suit different budgets 359- **Seasonal pricing**: Consider peak vs. off-peak rates`,`## Creating Packages That Sell 360- Lead with your most popular package 361- Make the middle option the most attractive (the decoy effect) 362- Clearly outline what's included and excluded 363- Name packages creatively rather than 'Basic', 'Standard', 'Premium' 364- Include an 'upgrade' option for couples who want more`,`## When to Raise Your Prices 365- When you're consistently fully booked 6+ months ahead 366- After gaining significant new skills or equipment 367- When your costs increase 368- Annually, at minimum, to keep pace with inflation 369- After receiving industry awards or recognition`,`## Price Presentation Tips 370- Present value before price â show what they get first 371- Use round numbers (£1,500 not £1,499) 372- Offer payment plans to make higher prices more accessible 373- Be confident â apologising for your prices undermines their value`,`## Elite Feature: Smart Pricing Suggestions 374Use our pricing benchmark tool to compare your rates with similar suppliers in your area and get data-driven pricing recommendations.`]},{id:"8",title:"Managing Difficult Situations",description:"Professional strategies for handling challenges",type:"guide",duration:"20 min read",completed:!1,category:"business",content:[`## Staying Professional Under Pressure 375Every supplier will face challenging situations. How you handle them defines your reputation and protects your business.`,`## Common Challenges & Solutions 376### Last-Minute Changes 377- Have clear terms about change deadlines in your contract 378- Assess feasibility honestly and communicate quickly 379- Charge fairly for additional work required 380- Document all changes in writing`,`## Managing Expectations 381- Set clear expectations from the first meeting 382- Use mood boards and samples to align on vision 383- Send detailed timelines and plans well in advance 384- Regular check-ins prevent last-minute surprises 385- Put everything in writing â verbal agreements cause problems`,`## Handling Complaints 386- Listen fully before responding 387- Acknowledge their feelings without being defensive 388- Propose a solution rather than making excuses 389- Follow up to ensure they're satisfied with the resolution 390- Learn from every complaint to improve your service`,`## Protecting Your Business 391- Always use a comprehensive contract (use our Contract Manager tool) 392- Take deposits and stage payments 393- Have professional indemnity and public liability insurance 394- Keep thorough records of all client communications
395- Know when to walk away from a toxic situation`,`## Self-Care for Suppliers 396- Wedding season can be exhausting â schedule regular breaks 397- Build a support network with other suppliers 398- Set boundaries around working hours and response times 399- Celebrate your wins, not just focus on problems 400- Remember: you can't pour from an empty cup`]},{id:"9",title:"Contract Essentials",description:"Protect your business with solid contracts",type:"guide",duration:"15 min read",completed:!1,category:"business",content:[`## Why Contracts Are Non-Negotiable 401A good contract protects both you and your clients. It sets clear expectations and provides legal protection if things go wrong.`,`## Essential Contract Clauses 402- **Services described**: Exactly what you'll provide 403- **Date and times**: When and for how long 404- **Pricing and payment schedule**: Including deposit and final payment dates 405- **Cancellation policy**: What happens if either party cancels 406- **Force majeure**: Covering unforeseen circumstances 407- **Liability limitations**: Protecting your business from excessive claims`,`## Payment Terms Best Practice 408- Require a non-refundable booking deposit (typically 25-50%) 409- Set clear payment milestones 410- Specify accepted payment methods 411- Include late payment consequences 412- Consider offering payment plans for larger amounts`,`## Cancellation & Rescheduling Policies 413- Tiered refund structure based on notice period 414- Separate policies for cancellation vs. postponement 415- COVID/illness clauses for flexibility 416- Credit towards future bookings as an alternative to refunds 417- Be fair but protect your lost income opportunity`,`## Digital Contracts 418- Use our Contract Manager to create, send, and track contracts digitally 419- Digital signatures are legally binding in the UK 420- Both parties receive a copy automatically 421- Track when contracts are viewed and signed 422- Store all contracts securely in your dashboard`,`## Getting Legal Advice 423- Have a solicitor review your contract template at least once 424- Industry associations often provide template contracts 425- Update your contracts annually to reflect law changes 426- Specific to your region â Scottish law differs from English law`]},{id:"10",title:"Wedding Show Success Guide",description:"Maximise your ROI at wedding exhibitions",type:"guide",duration:"25 min read",completed:!1,category:"shows",content:[`## Making the Most of Wedding Shows 427Wedding shows are one of the best opportunities to meet couples face-to-face. With the right preparation, they can be your most profitable marketing channel.`,`## Before the Show 428- Book your space early â Elite members get 20% off and priority positioning 429- Plan your stand layout and design well in advance 430- Prepare printed materials: business cards, brochures, price lists 431- Create a special show-only offer to encourage bookings 432- Promote your attendance on social media in the weeks before`,`## Stand Design on Any Budget 433- Height creates impact â use backdrops, banners, or shelving 434- Lighting makes everything look better â bring your own if needed 435- Display your best work prominently at eye level 436- Keep surfaces uncluttered â quality over quantity 437- Brand everything consistently: colours, fonts, logo placement`,`## Engaging with Couples 438- Stand at the front of your space, not behind a table 439- Smile and make eye contact â be approachable 440- Ask open questions: 'When's the big day?' 'What's your vision?' 441- Listen more than you talk 442- Have a quick 30-second pitch ready but keep it natural`,`## Capturing Leads 443- Use a simple form or tablet to collect contact details 444- Offer something in exchange: a prize draw entry, free consultation, or discount 445- Take notes about each conversation for personalised follow-up 446- Qualify leads â not everyone will be your ideal client 447- Aim for quality conversations over quantity`,`## After the Show 448- Follow up within 48 hours while you're fresh in their minds 449- Send personalised messages referencing your conversation 450- Connect on social media 451- Track which shows generate the most bookings for future decisions 452- Elite members can access show attendee data (GDPR compliant) for targeted follow-up`]},{id:"11",title:"Stand Design Best Practices",description:"Create an eye-catching booth on any budget",type:"guide",duration:"12 min read",completed:!1,category:"shows",content:[`## First Impressions Count 453Couples walk past dozens of stands at a wedding show. You have about 3 seconds to catch their attention. Your stand design makes or breaks that moment.`,`## Budget-Friendly Stand Ideas 454- Use fabric draping for an elegant backdrop (£20-50) 455- Print a large banner with your best image and logo (£30-80) 456- Fairy lights or LED strips add instant warmth (£10-20) 457- Fresh flowers or plants bring life to any space 458- Tablecloths in your brand colours create a cohesive look`,`## Layout Principles 459- Create a welcoming entrance â don't block access with tables 460- Use different heights to create visual interest 461- Leave space for couples to step in and browse comfortably 462- Position your most impressive piece where it's visible from the aisle 463- Consider traffic flow â which direction will most people approach from?`,`## Displaying Your Work 464- For photographers/videographers: a large screen showing a slideshow or highlights reel 465- For florists: a mix of fresh arrangements and portfolio photos 466- For caterers: samples! Nothing draws a crowd like free food
467- For venues: immersive visuals â large photos or virtual tour on a screen 468- For stationers: framed samples at different price points`,`## Interactive Elements 469- Live demonstrations draw crowds and create buzz 470- Photo opportunities (a prop or backdrop) get shared on social media 471- Touch-and-feel samples let couples engage with your work 472- A prize draw or competition captures details and creates excitement`,`## What to Bring Checklist 473- Branded tablecloth and banner 474- Business cards and brochures 475- Portfolio samples or display 476- Lead capture system (tablet/forms) 477- Pens, tape, scissors, cable ties 478- Extension lead and phone charger 479- Water and snacks for yourself 480- Show-exclusive offers printed and visible`]},{id:"12",title:"Converting Show Leads",description:"Follow-up strategies that win bookings",type:"guide",duration:"10 min read",completed:!1,category:"shows",content:[`## The Fortune Is in the Follow-Up 481Most couples visit a wedding show to gather ideas and contacts. The supplier who follows up first and best wins the booking.`,`## The 48-Hour Rule 482- Contact every lead within 48 hours of the show 483- Couples speak to many suppliers â be the one they remember 484- If you wait a week, they've likely already booked someone else 485- Set aside the Monday after a show specifically for follow-up`,`## Crafting Your Follow-Up Message 486- Reference something specific from your conversation 487- Remind them of any offer or discount discussed 488- Include a clear next step: consultation booking, venue visit, quote request 489- Attach 2-3 images relevant to their wedding style 490- Keep it brief â they're getting lots of emails`,`## Follow-Up Sequence 4911. **Day 1-2**: Initial personalised email or message 4922. **Day 5-7**: Follow up if no response â share a recent testimonial or blog post 4933. **Day 14**: Final gentle nudge with a time-limited offer 4944. **Day 30+**: Add to your regular marketing list (with consent) 495- Don't be pushy â 3 follow-ups is the maximum`,`## Tracking & Measuring 496- Record every lead and their status (contacted, responded, booked, lost) 497- Calculate your cost per lead: stand cost ÷ number of leads 498- Calculate your conversion rate: bookings ÷ leads à 100 499- Compare different shows to identify which ones work best for you 500- Use this data to negotiate better stand positions at future shows`,`## Using Elite Tools for Follow-Up 501- Use Enquiry Templates for quick, professional responses 502- The AI Enquiry Reply tool can help personalise messages at scale 503- Track all your leads in the Lead Scoring system 504- Set up Automated Follow-ups to never miss a lead`]}],qV=e=>{switch(e){case"video":return a.jsx(Hr,{className:"w-4 h-4"});case"guide":return a.jsx(nt,{className:"w-4 h-4"});case"webinar":return a.jsx(Ad,{className:"w-4 h-4"})}},UV=e=>e.split(` 505`).map((t,r)=>{if(t.startsWith("## "))return a.jsx("h2",{className:"text-lg font-bold mt-6 mb-2 text-foreground",children:t.replace("## ","")},r);if(t.startsWith("### "))return a.jsx("h3",{className:"text-base font-semibold mt-4 mb-1 text-foreground",children:t.replace("### ","")},r);if(t.startsWith("- ")){const n=t.replace("- ",""),i=n.match(/^\*\*(.+?)\*\*:?\s*(.*)/);return i?a.jsxs("li",{className:"ml-4 text-sm text-muted-foreground list-disc",children:[a.jsx("span",{className:"font-semibold text-foreground",children:i[1]}),i[2]?`: ${i[2]}`:""]},r):a.jsx("li",{className:"ml-4 text-sm text-muted-foreground list-disc",children:n},r)}if(/^\d+\.\s/.test(t)){const n=t.replace(/^\d+\.\s/,""),i=n.match(/^\*\*(.+?)\*\*\s*[â\-â]?\s*(.*)/);return i?a.jsxs("li",{className:"ml-4 text-sm text-muted-foreground list-decimal",children:[a.jsx("span",{className:"font-semibold text-foreground",children:i[1]}),i[2]?` â ${i[2]}`:""]},r):a.jsx("li",{className:"ml-4 text-sm text-muted-foreground list-decimal",children:n},r)}return t.trim()===""?a.jsx("div",{className:"h-2"},r):a.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t},r)}),zV=({resource:e,open:t,onOpenChange:r,onComplete:n})=>e?a.jsx(Je,{open:t,onOpenChange:r,children:a.jsxs(Ze,{className:"max-w-2xl max-h-[85vh]",children:[a.jsxs(dt,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"text-gold",children:qV(e.type)}),a.jsxs(ne,{variant:"outline",children:[a.jsx(St,{className:"w-3 h-3 mr-1"}),e.duration]}),e.completed&&a.jsxs(ne,{className:"bg-green-500/10 text-green-500 border-green-500/30",variant:"outline",children:[a.jsx(ke,{className:"w-3 h-3 mr-1"}),"Completed"]})]}),a.jsx(ft,{className:"text-xl",children:e.title}),a.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]}),a.jsx(gv,{className:"max-h-[55vh] pr-4",children:a.jsx("div",{className:"space-y-1",children:e.content.map((i,s)=>a.jsx("div",{children:UV(i)},s))})}),!e.completed&&a.jsx("div",{className:"flex justify-end pt-2",children:a.jsxs(F,{className:"bg-gold hover:bg-gold/90 text-secondary",onClick:()=>{n(e.id),r(!1)},children:[a.jsx(ke,{className:"w-4 h-4 mr-2"}),"Mark as Completed"]})})]})}):null,WV=()=>{const[e,t]=S.useState(new Set),[r,n]=S.useState(null),[i,s]=S.useState(!1),o=Ec.length,l=e.size,c=h=>{t(g=>new Set(g).add(h))},u=h=>{n({...h,completed:e.has(h.id)}),s(!0)},f=h=>Ec.filter(g=>g.category===h),d=h=>{switch(h){case"video":return a.jsx(Hr,{className:"w-5 h-5"});case"guide":return a.jsx(nt,{className:"w-5 h-5"});case"webinar":return a.jsx(Ad,{className:"w-5 h-5"})}},m=({resource:h})=>{const g=e.has(h.id);return a.jsx(K,{className:g?"border-green-500/30 bg-green-500/5":"",children:a.jsx(H,{className:"py-4",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:`p-3 rounded-lg shrink-0 ${g?"bg-green-500/10":"bg-gold/10"}`,children:g?a.jsx(ke,{className:"w-5 h-5 text-green-500"}):a.jsx("span",{className:"text-gold",children:d(h.type)})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium",children:h.title}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:h.description})]}),a.jsxs(ne,{variant:"outline",className:"shrink-0",children:[a.jsx(St,{className:"w-3 h-3 mr-1"}),h.duration]})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[g?a.jsxs(ne,{className:"bg-green-500/10 text-green-500 border-green-500/30",variant:"outline",children:[a.jsx(ke,{className:"w-3 h-3 mr-1"}),"Completed"]}):null,a.jsx(F,{size:"sm",className:"bg-gold hover:bg-gold/90 text-secondary",onClick:()=>u(h),children:g?"Read Again":"Read Now"})]})]})]})})})};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(K0,{className:"w-5 h-5 text-gold"}),a.jsx("h2",{className:"text-lg font-semibold",children:"Training & Resources"}),a.jsx(ne,{variant:"outline",className:"text-gold border-gold",children:"Elite Exclusive"})]})}),a.jsx(K,{className:"border-gold/30 bg-gradient-to-r from-gold/5 to-background",children:a.jsxs(H,{
505className:"py-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-medium",children:"Your Progress"}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[l," of ",o," completed"]})]}),a.jsx(en,{value:l/o*100,className:"h-2"}),l===o?a.jsxs("p",{className:"text-sm text-gold mt-2 flex items-center gap-1",children:[a.jsx(be,{className:"w-4 h-4"}),"Congratulations! You've completed all training resources"]}):a.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Complete all resources to become a certified Elite expert"})]})}),a.jsxs(Ka,{defaultValue:"all",children:[a.jsxs(On,{children:[a.jsx(ge,{value:"all",children:"All Resources"}),a.jsx(ge,{value:"profile",children:"Profile"}),a.jsx(ge,{value:"marketing",children:"Marketing"}),a.jsx(ge,{value:"business",children:"Business"}),a.jsx(ge,{value:"shows",children:"Shows"})]}),a.jsx(ye,{value:"all",className:"mt-4",children:a.jsx("div",{className:"grid gap-3",children:Ec.map(h=>a.jsx(m,{resource:h},h.id))})}),["profile","marketing","business","shows"].map(h=>a.jsx(ye,{value:h,className:"mt-4",children:a.jsx("div",{className:"grid gap-3",children:f(h).map(g=>a.jsx(m,{resource:g},g.id))})},h))]}),a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-8 text-center",children:[a.jsx(L0,{className:"w-10 h-10 mx-auto text-muted-foreground mb-3"}),a.jsx("h4",{className:"font-semibold mb-2",children:"New Content Added Monthly"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:"We regularly add new training resources, webinars, and guides exclusively for Elite members."})]})}),a.jsx(zV,{resource:r,open:i,onOpenChange:s,onComplete:c})]})},VV=({supplierName:e})=>{const[t,r]=S.useState([]),n=[{id:"social-1",name:"Instagram Story Templates",description:"5 customizable story templates featuring Elite branding",type:"social",format:"PNG, PSD"},{id:"social-2",name:"Facebook Cover Photo",description:"Professional cover photo with Elite member badge",type:"social",format:"PNG"},{id:"social-3",name:"Social Media Post Pack",description:"10 branded post templates for various occasions",type:"social",format:"PNG, Canva"},{id:"print-1",name:"Business Card Template",description:"Premium business cards with Elite Vow Collective branding",type:"print",format:"PDF, AI"},{id:"print-2",name:"A5 Flyer Template",description:"Eye-catching flyer for wedding shows and events",type:"print",format:"PDF, INDD"},{id:"print-3",name:"Pull-up Banner Design",description:"Professional banner for exhibitions and events",type:"print",format:"PDF, AI"},{id:"email-1",name:"Email Signature",description:"Professional email signature with Elite badge",type:"email",format:"HTML"},{id:"email-2",name:"Email Newsletter Template",description:"Branded newsletter for client communications",type:"email",format:"HTML"},{id:"pres-1",name:"Proposal Deck Template",description:"Professional PowerPoint for client proposals",type:"presentation",format:"PPTX"},{id:"pres-2",name:"Wedding Show Presentation",description:"Slide deck for booth presentations",type:"presentation",format:"PPTX, KEY"}],i=(o,l)=>{r([...t,o]),G.success(`${l} downloaded! Check your downloads folder.`)},s=o=>n.filter(l=>l.type===o);return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cv,{className:"w-5 h-5 text-gold"}),a.jsx("h2",{className:"text-lg font-semibold",children:"Co-Branded Marketing Materials"}),a.jsx(ne,{variant:"outline",className:"text-gold border-gold",children:"Elite Exclusive"})]})}),a.jsx("p",{className:"text-muted-foreground",children:"Download professionally designed marketing materials featuring Elite Vow Collective branding alongside your business name. All templates are customizable to match your brand."}),a.jsx(K,{className:"border-gold/30 bg-gradient-to-r from-gold/5 to-background",children:a.jsx(H,{className:"py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(be,{className:"w-8 h-8 text-gold"}),a.jsxs("div",{children:[a.jsxs("p",{className:"font-medium",children:["Materials personalized for: ",e]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"All templates include your business name and Elite member status"})]})]})})}),a.jsxs("div",{children:[a.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"ð±"})," Social Media"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:s("social").map(o=>a.jsx(Ks,{material:o,isDownloaded:t.includes(o.id),onDownload:i},o.id))})]}),a.jsxs("div",{children:[a.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"ð¨ï¸"})," Print Materials"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:s("print").map(o=>a.jsx(Ks,{material:o,isDownloaded:t.includes(o.id),onDownload:i},o.id))})]}),a.jsxs("div",{children:[a.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"ð§"})," Email Templates"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:s("email").map(o=>a.jsx(Ks,{material:o,isDownloaded:t.includes(o.id),onDownload:i},o.id))})]}),a.jsxs("div",{children:[a.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"ð"})," Presentations"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:s("presentation").map(o=>a.jsx(Ks,{material:o,isDownloaded:t.includes(o.id),onDownload:i},o.id))})]})]})},Ks=({material:e,isDownloaded:t,onDownload:r})=>a.jsx(K,{className:t?"border-green-500/30":"",children:a.jsxs(H,{
505className:"py-4",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[a.jsx("h4",{className:"font-medium text-sm",children:e.name}),a.jsx(ne,{variant:"outline",className:"text-xs shrink-0",children:e.format})]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:e.description}),a.jsx(F,{size:"sm",variant:t?"outline":"default",className:t?"":"bg-gold hover:bg-gold/90 text-secondary",onClick:()=>r(e.id,e.name),children:t?a.jsxs(a.Fragment,{children:[a.jsx(it,{className:"w-3 h-3 mr-1"}),"Downloaded"]}):a.jsxs(a.Fragment,{children:[a.jsx(ua,{className:"w-3 h-3 mr-1"}),"Download"]})})]})}),KV=({supplierId:e,supplierName:t})=>{const[r,n]=S.useState("elite_sk_"+e.substring(0,8)+"xxxxxxxxxxxx"),[i,s]=S.useState(!1),[o,l]=S.useState(null),c=(d,m)=>{navigator.clipboard.writeText(d),l(m),G.success("Copied to clipboard!"),setTimeout(()=>l(null),2e3)},u=()=>{const d="elite_sk_"+Math.random().toString(36).substring(2,10)+"xxxxxxxxxxxx";n(d),G.success("API key regenerated. Make sure to update your integrations.")},f=[{method:"GET",path:"/api/v1/availability",description:"Fetch your availability calendar"},{method:"POST",path:"/api/v1/availability",description:"Update availability status for dates"},{method:"GET",path:"/api/v1/enquiries",description:"List all enquiries with filters"},{method:"GET",path:"/api/v1/bookings",description:"List confirmed bookings"},{method:"GET",path:"/api/v1/analytics",description:"Fetch profile views and metrics"},{method:"POST",path:"/api/v1/webhooks",description:"Configure webhook notifications"}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ti,{className:"w-5 h-5 text-gold"}),a.jsx("h2",{className:"text-lg font-semibold",children:"API Access"}),a.jsx(ne,{variant:"outline",className:"text-gold border-gold",children:"Elite Developer"})]})}),a.jsx("p",{className:"text-muted-foreground",children:"Integrate your Elite profile with your own website, booking system, or custom applications. Our API provides programmatic access to your availability, enquiries, and analytics."}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"text-base flex items-center gap-2",children:[a.jsx(zf,{className:"w-4 h-4 text-gold"}),"Your API Key"]}),a.jsx(he,{children:"Use this key to authenticate your API requests. Keep it secure and never share publicly."})]}),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(ee,{value:i?r:"â¢".repeat(r.length),readOnly:!0,className:"font-mono pr-10"}),a.jsx(F,{size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:()=>s(!i),children:i?a.jsx(Bc,{className:"w-4 h-4"}):a.jsx(br,{className:"w-4 h-4"})})]}),a.jsx(F,{variant:"outline",onClick:()=>c(r,"apiKey"),children:o==="apiKey"?a.jsx(it,{className:"w-4 h-4"}):a.jsx(Mt,{className:"w-4 h-4"})}),a.jsx(F,{variant:"outline",onClick:u,children:a.jsx($i,{className:"w-4 h-4"})})]}),a.jsxs(gw,{children:[a.jsx(zf,{className:"h-4 w-4"}),a.jsx(vw,{children:"Never expose your API key in client-side code. Use it only in server-side applications."})]})]})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsx(le,{className:"text-base",children:"Available Endpoints"}),a.jsxs(he,{children:["Base URL: ",a.jsx("code",{className:"bg-muted px-2 py-0.5 rounded text-xs",children:"https://api.eliteweddings.dev/v1"})]})]}),a.jsx(H,{children:a.jsx("div",{className:"space-y-2",children:f.map((d,m)=>a.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border hover:border-gold/30 transition-colors",children:[a.jsx(ne,{variant:"outline",className:d.method==="GET"?"bg-green-500/10 text-green-500 border-green-500/30":"bg-blue-500/10 text-blue-500 border-blue-500/30",children:d.method}),a.jsx("code",{className:"text-sm font-mono flex-1",children:d.path}),a.jsx("span",{className:"text-xs text-muted-foreground hidden md:block",children:d.description})]},m))})})]}),a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsx(le,{className:"text-base",children:"Qu
505ick Start Example"}),a.jsx(he,{children:"Fetch your availability using cURL"})]}),a.jsx(H,{children:a.jsxs("div",{className:"relative",children:[a.jsx("pre",{className:"bg-muted p-4 rounded-lg text-xs overflow-x-auto",children:a.jsx("code",{children:`curl -X GET "https://api.eliteweddings.dev/v1/availability" \\ 506 -H "Authorization: Bearer ${i?r:"YOUR_API_KEY"}" \\ 507 -H "Content-Type: application/json"`})}),a.jsx(F,{size:"sm",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>c(`curl -X GET "https://api.eliteweddings.dev/v1/availability" -H "Authorization: Bearer ${r}"`,"curl"),children:o==="curl"?a.jsx(it,{className:"w-4 h-4"}):a.jsx(Mt,{className:"w-4 h-4"})})]})})]}),a.jsx(K,{className:"border-dashed",children:a.jsxs(H,{className:"py-8 text-center",children:[a.jsx(Ti,{className:"w-10 h-10 mx-auto text-muted-foreground mb-3"}),a.jsx("h4",{className:"font-semibold mb-2",children:"Webhook Notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto mb-4",children:"Get real-time notifications when you receive new enquiries, bookings, or reviews."}),a.jsx(F,{variant:"outline",children:"Configure Webhooks"})]})}),a.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium",children:"Full API Documentation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Explore all endpoints, request/response examples, and integration guides"})]}),a.jsxs(F,{variant:"outline",children:[a.jsx(In,{className:"w-4 h-4 mr-2"}),"View Docs"]})]})]})},GV=({isOpen:e,onClose:t})=>a.jsx(Je,{open:e,onOpenChange:t,children:a.jsxs(Ze,{className:"sm:max-w-lg max-h-[90vh]",children:[a.jsxs(dt,{className:"text-center",children:[a.jsx(ft,{className:"text-2xl font-display",children:"Elite membership is changing"}),a.jsx(h0,{children:"New for 2027 â applications open via the Wedding Supplier Standard UK."})]}),a.jsx(gv,{className:"max-h-[65vh] pr-4",children:a.jsx(kv,{})}),a.jsx(F,{variant:"ghost",onClick:t,className:"w-full",children:"Maybe later"})]})}),Hn={free:{label:"Free",price:"£0/month",icon:ps,color:"text-muted-foreground",features:["Basic listing","Contact display","1 profile image"]},standard:{label:"Standard",price:"£10/month",icon:lt,color:"text-blue-500",features:["Up to 3 gallery images","Video showcase","Social media links","10% off shows & magazine"]},elite:{label:"Elite Vow Collective",price:"£20/month",icon:be,color:"text-gold",features:["Priority search ranking","Unlimited gallery images","AI-powered tools & analytics","Verified & Recommended badges","20% off shows & magazine"]}},Yn={free:0,standard:1,elite:2},HV=({currentTier:e,onTierChanged:t})=>{const[r,n]=S.useState(null),[i,s]=S.useState(null),o=async()=>{n("portal");try{const{data:m,error:h}=await Y.functions.invoke("customer-portal");if(h)throw h;m!=null&&m.url&&window.open(m.url,"_blank")}catch(m){G.error((m==null?void 0:m.message)||"Could not open billing portal.")}finally{n(null)}},l=async m=>{n(m);try{const{data:h,error:g}=await Y.functions.invoke("create-checkout",{body:{priceId:Zf[m].price_id}});if(g)throw g;h!=null&&h.url&&(window.location.href=h.url)}catch(h){G.error((h==null?void 0:h.message)||"Could not start checkout."),n(null)}},c=async m=>{n(m);try{const{data:h,error:g}=await Y.functions.invoke("change-subscription",{body:{action:"change",priceId:Zf[m].price_id}});if(g)throw g;G.success((h==null?void 0:h.message)||"Subscription updated."),t==null||t()}catch(h){G.error((h==null?void 0:h.message)||"Could not change subscription.")}finally{n(null),s(null)}},u=async()=>{n("cancel");try{const{data:m,error:h}=await Y.functions.invoke("change-subscription",{body:{action:"cancel"}});if(h)throw h;G.success((m==null?void 0:m.message)||"Subscription cancelled."),t==null||t()}catch(m){G.error((m==null?void 0:m.message)||"Could not cancel subscription.")}finally{n(null),s(null)}},f=m=>{if(m===e)return;if(e==="free"&&m!=="free"){l(m);return}if(m==="free"){s({tier:m,type:"cancel"});return}const h=Yn[m]>Yn[e]?"upgrade":"downgrade";s({tier:m,type:h})},d=()=>
507{i&&(i.type==="cancel"?u():c(i.tier))};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Av,{className:"w-5 h-5"}),"Manage Your Membership"]}),a.jsx(he,{children:"Manage or cancel your current membership. New Standard and Elite sign-ups have closed â Elite relaunches in 2027."})]}),a.jsx(H,{children:a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Current plan:"}),a.jsxs(ne,{variant:"secondary",className:"text-base px-3 py-1",children:[Hn[e].label," · ",Hn[e].price]}),e!=="free"&&a.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:r==="portal",className:"ml-auto",children:[r==="portal"?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(bv,{className:"w-4 h-4 mr-2"}),"Manage Billing"]})]})})]}),a.jsx("div",{className:"grid md:grid-cols-3 gap-4 items-start",children:Object.keys(Hn).filter(m=>m==="free"||m===e).map(m=>{const h=Hn[m],g=h.icon,p=m===e,v=r===m,x=Yn[m]>Yn[e],b=Yn[m]<Yn[e];return a.jsxs(K,{className:`relative flex flex-col ${p?"border-2 border-primary shadow-lg":"border-border"} ${m==="elite"?"bg-gradient-to-b from-gold/5 to-transparent":""}`,children:[p&&a.jsx(ne,{className:"absolute -top-2 left-1/2 -translate-x-1/2 px-3 py-0.5 bg-primary",children:"Current Plan"}),a.jsxs(oe,{className:"text-center pb-3",children:[a.jsx(g,{className:`w-8 h-8 mx-auto mb-2 ${h.color}`}),a.jsx(le,{className:"text-lg",children:h.label}),a.jsx("p",{className:"text-2xl font-bold",children:h.price})]}),a.jsxs(H,{className:"flex-1 flex flex-col",children:[a.jsx("ul",{className:"space-y-2 mb-4 flex-1 text-sm",children:h.features.map((j,N)=>a.jsxs("li",{className:"flex items-start gap-2",children:[a.jsx(ps,{className:"w-4 h-4 text-primary mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-muted-foreground",children:j})]},N))}),a.jsxs(F,{onClick:()=>f(m),disabled:p||v||r!==null,variant:p?"outline":x?"default":"secondary",className:"w-full",children:[v?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):x?a.jsx($v,{className:"w-4 h-4 mr-2"}):b?a.jsx(Ev,{className:"w-4 h-4 mr-2"}):null,p?"Current Plan":x?`Upgrade to ${h.label}`:`Downgrade to ${h.label}`]})]})]},m)})}),e!=="elite"&&a.jsx(kv,{}),a.jsx(da,{open:!!i,onOpenChange:m=>!m&&s(null),children:a.jsxs(fa,{children:[a.jsxs(ma,{children:[a.jsx(ha,{children:(i==null?void 0:i.type)==="cancel"?"Cancel paid membership?":(i==null?void 0:i.type)==="upgrade"?`Upgrade to ${i?Hn[i.tier].label:""}?`:`Downgrade to ${i?Hn[i.tier].label:""}?`}),a.jsx(pa,{children:(i==null?void 0:i.type)==="cancel"?"You'll keep your current benefits until the end of your billing period, then your account will return to the Free tier. No further charges will be made.":(i==null?void 0:i.type)==="upgrade"?"You'll be charged a prorated amount immediately for the remainder of this billing period at the new rate. Future months will be billed at the new price.":"Your plan will change immediately. Stripe will apply a prorated credit to your next invoice for the unused portion of your current plan."})]}),a.jsxs(ga,{children:[a.jsx(va,{disabled:r!==null,children:"Keep Current Plan"}),a.jsxs(xa,{onClick:d,disabled:r!==null,children:[r!==null?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Confirm"]})]})]})})]})},YV=({supplierId:e})=>{const{notifications:t,isLoading:r,unreadCount:n,markAsRead:i}=o0(e),s=async()=>{const o=t.filter(l=>!l.notified_at).map(l=>l.id);if(o.length!==0)try{await i.mutateAsync(o),Zn({title:"All notifications marked as read"})}catch{Zn({title:"Failed to mark as read",variant:"destructive"})}};return r?a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"w-5 h-5 text-primary"}),"Wishlist Alerts"]})}),a.jsx(H,{children:a.jsx("div",{className:"animate-pulse space-y-3",children:[1,2,3].map(o=>a.jsx("div",{className:"h-12 bg-muted rounded"},o))})})]}):a.jsxs(K,{children:[a.jsxs(oe,{className:"flex flex-row items-center justify-between",children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(mr,{className:"w-5 h-5 text-primary"}),"Wishlist Alerts",n>0&&a.jsxs(ne,{variant:"destructive",className:"ml-2",children:[n," new"]})]}),n>0&&a.jsxs(F,{variant:"ghost",size:"sm",onClick:s,children:[a.jsx(it,{className:"w-4 h-4 mr-1"}),"Mark all read"]})]}
507),a.jsxs(H,{children:[t.length===0?a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx(mr,{className:"w-12 h-12 mx-auto mb-3 opacity-20"}),a.jsx("p",{className:"text-sm",children:"No wishlist alerts yet"}),a.jsx("p",{className:"text-xs mt-1",children:"You'll be notified when couples save your profile"})]}):a.jsx("div",{className:"space-y-3 max-h-[400px] overflow-y-auto",children:t.map(o=>a.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${o.notified_at?"bg-muted/50 border-border":"bg-primary/5 border-primary/20"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 rounded-full ${o.notified_at?"bg-muted":"bg-primary/20"}`,children:a.jsx(mr,{className:`w-4 h-4 ${o.notified_at?"text-muted-foreground":"text-primary"}`})}),a.jsxs("div",{children:[a.jsxs("p",{className:"font-medium text-sm",children:[o.couple_name||"A couple"," saved your profile"]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:Mw(new Date(o.created_at),{addSuffix:!0})})]})]}),!o.notified_at&&a.jsxs(ne,{variant:"outline",className:"text-primary border-primary",children:[a.jsx(Js,{className:"w-3 h-3 mr-1"}),"New"]})]},o.id))}),t.length>0&&a.jsx("div",{className:"mt-4 pt-4 border-t text-center",children:a.jsxs("p",{className:"text-xs text-muted-foreground",children:["ð¡ ",a.jsx("strong",{children:"Tip:"})," Couples who save your profile are highly interested. Consider sending them a special offer!"]})})]})]})},XV=({currentImage:e,supplierId:t,userId:r,onImageUpdate:n})=>{const[i,s]=S.useState(!1),[o,l]=S.useState(!1),[c,u]=S.useState(null),f=S.useRef(null),d=v=>{var j;const x=(j=v.target.files)==null?void 0:j[0];if(!x)return;if(!x.type.startsWith("image/")){G.error("Please select an image file");return}if(x.size>5*1024*1024){G.error("File is too large (max 5MB)");return}const b=URL.createObjectURL(x);u(b),l(!0)},m=async v=>{l(!1),c&&(URL.revokeObjectURL(c),u(null)),await g(v)},h=()=>{l(!1),c&&(URL.revokeObjectURL(c),u(null)),f.current&&(f.current.value="")},g=async v=>{s(!0);try{const x=`${r}/${t}/profile-${Date.now()}.jpg`,{error:b}=await Y.storage.from("supplier-images").upload(x,v);if(b)throw b;const{data:{publicUrl:j}}=Y.storage.from("supplier-images").getPublicUrl(x),{error:N}=await Y.from("suppliers").update({image_url:j}).eq("id",t).eq("owner_user_id",r);if(N)throw N;n(j),G.success("Profile image updated!")}catch(x){console.error("Upload error:",x),G.error("Failed to upload image")}finally{s(!1),f.current&&(f.current.value="")}},p=async()=>{try{const{error:v}=await Y.from("suppliers").update({image_url:null}).eq("id",t).eq("owner_user_id",r);if(v)throw v;n(""),G.success("Profile image removed")}catch{G.error("Failed to remove image")}};return a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:d,className:"hidden"}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-32 h-32 rounded-full overflow-hidden border-4 border-gold/30 bg-muted",children:e?a.jsx("img",{src:e,alt:"Profile",className:"w-full h-full object-cover"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center",children:a.jsx(ji,{className:"w-16 h-16 text-muted-foreground"})})}),i?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 rounded-full",children:a.jsx(Se,{className:"w-8 h-8 text-white animate-spin"})}):a.jsx(F,{size:"icon",variant:"secondary",className:"absolute bottom-0 right-0 rounded-full shadow-lg h-10 w-10",onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},children:a.jsx(wi,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(F,{variant:"outline",size:"sm",onClick:()=>{var v;return(v=f.current)==null?void 0:v.click()},disabled:i,children:e?"Change Photo":"Upload Photo"}),e&&a.jsxs(F,{variant:"ghost",size:"sm",onClick:p,className:"text-destructive hover:text-destructive",children:[a.jsx(Va,{className:"w-4 h-4 mr-1"}),"Remove"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground text-center max-w-[200px]",children:"This image appears as your listing thumbnail and profile picture"}),c&&a.jsx(g0,{imageSrc:c,open:o,onClose:h,onCropComplete:m,aspectRatio:1})]})},Xn=3,QV=({supplierId:e})=>{const t=ur(),{data:r,isLoading:n}=Ge({queryKey:["supplier-reviews-manage",e],queryFn:async()=>{const{data:o,error:l}=await Y.from("reviews").select("*").eq("supplier_id",e).order("is_pinned",{ascending:!1}).order("created_at",{ascending:!1});if(l)throw l;return o}}),i=Xe({mutationFn:async({reviewId:o,isPinned:l})=>
507{if(l&&((r==null?void 0:r.filter(f=>f.is_pinned).length)||0)>=Xn)throw new Error(`Maximum ${Xn} pinned reviews allowed`);const{error:c}=await Y.from("reviews").update({is_pinned:l}).eq("id",o);if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["supplier-reviews-manage",e]}),t.invalidateQueries({queryKey:["reviews",e]}),G.success("Review updated")},onError:o=>{G.error(o.message)}}),s=(r==null?void 0:r.filter(o=>o.is_pinned).length)||0;return n?a.jsx(K,{children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsx(Se,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):!r||r.length===0?a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Cs,{className:"w-5 h-5 text-gold"}),"Pinned Reviews"]}),a.jsx(he,{children:"Pin your best reviews to display them prominently on your profile"})]}),a.jsx(H,{children:a.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No reviews yet. Reviews will appear here once couples leave feedback."})})]}):a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Cs,{className:"w-5 h-5 text-gold"}),"Pinned Reviews"]}),a.jsxs(he,{children:["Pin up to ",Xn," reviews to highlight them on your profile"]})]}),a.jsxs(ne,{variant:s>=Xn?"secondary":"outline",children:[s,"/",Xn," pinned"]})]})}),a.jsx(H,{className:"space-y-4",children:r.map(o=>a.jsx("div",{className:`p-4 rounded-lg border ${o.is_pinned?"border-gold bg-gold/5":"border-border"}`,children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-medium truncate",children:o.reviewer_name}),a.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:5}).map((l,c)=>a.jsx(lt,{className:`w-3 h-3 ${c<o.rating?"fill-gold text-gold":"text-muted"}`},c))}),o.is_pinned&&a.jsxs(ne,{className:"bg-gold/20 text-gold border-gold/30",children:[a.jsx(Cs,{className:"w-3 h-3 mr-1"}),"Pinned"]})]}),a.jsx("h4",{className:"font-medium text-sm mb-1",children:o.title}),a.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:o.content}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[me(new Date(o.created_at),"MMM d, yyyy"),o.wedding_date&&a.jsxs("span",{children:[" ⢠Wedding: ",me(new Date(o.wedding_date),"MMM yyyy")]})]})]}),a.jsx(F,{variant:o.is_pinned?"default":"outline",size:"sm",onClick:()=>i.mutate({reviewId:o.id,isPinned:!o.is_pinned}),disabled:i.isPending||!o.is_pinned&&s>=Xn,className:o.is_pinned?"bg-gold hover:bg-gold/90 text-secondary":"",children:i.isPending?a.jsx(Se,{className:"w-4 h-4 animate-spin"}):o.is_pinned?a.jsxs(a.Fragment,{children:[a.jsx(G0,{className:"w-4 h-4 mr-1"}),"Unpin"]}):a.jsxs(a.Fragment,{children:[a.jsx(Cs,{className:"w-4 h-4 mr-1"}),"Pin"]})})]})},o.id))})]})},JV=[{name:"Classic Gold",primary:"#D4AF37",accent:"#B8860B"},{name:"Rose Romance",primary:"#E8B4B8",accent:"#C9A0A0"},{name:"Sage Garden",primary:"#9CAF88",accent:"#6B7F5E"},{name:"Ocean Blue",primary:"#5B8FA8",accent:"#3D6F8C"},{name:"Lavender Dream",primary:"#9D8FBF",accent:"#7B6FA1"},{name:"Blush Pink",primary:"#F5B7B1",accent:"#E6A09A"},{name:"Midnight Navy",primary:"#2C3E50",accent:"#1A252F"},{name:"Terracotta",primary:"#CD6D4A",accent:"#A65835"}],ZV=({supplierId:e,userId:t,currentPrimary:r,currentAccent:n,onUpdate:i})=>{const[s,o]=S.useState(r||"#D4AF37"),[l,c]=S.useState(n||"#B8860B"),[u,f]=S.useState(!1),d=async()=>{f(!0);try{const{error:g}=await Y.from("suppliers").update({custom_theme_primary:s,custom_theme_accent:l}).eq("id",e).eq("owner_user_id",t);if(g)throw g;i(s,l),G.success("Profile theme updated!")}catch{G.error("Failed to save theme")}finally{f(!1)}},m=async()=>{f(!0);try{const{error:g}=await Y.from("suppliers").update({custom_theme_primary:null,custom_theme_accent:null}).eq("id",e).eq("owner_user_id",t);if(g)throw g;o("#D4AF37"),c("#B8860B"),i(null,null),G.success("Theme reset to default")}catch{G.error("Failed to reset theme")}finally{f(!1)}},h=g=>{o(g.primary),c(g.accent)};return a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(Cv,{className:"w-5 h-5 text-gold"}),"Custom Profile Theme"]}),a.jsx(he,{children:"Personalize your profile with custom brand colors"})]}
507),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsx(q,{children:"Quick Presets"}),a.jsx("div",{className:"grid grid-cols-4 gap-2",children:JV.map(g=>a.jsxs("button",{onClick:()=>h(g),className:"group flex flex-col items-center gap-1 p-2 rounded-lg border hover:border-primary transition-colors",children:[a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-background shadow-sm",style:{backgroundColor:g.primary}}),a.jsx("div",{className:"w-6 h-6 rounded-full border-2 border-background shadow-sm",style:{backgroundColor:g.accent}})]}),a.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground",children:g.name})]},g.name))})]}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"primary-color",children:"Primary Color"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg border-2 border-border cursor-pointer shadow-inner",style:{backgroundColor:s},onClick:()=>{var g;return(g=document.getElementById("primary-picker"))==null?void 0:g.click()}}),a.jsx("input",{type:"color",id:"primary-picker",value:s,onChange:g=>o(g.target.value),className:"sr-only"}),a.jsx(ee,{id:"primary-color",value:s,onChange:g=>o(g.target.value),placeholder:"#D4AF37",className:"font-mono uppercase"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"accent-color",children:"Accent Color"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg border-2 border-border cursor-pointer shadow-inner",style:{backgroundColor:l},onClick:()=>{var g;return(g=document.getElementById("accent-picker"))==null?void 0:g.click()}}),a.jsx("input",{type:"color",id:"accent-picker",value:l,onChange:g=>c(g.target.value),className:"sr-only"}),a.jsx(ee,{id:"accent-color",value:l,onChange:g=>c(g.target.value),placeholder:"#B8860B",className:"font-mono uppercase"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Preview"}),a.jsxs("div",{className:"p-4 rounded-lg border bg-card",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[a.jsx("div",{className:"w-16 h-16 rounded-full",style:{backgroundColor:s}}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg",style:{color:s},children:"Your Business Name"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Wedding Photographer"})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{className:"px-4 py-2 rounded-lg text-white text-sm font-medium",style:{backgroundColor:s},children:"Contact Us"}),a.jsx("button",{className:"px-4 py-2 rounded-lg text-sm font-medium border-2",style:{borderColor:l,color:l},children:"View Portfolio"})]})]})]}),a.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[a.jsxs(F,{onClick:d,disabled:u,className:"bg-gold text-secondary hover:bg-gold/90",children:[u?a.jsx(Se,{className:"w-4 h-4 mr-2 animate-spin"}):a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Theme"]}),a.jsxs(F,{variant:"outline",onClick:m,disabled:u,children:[a.jsx(xw,{className:"w-4 h-4 mr-2"}),"Reset to Default"]})]})]})]})},hv=["hsl(var(--gold))","hsl(var(--elite))","hsl(var(--primary))","hsl(var(--accent))"],eK=({supplierId:e})=>{var i;const{data:t,isLoading:r}=Ge({queryKey:["conversion-analytics",e],queryFn:async()=>{const s=Ni(new Date,30),o=Ni(new Date,60),{data:l}=await Y.from("supplier_profile_views").select("viewed_at").eq("supplier_id",e).gte("viewed_at",s.toISOString()),{data:c}=await Y.from("supplier_profile_views").select("viewed_at").eq("supplier_id",e).gte("viewed_at",o.toISOString()).lt("viewed_at",s.toISOString()),{data:u}=await Y.from("enquiries").select("created_at").eq("supplier_id",e).gte("created_at",s.toISOString()),{data:f}=await Y.from("enquiries").select("created_at").eq("supplier_id",e).gte("created_at",o.toISOString()).lt("created_at",s.toISOString()),{data:d}=await Y.from("saved_suppliers").select("created_at").eq("supplier_id",e).gte("created_at",s.toISOString()),{data:m}=await Y.from("saved_suppliers").select("created_at").eq("supplier_id",e).gte("created_at",o.toISOString()).lt("created_at",s.toISOString()),{data:h}=await Y.from("booking_requests").select("created_at, status").eq("supplier_id",e).gte("created_at",s.toISOString()),p=Ic({start:s,end:new Date}).map(E=>{const T=qt(E),$=new Date(T);return $.setDate($.getDate()+1),{date:me(E,"MMM d"),views:(l==null?void 0:l.filter(I=>{const B=new Date(I.viewed_at);return B>=T&&B<$}).length)||0,enquiries:(u==null?void 0:u.filter(I=>{const B=new Date(I.created_at);return B>=T&&B<$}).length)||0,saves:(d==null?void 0:d.filter(I=>{const B=new Date(I.created_at);return B>=T&&B<$}).length)||0}}),v=(l==null?void 0:l.length)||0,x=(c==null?void 0:c.length)||0,b=x>0?(v-x)/x*100:0,j=(u==null?void 0:u.length)||0,N=(f==null?void 0:f.length)||0,y=N>0?(j-N)/N*100:0,w=(d==null?void 0:d.length)||0,_=(m==null?void 0:m.length)||0,O=_>0?(w-_)/_*100:0,A=v>0?j/v*100:0,C=x>0?N/x*100:0,P=C>0?A-C:0,M=[{name:"Profile Views",value:v},{name:"Saved to List",value:w},{name:"Enquiries Sent",value:j},{name:"Bookings",value:(h==null?void 0:h.filter(E=>E.status==="confirmed").length)||0}];return{dailyData:p,funnelData:M,stats:{views:v,viewsChange:b,enquiries:j,enquiriesChange:y,saves:w,savesChange:O,conversionRate:A,conversionChange:P}}}});if(r)return a.jsx(K,{className:"elite-card",children:a.jsx(H,{className:"flex items-center justify-center py-12",children:a.jsxs("div",{className:"text-center",children:[a.jsx(Se,{className:"w-8 h-8 animate-spin text-gold mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading analytics..."})]})})});const n=({title:s,value:o,change:l,icon:c})=>a.jsx("div",{className:"elite-stat-card group",children:a.jsxs("div",{className:"relative z-10",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("div",{className:"p-2 rounded-lg bg-gold/10 text-gold transition-transform group-hover:scale-110",children:a.jsx(c,{className:"w-5 h-5"})}),a.jsxs("div",{className:`flex items-center gap-1 text-xs font-medium ${l>=0?"text-green-500":"text-red-500"}`,children:[l>=0?a.jsx($v,{className:"w-3 h-3"}):a.jsx(Ev,{className:"w-3 h-3"}),Math.abs(l).toFixed(1),"%"]})]}),a.jsx("div",{className:"elite-stat-value",children:o}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s})]})});return a.jsxs("div",{className:"space-y-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"elite-icon",children:a.jsx(_t,{className:"w-6 h-6"})}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["Conversion Analytics",a.jsx(yt,{className:"w-4 h-4 text-gold animate-crown-pulse"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"30-day performance insights"})]})]}),a.jsxs(ne,{className:"elite-badge",children:[a.jsx(be,{className:"w-3 h-3 mr-1"}),"Elite"]})]}),a.jsx("div",{className:"elite-divider"}),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(n,{title:"Profile Views",value:(t==null?void 0:t.stats.views)||0,change:(t==null?void 0:t.stats.viewsChange)||0,icon:xt}),a.jsx(n,{title:"Enquiries",value:(t==null?void 0:t.stats.enquiries)||0,change:(t==null?void 0:t.stats.enquiriesChange)||0,icon:Mr}),a.jsx(n,{title:"Saved by Couples",value:(t==null?void 0:t.stats.saves)||0,change:(t==null?void 0:t.stats.savesChange)||0,icon:mr}),a.jsx(n,{title:"Conversion Rate",value:`${((t==null?void 0:t.stats.conversionRate)||0).toFixed(1)}%`,change:(t==null?void 0:t.stats.conversionChange)||0,icon:Xs})]}),a.jsxs(K,{className:"elite-card",children:[a.jsxs(oe,{className:"elite-header rounded-t-xl",children:[a.jsxs(le,{className:"flex items-center gap-2 text-lg",children:[a.jsx(_t,{className:"w-5 h-5 text-gold"}),"30-Day Activity Trends"]}),a.jsx(he,{children:"Track your profile performance over time"})]}),a.jsx(H,{children:a.jsx("div",{className:"h-[300px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(Dj,{data:(t==null?void 0:t.dailyData)||[],children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"viewsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",
507stopColor:"hsl(var(--primary))",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]}),a.jsxs("linearGradient",{id:"enquiriesGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"hsl(var(--gold))",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"hsl(var(--gold))",stopOpacity:0})]})]}),a.jsx(Sn,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(ir,{dataKey:"date",tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickLine:{stroke:"hsl(var(--muted-foreground))"},interval:"preserveStartEnd"}),a.jsx(sr,{tick:{fill:"hsl(var(--muted-foreground))"},tickLine:{stroke:"hsl(var(--muted-foreground))"}}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(nr,{}),a.jsx(lr,{type:"monotone",dataKey:"views",stroke:"hsl(var(--primary))",fill:"url(#viewsGradient)",strokeWidth:2}),a.jsx(lr,{type:"monotone",dataKey:"enquiries",stroke:"hsl(var(--gold))",fill:"url(#enquiriesGradient)",strokeWidth:2})]})})})})]}),a.jsxs(K,{className:"elite-card",children:[a.jsxs(oe,{className:"elite-header rounded-t-xl",children:[a.jsx(le,{className:"text-lg",children:"Conversion Funnel"}),a.jsx(he,{children:"How couples move through your profile to booking"})]}),a.jsx(H,{children:a.jsx("div",{className:"h-[300px]",children:a.jsx(jn,{width:"100%",height:"100%",children:a.jsxs(JW,{children:[a.jsx(Ur,{data:(t==null?void 0:t.funnelData)||[],cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:5,dataKey:"value",children:(i=t==null?void 0:t.funnelData)==null?void 0:i.map((s,o)=>a.jsx(Al,{fill:hv[o%hv.length]},`cell-${o}`))}),a.jsx(gt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(nr,{})]})})})})]})]})};function tK({supplierId:e}){Hj();const t=ur(),[r,n]=S.useState(!1),[i,s]=S.useState({available_date:"",discount_percentage:10,original_price:"",notes:""}),{data:o=[],isLoading:l}=Ge({queryKey:["late-availability",e],queryFn:async()=>{const{data:h,error:g}=await Y.from("supplier_late_availability").select("*").eq("supplier_id",e).order("available_date",{ascending:!0});if(g)throw g;return h},enabled:!!e}),c=Xe({mutationFn:async()=>{const h=parseFloat(i.original_price)||null,g=h?h*(1-i.discount_percentage/100):null,{error:p}=await Y.from("supplier_late_availability").insert({supplier_id:e,available_date:i.available_date,discount_percentage:i.discount_percentage,original_price:h,discounted_price:g,notes:i.notes||null,is_active:!0,expires_at:B0(new Date(i.available_date),-3).toISOString()});if(p)throw p},onSuccess:()=>{t.invalidateQueries({queryKey:["late-availability"]}),n(!1),s({available_date:"",discount_percentage:10,original_price:"",notes:""}),Zn({title:"Late availability added!",description:"Couples searching for this date will see your offer."})},onError:h=>{var g;(g=h.message)!=null&&g.includes("duplicate")?Zn({title:"Date already listed",description:"You already have late availability for this date.",variant:"destructive"}):Zn({title:"Failed to add",description:h.message,variant:"destructive"})}}),u=Xe({mutationFn:async({id:h,isActive:g})=>{const{error:p}=await Y.from("supplier_late_availability").update({is_active:g}).eq("id",h);if(p)throw p},onSuccess:()=>{t.invalidateQueries({queryKey:["late-availability"]})}}),f=Xe({mutationFn:async h=>{const{error:g}=await Y.from("supplier_late_availability").delete().eq("id",h);if(g)throw g},onSuccess:()=>{t.invalidateQueries({queryKey:["late-availability"]}),Zn({title:"Availability removed"})}}),d=o.filter(h=>h.is_active&&!hn(new Date(h.available_date),new Date)),m=o.filter(h=>hn(new Date(h.available_date),new Date));return a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(St,{className:"h-5 w-5 text-primary"}),"Late Availability"]}),a.jsx(he,{children:"Promote dates you have available to fill your calendar"})]}),a.jsxs(Je,{open:r,onOpenChange:n,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{className:"gap-2",children:[a.jsx(ut,{className:"h-4 w-4"}),"Add Date"]})}),a.jsxs(Ze,{children:[a.jsx(dt,{children:a.jsx(ft,{children:"Add Late Availability"})}),a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Available Date"}),a.jsx(ee,{type:"date",value:i.available_date,onChange:h=>s(g=>({...g,available_date:h.target.value})),min:me(new Date,"yyyy-MM-dd")})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Discount Percentage"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ee,{type:"number",min:0,max:50,value:i.discount_percentage,onChange:h=>s(g=>({...g,discount_percentage:parseInt(h.target.value)||0}))}),a.jsx("span",{className:"text-muted-foreground",children:"%"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Original Price (optional)"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:"£"}),a.jsx(ee,{type:"number",placeholder:"e.g. 500",value:i.original_price,onChange:h=>s(g=>({...g,original_price:h.target.value}))})]}),i.original_price&&i.discount_percentage>0&&a.jsxs("p",{className:"text-sm text-green-600",children:["Discounted price: £",(parseFloat(i.original_price)*(1-i.discount_percentage/100)).toFixed(2)]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Notes (optional)"}),a.jsx(Ce,{placeholder:"e.g. Perfect for intimate ceremonies, includes setup",value:i.notes,onChange:h=>s(g=>({...g,notes:h.target.value}))})]})]}),a.jsxs(Ga,{children:[a.jsx(F,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),a.jsx(F,{onClick:()=>c.mutate(),disabled:!i.available_date||c.isPending,children:"Add Availability"})]})]})]})]})}
507),a.jsxs(H,{children:[l?a.jsx("p",{className:"text-muted-foreground text-center py-8",children:"Loading..."}):d.length===0?a.jsxs("div",{className:"text-center py-12 space-y-4",children:[a.jsx(qe,{className:"h-12 w-12 mx-auto text-muted-foreground/50"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"No late availability listed"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add dates you have open to attract couples looking for last-minute bookings"})]})]}):a.jsx("div",{className:"space-y-3",children:d.map(h=>a.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-muted/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-3 bg-primary/10 rounded-lg",children:a.jsx(qe,{className:"h-5 w-5 text-primary"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:me(new Date(h.available_date),"EEEE, d MMMM yyyy")}),h.discount_percentage&&h.discount_percentage>0&&a.jsxs(ne,{className:"bg-green-500 hover:bg-green-600 gap-1",children:[a.jsx(Rc,{className:"h-3 w-3"}),h.discount_percentage,"% off"]})]}),h.original_price&&h.discounted_price&&a.jsxs("p",{className:"text-sm",children:[a.jsxs("span",{className:"text-muted-foreground line-through",children:["£",h.original_price]})," â ",a.jsxs("span",{className:"text-green-600 font-medium",children:["£",h.discounted_price.toFixed(2)]})]}),h.notes&&a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:h.notes})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Active"}),a.jsx(bt,{checked:h.is_active,onCheckedChange:g=>u.mutate({id:h.id,isActive:g})})]}),a.jsx(F,{variant:"ghost",size:"icon",onClick:()=>f.mutate(h.id),className:"text-destructive hover:text-destructive",children:a.jsx(dr,{className:"h-4 w-4"})})]})]},h.id))}),a.jsxs("div",{className:"mt-6 p-4 bg-gradient-to-r from-primary/5 to-pink-500/5 rounded-lg border border-primary/20",children:[a.jsxs("h4",{className:"font-medium mb-3 flex items-center gap-2",children:[a.jsx(yt,{className:"h-4 w-4 text-primary"}),"Why List Late Availability?"]}),a.jsxs("div",{className:"grid sm:grid-cols-3 gap-4 text-sm",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Qr,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Highlighted to Couples"}),a.jsx("p",{className:"text-muted-foreground",children:"Your dates appear in search results"})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(St,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Fill Empty Dates"}),a.jsx("p",{className:"text-muted-foreground",children:"Convert gaps into bookings"})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Rc,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Discount Incentives"}),a.jsx("p",{className:"text-muted-foreground",children:"Attract budget-conscious couples"})]})]})]})]}),m.length>0&&a.jsx("div",{className:"mt-6",children:a.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Past dates (",m.length,") are automatically hidden from couples."]})})]})]})}const rK=[{id:"1",name:"Initial Response",message:"Hi {name}! ð Thank you so much for getting in touch about your wedding on {date}. I'd love to hear more about your plans! Are you free for a quick call this week?",category:"enquiry",variables:["name","date"]},{id:"2",name:"Availability Check",message:"Great news, {name}! ð I've just checked my calendar and I'm available on {date}. Would you like me to send over my packages and pricing?",category:"enquiry",variables:["name","date"]},{id:"3",name:"Follow-up",message:"Hi {name}, just following up on my last message. I'd hate for you to miss out on your date! Let me know if you have any questions. ð",category:"followup",variables:["name"]},{id:"4",name:"Booking Confirmation",message:"Amazing news, {name}! 𥳠Your booking for {date} is confirmed! I'll send over the contract and deposit details shortly. So excited to be part of your special day!",category:"booking",variables:["name","date"]},{id:"5",name:"Meeting Reminder",message:"Hi {name}! Just a friendly reminder about our meeting tomorrow at {time}. Looking forward to chatting about your wedding plans! â",category:"general",variables:["name","time"]}],nK={enquiry:"bg-blue-500/20 text-blue-600 border-blue-500/30",followup:"bg-amber-500/20 text-amber-600 border-amber-500/30",booking:"bg-green-500/20 text-green-600 border-green-500/30",general:"bg-muted text-muted-foreground border-border"},aK=({supplierName:e="Your Business",supplierPhone:t})=>{const{items:r,setItems:n}=rl("whatsapp-replies",rK),[i,s]=S.useState(null),[o,l]=S.useState(""),[c,u]=S.useState(""),[f,d]=S.useState(!1),[m,h]=S.useState(""),[g,p]=S.useState(""),[v,x]=S.useState("general"),[b,j]=S.useState({name:"Sarah",date:"15th June 2025",time:"2:00 PM"}),N=T=>{const $=T.match(/\{(\w+)\}/g);return $?$.map(I=>I.replace(/[{}]/g,"")):[]}
507,y=T=>T.replace(/\{(\w+)\}/g,($,I)=>b[I]||`{${I}}`),w=T=>{const $=y(T);navigator.clipboard.writeText($),G.success("Copied to clipboard!")},_=(T,$)=>{const I=y(T),L=`https://wa.me/?text=${encodeURIComponent(I)}`;window.open(L,"_blank")},O=T=>{s(T.id),l(T.name),u(T.message)},A=T=>{n($=>$.map(I=>I.id===T?{...I,name:o,message:c,variables:N(c)}:I)),s(null),G.success("Template updated!")},C=()=>{s(null),l(""),u("")},P=()=>{if(!m.trim()||!g.trim()){G.error("Please fill in all fields");return}const T={id:Date.now().toString(),name:m.trim(),message:g.trim(),category:v,variables:N(g)};n($=>[...$,T]),h(""),p(""),x("general"),d(!1),G.success("Template added!")},M=T=>{n($=>$.filter(I=>I.id!==T)),G.success("Template deleted")},E=r.reduce((T,$)=>(T[$.category]||(T[$.category]=[]),T[$.category].push($),T),{});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(K,{className:"border-green-500/20",children:[a.jsx(oe,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-500/10 rounded-lg",children:a.jsx(Wf,{className:"w-6 h-6 text-green-600"})}),a.jsxs("div",{children:[a.jsx(le,{children:"WhatsApp Quick Replies"}),a.jsx(he,{children:"One-tap message templates for faster responses"})]})]}),a.jsxs(Je,{open:f,onOpenChange:d,children:[a.jsx(Lr,{asChild:!0,children:a.jsxs(F,{children:[a.jsx(ut,{className:"w-4 h-4 mr-2"}),"New Template"]})}),a.jsxs(Ze,{children:[a.jsx(dt,{children:a.jsx(ft,{children:"Create Quick Reply Template"})}),a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Template Name"}),a.jsx(ee,{placeholder:"e.g., Price Request Response",value:m,onChange:T=>h(T.target.value)})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Category"}),a.jsxs("select",{value:v,onChange:T=>x(T.target.value),className:"w-full px-3 py-2 rounded-md border bg-background",children:[a.jsx("option",{value:"enquiry",children:"Enquiry"}),a.jsx("option",{value:"followup",children:"Follow-up"}),a.jsx("option",{value:"booking",children:"Booking"}),a.jsx("option",{value:"general",children:"General"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{children:"Message"}),a.jsx(Ce,{placeholder:"Hi {name}! Thanks for your enquiry...",value:g,onChange:T=>p(T.target.value),rows:4}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ","{name}",", ","{date}",", ","{time}"," as placeholders"]})]}),a.jsx(F,{onClick:P,className:"w-full",children:"Create Template"})]})]})]})]})}),a.jsx(H,{children:a.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(yt,{className:"w-4 h-4 text-primary"}),a.jsx("span",{className:"font-medium text-sm",children:"Preview Variables"})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(q,{className:"text-xs",children:"Name"}),a.jsx(ee,{value:b.name,onChange:T=>j($=>({...$,name:T.target.value})),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(q,{className:"text-xs",children:"Date"}),a.jsx(ee,{value:b.date,onChange:T=>j($=>({...$,date:T.target.value})),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(q,{className:"text-xs",children:"Time"}),a.jsx(ee,{value:b.time,onChange:T=>j($=>({...$,time:T.target.value})),className:"h-8 text-sm"})]})]})]})})]}),["enquiry","followup","booking","general"].map(T=>{const $=E[T]||[];return $.length===0?null:a.jsxs(K,{children:[a.jsx(oe,{className:"pb-3",children:a.jsxs(ne,{className:nK[T],children:[T.charAt(0).toUpperCase()+T.slice(1)," Templates"]})}),a.jsx(H,{className:"space-y-3",children:$.map(I=>a.jsx("div",{className:"p-4 rounded-lg border bg-card hover:bg-muted/30 transition-colors",children:i===I.id?a.jsxs("div",{className:"space-y-3",children:[a.jsx(ee,{value:o,onChange:B=>l(B.target.value),placeholder:"Template name"}),a.jsx(Ce,{value:c,onChange:B=>u(B.target.value),rows:3}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(F,{size:"sm",onClick:()=>A(I.id),children:[a.jsx(it,{className:"w-4 h-4 mr-1"}),"Save"]}),a.jsxs(F,{size:"sm",variant:"outline",onClick:C,children:[a.jsx(Va,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium",children:I.name}),I.variables.length>0&&a.jsx("div",{className:"flex gap-1",children:I.variables.map(B=>a.jsx(ne,{variant:"outline",className:"text-xs",children:B},B))})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>O(I),children:a.jsx(Sd,{className:"w-4 h-4"})}),a.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>M(I.id),children:a.jsx(dr,{className:"w-4 h-4"})})]})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3 whitespace-pre-wrap",children:y(I.message)}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(F,{size:"sm",variant:"outline",onClick:()=>w(I.message),children:[a.jsx(Mt,{className:"w-4 h-4 mr-1"}),"Copy"]}),a.jsxs(F,{size:"sm",className:"bg-green-600 hover:bg-green-700",onClick:()=>_(I.message),children:[a.jsx(Wf,{className:"w-4 h-4 mr-1"}),"Open WhatsApp"]})]})]})},I.id))})]},T)}),a.jsx(K,{className:"bg-muted/30",children:a.jsx(H,{className:"pt-6",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(St,{className:"w-5 h-5 text-primary mt-0.5"}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsx("p",{className:"font-medium text-foreground mb-1",children:"Response Time Tips:"}),a.jsxs("ul",{className:"list-disc list-inside space-y-1",children:[a.jsx("li",{children:"Couples expect responses within 24 hours"}),a.jsx("li",{children:"Using quick replies can cut response time by 70%"}),a.jsx("li",{children:"Personal touches like emojis increase engagement"}),a.jsxs("li",{children:["Always personalise the ","{name}"," variable before sending"]})]})]})]})})})]})},iK=({supplierId:e,categoryId:t,location:r})=>{const[n,i]=S.useState([]),[s,o]=S.useState(!0),[l,c]=S.useState(0),u=async()=>{var m,h,g;o(!0);try{const{data:p}=await Y.from("suppliers").select(` 508 id, 509 gallery_images, 510 description, 511 short_description 512 `).eq("id",e).single(),{data:v}=await Y.from("supplier_packages").select("id").eq("supplier_id",e).eq("is_active",!0),{data:x}=await Y.from("reviews").select("rating").eq("supplier_id",e);let b=Y.from("suppliers").select(` 513 id, 514 gallery_images, 515 description, 516 short_description 517 `).neq("id",e).not("category_id","is",null);t&&(b=b.eq("category_id",t));const{data:j}=await b.limit(50);if(!j||j.length===0){i([]),o(!1);return}c(j.length);const N=j.map(R=>R.id),{data:y}=await Y.from("supplier_packages").select("supplier_id").in("supplier_id",N).eq("is_active",!0),{data:w}=await Y.from("reviews").select("supplier_id, rating").in("supplier_id",N),_=((m=p==null?void 0:p.gallery_images)==null?void 0:m.length)||0,O=(v==null?void 0:v.length)||0,A=(x==null?void 0:x.length)||0,C=x&&x.length>0?x.reduce((R,re)=>R+re.rating,0)/x.length:0,P=(((h=p==null?void 0:p.description)==null?void 0:h.length)||0)+(((g=p==null?void 0:p.short_description)==null?void 0:g.length)||0),M=j.map(R=>{var re;return((re=R.gallery_images)==null?void 0:re.length)||0}),E=M.reduce((R,re)=>R+re,0)/j.length,T=Math.max(...M),$={};
517y==null||y.forEach(R=>{$[R.supplier_id]=($[R.supplier_id]||0)+1});const I=Object.values($),B=I.length>0?I.reduce((R,re)=>R+re,0)/I.length:0,L=I.length>0?Math.max(...I):0,X={},z={};w==null||w.forEach(R=>{X[R.supplier_id]=(X[R.supplier_id]||0)+1,z[R.supplier_id]||(z[R.supplier_id]={sum:0,count:0}),z[R.supplier_id].sum+=R.rating,z[R.supplier_id].count+=1});const U=Object.values(X),D=U.length>0?U.reduce((R,re)=>R+re,0)/U.length:0,Q=U.length>0?Math.max(...U):0,ae=Object.values(z).map(R=>R.sum/R.count),te=ae.length>0?ae.reduce((R,re)=>R+re,0)/ae.length:0,pe=j.map(R=>{var re,se;return(((re=R.description)==null?void 0:re.length)||0)+(((se=R.short_description)==null?void 0:se.length)||0)}),Ne=pe.reduce((R,re)=>R+re,0)/j.length,Z=Math.max(...pe);i([{label:"Gallery Images",yourValue:_,avgValue:E,maxValue:T,icon:a.jsx(Pv,{className:"w-4 h-4"}),higherIsBetter:!0},{label:"Active Packages",yourValue:O,avgValue:B,maxValue:L,icon:a.jsx(Qs,{className:"w-4 h-4"}),higherIsBetter:!0},{label:"Total Reviews",yourValue:A,avgValue:D,maxValue:Q,icon:a.jsx(Mr,{className:"w-4 h-4"}),higherIsBetter:!0},{label:"Average Rating",yourValue:C,avgValue:te,maxValue:5,unit:"â
",icon:a.jsx(lt,{className:"w-4 h-4"}),higherIsBetter:!0},{label:"Profile Completeness",yourValue:Math.min(P,1e3),avgValue:Math.min(Ne,1e3),maxValue:Math.min(Z,1e3),unit:" chars",icon:a.jsx(St,{className:"w-4 h-4"}),higherIsBetter:!0}])}catch(p){console.error("Error fetching benchmark data:",p),G.error("Failed to load benchmark data")}o(!1)};S.useEffect(()=>{u()},[e,t]);const f=m=>{const h=m.yourValue-m.avgValue,g=m.avgValue*.15;return m.higherIsBetter?h>g?{icon:a.jsx(_t,{className:"w-4 h-4 text-green-500"}),label:"Above Average",color:"text-green-600"}:h<-g?{icon:a.jsx(Uc,{className:"w-4 h-4 text-amber-500"}),label:"Below Average",color:"text-amber-600"}:{icon:a.jsx(qc,{className:"w-4 h-4 text-blue-500"}),label:"Average",color:"text-blue-600"}:h<-g?{icon:a.jsx(_t,{className:"w-4 h-4 text-green-500"}),label:"Above Average",color:"text-green-600"}:h>g?{icon:a.jsx(Uc,{className:"w-4 h-4 text-amber-500"}),label:"Below Average",color:"text-amber-600"}:{icon:a.jsx(qc,{className:"w-4 h-4 text-blue-500"}),label:"Average",color:"text-blue-600"}},d=m=>m.maxValue===0?0:Math.min(m.yourValue/m.maxValue*100,100);return s?a.jsx(K,{children:a.jsxs(H,{className:"py-8 text-center text-muted-foreground",children:[a.jsx($i,{className:"w-5 h-5 animate-spin mx-auto mb-2"}),"Analysing competitor data..."]})}):n.length===0?a.jsxs(K,{children:[a.jsx(oe,{children:a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(zc,{className:"w-5 h-5 text-primary"}),"Competitor Benchmark"]})}),a.jsx(H,{children:a.jsx("p",{className:"text-muted-foreground text-center py-4",children:"Not enough competitors in your category to generate insights."})})]}):a.jsxs(K,{children:[a.jsxs(oe,{className:"flex flex-row items-start justify-between",children:[a.jsxs("div",{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(zc,{className:"w-5 h-5 text-primary"}),"Competitor Benchmark"]}),a.jsxs(he,{children:["Anonymous comparison against ",l," suppliers in your category"]})]}),a.jsx(F,{variant:"ghost",size:"icon",onClick:u,children:a.jsx($i,{className:"w-4 h-4"})})]}),a.jsxs(H,{className:"space-y-6",children:[a.jsx(Yj,{children:n.map((m,h)=>{const g=f(m),p=d(m);return a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground",children:m.icon}),a.jsx("span",{className:"text-sm font-medium",children:m.label}),a.jsxs(Xj,{children:[a.jsx(Qj,{children:a.jsx(H0,{className:"w-3 h-3 text-muted-foreground"})}),a.jsxs(Jj,{children:[a.jsxs("p",{children:["Category average: ",m.avgValue.toFixed(1),m.unit||""]}),a.jsxs("p",{children:["Category best: ",m.maxValue.toFixed(1),m.unit||""]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-sm font-bold",children:[m.yourValue.toFixed(m.unit==="â
"?1:0),m.unit||""]}),g.icon,a.jsx(ne,{variant:"secondary",className:`text-xs ${g.color}`,children:g.label})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(en,{value:p,className:"h-2"}),a.jsx("div",{className:"absolute top-0 w-0.5 h-2 bg-foreground
517/50",style:{left:`${Math.min(m.avgValue/m.maxValue*100,100)}%`}})]}),a.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[a.jsx("span",{children:"0"}),a.jsxs("span",{children:["Avg: ",m.avgValue.toFixed(1)]}),a.jsxs("span",{children:["Best: ",m.maxValue.toFixed(0)]})]})]},h)})}),a.jsxs("div",{className:"mt-6 p-4 bg-primary/5 border border-primary/20 rounded-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"font-medium",children:"Overall Competitiveness"}),a.jsxs(ne,{className:"bg-primary/10 text-primary",children:[n.filter(m=>f(m).label!=="Below Average").length," / ",n.length," metrics above average"]})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:n.filter(m=>f(m).label==="Below Average").length===0?"Great work! You're performing well across all metrics.":`Consider improving: ${n.filter(m=>f(m).label==="Below Average").map(m=>m.label).join(", ")}`})]})]})]})},sK=({supplierId:e,supplierName:t})=>{const[r,n]=S.useState({preFayreAlerts:!0,newCoupleAlerts:!0,matchAlerts:!0,weeklyDigest:!1}),i=[{id:1,name:"Wrexham AFC Wedding Fayre",date:"Feb 15, 2025",venue:"The Racecourse Ground",couplesNotified:156,status:"scheduled"},{id:2,name:"Ruthin Castle Spring Show",date:"Mar 8, 2025",venue:"Ruthin Castle",couplesNotified:0,status:"pending"},{id:3,name:"Llangollen Pavilion Expo",date:"Apr 12, 2025",venue:"Llangollen Pavilion",couplesNotified:0,status:"pending"}],s=(o,l)=>{G.success(`Couples will be notified about your presence at ${l}`)};return a.jsxs("div",{className:"space-y-6 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"elite-icon",children:a.jsx(Js,{className:"w-6 h-6"})}),a.jsxs("div",{children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center gap-2",children:["Priority Event Notifications",a.jsx(yt,{className:"w-4 h-4 text-gold animate-crown-pulse"})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Alert couples before wedding fayres"})]})]}),a.jsxs(ne,{className:"elite-badge",children:[a.jsx(be,{className:"w-3 h-3 mr-1"}),"Elite"]})]}),a.jsx("div",{className:"elite-divider"}),a.jsxs(K,{className:"elite-card",children:[a.jsxs(oe,{className:"elite-header rounded-t-xl pb-3",children:[a.jsxs(le,{className:"text-base flex items-center gap-2",children:[a.jsx(Js,{className:"w-4 h-4 text-gold"}),"Alert Settings"]}),a.jsx(he,{children:"Get discovered first by engaged couples before wedding fayres"})]}),a.jsxs(H,{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(q,{htmlFor:"preFayreAlerts",children:"Pre-Fayre Alerts"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Notify couples about your attendance 1 week before events"})]}),a.jsx(bt,{id:"preFayreAlerts",checked:r.preFayreAlerts,onCheckedChange:o=>n({...r,preFayreAlerts:o})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(q,{htmlFor:"newCoupleAlerts",children:"New Couple Notifications"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Alert new couples in your area about your elite status"})]}),a.jsx(bt,{id:"newCoupleAlerts",checked:r.newCoupleAlerts,onCheckedChange:o=>n({...r,newCoupleAlerts:o})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(q,{htmlFor:"matchAlerts",children:"AI Match Alerts"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Notify couples when you're a top match for their preferences"})]}),a.jsx(bt,{id:"matchAlerts",checked:r.matchAlerts,onCheckedChange:o=>n({...r,matchAlerts:o})})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(q,{htmlFor:"weeklyDigest",children:"Weekly Digest"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Send weekly summary to couples who s
517aved you"})]}),a.jsx(bt,{id:"weeklyDigest",checked:r.weeklyDigest,onCheckedChange:o=>n({...r,weeklyDigest:o})})]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("h3",{className:"font-medium flex items-center gap-2",children:[a.jsx(qe,{className:"w-4 h-4"}),"Upcoming Wedding Fayres"]}),i.map(o=>a.jsx(K,{className:"p-4",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"font-medium",children:o.name}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-1 text-sm text-muted-foreground",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(qe,{className:"w-3 h-3"}),o.date]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Tr,{className:"w-3 h-3"}),o.venue]})]}),o.couplesNotified>0&&a.jsxs("div",{className:"flex items-center gap-1 mt-2 text-sm text-green-600",children:[a.jsx(it,{className:"w-3 h-3"}),a.jsxs("span",{children:[o.couplesNotified," couples notified"]})]})]}),a.jsx("div",{className:"flex flex-col items-end gap-2",children:o.status==="scheduled"?a.jsxs(ne,{className:"bg-green-100 text-green-800 border-green-200",children:[a.jsx(it,{className:"w-3 h-3 mr-1"}),"Scheduled"]}):a.jsxs(F,{size:"sm",className:"bg-gold hover:bg-gold/90 text-secondary",onClick:()=>s(o.id,o.name),children:[a.jsx(_d,{className:"w-3 h-3 mr-1"}),"Notify Couples"]})})]})},o.id))]}),a.jsx(K,{className:"p-4 bg-muted/50",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(xt,{className:"w-5 h-5 text-gold mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium",children:"Reach More Couples"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"As an Elite member, your notifications are prioritised in couple inboxes. On average, Elite suppliers see 3x higher engagement from pre-fayre notifications."})]})]})})]})},Ve=({children:e,isElite:t,featureName:r})=>t?a.jsx(a.Fragment,{children:e}):a.jsxs("div",{className:"relative animate-fade-in",children:[a.jsx("div",{className:"pointer-events-none opacity-30 select-none blur-[1px]",children:e}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-xl",children:a.jsxs("div",{className:"elite-card p-8 rounded-xl text-center max-w-sm mx-4 shadow-2xl",children:[a.jsx("div",{className:"elite-icon mx-auto mb-4",children:a.jsx(Sv,{className:"w-6 h-6"})}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:r}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Upgrade to Elite Vow Collective to unlock this premium feature"}),a.jsxs(F,{className:"elite-button w-full",onClick:()=>window.location.href="mailto:[email protected]?subject=Elite%20Membership%20Enquiry",children:[a.jsx(be,{className:"w-4 h-4 mr-2"}),"Upgrade to Elite"]})]})})]}),oK={free:1,standard:3,elite:1/0},NG=()=>{var Ne;const e=Zj(),[t,r]=e0(),[n,i]=S.useState(null),[s,o]=S.useState(null),[l,c]=S.useState(!0),[u,f]=S.useState(!1),[d,m]=S.useState(!1),[h,g]=S.useState(null),[p,v]=S.useState(null),[x,b]=S.useState([]),[j,N]=S.useState(null),y=S.useRef(null),[w,_]=S.useState(t.get("tab")||"listing");S.useState(!0);const[O,A]=S.useState(!1),C=t.get("enquiry"),P=t.get("booking"),M=t.get("conversation"),{data:E}=t0(),{data:T}=l0("supplier"),[$,I]=S.useState({name:"",description:"",short_description:"",location:"",phone:"",email:"",website:"",category_ids:[],social_facebook:"",social_instagram:"",social_twitter:""}),{data:B}=Dw(p==null?void 0:p.id),L=Iw();S.useEffect(()=>{const Z=window.location.pathname+window.location.search,R=Z!=="/supplier-dashboard"?`?redirect=${encodeURIComponent(Z)}`:"",{data:{subscription:re}}=Y.auth.onAuthStateChange((se,V)=>{o(V),i((V==null?void 0:V.user)??null),V!=null&&V.user||e(`/supplier-auth${R}`)}
517);return Y.auth.getSession().then(({data:{session:se}})=>{o(se),i((se==null?void 0:se.user)??null),se!=null&&se.user||e(`/supplier-auth${R}`)}),()=>re.unsubscribe()},[e]),S.useEffect(()=>{(async()=>{if(!n)return;c(!0);const{data:R,error:re}=await Y.from("supplier_profiles").select("*").eq("user_id",n.id).maybeSingle();if(re)G.error("Error loading profile");else if(R&&(g(R),R.supplier_id)){const{data:se,error:V}=await Y.from("suppliers").select("id, name, slug, category_id, description, short_description, location, website, image_url, gallery_images, featured, is_elite_member, membership_type, social_facebook, social_instagram, social_twitter, owner_user_id, is_promoted, is_verified, priority_score, custom_slug, watermark_enabled, watermark_text, watermark_position, is_spotlight_featured, spotlight_featured_until, custom_theme_primary, custom_theme_accent, created_at, updated_at").eq("id",R.supplier_id).maybeSingle(),{data:Ae}=await Y.rpc("get_supplier_contacts",{_ids:[R.supplier_id]}),ce=Ae==null?void 0:Ae[0],we=se?{...se,email:(ce==null?void 0:ce.email)??"",phone:(ce==null?void 0:ce.phone)??null}:null;!V&&we&&(v(we),b(we.gallery_images||[]),N(we.image_url),I({name:we.name||"",description:we.description||"",short_description:we.short_description||"",location:we.location||"",phone:we.phone||"",email:we.email||"",website:we.website||"",category_ids:[],social_facebook:we.social_facebook||"",social_instagram:we.social_instagram||"",social_twitter:we.social_twitter||""}))}c(!1)})()},[n]),S.useEffect(()=>{B&&B.length>0&&I(Z=>({...Z,category_ids:B.map(R=>R.category_id)}))},[B]),S.useEffect(()=>{if(!l&&h&&h.membership_type!=="elite"){const Z=`upgrade_popup_shown_${n==null?void 0:n.id}`;if(!sessionStorage.getItem(Z)){const re=setTimeout(()=>{A(!0),sessionStorage.setItem(Z,Date.now().toString())},2e3);return()=>clearTimeout(re)}}},[l,h,n==null?void 0:n.id]);const X=async()=>{await Y.auth.signOut(),G.success("Logged out successfully"),e("/supplier-auth")},z=async()=>{if(!p||!n||!h)return;f(!0);const Z=[{key:"name",label:"Business Name"},{key:"location",label:"Location"},{key:"email",label:"Email"},{key:"phone",label:"Phone"},{key:"website",label:"Website"}],R=[];Z.forEach(({key:ce,label:we})=>{const $e=p[ce]||"",ze=$[ce]||"";$e!==ze&&R.push({field:we,oldValue:$e,newValue:ze})});const re=(B==null?void 0:B.map(ce=>ce.category_id))||[],se=$.category_ids;if(JSON.stringify(re.sort())!==JSON.stringify(se.sort())){const ce=re.map($e=>{var ze;return(ze=E==null?void 0:E.find(Rt=>Rt.id===$e))==null?void 0:ze.name}).filter(Boolean).join(", "),we=se.map($e=>{var ze;return(ze=E==null?void 0:E.find(Rt=>Rt.id===$e))==null?void 0:ze.name}).filter(Boolean).join(", ");R.push({field:"Categories",oldValue:ce||"None",newValue:we||"None"})}const V=$.category_ids.length>0?$.category_ids[0]:null,{error:Ae}=await Y.from("suppliers").update({name:$.name,description:$.description,short_description:$.short_description,location:$.location,phone:$.phone,email:$.email,website:$.website,category_id:V,social_facebook:$.social_facebook,social_instagram:$.social_instagram,social_twitter:$.social_twitter}).eq("id",p.id).eq("owner_user_id",n.id);if(Ae){G.error("Failed to save changes"),f(!1);return}try{await L.mutateAsync({supplierId:p.id,categoryIds:$.category_ids})}catch(ce){console.error("Error updating categories:",ce)}if(R.length>0)try{await Y.functions.invoke("send-listing-update-notification",{body:{businessName:$.name,email:$.email||h.email,changes:R,membershipType:h.membership_type}}),console.log("Listing update notification sent")}catch(ce){console.error("Failed to send listing update notification:",ce)}v(ce=>ce?{...ce,name:$.name,category_id:V,location:$.location,email:$.email,phone:$.phone,website:$.website}:null),G.success("Listing updated successfully!"),f(!1)},U=(h==null?void 0:h.membership_type)||"free",D=oK[U],Q=x.length<D,ae=async Z=>{const R=Z.target.files;if(!R||!n||!p)return;const re=D-x.length;if(R.length>re){G.error(`You can only add ${re} more image${re===1?"":"s"} with your ${U} membership`),y.current&&(y.current.value="");return}m(!0);const se=[];for(const V of Array.from(R)){if(!V.type.startsWith("image/")){G.error(`${V.name} is not an image`);continue}if(V.size>5*1024*1024){G.error(`${V.name} is too large (max 5MB)`);continue}const Ae=V.name.split(".").pop(),ce=`${n.id}/${p.id}/${Date.now()}-${Math.random().toString(36).substring(7)}.${Ae}`,{error:we}=await Y.storage.from("supplier-images").upload(ce,V);if(we){console.error("Upload error:",we),G.error(`Failed to upload ${V.name}`);continue}const{data:{publicUrl:$e}}=Y.storage.from("supplier-images").getPublicUrl(ce);se.push($e)}if(se.length>0){const V=[...x,...se],{error:Ae}=await Y.from("suppliers").update({gallery_images:V}).eq("id",p.id).eq("owner_user_id",n.id);Ae?G.error("Failed to update gallery"):(b(V),G.success(`${se.length} image(s) uploaded successfully!`))}m(!1),y.current&&(y.current.value="")},te=async Z=>{if(!n||!p)return;const R=Z.split("/supplier-images/");if(R.length<2){G.error("Invalid image URL");return}const re=R[1],{error:se}=await Y.storage.from("supplier-images").remove([re]);se&&console.error("Delete error:",se);const V=x.filter(ce=>ce!==Z),{error:Ae}=await Y.from("suppliers").update({gallery_images:V}).eq("id",p.id).eq("owner_user_id",n.id);Ae?G.error("Failed to update gallery"):(b(V),G.success("Image deleted"))}
517,pe=async Z=>{if(!n||!p)return;const{error:R}=await Y.from("suppliers").update({image_url:Z}).eq("id",p.id).eq("owner_user_id",n.id);R?G.error("Failed to set main image"):(N(Z),G.success("Main image updated!"))};return l?a.jsxs(a.Fragment,{children:[a.jsx(Vf,{}),a.jsx("main",{className:"min-h-screen bg-muted py-12",children:a.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[a.jsx(Jf,{className:"h-12 w-64 mb-8"}),a.jsx(Jf,{className:"h-96 w-full"})]})}),a.jsx(Kf,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(r0,{children:[a.jsx("title",{children:"Supplier Dashboard | Elite Weddings & Events"}),a.jsx("meta",{name:"description",content:"Manage your supplier profile and listings on Elite Weddings & Events."})]}),a.jsx(Vf,{}),a.jsxs("main",{className:"min-h-screen bg-muted",children:[a.jsx("section",{className:"bg-secondary py-8 border-b border-gold/20",children:a.jsx("div",{className:"container mx-auto px-4",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-gold/20 flex items-center justify-center",children:a.jsx(be,{className:"w-6 h-6 text-gold"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-display text-2xl text-gold",children:(h==null?void 0:h.business_name)||"Supplier Dashboard"}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:["Welcome back, ",(h==null?void 0:h.contact_name)||(n==null?void 0:n.email)]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[p&&a.jsxs(F,{variant:"outline",onClick:()=>e(`/suppliers/${p.slug}`),children:[a.jsx(br,{className:"w-4 h-4 mr-2"}),"View Listing"]}),a.jsxs(F,{variant:"outline",onClick:X,className:"border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",children:[a.jsx(n0,{className:"w-4 h-4 mr-2"}),"Logout"]})]})]})})}),a.jsx("section",{className:"py-8",children:a.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[a.jsxs("div",{className:"grid sm:grid-cols-3 gap-4 mb-8",children:[a.jsx(K,{children:a.jsxs(H,{className:"p-4 flex items-center gap-3",children:[(h==null?void 0:h.membership_type)==="elite"?h!=null&&h.is_approved?a.jsx(ke,{className:"w-8 h-8 text-green-500"}):a.jsx(St,{className:"w-8 h-8 text-amber-500"}):a.jsx(ke,{className:"w-8 h-8 text-green-500"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Account Status"}),a.jsx("p",{className:"font-semibold",children:(h==null?void 0:h.membership_type)==="elite"?h!=null&&h.is_approved?"Approved":"Pending Approval":"Active"})]})]})}),a.jsx(K,{children:a.jsxs(H,{className:"p-4 flex items-center gap-3",children:[p?a.jsx(nt,{className:"w-8 h-8 text-primary"}):a.jsx(Od,{className:"w-8 h-8 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Listing Status"}),a.jsx("p",{className:"font-semibold",children:p?"Active":"No Listing"})]})]})}),a.jsx(K,{children:a.jsxs(H,{className:"p-4 flex items-center gap-3",children:[(h==null?void 0:h.membership_type)==="elite"?a.jsx(be,{className:"w-8 h-8 text-gold"}):(h==null?void 0:h.membership_type)==="standard"?a.jsx(lt,{className:"w-8 h-8 text-blue-500"}):a.jsx(be,{className:"w-8 h-8 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Membership"}),a.jsx("p",{className:"font-semibold",children:(h==null?void 0:h.membership_type)==="elite"?"Elite Member":(h==null?void 0:h.membership_type)==="standard"?"Standard Member":"Free"})]})]})})]}),a.jsx("div",{className:"mb-8",children:a.jsx(xV,{membershipType:(h==null?void 0:h.membership_type)||"free"})}),(h==null?void 0:h.membership_type)==="free"&&a.jsx(K,{className:"mb-8 border-gold/30 bg-gradient-to-r from-gold/5 to-gold/10",children:a.jsx(H,{className:"p-6",children:a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-gold/20 flex items-center justify-center flex-shrink-0",children:a.jsx(lt,{className:"w-6 h-6 text-gold fill-gold"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-display text-lg text-gold mb-1",children:"Upgrade to Standard or Elite"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Get more visibility and features to grow your wedding business"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"text-sm font-semibold text-primary mb-2",children:"Standard (£10/month):"}),a.jsxs("ul",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-1 text-sm text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"Featured as Recognised Supplier"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"Up to 3 gallery images"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"Video portfolio showcase"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}
517),"Social media links & promotion"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"Enquiry notifications"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"Basic analytics dashboard"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"Response time badge"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-green-500 flex-shrink-0"}),"10% off exhibition spaces"]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-gold mb-2",children:"Elite Vow Collective (£25/month):"}),a.jsxs("ul",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-1 text-sm text-muted-foreground",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"Priority search ranking"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"Homepage spotlight rotation"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"Unlimited gallery images"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"Verified & Recommended badges"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"AI-powered enquiry replies"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"Advanced analytics & insights"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"Featured at wedding shows"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx(ke,{className:"w-3 h-3 text-gold flex-shrink-0"}),"20% off exhibition & magazine"]})]})]})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(da,{children:[a.jsx($c,{asChild:!0,children:a.jsxs(F,{className:"bg-gold text-secondary hover:bg-gold/90 whitespace-nowrap",children:[a.jsx(be,{className:"w-4 h-4 mr-2"}),"Upgrade Now"]})}),a.jsxs(fa,{children:[a.jsxs(ma,{children:[a.jsx(ha,{children:"Upgrade Your Membership"}),a.jsxs(pa,{children:[a.jsx("span",{className:"block mb-2",children:a.jsx("strong",{children:"Standard - £10/month"})}),a.jsxs("span",{className:"block mb-2",children:[a.jsx("strong",{children:"Elite - £25/month"})," (North Wales, Shropshire & Cheshire - includes event benefits)"]}),a.jsxs("span",{className:"block mb-2",children:[a.jsx("strong",{children:"Elite - £20/month"})," (Other Locations)"]}),a.jsx("br",{}),"To upgrade, please contact our team and we'll help you get set up."]})]}),a.jsxs(ga,{children:[a.jsx(va,{children:"Cancel"}),a.jsx(xa,{className:"bg-gold text-secondary hover:bg-gold/90",onClick:()=>{window.location.href=`mailto:[email protected]?subject=Membership Upgrade Request&body=Hi,%0A%0AI would like to upgrade my supplier account.%0A%0ABusiness Name: ${encodeURIComponent((h==null?void 0:h.business_name)||"")}%0AEmail: ${encodeURIComponent((h==null?void 0:h.email)||"")}%0A%0AThank you!`},children:"Contact Us to Upgrade"})]})]})]})})]})})}),p?a.jsxs(a.Fragment,{children:[a.jsx(vV,{listing:p,categoryCount:(B==null?void 0:B.length)||0,onNavigateToTab:Z=>_(Z)}),a.jsxs(Ka,{value:w,onValueChange:_,className:"w-full",children:[a.jsxs(On,{className:"mb-2 flex-wrap h-auto gap-1",children:[a.jsxs(ge,{value:"listing",className:"gap-2 bg-primary/10 border border-primary/20",children:[a.jsx(kr,{className:"w-4 h-4"}),"Edit Listing"]}),a.jsxs(ge,{value:"enquiries",className:"gap-2",children:[a.jsx(Mr,{className:"w-4 h-4"}),"Enquiries"]}),a.jsxs(ge,{value:"bookings",className:"gap-2",children:[a.jsx(yw,{className:"w-4 h-4"}),"Bookings"]}),a.jsxs(ge,{value:"messages",className:"gap-2",children:[a.jsx(Tt,{className:"w-4 h-4"}),"Messages",T>0&&a.jsx(ne,{className:"bg-gold text-secondary ml-1 h-5 min-w-5 text-xs",children:T})]}),a.jsxs(ge,{value:"gallery",className:"gap-2",children:[a.jsx(sa,{className:"w-4 h-4"}),"Photos"]}),a.jsxs(ge,{value:"packages",className:"gap-2",children:[a.jsx(Qs,{className:"w-4 h-4"}),"Packages"]}),a.jsxs(ge,{value:"availability",className:"gap-2",children:[a.jsx(qe,{className:"w-4 h-4"}),"Availability"]}),a.jsxs(ge,{value:"analytics",className:"gap-2",children:[a.jsx(zc,{className:"w-4 h-4"}),"Analytics"]}),a.jsxs(ge,{value:"profile",className:"gap-2",children:[a.jsx(ji,{className:"w-4 h-4"}),"Account"]})]}),a.jsxs(On,{className:"mb-6 flex-wrap h-auto gap-1",children:[a.jsxs(ge,{value:"services",className:"gap-2",children:[a.jsx(nt,{className:"w-4 h-4"}),"Services"]}),a.jsxs(ge,{value:"reviews",className:"gap-2",children:[a.jsx(lt,{className:"w-4 h-4"}),"Reviews"]}),a.jsxs(ge,{value:"insights",className:"gap-2",children:[a.jsx(_t,{className:"w-4 h-4"}),"Insights",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"promotions",className:"gap-2",children:[a.jsx(Qr,{className:"w-4 h-4"}),"Promotions",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"videos",className:"gap-2",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Videos"]}),a.jsxs(ge,{value:"articles",className:"gap-2",children:[a.jsx(nt,{className:"w-4 h-4"}),"Articles",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"marketing",className:"gap-2",children:[a.jsx(Qr,{className:"w-4 h-4"}),"Marketing",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"leads",className:"gap-2",children:[a.jsx(xt,{className:"w-4 h-4"}),"Leads",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"instant",className:"gap-2",children:[a.jsx(yi,{className:"w-4 h-4"}),"Instant Book",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"quotes",className:"gap-2",children:[a.jsx(nt,{className:"w-4 h-4"}),"Quotes",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"clients",className:"gap-2",children:[a.jsx(xt,{className:"w-4 h-4"}),"Client Portal",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"automation",className:"gap-2",children:[a.jsx(yi,{className:"w-4 h-4"}),"Automation",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"branding",className:"gap-2",children:[a.jsx(be,{className:"w-4 h-4"}),"Branding",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"referrals",className:"gap-2",children:[a.jsx(xt,{className:"w-4 h-4"}),"Referrals",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"virtual-tours",className:"gap-2",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Virtual Tours",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"training",className:"gap-2",children:[a.jsx(nt,{className:"w-4 h-4"}),"Training",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"materials",className:"gap-2",children:[a.jsx(sa,{className:"w-4 h-4"}),"Materials",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"account-manager",className:"gap-2",children:[a.jsx(ji,{className:"w-4 h-4"}),"Manager",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"api",className:"gap-2",children:[a.jsx(yi,{className:"w-4 h-4"}),"API",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"business-tools",className:"gap-2",children:[a.jsx(_t,{className:"w-4 h-4"}),"Business Tools",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"priority-alerts",className:"gap-2",children:[a.jsx(yi,{className:"w-4 h-4"}),"Priority Alerts",a.jsx(be,{className:"w-3 h-3 text-gold"})]}),a.jsxs(ge,{value:"membership",className:"gap-2",children:[a.jsx(be,{className:"w-4 h-4"}),"Membership"]})]}),a.jsx(ye,{value:"enquiries",children:a.jsx(Fw,{supplierId:p.id,highlightedEnquiryId:C,onEnquiryOpened:()=>{t.delete("enquiry"),r(t,{replace:!0})}})}
517),a.jsx(ye,{value:"bookings",children:a.jsx(rV,{highlightedBookingId:P,onBookingOpened:()=>{t.delete("booking"),r(t,{replace:!0})}})}),a.jsx(ye,{value:"messages",children:a.jsx(c0,{userType:"supplier",initialConversationId:M||void 0})}),a.jsx(ye,{value:"packages",children:a.jsx(tV,{})}),a.jsx(ye,{value:"availability",children:a.jsxs("div",{className:"space-y-8",children:[a.jsx(mN,{supplierId:p.id}),a.jsx(tK,{supplierId:p.id})]})}),a.jsx(ye,{value:"analytics",children:a.jsxs("div",{className:"space-y-8",children:[a.jsx(ZW,{supplierId:p.id}),U==="elite"&&a.jsx(a.Fragment,{children:a.jsx("div",{className:"border-t pt-8",children:a.jsx(eK,{supplierId:p.id})})})]})}),a.jsx(ye,{value:"insights",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Business Insights",children:a.jsx(iV,{supplierId:p.id,categoryId:p.category_id})})}),a.jsx(ye,{value:"promotions",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Promotions & Offers",children:a.jsx(eV,{supplierId:p.id})})}),a.jsx(ye,{value:"videos",children:U==="free"?a.jsx(Ve,{isElite:!1,featureName:"Video Portfolio",children:a.jsx(ov,{membershipType:U})}):a.jsx(ov,{membershipType:U})}),a.jsx(ye,{value:"articles",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Advice Articles",children:a.jsx(nV,{})})}),a.jsx(ye,{value:"marketing",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Marketing Tools",children:a.jsx(fV,{supplierId:p.id,supplierSlug:p.slug,supplierName:p.name})})}),a.jsx(ye,{value:"leads",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Lead Scoring",children:a.jsx(jV,{supplierId:p.id})})}),a.jsx(ye,{value:"instant",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Instant Booking",children:a.jsx(NV,{supplierId:p.id})})}),a.jsx(ye,{value:"quotes",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Quote Management",children:a.jsx(PV,{supplierId:p.id,businessName:p.name})})}),a.jsx(ye,{value:"clients",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Client Portal",children:a.jsx(kV,{supplierId:p.id})})}),a.jsx(ye,{value:"automation",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Automation Tools",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(SV,{supplierId:p.id}),a.jsx(AV,{supplierId:p.id}),a.jsx(aK,{supplierName:p.name,supplierPhone:p.phone})]})})}),a.jsx(ye,{value:"branding",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Branding Tools",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx(ZV,{supplierId:p.id,userId:n.id,currentPrimary:null,currentAccent:null,onUpdate:()=>{}}),a.jsx($V,{supplierId:p.id,currentSlug:p.slug,customSlug:null}),a.jsx(EV,{supplierId:p.id,currentSettings:{watermark_enabled:!1,watermark_text:null,watermark_position:"bottom-right"}}),a.jsx(OV,{businessName:p.name,category:(Ne=E==null?void 0:E.find(Z=>Z.id===p.category_id))==null?void 0:Ne.name,currentDescription:p.description||void 0,onApply:Z=>I(R=>({...R,description:Z}))}),a.jsx(_V,{supplierId:p.id}),a.jsx(YV,{supplierId:p.id}),a.jsx(CV,{supplierId:p.id}),a.jsx(uv,{supplierId:p.id,categoryId:p.category_id}),a.jsx(dv,{supplierId:p.id,supplierSlug:p.slug}),a.jsx(mv,{supplierId:p.id,supplierName:p.name}),a.jsx(fv,{supplierName:p.name,supplierData:{description:p.description,location:p.location,email:p.email,phone:p.phone,website:p.website},packages:[],reviews:[]}),a.jsx(LV,{supplierId:p.id})]})})}),a.jsx(ye,{value:"reviews",children:a.jsxs("div",{className:"space-y-8",children:[U==="elite"&&a.jsx(QV,{supplierId:p.id}),a.jsx(DV,{supplierId:p.id}),a.jsx("div",{className:"border-t pt-8",children:a.jsx(IV,{supplierId:p.id})})]})}),a.jsx(ye,{value:"referrals",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Referral Program",children:a.jsx(MV,{supplierId:p.id,supplierName:p.name})})}),a.jsx(ye,{value:"virtual-tours",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Virtual Tours",children:a.jsx(FV,{supplierId:p.id})})}),a.jsx(ye,{value:"training",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Training Resources",children:a.jsx(WV,{})})}),a.jsx(ye,{value:"materials",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Marketing Materials",children:a.jsx(VV,{supplierName:p.name})})}),a.jsx(ye,{value:"account-manager",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Dedicated Account Manager",children:a.jsx(BV,{supplierName:p.name})})}),a.jsx(ye,{value:"membership",children:a.jsx(HV,{currentTier:U,onTierChanged:()=>window.location.reload()})}),a.jsx(ye,{value:"api",children:a.jsx(Ve,{isElite:U==="elite",featureName:"API Access",children:a.jsx(KV,{supplierId:p.id,supplierName:p.name})})}),a.jsx(ye,{value:"business-tools",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Business Tools",children:a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[a.jsx(iK,{supplierId:p.id,categoryId:p.category_id,location:p.location}),a.jsx(uv,{supplierId:p.id,categoryId:p.category_id||void 0})]}),a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[a.jsx(fv,{supplierName:p.name,supplierData:{description:p.description||void 0,location:p.location||void 0,email:p.email||void 0,phone:p.phone||void 0,website:p.website||void 0,galleryImages:p.gallery_images||void 0},packages:[],reviews:[]}),a.jsx(Rj,{supplierId:p.id,supplierName:p.name})]}),a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[a.jsx(mv,{supplierId:p.id,supplierName:p.name}),a.jsx(dv,{supplierId:p.id,supplierSlug:p.slug})]})]})})}),a.jsx(ye,{value:"priority-alerts",children:a.jsx(Ve,{isElite:U==="elite",featureName:"Priority Event Notifications",children:a.jsx(sK,{supplierId:p.id,supplierName:p.name})})}),a.jsx(ye,{value:"listing",children:a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(kr,{className:"w-5 h-5 text-primary"}),"Edit Your Listing"]}),a.jsxs(he,{children:["Update your business information visible to couples. Fields marked with ",a.jsx("span",{className:"text-amber-600 font-medium",children:"*"})," are required."]})]}
517),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"name",className:"flex items-center gap-1",children:["Business Name ",a.jsx("span",{className:"text-amber-600",children:"*"})]}),a.jsx(ee,{id:"name",value:$.name,onChange:Z=>I(R=>({...R,name:Z.target.value})),placeholder:"e.g., Smith Photography"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Your official business name as it should appear to couples"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"category",className:"flex items-center gap-1",children:["Categories ",a.jsx("span",{className:"text-amber-600",children:"*"})]}),a.jsx(Gv,{categories:E,selectedIds:$.category_ids,onChange:Z=>I(R=>({...R,category_ids:Z})),placeholder:"Select categories..."}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Select all services you offer â this helps couples find you"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"short_description",children:"Short Description"}),a.jsx(ee,{id:"short_description",value:$.short_description,onChange:Z=>I(R=>({...R,short_description:Z.target.value})),placeholder:"Brief tagline for your business"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"A catchy one-liner shown in search results (50-100 characters recommended)"})]}),a.jsx(Ve,{isElite:(h==null?void 0:h.membership_type)==="elite",featureName:"Full Description",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(q,{htmlFor:"description",children:"Full Description"}),a.jsx(Ce,{id:"description",value:$.description,onChange:Z=>I(R=>({...R,description:Z.target.value})),rows:5,placeholder:"Tell couples about your services, experience, and what makes you unique..."}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Detailed description shown on your profile page. Include your style, experience, and what couples can expect."})]})}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"location",className:"flex items-center gap-1",children:[a.jsx(Tr,{className:"w-4 h-4 inline mr-1"}),"Location ",a.jsx("span",{className:"text-amber-600",children:"*"})]}),a.jsx(ee,{id:"location",value:$.location,onChange:Z=>I(R=>({...R,location:Z.target.value})),placeholder:"e.g., Chester, Cheshire"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Where you're based â couples search by location"})]}),a.jsxs("div",{className:"border-t pt-6",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("h3",{className:"font-semibold",children:"Contact Information"}),a.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/20 text-amber-700 dark:text-amber-400",children:"At least one required"})]}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"How couples can reach you â add at least email or phone"}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"listing-email",className:"flex items-center gap-1",children:[a.jsx(Tt,{className:"w-4 h-4 inline mr-1"}),"Email ",a.jsx("span",{className:"text-amber-600",children:"*"})]}),a.jsx(ee,{id:"listing-email",type:"email",value:$.email,onChange:Z=>I(R=>({...R,email:Z.target.value})),placeholder:"[email protected]"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.jsx("strong",{children:"Important:"})," Enquiries from couples will be sent to this email address"]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"listing-phone",children:[a.jsx(Xr,{className:"w-4 h-4 inline mr-1"}),"Phone"]}),a.jsx(ee,{id:"listing-phone",type:"tel",value:$.phone,onChange:Z=>I(R=>({...R,phone:Z.target.value})),placeholder:"01onal 123456"})]})]}),a.jsxs("div",{className:"space-y-2 mt-4",children:[a.jsxs(q,{htmlFor:"website",children:[a.jsx(vv,{className:"w-4 h-4 inline mr-1"}),"Website"]}),a.jsx(ee,{id:"website",type:"url",value:$.website,onChange:Z=>I(R=>({...R,website:Z.target.value})),placeholder:"https://yourwebsite.com"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional â include https:// for the link to work"})]})]}),a.jsx(Ve,{isElite:(h==null?void 0:h.membership_type)==="elite",featureName:"Social Media Links",children:a.jsxs("div",{className:"border-t pt-6",children:[a.jsx("h3",{className:"font-semibold mb-4",children:"Social Media"}),a.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"facebook",children:[a.jsx(a0,{className:"w-4 h-4 inline mr-1"}),"Facebook"]}),a.jsx(ee,{id:"facebook",value:$.social_facebook,onChange:Z=>I(R=>({...R,social_facebook:Z.target.value})),placeholder:"Facebook URL"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"instagram",children:[a.jsx(i0,{className:"w-4 h-4 inline mr-1"}),"Instagram"]}),a.jsx(ee,{id:"instagram",value:$.social_instagram,onChange:Z=>I(R=>({...R,social_instagram:Z.target.value})),placeholder:"Instagram URL"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(q,{htmlFor:"twitter",children:[a.jsx(u0,{className:"w-4 h-4 inline mr-1"}),"Twitter/X"]}),a.jsx(ee,{id:"twitter",value:$.social_twitter,onChange:Z=>I(R=>({...R,social_twitter:Z.target.value})),placeholder:"Twitter URL"})]})]})]})}),a.jsx("div",{className:"flex justify-end pt-4 border-t",children:a.jsxs(F,{onClick:z,disabled:u,className:"bg-gold text-secondary hover:bg-gold/90",children:[u?a.jsx(Se,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Rn,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]})]})}),a.jsx(ye,{value:"services",children:a.jsx(gV,{supplierId:p.id})}),a.jsx(ye,{value:"gallery",children:a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(sa,{className:"w-5 h-5 text-primary"}),"Photo Gallery"]}),a.jsx(he,{children:"Upload photos to showcase your work. The main image will be displayed as your listing thumbnail."})]}
517),a.jsxs(H,{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row gap-8 items-start border-b pb-6",children:[a.jsxs("div",{className:"flex-shrink-0",children:[a.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[a.jsx(be,{className:"w-4 h-4 text-gold"}),"Profile Photo / Logo"]}),a.jsx(XV,{currentImage:j,supplierId:p.id,userId:n.id,onImageUpdate:Z=>N(Z||null)})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Your profile photo appears on your listing card and profile page. Use a high-quality logo or photo that represents your brand."}),a.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1",children:[a.jsx("li",{children:"⢠Recommended: Square format (1:1 ratio)"}),a.jsx("li",{children:"⢠Minimum: 400 x 400 pixels"}),a.jsx("li",{children:"⢠Max file size: 5MB"})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 bg-muted rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(ne,{className:U==="elite"?"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200":U==="standard"?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-muted text-muted-foreground",children:[U==="elite"&&a.jsx(be,{className:"w-3 h-3 mr-1"}),U==="standard"&&a.jsx(lt,{className:"w-3 h-3 mr-1"}),U.charAt(0).toUpperCase()+U.slice(1)]}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[x.length," / ",D," images used"]})]}),!Q&&U!=="elite"&&a.jsx("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:"Upgrade for more images"})]}),Q?a.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-8 text-center hover:border-primary/50 transition-colors",children:[a.jsx("input",{ref:y,type:"file",accept:"image/*",multiple:!0,onChange:ae,className:"hidden",id:"gallery-upload"}),a.jsx("label",{htmlFor:"gallery-upload",className:"cursor-pointer",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[d?a.jsx(Se,{className:"w-12 h-12 text-primary animate-spin"}):a.jsx(Fc,{className:"w-12 h-12 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-foreground",children:d?"Uploading...":"Click to upload images"}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:["PNG, JPG up to 5MB each ⢠",D-x.length," slot",D-x.length===1?"":"s"," remaining"]})]})]})})]}):a.jsxs("div",{className:"border-2 border-dashed border-amber-300 rounded-lg p-8 text-center bg-amber-50/50 dark:bg-amber-900/10",children:[a.jsx(be,{className:"w-12 h-12 text-amber-500 mx-auto mb-3"}),a.jsx("p",{className:"font-medium text-foreground mb-1",children:"Image limit reached"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:U==="free"?"Upgrade to Standard (3 images) or Elite (unlimited images) to add more photos":"Upgrade to Elite membership for unlimited images"})]}),j&&a.jsxs("div",{className:"border-t pt-6",children:[a.jsxs("h3",{className:"font-semibold mb-4 flex items-center gap-2",children:[a.jsx(lt,{className:"w-4 h-4 text-gold"}),"Main Image (Listing Thumbnail)"]}),a.jsxs("div",{className:"relative w-48 aspect-video rounded-lg overflow-hidden border-2 border-gold",children:[a.jsx("img",{src:j,alt:"Main",className:"w-full h-full object-cover"}),a.jsx(ne,{className:"absolute top-2 left-2 bg-gold text-secondary",children:"Main"})]})]}),a.jsxs("div",{className:"border-t pt-6",children:[a.jsxs("h3",{className:"font-semibold mb-4",children:["Gallery Images (",x.length,")"]}),x.length===0?a.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[a.jsx(Nw,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),a.jsx("p",{children:"No images uploaded yet"}),a.jsx("p",{className:"text-sm",children:"Upload some photos to showcase your work"})]}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map((Z,R)=>a.jsxs("div",{className:"relative group aspect-square rounded-lg overflow-hidden border border-border",children:[a.jsx("img",{src:Z,alt:`Gallery ${R+1}`,className:"w-full h-full object-cover"}),j===Z&&a.jsxs(ne,{className:"absolute top-2 left-2 bg-gold text-secondary text-xs",children:[a.jsx(lt,{className:"w-3 h-3 mr-1"}),"Main"]}),a.jsxs("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[j!==
517Z&&a.jsxs(F,{size:"sm",variant:"secondary",onClick:()=>pe(Z),className:"text-xs",children:[a.jsx(lt,{className:"w-3 h-3 mr-1"}),"Set Main"]}),a.jsxs(da,{children:[a.jsx($c,{asChild:!0,children:a.jsx(F,{size:"sm",variant:"destructive",className:"text-xs",children:a.jsx(dr,{className:"w-3 h-3"})})}),a.jsxs(fa,{children:[a.jsxs(ma,{children:[a.jsx(ha,{children:"Delete Image?"}),a.jsx(pa,{children:"This action cannot be undone. The image will be permanently deleted."})]}),a.jsxs(ga,{children:[a.jsx(va,{children:"Cancel"}),a.jsx(xa,{onClick:()=>te(Z),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]})]},R))})]})]})]})}),a.jsx(ye,{value:"profile",children:a.jsxs(K,{children:[a.jsxs(oe,{children:[a.jsxs(le,{className:"flex items-center gap-2",children:[a.jsx(ji,{className:"w-5 h-5 text-primary"}),"Account Settings"]}),a.jsx(he,{children:"Your account information"})]}),a.jsx(H,{className:"space-y-4",children:a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(q,{className:"text-muted-foreground",children:"Business Name"}),a.jsx("p",{className:"font-medium",children:h==null?void 0:h.business_name})]}),a.jsxs("div",{children:[a.jsx(q,{className:"text-muted-foreground",children:"Contact Name"}),a.jsx("p",{className:"font-medium",children:(h==null?void 0:h.contact_name)||"-"})]}),a.jsxs("div",{children:[a.jsx(q,{className:"text-muted-foreground",children:"Email"}),a.jsx("p",{className:"font-medium",children:h==null?void 0:h.email})]}),a.jsxs("div",{children:[a.jsx(q,{className:"text-muted-foreground",children:"Phone"}),a.jsx("p",{className:"font-medium",children:(h==null?void 0:h.phone)||"-"})]})]})})]})})]})]}):a.jsxs("div",{className:"space-y-6",children:[(h==null?void 0:h.membership_type)==="elite"&&!(h!=null&&h.is_approved)&&a.jsx(K,{className:"border-amber-500/30 bg-amber-500/5",children:a.jsx(H,{className:"py-4",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(St,{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-foreground",children:"Elite Membership Pending Approval"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Your Elite membership is being reviewed. You can set up your profile now â it will go live once approved (usually 1-2 business days)."})]})]})})}),a.jsx(dN,{userId:n.id,businessName:(h==null?void 0:h.business_name)||"",email:(h==null?void 0:h.email)||"",phone:h==null?void 0:h.phone,categories:E,onListingCreated:()=>{window.location.reload()}})]})]})})]}),a.jsx(Kf,{}),h&&a.jsx(GV,{isOpen:O,onClose:()=>A(!1),currentTier:h.membership_type,businessName:h.business_name})]})};export{NG as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.