PageSourceSearch

https://app.smartdialog.ai/assets/AdBanServiceInfo-WdRfMzIv.js

js smartdialog.ai collected 2026-10-05 12:39:42 UTC 10,877 bytes, 1 lines download raw bytes

1import{bK as K,R as e,am as de,a6 as ue,af as ge,cI as Ee,ai as x,q as W,c$ as pe,a2 as Y,b as V,p as D,d as j,cS as T,a4 as fe,bP as A,r as z,y as o,bx as M,d2 as R,E as I,U as k,bZ as ve,gM as ye,d4 as Se,cg as $,T as d,d5 as F,b4 as H,b5 as O,b6 as q,b7 as u,b8 as n,b0 as be,aD as h,gH as J,gN as he,a5 as Ce,gO as Ie,gJ as ke,P as Be,dm as xe,aA as Te,z as Ae,aC as Ne}from"./index-CpcUj6vn.js";import{S as we}from"./ServiceTags-__zOVFbb.js";import{W as Le}from"./ResourceAccessControl-BuAkXQTs.js";import{N as De,a as Me,b as Re}from"./index-CXES7HEQ.js";import"./ComboBox-BZcaHpwp.js";import"./AdminAction-DPSBG5Fm.js";import"./AccessGroupTable-CrtG92CC.js";import"./AccessGroupForm-JWkeOl5H.js";import"./ArrowBackRounded-DjrvSj4E.js";import"./userAccess-jX4bU9Up.js";import"./LockRounded-KZJ2DSB0.js";const $e=K(s=>({listItem:{marginBottom:"5px"},listItemText:{textAlign:"center"},paper:{padding:s.spacing(2)}}));function f({actions:s,action:p,inputSources:v,serviceKeywords:y}){const a=$e(),m=c=>{const l=y?.availableKeywords?.find(i=>i?.text===c);if(l!==void 0){const i=v?.find(g=>g?.inputSource?.id===l?.inputSourceId);let C=i?.inputSource?.address??"";return i.inputSource.type==="RCS"&&(C=i?.inputSource?.metadata?.find?.(g=>g.key===Ee)?.value??C),`${C} - ${c}`}return""};return e.createElement(de,{component:"nav","aria-label":"Actions"},s?.filter(c=>c.action===p)?.map(c=>e.createElement("div",{key:c},c.keywords?.map(l=>e.createElement(ue,{key:l,button:!0,className:a.listItem},e.createElement(ge,{className:a.listItemText,primary:m(l)}))))))}f.propTypes={actions:x.array,action:x.string,inputSources:x.any.isRequired,serviceKeywords:x.any.isRequired};const Fe=K(s=>({lastTableRow:{border:"0"},card:{width:"100%",marginBottom:s.spacing(2),flex:1,display:"flex",flexDirection:"column"},select:{minWidth:"40%"},cardContent:{display:"flex",justifyContent:"center"},paper:{padding:s.spacing(2),height:"100%"},h5header:{marginBottom:s.spacing(1)}})),Ke=["SMS","RCS"];function Pe(){const s=W(),{showInfo:p}=pe(),{error:v,success:y}=Y(),a=Fe(),m=V(),c=D(r=>r.enums),{customerId:l,serviceId:i}=j(),[C,B]=e.useState(!1),[g,Z]=e.useState(!1),{messagingAccounts:Q}=D(r=>r.messagingAccounts),{selectedAdBanService:t}=D(r=>r.adbanservice),[S,X]=e.useState(null),[b,_]=e.useState(null),{payload:N,loading:ee}=T({method:"GET",endpoint:"/messaging/services/adban/defaultmessages"});e.useEffect(()=>{N&&Z(N)},[N,m]);const{loading:te,mutate:ae}=fe(()=>({method:"DELETE",endpoint:`/messaging/services/adban/${i}`})),{payload:w,loading:ne}=T({method:"GET",endpoint:"/messaging/services/adban/inputsources"});e.useEffect(()=>{w&&X(w?.filter(r=>Ke.some(E=>E===r?.inputSource?.type)))},[w,m]);const{payload:L,loading:se}=T({method:"GET",endpoint:`/messaging/services/adban/inputsources/servicekeywords/${i}`});e.useEffect(()=>{L&&_(L)},[L]);const re=te||ee||ne||se,ce=()=>{s.push(`/${l}/management/optoutservices/edit/${i}`)},P=()=>{s.push(`/${l}/management/optoutservices/edit/${i}/advancedsettings`)},ie=()=>{B(!0)},le=async()=>{B(!1);const{error:r,errorMessages:E}=await ae();let G=!1;r?v(E):(y("Opt-out service deleted successfully"),m(Ie(i)),G=!0),G&&s.push(`/${l}/management/optoutservices`)},oe=r=>c?.serviceState?.[r]??r,U=r=>{const E=Ce.utc(r).local();return E.isValid()?E.format("D.M.YYYY HH:mm"):""},me=r=>{const E={...t,serviceTags:[...r]};m(J(E)),m(he)};return re?e.createElement(A,null):e.createElement(z.Suspense,{fallback:e.createElement(A,null)},e.createElement(o,{container:!0,spacing:1,alignItems:"stretch"},e.createElement(o,{item:!0,xs:12,lg:12},e.createElement(we,{serviceTags:t?.serviceTags,onTagsUpdated:me})),e.createElement(o,{item:!0,xs:12,lg:6},e.createElement(M,{className:a.card},e.createElement(R,{avatar:e.createElement(d,{variant:"h5"},"General"),action:e.createElement(e.Fragment,null,e.createElement(I,{"aria-label":"info",onClick:p},e.createElement(k,{title:"Info"},e.createElement(ve,null))),e.createElement(Le,{resourceId:i,productType:ye}),e.createElement(I,{"aria-label":"delete",onClick:ie},e.createElement(k,{title:"Delete service"},e.createElement(Se,null))),e.createElement(I,{"aria-label":"edit",onClick:ce},e.createElement(k,{title:"Edit service"},e.createElement($,null))))}),e.createElement(F,{className:a.cardContent},e.createElement(H,{style:{flexGrow:1}},e.createElement(O,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(q,null,e.createElement(u,{key:"name"},e.createElement(n,{align:"left"},"Service name:"),e.createElement(n,{align:"left"},t?.name)),e.createElement(u,{key:"servicestate"},e.createElement(n,{align:"left"},"Service state:"),e.createElement(n,{align:"left"},oe(t?.serviceState))),e.createElement(u,{key:"messagingaccount"},e.createElement(n,{align:"left"},"Messaging account:"),e.createElement(n,{align:"left"},Q?.find(r=>r.id===t?.messagingAccountId)?.name??t?.messagingAccountId)),e.createElement(u,{key:"startdate"},e.createElement(n,{align:"left"},"Start date:"),e.createElement(n,{align:"left"},U(t?.startDate))),e.createElement(u,{key:"enddate"},e.createElement(n,{align:"left"},"End date:"),e.createElement(n,{align:"left"},U(t?.endDate)))))))),e.createElement(be,{title:"Delete service?",open:C,onConfirm:le,onCancel:()=>B(!1)},e.createElement(d,{variant:"body1"}
1,"Do you really want to delete this Opt-out service?"))),e.createElement(o,{item:!0,xs:12,lg:6},e.createElement(M,{className:a.card},e.createElement(R,{avatar:e.createElement(d,{variant:"h5"},"Response Messages"),action:e.createElement(I,{"aria-label":"edit",onClick:P},e.createElement(k,{title:"Edit messages"},e.createElement($,null)))}),e.createElement(F,{className:a.cardContent},e.createElement(H,{style:{flexGrow:1}},e.createElement(O,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"40%"}),e.createElement("col",{width:"60%"})),e.createElement(q,null,e.createElement(u,{key:"addedtobanlist"},e.createElement(n,{align:"left"},"Added to ban list:"),e.createElement(n,{align:"left"},t?.serviceConfiguration?.responseMessages?.addedToBanList?t?.serviceConfiguration?.responseMessages?.addedToBanList:g?.addedToBanList??"")),e.createElement(u,{key:"alreadyexistsinbanlist"},e.createElement(n,{align:"left"},"Already exists in ban list:"),e.createElement(n,{align:"left"},t?.serviceConfiguration?.responseMessages?.alreadyExistsInBanList?t?.serviceConfiguration?.responseMessages?.alreadyExistsInBanList:g?.alreadyExistsInBanList??"")),e.createElement(u,{key:"removedfrombanlist"},e.createElement(n,{align:"left"},"Removed from ban list:"),e.createElement(n,{align:"left"},t?.serviceConfiguration?.responseMessages?.removedFromBanList?t?.serviceConfiguration?.responseMessages?.removedFromBanList:g?.removedFromBanList??"")),e.createElement(u,{key:"failedtoremovefrombanlist"},e.createElement(n,{align:"left"},"Failed to remove from ban list:"),e.createElement(n,{align:"left"},t?.serviceConfiguration?.responseMessages?.failedToRemoveFromBanList?t?.serviceConfiguration?.responseMessages?.failedToRemoveFromBanList:g?.failedToRemoveFromBanList??"")),e.createElement(u,{key:"notfoundinbanlist"},e.createElement(n,{align:"left"},"Not found in ban list:"),e.createElement(n,{align:"left"},t?.serviceConfiguration?.responseMessages?.notFoundInBanList?t?.serviceConfiguration?.responseMessages?.notFoundInBanList:g?.notFoundInBanList??"")))))))),e.createElement(o,{item:!0,xs:12},e.createElement(M,{className:a.card},e.createElement(R,{avatar:e.createElement(d,{variant:"h5"},"Action keywords"),action:e.createElement(I,{"aria-label":"edit",onClick:P},e.createElement(k,{title:"Edit keywords"},e.createElement($,null)))}),e.createElement(F,{className:a.cardContent},e.createElement(o,{container:!0,spacing:2},e.createElement(o,{item:!0,xs:12,md:6},e.createElement(h,{className:a.paper},e.createElement(d,{className:a.h5header,variant:"h5"},"'Block' Keywords"),e.createElement(f,{serviceId:t?.id,action:"Block",actions:t?.serviceConfiguration?.actions??[],inputSources:S,serviceKeywords:b}))),e.createElement(o,{item:!0,xs:12,md:6},e.createElement(h,{className:a.paper},e.createElement(d,{className:a.h5header,variant:"h5"},"'Block All' Keywords"),e.createElement(f,{serviceId:t?.id,action:"BlockAll",actions:t?.serviceConfiguration?.actions??[],inputSources:S,serviceKeywords:b}))),e.createElement(o,{item:!0,xs:12,md:6},e.createElement(h,{className:a.paper},e.createElement(d,{className:a.h5header,variant:"h5"},"'Block Sender' Keywords"),e.createElement(f,{serviceId:t?.id,action:"BlockSender",actions:t?.serviceConfiguration?.actions??[],inputSources:S,serviceKeywords:b}))),e.createElement(o,{item:!0,xs:12,md:6},e.createElement(h,{className:a.paper},e.createElement(d,{className:a.h5header,variant:"h5"},"'Unblock' Keywords"),e.createElement(f,{serviceId:t?.id,action:"Unblock",actions:t?.serviceConfiguration?.actions??[],inputSources:S,serviceKeywords:b}))),e.createElement(o,{item:!0,xs:12,md:6},e.createElement(h,{className:a.paper},e.createElement(d,{className:a.h5header,variant:"h5"},"'Unblock All' Keywords"),e.createElement(f,{serviceId:t?.id,action:"UnblockAll",actions:t?.serviceConfiguration?.actions??[],inputSources:S,serviceKeywords:b}))),e.createElement(o,{item:!0,xs:12,md:6},e.createElement(h,{className:a.paper},e.createElement(d,{className:a.h5header,variant:"h5"},"'Unblock Sender' Keywords"),e.createElement(f,{serviceId:t?.id,action:"UnblockSender",actions:t?.serviceConfiguration?.actions??[],inputSources:S,serviceKeywords:b})))))))))}const Ue=K(s=>({root:{flex:1,display:"flex",flexDirection:"column"},contentContainer:{width:"100%",padding:s.spacing(2)},gridItem:{margin:s.spacing(1)},toggleContainer:{margin:s.spacing(2,0)},formControl:{margin:s.spacing(1),minWidth:120},appBar:{backgroundColor:"#fff"}})),Qe=()=>{const s=Ue(),p=V(),v=W(),{error:y}
1=Y(),{customerId:a,serviceId:m}=j(),{payload:c,error:l,loading:i}=T({method:"GET",endpoint:`/messaging/services/adban/${m}`,params:{includeUncachedProperties:!0}});return e.useEffect(()=>{c&&(p(ke(c)),p(J(c)))},[c,p]),e.useEffect(()=>{l&&(y("Service not found"),v.replace(`/${a}/management/optoutservices`))},[y,l,a,v]),e.createElement(z.Suspense,{fallback:e.createElement(A,null)},e.createElement(Be,{className:s.root,title:"Opt-out Service"},i?e.createElement(A,null):e.createElement(e.Fragment,null,e.createElement(xe,{position:"static",color:"default",elevation:0,className:s.appBar,variant:"outlined"},e.createElement(De,null,e.createElement(Me,{label:"Service Info",value:`/${a}/management/optoutservices/${m}/info`}))),e.createElement(Te,null,e.createElement(Ae,{exact:!0,path:"/:customerId/management/optoutservices/:serviceId"},e.createElement(Ne,{replace:!0,to:`/${a}/management/optoutservices/${m}/info`})),e.createElement(Re,{path:"/:customerId/management/optoutservices/:serviceId/info"},e.createElement(Pe,null))))))};export{Qe 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.