import{j as s,r,u as n}from"./router.chunk.YsRm4bSN.js";import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{S as e}from"./campaign.chunk.Bl3EV_wc.js";import{b8 as a,Z as o,J as i,r as c,a2 as t,C as m,K as d,E as u,be as l,l as g,$ as f,L as p,N as h,aC as j,aD as w,az as x}from"./main.chunk.N-eZ2ybB.js";import{k}from"./forms.chunk.Bz8aaTWe.js";import{D as v}from"./date-picker-field.chunk.ipSHuuNj.js";import{P as b}from"./pro-banner.chunk.CUk03dEk.js";import{S as y,a as N,b as C,c as O,d as z}from"./sheet.chunk.B4xhWhQI.js";import{I}from"./information-metrics.chunk.BUFrAROV.js";import{A as S}from"./campaign-information-metrics.chunk.CDqEuZTP.js";import{C as D}from"./campaign-context.chunk.BmsJZ0pE.js";import{aH as E}from"./icons.chunk.BwnSC3zE.js";import{l as L}from"./campaign.chunk.DLkjF6XJ.js";import"./react-jsx-runtime.chunk.ATkk6v2S.js";import"./react.js";import"./react-dom-client.chunk.BMQ1litG.js";import"./react-dom.js";import"./pdf-core.chunk.D33I_Wdh.js";import"./ui-radix.chunk.Xzokq_Gv.js";import"./utils.chunk.C1IATKsN.js";import"./date-utils.chunk.DWRtWTmT.js";import"./loading-skeleton.chunk.sJ-6gSIX.js";import"./metrics-card.chunk.ao_0wOYX.js";import"./pro-badge.chunk.PstHsVdU.js";import"./tooltip.chunk.DtTQ21GF.js";import"./use-currency.chunk.QE--bLc6.js";import"./use-debounce.chunk.th480LZc.js";import"./filter.chunk.Bx8zQ-yD.js";const P=()=>s.jsx("div",{className:"growfund-relative growfund-min-h-[28rem] growfund-bg-no-repeat growfund-bg-cover",style:{backgroundImage:`url('${a("/images/campaign-overview-overlay.webp")}')`},children:s.jsx("div",{className:"growfund-z-10 growfund-flex growfund-items-center growfund-justify-center growfund-min-h-[28rem]",children:s.jsx(b,{title:__("Turn insights into growth","growfund"),description:__("Pro gives you deeper campaign overview to help you maximize performance and scale faster.","growfund")})})}),T=({campaign:r,open:n,onOpenChange:e})=>{const a=k({resolver:i(S),defaultValues:o(S)}),g=c.get("CampaignOverviewAnalytics");return s.jsx(y,{open:n,onOpenChange:e,children:s.jsxs(N,{side:"bottom",className:"growfund-h-[90svh] growfund-grid",children:[s.jsxs(C,{children:[s.jsxs(O,{children:[s.jsx(E,{className:"growfund-size-6"}),__("Campaign Overview","growfund")]}),s.jsx(z,{className:"growfund-sr-only",children:__("Campaign Overview","growfund")})]}),s.jsxs(t,{children:[s.jsx(m,{className:"growfund-my-7 growfund-space-y-5 growfund-min-h-[calc(100svh-10rem)]",children:s.jsxs(d,{...a,children:[s.jsxs("div",{className:"growfund-flex growfund-items-center growfund-justify-between",children:[s.jsx("h4",{className:"growfund-typo-h4 growfund-text-fg-brand ",children:r.title}),s.jsx("div",{children:s.jsx(v,{control:a.control,name:"date_range",placeholder:__("Date: Last 30 days","growfund"),type:"range",showRangePresets:!0,clearable:!0,className:"growfund-w-64"})})]}),s.jsx(I,{hasNoColor:!0,invisibleGrowth:!0,campaignId:r.id}),s.jsx(u,{fallback:s.jsx(P,{}),children:g&&s.jsx(D,{campaign:r,children:s.jsx(g,{})})})]})}),s.jsx(l,{})]})]})})},A=()=>{const[a,o]=r.useState(!0),i=n(),{id:c}=g(),t=L(c);return f(t,{Loading:s.jsx(x,{}),Error:s.jsx(j,{className:"growfund-mt-10",children:s.jsxs(w,{children:[s.jsx(e,{}),s.jsx("div",{children:__("Campaign not found.","growfund")})]})}),Empty:s.jsx(p,{className:"growfund-mt-10",children:s.jsxs(h,{className:"growfund-flex growfund-flex-col growfund-items-center",children:[s.jsx(e,{}),s.jsx("div",{children:__("Campaign not found.","growfund")})]})}),Success:r=>s.jsx(T,{open:a,onOpenChange:s=>{s||(o(!1),setTimeout(()=>{i(-1)},300))},campaign:r.data})})};export{A as default};
