1import{u as b,a as E,b as A,r as a,dP as v,ec as I,j as s,z as T,bQ as C,l,aK as O,c0 as U}from"./index-Bfuskbvf.js";import{O as B}from"./OrderCrm-iyj2rdeW.js";import{G as R}from"./TemplateSection-DlzzOa4-.js";import{P as _}from"./PageMarkup-Wdu19r-5.js";import{P as L}from"./PageHeader-B4MQwna_.js";import{M as W}from"./ManualWhatsAppConfigModal-D6XR6rqr.js";import{B as d}from"./Banner-CA00zSsJ.js";import{P as N}from"./ProgressBar-DGEeqXAs.js";import"./NoManualTemplatesModal-BynjP8IQ.js";import"./Filters-CP7-UWdS.js";import"./DataTable-DpPVeQCz.js";import"./campaigns-DF_1YeRp.js";import"./WhatsAppTemplatePreview-DH5QdBtS.js";/* empty css */import"./ChoiceList-lJgzmq9l.js";import"./RadioButton-uoiHGclV.js";import"./Checkbox-JrDf54NZ.js";import"./InfoIcon.svg-ByI-v68A.js";import"./Card-OPaZ3948.js";import"./constants-CfTbxg26.js";import"./WabaNotProcured-BtxJRagg.js";import"./CheckIcon.svg-CGbzQukX.js";const ls=()=>{const m=b(),{shopDetailsData:e,agentPhone:h}=E(A(t=>({shopDetailsData:t.shopDetailsData,agentPhone:t.agentPhone}))),[c,u]=a.useState(!1),[f,x]=a.useState(),[j,k]=a.useState(!1),[S,p]=a.useState(!1),[M,y]=a.useState(0),[i,w]=a.useState({used:0,limit:"-"}),P=Number(e==null?void 0:e.planId),g=[T,C].includes(P),r=i.limit,n=typeof r=="number"&&r>0?Math.min(100,i.used/r*100):0;return a.useEffect(()=>{e!=null&&e.userId&&(v(e.userId).then(t=>{t.status==="success"&&x(t.owner)},()=>{}),g&&I(e.userId).then(t=>{const o=t==null?void 0:t.usageInfo;o&&w({used:o.used||0,limit:o.limit??"-"})}).catch(()=>{}))},[e==null?void 0:e.userId]),s.jsxs(s.Fragment,{children:[s.jsx(R,{showSuccess:c,setShowSuccess:u,value:"Message triggered successfully"}),s.jsxs(_,{customHeader:s.jsx(L,{title:"Orders",subtitle:"Send WhatsApp messages to customers about their orders using pre-defined templates.",actions:s.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[s.jsx(l,{onClick:()=>{m.push("/templates/manual-messaging-templates",{sourceTab:O.MANUAL_TEMP_NAMES.ORDER})},children:"Manual Templates"}),s.jsx(l,{icon:U,accessibilityLabel:"Manual WhatsApp Configuration",onClick:()=>p(!0)})]})}),children:[g&&s.jsx("div",{style:{marginBottom:"16px"},children:s.jsx(d,{tone:n>=80?"warning":"success",children:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[s.jsxs("div",{style:{flex:1},children:[s.jsxs("div",{style:{marginBottom:"8px"},children:["Monthly message usage: ",i.used," / ",i.limit]}),s.jsx(N,{progress:n,size:"small",tone:"success"})]}),n>=80&&s.jsx(l,{variant:"primary",onClick:()=>m.push("/pricing"),children:"Upgrade"})]})})}),s.jsx(B,{owner:f,isCrmToolEnabled:j,agentPhone:h,showSuccess:c,setShowSuccess:u,settingsVersion:M}),s.jsx("div",{style:{marginTop:"16px"},children:s.jsxs(d,{title:"Manual messaging best practices to avoid WhatsApp spam flags",tone:"warning",children:[s.jsx("p",{children:"Do not send more than 20-30 messages per hour. The best practice is to send a few messages at a time (10-20) distributed throughout the day."}),s.jsx("p",{children:"If you are using a new number, wait a few days before sending manual messages, especially to unsaved contacts."})]})})]}),s.jsx(W,{open:S,onClose:()=>p(!1),onSaveSuccess:()=>y(t=>t+1)})]})};export{ls 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.