1import{u as R,b as y,r as i,j as e,X as $,dr as F,p as G,a1 as k,aj as H,a as W,g as z,ds as K,U as Z}from"./index-Dh_AV2g5.js";import{b as c,A as U}from"./AdminLayout-BooGSQDI.js";import{A as p}from"./callLinkAPI-CNKpih9C.js";import{A as X}from"./customerStore-Dfv0QvIR.js";import{c as q}from"./confirmAlert-DfSfOEJp.js";import{M as Q}from"./ModalAddContact-xQIkXg3A.js";import{F as J}from"./Table-Boi3Qpd3.js";import{B as j}from"./button-JSvroh7r.js";import{C as V}from"./index-DjOsupcE.js";import{T as I}from"./index-BUShmqh3.js";import{E as Y}from"./index-DkUYvAlC.js";import"./RootLayout-BvMvLZoB.js";import"./next-head-BhqH8WkB.js";import"./next-link-DH_sCKCI.js";import"./orderAdminStore-DOxCrdyt.js";import"./commonState-BL7LwewB.js";import"./productStore-CXTABOu-.js";import"./authAPI-BkugxGoU.js";import"./roleHelper-B0bZnFws.js";import"./eventStore-BWCtRU4b.js";import"./importOrderAPI-Cxmb4OG5.js";import"./index-0Z-O0NJ7.js";import"./Switch-DVdcW_OP.js";import"./NumberScaleInput-BlaxI4Ex.js";import"./index-X_qAngJP.js";import"./useMergedState-U9g0Ws0W.js";import"./useLayoutEffect-DhLKoqqb.js";import"./isMobile-DjGTsQxe.js";import"./pickAttrs-C0_Y49QJ.js";import"./Overflow-BOL4JFGF.js";import"./index-U0PteHaJ.js";import"./index-CPRd8heE.js";import"./Portal-B4hXuI_x.js";import"./useId-CTa8QTei.js";import"./index-TF58nCE2.js";import"./PurePanel-BIX0Z-dU.js";import"./motion-vrmuGtMa.js";import"./motion-B-mhyME-.js";import"./statusUtils-DRfppJbB.js";import"./context-D1MzgKmZ.js";import"./compact-item-C9fnRPim.js";import"./slide-BFFEqa3e.js";import"./CheckOutlined-C97NHrD0.js";import"./DownOutlined-uUZ9EFHn.js";import"./SearchOutlined-BucRY_LC.js";import"./styleChecker-BH5TIKqt.js";import"./addEventListener-mOTKhTBc.js";import"./css-CL3KzXSx.js";import"./useBreakpoint-CrUwtjIz.js";import"./responsiveObserver-B6uG-T35.js";import"./RightOutlined-Cfxrpk1-.js";import"./index-gTadlb3j.js";import"./useLocale-AhDP-tZx.js";import"./index-DvSH9AzT.js";import"./dropdown-CK7lMuqL.js";import"./EllipsisOutlined-C6yNN4Ii.js";import"./index-C7sJT37S.js";import"./roundedArrow-CPTKCeIL.js";import"./zoom-DHajllYn.js";import"./colors-DA0Pq8Wn.js";import"./collapse-BbEVqHco.js";import"./index-Buh1dOWy.js";import"./useFlexGapSupport-PGiooqZx.js";import"./styleChecker-CxBGJfY9.js";import"./index-Drizg2K7.js";import"./getDataOrAriaProps-BQfWqyDD.js";import"./index-B7uVxY8r.js";import"./index-Cwd14iH1.js";import"./TextArea-6CmLop9I.js";import"./EyeOutlined-w9mVtiWE.js";function ee(){const v=R(),N=y(t=>t.businessTypeIds),m=y(t=>t.employeeId),h=y(t=>t.listEmployees);c(t=>t.HELP_AFADA_CALL);const n=c(t=>t.ZALO_ID),o=c(t=>t.MESSENGER_ID),a=c(t=>t.CONTACT_PHONE),x=i.useMemo(()=>{var t;return!m||!Array.isArray(h)?null:((t=h.find(r=>r.userId===m))==null?void 0:t.apiKey)||null},[m,h]),S=[{id:"in",text:"Gá»i Äến"},{id:"out",text:"Gá»i Äi"},{id:"miss",text:"Gá»i nhỡ"},{id:"all",text:"Tất cả"}],[l,T]=i.useState("in"),[g,f]=i.useState([]),[u,b]=i.useState(1),[L,B]=i.useState(!0),[M,w]=i.useState(!1);let[d,A]=i.useState({fullName:"",phone:"",show:!1});i.useEffect(()=>{if(!x)return;let t=!0;return w(!0),p.listCallLink(l,u,x).then(r=>{t&&(r.error||(f(u===1?r.data:s=>s.concat(r.data)),B(r.data.length>=20)))}).finally(()=>{t&&w(!1)}),()=>{t=!1}},[l,u,x]);const C=t=>{if(t.contactId){v.push(`/member/detail?contactId=${t.contactId}`);return}},O=async t=>{var s;const r=await X.apiDetailCustomer(t.contactId);r.error||(await p.pressCreateOrder(t.callId),v.push({pathname:Z.sale,query:{customerId:(s=r.customer)==null?void 0:s.contactId}}))},E=async t=>{await p.pressCreateOrder(t.callId),A({phone:t.phone||"",fullName:t.callerName||"",show:!0})},P=async t=>{if(!t.isOrderLinked&&!await q("Xác nháºn","Äánh dấu cuá»c gá»i nà y Äã ÄÆ°á»£c tạo ÄÆ¡n?"))return;(await p.changeOrderLinked(t.callId,!t.isOrderLinked)).error==null&&(t.isOrderLinked=!t.isOrderLinked,f([...g]))},_=[{title:e.jsx("div",{style:{textAlign:"center"},children:"Tạo ÄÆ¡n"}),dataIndex:"callMissed",render:(t,r)=>e.jsx("div",{style:{textAlign:"center"},children:e.jsx(V,{checked:!!r.isOrderLinked,onChange:()=>P(r)})})},{title:"Cuá»c gá»i",dataIndex:"fullName",render:(t,r)=>{const s=r.fullName||H(r.phone)||r.callerName||"Không rõ";return parseFloat(r.callStartTime),e.jsxs("div",{children:[e.jsx("div",{style:{cursor:"pointer",fontWeight:r.callMissed?700:500},onClick:()=>C(r),children:s}),e.jsxs("div",{style:{display:"flex",gap:5,flexWrap:"wrap"},children:[e.jsxs("div",{style:{color:"gray"},children:[W(parseFloat(r.callStartTime))," ",z(parseFloat(r.callStartTime))]}),r.durationCalling>0&&e.jsx("div",{style:{color:"gray"},children:K(r.durationCalling)}),e.jsxs("div",{style:{color:"gray"},children:["(",(r.callSource||"phone").toUpperCase(),")"]})]})]})}},{title:e.jsx("div",{style:{textAlign:"center"},children:"Trạng thái"}),dataIndex:"callMissed",render:(t,r)=>e.jsx("div",{style:{textAlign:"center"},children:t?e.jsx(I,{color:"red",children:"Gá»i nhỡ"}):e.jsx(I,{color:"green",children:"Äã nghe"})})},{title:e.jsx("div",{style:{textAlign:"center"},children:"Hà nh Äá»ng"}),dataIndex:"actions",render:(t,r)=>e.jsx("div",{style:{textAlign:"center"},children:r.contactId?e.jsx(j,{type:"primary",size:"small",onClick:()=>O(r),children:"Tạo ÄÆ¡n"}):e.jsx(j,{type:"primary",size:"small",ghost:!0,onClick:()=>E(r),children:"Tạo khách"})})}],D=()=>e.jsx(Y,{description:e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:600,marginBottom:4},children:"Bạn cần có app ACall Äá» sá» dụng tÃnh nÄng nà y"}),e.jsxs("div",{style:{border:"1px solid #eee",padding:12,borderRadius:8,textAlign:"left",maxWidth:360,margin:"0 auto"},children:[e.jsx("div",{style:{fontSize:16,fontWeight:500,marginBottom:8,textAlign:"center"},children:"Há» trợ"}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Fanpage"}),e.jsx("a",{href:"https://www.facebook.com/afadaApp",target:"_blank",rel:"noreferrer",children:k.fullName})]}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Messenger"}),e.jsx("a",{href:typeof window<"u"?/iPhone|iPad|iPod/i.test(navigator.userAgent)?`fb-messenger-public://user-thread/${o}`:`fb-messenger://user/${o}`:"#",children:"Chat ngay"})]}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Phone"}),e.jsx("a",{href:`tel:${a}`,children:a||"096 131 7258"})]}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Zalo"}),e.jsx("div",{children:e.jsxs("a",{href:`https://zalo.me/${n}`,target:"_blank",rel:"noreferrer",children:["+",n]})})]})]})]})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"warehouse-record",children:[e.jsxs("div",{className:"head-bar",id:"fixed-head-bar",children:[e.jsxs("button",{className:"back",onClick:()=>$.back(),children:[e.jsx("ion-icon",{name:"arrow-back-circle"}),e.jsx("span",{children:"Quay lại"})]}),e.jsx("div",{className:"name",children:"Lá»ch sá» cuá»c gá»i"}),e.jsx("div",{className:"head-right"})]}),e.jsx("div",{className:"statistic-wrapper",id:"section-below-fixed-head-bar",children:e.jsx("div",{className:"statistic"})}),F(N)?e.jsx("div",{className:"customer-table",children:e.jsxs("div",{className:"wrapper",children:[e.jsx("div",{style:{display:"flex",borderBottom:"1px solid #eee",marginBottom:12},children:S.map(t=>e.jsx("button",{onClick:()=>{T(t.id),b(1)},style:{flex:1,padding:"8px 0",border:"none",borderBottom:l===t.id?`3px solid ${G.primary}`:"3px solid transparent",backgroundColor:"#fff",cursor:"pointer",fontWeight:l===t.id?600:400},children:t.text},t.id))}),e.jsx("div",{style:{marginBottom:20},children:e.jsx(J,{columns:_,rowKey:t=>t.callId,dataSource:g,pagination:!1,loading:M,locale:{emptyText:D()},onRow:t=>({onDoubleClick:()=>C(t)})})}),L&&g.length>0&&e.jsx("div",{style:{textAlign:"center",paddingTop:5,paddingBottom:5},children:e.jsx(j,{type:"primary",onClick:()=>{b(t=>t+1)},children:"Xem thêm"})})]})}):e.jsxs("div",{children:[e.jsx("div",{style:{textAlign:"center",marginTop:20},children:"TÃnh nÄng chá» dùng cho cá»a hà ng Gas, gạo"}),e.jsxs("div",{style:{border:"1px solid #eee",padding:12,borderRadius:8,textAlign:"left",maxWidth:360,margin:"0 auto"},children:[e.jsx("div",{style:{fontSize:16,fontWeight:500,marginBottom:8,textAlign:"center"},children:"Há» trợ"}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Fanpage"}),e.jsx("a",{href:"https://www.facebook.com/afadaApp",target:"_blank",rel:"noreferrer",children:k.fullName})]}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Messenger"}),e.jsx("a",{href:typeof window<"u"?/iPhone|iPad|iPod/i.test(navigator.userAgent)?`fb-messenger-public://user-thread/${o}`:`fb-messenger://user/${o}`:"#",children:"Chat ngay"})]}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Phone"}),e.jsx("a",{href:`tel:${a}`,children:a||"096 131 7258"})]}),e.jsxs("div",{style:{display:"flex",marginBottom:6},children:[e.jsx("div",{style:{width:90},children:"Zalo"}),e.jsx("div",{children:e.jsxs("a",{href:`https://zalo.me/${n}`,target:"_blank",rel:"noreferrer",children:["+",n]})})]})]})]})]}
1),e.jsx(Q,{isShowing:d.show,hide:()=>A({...d,show:!1}),fullName:d.fullName,phone:d.phone})]})}function ut(){return e.jsx(U,{children:e.jsx(ee,{})})}export{ut 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.