PageSourceSearch

https://app.smartdialog.ai/assets/DialogService-BYI23g7l.js

js smartdialog.ai collected 2026-10-05 12:39:19 UTC 14,807 bytes, 1 lines download raw bytes

1import{bK as U,R as e,b1 as ne,b2 as le,T as B,b3 as re,dm as z,ey as oe,ez as F,cA as ie,cB as L,ba as ce,E as ue,U as R,bY as me,c as de,ai as g,b as pe,d as H,cS as J,bJ as fe,bI as ve,r as K,bP as P,eA as Ee,B as ge,a5 as f,eB as he,eC as be,m as ye,bx as Se,y as b,eD as Ie,be as Y,G,M as w,N as O,O as m,c9 as W,p as Te,P as Ce,aA as De,z as Ge,aC as we,dE as Oe}from"./index-CpcUj6vn.js";import{N as xe,a as x,b as k}from"./index-CXES7HEQ.js";import{T as ke}from"./TwoWayServiceInfo-DCvRDUpi.js";import{O as Ae}from"./index-h9mpbqWH.js";import{G as Be}from"./GroupServiceInfo-BCYNOOA0.js";import{D as Re}from"./ActionList-DlfzHCUT.js";import{T as Me}from"./ToggleButtonGroup-BmqFZsME.js";import{T as j}from"./ToggleButton-CeIAdu7E.js";import"./ServiceTags-__zOVFbb.js";import"./ComboBox-BZcaHpwp.js";import"./NotInterestedRounded-pkMu3qIG.js";import"./DialogServiceShown-BgEjn472.js";import"./DialogServiceHidden-6aqcxnB3.js";import"./DescriptionOutlined-BItYoAWk.js";import"./AdminAction-DPSBG5Fm.js";import"./ResourceAccessControl-BuAkXQTs.js";import"./AccessGroupTable-CrtG92CC.js";import"./AccessGroupForm-JWkeOl5H.js";import"./ArrowBackRounded-DjrvSj4E.js";import"./userAccess-jX4bU9Up.js";import"./LockRounded-KZJ2DSB0.js";import"./PinAsFavouriteService-TqJby03k.js";import"./InstructionVideoPopup-Bf6EIbNt.js";import"./lodash-1T78Azbp.js";const Ne=U(t=>({listItem:{marginBottom:"5px"},listItemText:{textAlign:"center"},paper:{padding:t.spacing(2)}}));function q(t){const{children:a,value:r,index:i,...o}=t;return e.createElement("div",{role:"tabpanel",hidden:r!==i,id:`simple-tabpanel-${i}`,"aria-labelledby":`simple-tab-${i}`,...o},r===i&&e.createElement(de,{p:3},a))}q.propTypes={children:g.node,index:g.any.isRequired,value:g.any.isRequired};const Le=t=>({...t,overrides:{...t.overrides,MuiTableHead:{root:{display:"none"}}}});function _({onClose:t,open:a,selectedEvent:r}){const i=Ne(),[o,u]=e.useState(0),I=r?.output?.successful??[],v=r?.output?.failed??[],y=()=>{u(0),t()},n=(c,D)=>{u(D)},h=[{name:"recipients",label:"Recipient phone",options:{filter:!1,sort:!0,customBodyRender:c=>c?.[0]?.address}},{name:"",label:"Status",options:{filter:!1,sort:!0,customBodyRender:()=>"Discussion started"}}],T=[{name:"recipients",label:"Recipient phone",options:{filter:!1,sort:!0,customBodyRender:c=>c?.[0]?.address}},{name:"errorMessage",label:"Error message",options:{filter:!1,sort:!0,customBodyRender:c=>e.createElement(R,{title:c},e.createElement("div",null,c))}}],C={elevation:0,print:!1,selectableRowsHeader:!1,selectableRows:"none",responsive:"standard",filter:!1,search:!1,download:!1,viewColumns:!1,fixedHeader:!0};return e.createElement(ne,{onClose:y,"aria-labelledby":"output popup",open:a,fullWidth:!0,maxWidth:"sm"},e.createElement(le,{disableTypography:!0},e.createElement(B,{variant:"h4"},"Discussion outputs")),e.createElement(re,null,e.createElement(z,{position:"static",color:"default",elevation:0,className:i.appBar,variant:"outlined"},e.createElement(oe,{value:o,onChange:n,"aria-label":"discussion tabs"},e.createElement(F,{label:"Successful"}),e.createElement(F,{label:"Failed"}))),e.createElement(ie,{theme:Le},e.createElement(q,{value:o,index:0},e.createElement(L,{data:I,columns:h,options:C})),e.createElement(q,{value:o,index:1},e.createElement(L,{data:v,columns:T,options:C})))),e.createElement(ce,null,e.createElement(ue,{onClick:y},e.createElement(R,{title:"Close"},e.createElement(me,null)))))}_.propTypes={onClose:g.func.isRequired,open:g.bool.isRequired,selectedEvent:g.any};const V=t=>{const a=f.utc(t).local();return a.isValid()?a.format("D.M.YYYY HH:mm"):""},Pe=[{name:"id",options:{filter:!1,sort:!1,display:!1}},{name:"input",label:"Protocol",options:{filter:!1,sort:!0,customBodyRender:t=>t?.request?.protocol}},{name:"input",label:"Content",options:{filter:!1,sort:!0,customBodyRender:t=>t?.request?.content}},{name:"input",label:"Recipients",options:{filter:!1,sort:!0,customBodyRender:t=>t.recipients?.length>1?`${t.recipients.length} recipients`:`${t.recipients.length} recipient`}},{name:"createdTime",label:"Created",options:{filter:!1,sort:!0,customBodyRender:t=>V(t)}},{name:"lastUpdatedTime",label:"Last updated",options:{filter:!1,sort:!0,customBodyRender:t=>V(t)}},{name:"runtimeStatus",label:"Status",options:{filter:!1,sort:!0}}];function qe(){const t=pe(),{serviceId:a}=H(),[r,i]=e.useState(!1),[o,u]=e.useState({}),[I,v]=e.useState(null),[y,n]=e.useState(!1),[h,T]=e.useState(null),{query:C,loading:c}=J({method:"GET",endpoint:"/messaging/services/dialog/groupmessageprocesses",params:{serviceId:a},headers:{...h!=null?{"x-continuation-token":h}:{}}}),D=e.useCallback(C,[]),s=e.useMemo(()=>Object.keys(o).map(E=>({id:E,...o[E]})),[o]);e.useEffect(()=>(a&&t(fe("IStartGroupDiscussionFinished",E=>{const M=E?.data?.serviceId;a===M&&(u({}),i(!1))})),()=>{t(ve("IStartGroupDiscussionFinished"))}),[t,a]),e.useEffect(()=>{const E=async()=>{const{payload:M,headers:te,error:ae}=await D();if(T(te?.["x-continuation-token"]??null),!ae){const se=M?.reduce((N,$)=>({...N,[$?.output?.orchestrationId??"unknown"]:$}),{})??{};u(N=>({...N,...se}))}};r||(T(null),i(!0),E()),y&&(n(!1),E())},[t,D,r,y,a]);const p=()=>{v(null)},l={elevation:0,print:!1,selectableRowsHeader:!1,selectableRows:"none",responsive:"standard",filter:!1,search:!1,download:!1,viewColumns:!1,fixedHeader:!0,rowsPerPage:s.length||10,sortOrder:{name:"createdTime",direction:"desc"},onRowClick:E=>
1v(o?.[E[0]]??null),customFooter:()=>e.createElement("tfoot",null)};let S="none";return s.length>1&&(S="block"),e.createElement(K.Suspense,{fallback:e.createElement(P,null)},e.createElement(Ee,{dataLength:s.length,hasMore:h!=null,loader:e.createElement(e.Fragment,null,c&&e.createElement(P,null),e.createElement("div",{style:{width:"100%",textAlign:"center",backgroundColor:"#fff",padding:"20px 0"}},e.createElement(ge,{onClick:()=>y(!0),color:"primary",variant:"contained",disabled:c},"Load more events"))),endMessage:e.createElement("h3",{style:{textAlign:"center",backgroundColor:"#fff",padding:"20px 0",display:`${S}`}},"Yay! You have seen all ",s.length," discussion events")},e.createElement(L,{data:s,columns:Pe,options:l})),e.createElement(_,{open:!!I,onClose:p,selectedEvent:I}))}const d={DIALOGCHATS:"DIALOGCHATS",DIALOGMESSAGES:"DIALOGMESSAGES"},A={year:f.duration(1,"year").add(1,"day"),quarter:f.duration(1,"quarter"),month:f.duration(32,"days"),week:f.duration(1,"week"),day:f.duration(1,"day"),hour:f.duration(1,"hour")},He=t=>{let a=[{label:"Per year",value:"year"}];return t<=A.year&&(a=[{label:"Per week",value:"week"},{label:"Per month",value:"month"},{label:"Per quarter",value:"quarter"},...a]),t<=A.month&&(a=[{label:"Per day",value:"day"},...a]),t<=A.day&&(a=[{label:"Per hour",value:"hour"},...a]),t<=A.hour&&(a=[{label:"Per minute",value:"minute"},...a]),a},Q=({chartType:t,...a})=>{switch(t){case d.DIALOGCHATS:return e.createElement(be,{...a});case d.DIALOGMESSAGES:return e.createElement(he,{...a}
1);default:return null}};Q.propTypes={chartType:g.oneOf(Object.keys(d))};const X=({chartType:t})=>{switch(t){case d.DIALOGCHATS:return e.createElement(B,{variant:"h5"},"Dialog Chat Statistics");case d.DIALOGMESSAGES:return e.createElement(B,{variant:"h5"},"Dialog Message Statistics");default:return e.createElement(B,{variant:"h5"},"Dialog Statistics")}};X.propTypes={chartType:g.oneOf(Object.keys(d))};const $e=ye(t=>({card:{width:"100%",flex:1},cardGrid:{height:"100%",display:"flex",flexDirection:"column",flexWrap:"wrap"},divider:{width:"100%",margin:"10px 0"},typeGrid:{width:"100%",flexBasis:"50px",backgroundColor:t.palette.background.gray,color:t.palette.white,"& *":{color:t.palette.white}},filterGrid:{width:"100%",flexBasis:"75px"},chartContainer:{width:"100%",display:"flex",flex:1,overflow:"hidden",flexDirection:"column"},gridItem:{margin:t.spacing(0),padding:t.spacing(0,2)},formControl:{margin:t.spacing(),minWidth:130},button:{marginLeft:t.spacing(1)}})),Fe=()=>{const t=$e(),[a,r]=e.useState(d.DIALOGCHATS),[i,o]=e.useState("all"),[u,I]=e.useState("Inbound"),[v,y]=e.useState({options:[],value:"day"}),[n,h]=e.useState({definedInterval:"thisweek",intervalDescr:"This week",from:f().startOf("week"),to:f()}),T={from:n.from.valueOf(),to:n.to.valueOf(),user:i,groupBy:v.value,direction:u};e.useEffect(()=>{let s=!0;const p=f.duration(n.to.diff(n.from)),l=He(p);let S={options:l,value:v.value};return l.find(E=>E.value===S.value)||(S={options:l,value:l?.[0]?.value}),s&&y(S),()=>{s=!1}},[n.to,n.from,v.value]);const{payload:C,loading:c}=J({method:"GET",endpoint:"/messaging/services/dialog/statistics/owners"}),D=s=>{const p=s.target.value;let l=f(),S=f();p==="today"?l=l.startOf("day"):p==="thisweek"?l=l.startOf("week"):p==="thismonth"?l=l.startOf("month"):p==="thisquarter"?l=l.startOf("quarter"):p==="thisyear"||p==="all"?l=l.startOf("year"):p==="custom"&&(l=n.from,S=n.to),h({...n,definedInterval:p,from:l,to:S})};return e.createElement(K.Suspense,{fallback:e.createElement(P,null)},e.createElement(Se,{className:t.card},e.createElement("div",{className:t.cardGrid},e.createElement("div",{className:t.typeGrid},e.createElement(b,{container:!0,item:!0,xs:12,alignItems:"center"},e.createElement(b,{container:!0,item:!0,xs:6,justifyContent:"flex-start",className:t.gridItem},e.createElement(X,{chartType:a})),e.createElement(b,{container:!0,item:!0,xs:6,justifyContent:"flex-end",className:t.gridItem},e.createElement(Me,{value:a,exclusive:!0},e.createElement(j,{value:d.DIALOGCHATS,onClick:()=>r(d.DIALOGCHATS)},e.createElement(R,{title:"Show chat statistics"},e.createElement(Ie,null))),e.createElement(j,{value:d.DIALOGMESSAGES,onClick:()=>r(d.DIALOGMESSAGES)},e.createElement(R,{title:"Show dialog message statistics"},e.createElement(Re,null))))))),e.createElement("div",{className:t.divider},e.createElement(Y,null)),e.createElement("div",{className:t.filterGrid},e.createElement(b,{container:!0,item:!0,xs:12,justifyContent:"center",alignItems:"center"},e.createElement(b,{item:!0,className:t.gridItem},e.createElement(G,{variant:"outlined",className:t.formControl},e.createElement(w,{id:"interval-label"},"Time intervals"),e.createElement(O,{labelId:"interval-label",id:"interval-select",defaultValue:"lasthour",value:n.definedInterval,onChange:D,label:"Time intervals"},e.createElement(m,{value:"custom"},e.createElement("em",null,"Custom")),e.createElement(m,{value:"today"},"Today"),e.createElement(m,{value:"thisweek"},"This week"),e.createElement(m,{value:"thismonth"},"This month"),e.createElement(m,{value:"thisquarter"},"This quarter"),e.createElement(m,{value:"thisyear"},"This year")))),e.createElement(b,{item:!0,className:t.gridItem},e.createElement(G,{variant:"outlined",className:t.formControl},e.createElement(W,{autoOk:!0,hideTabs:!0,ampm:!1,value:n.from,onChange:s=>h({...n,definedInterval:"custom",from:s}),name:"from",label:"From date",format:"D.M.YYYY HH.mm",inputVariant:"outlined"}))),e.createElement(b,{item:!0,className:t.gridItem},e.createElement(G,{variant:"outlined",className:t.formControl},e.createElement(W,{autoOk:!0,hideTabs:!0,ampm:!1,value:n.to,onChange:s=>h({...n,definedInterval:"custom",to:s}),name:"to",label:"To date",format:"D.M.YYYY HH.mm",inputVariant:"outlined"}))),a===d.DIALOGCHATS&&e.createElement(b,{item:!0,className:t.gridItem},e.createElement(G,{variant:"outlined",className:t.formControl},e.createElement(w,{id:"group-by-user-label"},"Group by user"),e.createElement(O,{labelId:"group-by-user-label",value:c?"loading":i,onChange:s=>o(s.target.value),label:"Group by user"},c&&e.createElement(m,{value:"loading"}
1,e.createElement("em",null,"Loading owners...")),e.createElement(m,{value:"all"},e.createElement("em",null,"All")),!c&&C?.map(s=>e.createElement(m,{key:s,value:s},s))))),a===d.DIALOGMESSAGES&&e.createElement(e.Fragment,null,e.createElement(b,{item:!0,className:t.gridItem},e.createElement(G,{variant:"outlined",className:t.formControl},e.createElement(w,{id:"group-by-time-label"},"Group by"),e.createElement(O,{labelId:"group-by-time-label",value:v.value,onChange:s=>y({...v,value:s.target.value}),label:"Group by"},v?.options?.map(s=>e.createElement(m,{key:s.value,value:s.value},s.label))))),e.createElement(b,{item:!0,className:t.gridItem},e.createElement(G,{variant:"outlined",className:t.formControl},e.createElement(w,{id:"direction-label"},"Direction"),e.createElement(O,{labelId:"direction-label",value:u,onChange:s=>I(s.target.value),label:"Direction"},e.createElement(m,{value:"Both"},e.createElement("em",null,"Both")),e.createElement(m,{value:"Inbound"},"Inbound"),e.createElement(m,{value:"Outbound"},"Outbound"))))))),e.createElement("div",{className:t.divider},e.createElement(Y,null)),e.createElement("div",{className:t.chartContainer},e.createElement(Q,{chartType:a,requestOptions:T,interval:n})))))},Ye=U(()=>({root:{flex:1,display:"flex",flexDirection:"column"},appBar:{backgroundColor:"#fff"}})),Z=({service:t,serviceType:a})=>{switch(a){case"TwoWay":return e.createElement(ke,{twoWayService:t});case"Group":return e.createElement(Be,{groupService:t});default:return null}};Z.propTypes={service:g.object.isRequired,serviceType:g.string.isRequired};const ee=({serviceType:t})=>{const{serviceId:a}=H();switch(t){case"TwoWay":return e.createElement(Oe,null);case"Group":return e.createElement(Ae,{defaultFrom:{amount:-1,unit:"month"},serviceId:a,persistedFiltersTableId:"dialogServiceMessageEvents"});default:return null}};ee.propTypes={serviceType:g.string.isRequired};const pt=()=>{const t=Ye(),{customerId:a,serviceId:r}=H(),{dialogServicesById:i}=Te(I=>I.dialog),o=i?.[r],u=o?.serviceExtension?.serviceType;return e.createElement(Ce,{className:t.root,title:"Dialog Service"},e.createElement(e.Fragment,null,e.createElement(z,{position:"static",color:"default",elevation:0,className:t.appBar,variant:"outlined"},e.createElement(xe,null,e.createElement(x,{label:"Service Info",value:`/${a}/services/dialog/${r}/info`}),e.createElement(x,{label:"Message Events",value:`/${a}/services/dialog/${r}/events`}),u==="Group"&&e.createElement(x,{label:"Discussion Events",value:`/${a}/services/dialog/${r}/discussionevents`}),e.createElement(x,{label:"Statistics",value:`/${a}/services/dialog/${r}/statistics`}))),e.createElement(De,null,e.createElement(Ge,{exact:!0,path:"/:customerId/services/dialog/:serviceId"},e.createElement(we,{replace:!0,to:`/${a}/services/dialog/${r}/info`})),e.createElement(k,{path:"/:customerId/services/dialog/:serviceId/info"},e.createElement(Z,{service:o,serviceType:u})),e.createElement(k,{path:"/:customerId/services/dialog/:serviceId/events"},e.createElement(ee,{serviceType:u})),u==="Group"&&e.createElement(k,{path:"/:customerId/services/dialog/:serviceId/discussionevents"},e.createElement(qe,null)),e.createElement(k,{path:"/:customerId/services/dialog/:serviceId/statistics"},e.createElement(Fe,null)))))};export{pt 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.