1"use strict";(globalThis.webpackChunkcom_bot||=[]).push([[480],{65869(e,s,a){var t=a(9950),c=a(24898),n=(a(9210),a(44414));const i=e=>(0,n.jsx)(t.Fragment,{children:(0,n.jsx)(c.Ay,{children:(0,n.jsxs)("title",{children:[e.pageTitle," | ",""]})})});a.d(s,["A",0,i])},19619(e,s,a){a(9950);var t=a(3480),c=a(44414);a.d(s,["ToastMe",0,function(e,s,a){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;(0,t.oR)(a,{position:s,autoClose:c,hideProgressBar:!0,className:"bg-"+e+" text-white"})},"v",0,()=>(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(t.N9,{})})])},60480(e,s,a){a.r(s),a.d(s,{default:()=>D});var t=a(9950),c=a(16673),n=a(20681),i=a(59335),l=a(84084),r=a(88156),d=a(97176),o=a(78125),m=a(35746),u=a(55909),h=a(38906),x=a(87941),p=a(46114),g=a(98277),_=a(91646),j=a(63403),f=a(73878),v=a(30615),y=a(82138),k=(a(34964),a(44414));const b=(0,c.withRouter)((0,n.C)()(e=>{const{profileData:s,setProfileData:a,adAccountData:c,setAdAccountData:n}=e,[i,l]=(0,t.useState)(!1),o=(0,f.wA)(),[m,u]=(0,t.useState)([]),[h,x]=(0,t.useState)([]),{connections:g}=(0,f.d4)(e=>({connections:e.AdConnection.connections}));return(0,t.useEffect)(()=>{if(g.success){var e=[];g.data.map(s=>{e.push({label:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("img",{className:"avatar-xs rounded",src:s.profile.picture.url,width:30,height:30}),(0,k.jsx)(_.A,{className:"mx-2",children:s.profile.name})]}),value:s})}),u(e),e.length>0&&null===s&&a(e[0])}},[g]),(0,t.useEffect)(()=>{null!==s&&(0,y.Gs)(s.value.accessToken).then(e=>{if(e.success){var a=[];e.data.map(e=>{-1!==s.value.adAccounts.indexOf(e.account_id)&&a.push({label:(0,k.jsx)(k.Fragment,{children:(0,k.jsxs)("div",{className:"d-flex align-items-center",children:[(0,k.jsx)("i",{className:"ri-facebook-circle-fill text-primary fs-20"}),"\xa0\xa0",(0,k.jsx)(_.A,{className:"mx-2 mb-0",children:e.name})]})}),value:e})}),x(a),n(a[0])}else x([])}).catch(e=>{x([])})},[s]),(0,t.useEffect)(()=>{o((0,j.fn)({isSearch:!1,type:"facebook",page:0,rows:1e3}))},[]),(0,k.jsx)(t.Fragment,{children:(0,k.jsx)(r.A,{className:"my-0 py-0 mb-2 ",children:(0,k.jsxs)(d.A,{className:"gap-2",children:[(0,k.jsx)(p.A,{lg:4,children:(0,k.jsx)(v.Ay,{value:s,options:m,placeholder:"Select FB Profile",onChange:e=>a(e)})}),(0,k.jsx)(p.A,{lg:4,children:(0,k.jsx)(v.Ay,{value:c,onChange:e=>n(e),options:h,placeholder:"Select Ad Account"})})]})})})}));a(19619);var N=a(97284),A=a(65869),w=a(50677),C=(a(96011),a(48738)),S=a.n(C),P=a(93047);const T=(0,c.withRouter)((0,n.C)()(e=>{(0,t.useRef)();const[s,a]=(0,t.useState)([]),[c,n]=(0,t.useState)({status:!1,message:"Confirm Delete"});return(0,t.useEffect)(()=>{var s=[];e.data.map(a=>{var t={id:a.id,status:a.status,label:a.name,data:a};void 0!==a.insights?t.spend=a.insights.data[0].spend:t.spend=0,"campaign"===e.type&&(t.icon="bx bxl-meta text-primary"),"adset"===e.type&&(t.icon="bx bxl-meta text-primary"),"ad"===e.type&&(t.icon="bx bxl-meta text-primary"),s.push(t)}),a(s)},[e]),(0,k.jsxs)(t.Fragment,{children:[(s||[]).map((s,a)=>(0,k.jsx)(p.A,{children:(0,k.jsxs)(l.A,{className:"team-box card-animate border-0",children:[(0,k.jsx)("div",{className:"team-cover",children:(0,k.jsx)("img",{src:s.cover,alt:"",className:"img-fluid"})}),(0,k.jsx)(r.A,{className:"py-2 px-4",children:(0,k.jsxs)(d.A,{className:"align-items-center team-row",children:[(0,k.jsx)(p.A,{lg:3,className:"col",children:(0,k.jsxs)("div",{className:"team-profile-img",children:[(0,k.jsx)("div",{className:"avatar-lg img-thumbnail rounded-circle flex-shrink-0 bg-soft-primary align-items-center justify-content-center d-flex",children:(0,k.jsx)("i",{className:s.icon,style:{fontSize:"36px"}})}),(0,k.jsxs)("div",{className:"team-content",children:[(0,k.jsx)(P.N_,{className:"d-flex align-items-center",to:"#",children:(0,k.jsx)("h5",{className:"fs-16 mb-1",children:s.label})}),(0,k.jsx)("p",{className:"text-muted mb-0",children:s.id})]})]})}),(0,k.jsx)(p.A,{lg:3,className:"col",children:(0,k.jsx)("div",{className:"team-profile-img",children:(0,k.jsxs)("div",{className:"team-content",children:[(0,k.jsx)(P.N_,{className:"d-flex align-items-center",to:"#",children:"ACTIVE"===s.status?(0,k.jsx)("label",{className:"badge text-bg-success",children:(0,k.jsx)("span",{className:"fs-12 mb-1 text-white",children:s.status})}):(0,k.jsx)("label",{className:"badge text-bg-danger",children:(0,k.jsx)("span",{className:"fs-12 mb-1 text-white",children:s.status})})}),(0,k.jsx)("p",{className:"text-muted mb-0",children:"Status"})]})})}),(0,k.jsx)(p.A,{lg:3,className:"col",children:(0,k.jsx)("div",{className:"team-profile-img",children:(0,k.jsxs)("div",{className:"team-content",children:[(0,k.jsx)(P.N_,{className:"d-flex align-items-center",to:"#",children:(0,k.jsxs)("h5",{className:"fs-16 mb-1",children:[s.spend," ",e.currency]})}),(0,k.jsx)("p",{className:"text-muted mb-0",children:"Spend"})]})})}),"ad"===e.type&&(0,k.jsx)(p.A,{lg:3,className:"col",children:(0,k.jsx)(d.A,{className:"text-muted text-center justify-content-center",children:(0,k.jsx)(p.A,{xs:6,children:(0,k.jsx)("div",{className:"text-start",children:(0,k.jsxs)(P.N_,{to:"/products/crm/contact/ad_filter/"+s.id,target:"_blank",className:"btn btn-light btn-soft-success view-btn d-flex align-items-center justify-content-center",children:[(0,k.jsx)("i",{className:"ri-refresh-line"}),"\xa0\xa0Conversation"]})})})})})]})})]})},a)),0===s.length&&(0,k.jsx)("div",{className:"d-flex justify-content-center",children:(0,k.jsx)("label",{children:"No Data Found"})})]})})),D=(0,c.withRouter)((0,n.C)()(e=>{const[s,a]=(0,t.useState)(!1),[c,n]=((0,f.wA)(),(0,t.useState)("facebook")),[_,j]=(0,t.useState)({status:!1}),[v,C]=(0,t.useState)("1"),P=e=>{v!==e&&C(e)};(0,t.useEffect)(()=>{},[c]);const[D,F]=(0,t.useState)(null),[E,R]=(0,t.useState)(null),[I,M]=(0,t.useState)([]),[q,z]=(0,t.useState)([]),[B,G]=(0,t.useState)([]);return t.useEffect(()=>{null!==E&&((0,y.N7)(D.value.accessToken,E.value.id).then(e=>{e.success?M(e.data):M([])}).catch(e=>{M([])}),(0,y.gR)(D.value.accessToken,E.value.id).then(e=>{e.success?z(e.data):z([])}).catch(e=>{z([])}),(0,y.g0)(D.value.accessToken,E.value.id).then(e=>{e.success?G(e.data):G([])}).catch(e=>{G([])}))},[E]),(0,k.jsx)(t.Fragment,{children:(0,k.jsxs)("div",{className:"page-content",children:[(0,k.jsx)(A.A,{pageTitle:"Connections - Ads Manager"}),(0,k.jsxs)(i.A,{fluid:!0,children:[(0,k.jsx)(g.A,{title:"Connections",pageTitle:"Ads Manager"}),(0,k.jsx)(b,{setProfileData:F,setAdAccountData:R,profileData:D,adAccountData:E}),(0,k.jsx)(l.A,{children:(0,k.jsx)(r.A,{className:"mb-0 pb-0",children:(0,k.jsx)(d.A,{children:(0,k.jsxs)(o.A,{tabs:!0,className:"nav nav-tabs nav-tabs-custom nav
1-primary mt-0 border-0 nav-justified",children:[(0,k.jsx)(m.A,{children:(0,k.jsxs)(u.A,{style:{cursor:"pointer"},className:S()({active:"1"===v},"d-flex justify-content-center align-items-center"),onClick:()=>{P("1"),n("campaign")},children:[(0,k.jsx)("i",{className:"bx bxs-rocket m-0 p-0"}),"\xa0\xa0\xa0",e.t("Campaigns")]})}),(0,k.jsx)(m.A,{children:(0,k.jsxs)(u.A,{style:{cursor:"pointer"},className:S()({active:"2"===v},"d-flex justify-content-center align-items-center"),onClick:()=>{P("2"),n("adset")},children:[(0,k.jsx)("i",{className:"ri-checkbox-multiple-blank-line m-0 p-0"}),"\xa0\xa0\xa0",e.t("Ad Sets")]})}),(0,k.jsx)(m.A,{children:(0,k.jsxs)(u.A,{style:{cursor:"pointer"},className:S()({active:"3"===v},"d-flex justify-content-center align-items-center"),onClick:()=>{P("3"),n("ad")},children:[(0,k.jsx)("i",{className:"bx bx-dock-right m-0 p-0"}),"\xa0\xa0\xa0",e.t("Ads")]})})]})})})}),(0,k.jsxs)(d.A,{children:[(0,k.jsx)(h.A,{activeTab:v,className:"text-muted",children:(0,k.jsx)(x.A,{tabId:"1",id:"base-justified-messages",children:(0,k.jsx)(p.A,{lg:12,children:(0,k.jsx)("div",{children:(0,k.jsx)(d.A,{className:"team-list list-view-filter",children:I!==[]&&(0,k.jsx)(T,{data:I,type:"campaign",currency:null===E||void 0===E?void 0:E.value.currency})})})})})}),(0,k.jsx)(h.A,{activeTab:v,className:"text-muted",children:(0,k.jsx)(x.A,{tabId:"2",id:"base-justified-messages",children:(0,k.jsx)(p.A,{lg:12,children:(0,k.jsx)("div",{children:(0,k.jsx)(d.A,{className:"team-list list-view-filter",children:q!==[]&&(0,k.jsx)(T,{data:q,type:"adset",currency:null===E||void 0===E?void 0:E.value.currency})})})})})}),(0,k.jsx)(h.A,{activeTab:v,className:"text-muted",children:(0,k.jsx)(x.A,{tabId:"3",id:"base-justified-messages",children:(0,k.jsx)(p.A,{lg:12,children:(0,k.jsx)("div",{children:(0,k.jsx)(d.A,{className:"team-list list-view-filter",children:B!==[]&&(0,k.jsx)(T,{data:B,type:"ad",currency:null===E||void 0===E?void 0:E.value.currency})})})})})})]}),(0,k.jsx)("svg",{className:"bookmark-hide",children:(0,k.jsx)("symbol",{viewBox:"0 0 24 24",stroke:"currentColor",fill:"var(--color-svg)",id:"icon-star",children:(0,k.jsx)("path",{strokeWidth:".4",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})})]}),!0===_.status?(0,k.jsx)(N.default,{..._}):"",s&&(0,k.jsx)(w.A,{})]})})}))},82138(e,s,a){var t=a(96011),c=a.n(t),n=a(85520),i=a.n(n);const l="https://graph.facebook.com/v15.0/";a.d(s,["F0",0,(e,s,a,t)=>new Promise((n,i)=>{try{var r="";r="data_preset"===a?l+s+"/insights?&date_preset="+t+"&fields=clicks,impressions,spend,reach,cpc,ctr,inline_post_engagement,cost_per_inline_link_click,cost_per_inline_post_engagement,inline_link_clicks,inline_link_click_ctr,actions&access_token="+e:l+s+"/insights?time_range={'since':'"+t.start+"','until':'"+t.end+"'}&date_preset=last_28d&fields=clicks,impressions,spend,reach,cpc,ctr,inline_post_engagement,cost_per_inline_link_click,cost_per_inline_post_engagement,inline_link_clicks,inline_link_click_ctr,actions&access_token="+e,c().get(r).then(e=>{n({success:!0,data:e.data})}).catch(e=>{n({success:!1,data:[]})})}catch(d){n({success:!1,data:[]})}}),"Gs",0,e=>new Promise((s,a)=>{try{c().get(l+"me/adaccounts?fields=name,account_status,id,account_id,owner,currency&access_token="+e).then(e=>{s({success:!0,data:e.data,type:"adaccount"})}).catch(e=>{s({success:!1,data:[]})})}catch(t){s({success:!1,data:[]})}}),"N7",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+s+"/campaigns?limit=1000&fields=name,status,insights&access_token="+e).then(e=>{a({success:!0,data:e.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}}),"O9",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+"search?type=adgeolocation&q="+s+"&limit=100&access_token="+e).then(e=>{a({success:!0,data:e.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}}),"Wx",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+s+"/advideos?fields=id,permalink_url,status,thumbnails,views,length&limit=1000&access_token="+e).then(e=>{a({success:!0,data:e.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}}),"Xx",0,(e,s,a,t)=>new Promise((n,i)=>{try{var r="";r="data_preset"===a?l+s+"/insights?&date_preset="+t+"&fields=clicks,impressions,spend,reach,cpc,ctr,inline_post_engagement,cost_per_inline_link_click,cost_per_inline_post_engagement,inline_link_clicks,inline_link_click_ctr,actions&access_token="+e:l+s+"/insights?time_range={'since':'"+t.start+"','until':'"+t.end+"'}&date_preset=last_28d&fields=clicks,impressions,spend,reach,cpc,ctr,inline_post_engagement,cost_per_inline_link_click,cost_per_inline_post_engagement,inline_link_clicks,inline_link_click_ctr,actions&access_token="+e,c().get(r).then(e=>{n({success:!0,data:e.data})}).catch(e=>{n({success:!1,data:[]})})}catch(d){n({success:!1,data:[]})}}),"ZZ",0,(e,s,a)=>new Promise((t,n)=>{try{var r=new(i());r.append("filename",a.data);var d={method:"post",url:l+s+"/advideos?access_token="+e,headers:{"Content-Type":"multipart/form-data"},data:r};c()(d).then(function(e){t({success:!0,data:e})}).catch(function(e){t({success:!1,data:e})})}catch(o){t({success:!1,data:o.message})}}),"ct",0,(e,s,a)=>new Promise((t,n)=>{try{c().get(l+"act_"+a+"/targetingsearch?q="+s+"&access_token="+e).then(e=>{t({success:!0,data:e.data})}).catch(e=>{t({success:!1,data:[]})})}catch(i){t({success:!1,data:[]})}}),"g0",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+s+"/ads?fields=name,campaign_id,adset_id,status,insights&limit=1000&access_token="+e).then(e=>{a({success:!0,data:e.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}}),"gR",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+s+"/adsets?fields=name,campaign_id,status,insights&limit=1000&access_token="+e).then(t=>{console.log(l+s+"/adsets?fields=name,campaign_id,status,insights&limit=1000&access_token="+e),a({success:!0,data:t.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}}),"o5",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+s+"/adimages?fields=hash,id,name,permalink_url,url,url_128,status&limit=1000&access_token="+e).then(e=>{a({success:!0,data:e.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}}),"o7",0,e=>new Promise((s,a)=>{try{c().get(l+"/me/accounts?fields=id,name,category_list,access_token,category,tasks,cover,whatsapp_number,has_whatsapp_number,has_whatsapp_business_number,picture&access_token="+e).then(e=>{s({success:!0,data:e.data,type:"page"})}).catch(e=>{s({success:!1,data:[]})})}catch(t){s({success:!1,data:[]})}}),"tu",0,(e,s,a)=>new Promise((t,n)=>{try{var r=new(i());r.append("filename",a.data);var d={method:"post",url:l+s+"/adimages?access_token="+e,headers:{"Content-Type":"multipart/form-data"},data:r};c()(d).then(function(e){t({success:!0,data:e})}).catch(function(e){t({success:!1,data:e})})}catch(o){t({success:!1,data:o.message})}}),"y3",0,(e,s)=>new Promise((a,t)=>{try{c().get(l+"search?type=adTargetingCategory&className="+s+"&access_token="+e).then(e=>{a({success:!0,data:e.data})}).catch(e=>{a({success:!1,data:[]})})}catch(n){a({success:!1,data:[]})}})])},63403(e,s,a){var t=a(53139);a.d(s,["J4",0,e=>({type:t.IN,payload:e}),"UZ",0,(e,s)=>({type:t.aG,payload:{flag:e,value:s}}),"_C",0,e=>({type:t.MX,payload:e}),"fn",0,e=>({type:t.zp,payload:e}),"q",0,(e,s)=>({type:t.Us,payload:{actionType:e,error:s}}),"t4",0,(e,s)=>({type:t.HO,payload:{actionType:e,data:s}})])}}]);
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.