PageSourceSearch

https://chatpilots.ai/static/js/5671.2ad34490.chunk.js

js chatpilots.ai collected 2026-10-05 13:04:11 UTC 73,137 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkPump=self.webpackChunkPump||[]).push([[5671],{48445(e,s,a){a.d(s,{Yh:()=>c,_H:()=>d,_q:()=>p});var t=a(22555),i=a(65043),n=a(25133),r=a(6867);const l={panel:null,isLocked:!1,isPreview:!1,message:""},o=e=>(0,t.A)((0,t.A)({},l),{},{panel:e||null}),c=function(){let{panelKey:e,employeeKey:s,fallbackPanel:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[l,c]=(0,i.useState)([]),[d,p]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=!0;return n.Ay.get(r.A.personas.employeeRegistry).then(s=>{if(!e)return;const a=s&&s.data&&s.data.data||{};c(Array.isArray(a.assignments)?a.assignments:[]),p(!0)}).catch(()=>{e&&(c([]),p(!0))}),()=>{e=!1}},[]),(0,i.useMemo)(()=>{const i=a||l.find(a=>e&&a.panel_key===e||s&&a.employee_key===s)||null;return(0,t.A)((0,t.A)({},o(i)),{},{loaded:d})},[l,s,a,d,e])},d=()=>{},p=o},54682(e,s,a){a.d(s,{A:()=>c});var t=a(22555),i=a(65043),n=a(27867),r=a(25133),l=a(6867),o=a(70579);const c=e=>{let{botType:s,style:a}=e;const[c,d]=(0,i.useState)(null),[p,u]=(0,i.useState)(!0),[m,g]=(0,i.useState)(!1),x=(0,i.useCallback)(async()=>{if(s)try{const e=await r.Ay.post(l.A.aiBots.list,{}),a=(Array.isArray(e&&e.data&&e.data.data)?e.data.data:[]).find(e=>(e.type||e.bot_type)===s)||null;d(a)}catch(e){d(null)}finally{u(!1)}else u(!1)},[s]);(0,i.useEffect)(()=>{x()},[x]);const h=!!c&&!1!==c.enabled;return p||!c?null:(0,o.jsxs)("button",{type:"button",onClick:async()=>{if(!c||!c.id||m)return;const e=!h;g(!0);try{await r.Ay.post(l.A.botSettings.update,{id:c.id,enabled:e}),d(s=>s?(0,t.A)((0,t.A)({},s),{},{enabled:e}):s),n.message.success(e?"\xc7al\u0131\u015fan aktif edildi":"\xc7al\u0131\u015fan pasife al\u0131nd\u0131")}catch(s){n.message.error("G\xfcncelleme hatas\u0131")}finally{g(!1)}},disabled:m,title:h?"Aktif \u2014 kapatmak i\xe7in t\u0131kla":"Pasif \u2014 a\xe7mak i\xe7in t\u0131kla",style:(0,t.A)({display:"inline-flex",alignItems:"center",gap:8,cursor:m?"default":"pointer",padding:"6px 12px",borderRadius:999,background:h?"rgba(34,197,94,.12)":"rgba(148,163,184,.14)",border:"1px solid "+(h?"rgba(34,197,94,.35)":"rgba(148,163,184,.3)"),opacity:m?.6:1},a),children:[(0,o.jsx)("span",{style:{width:34,height:20,borderRadius:11,background:h?"#22c55e":"rgba(148,163,184,.45)",position:"relative",transition:"background .2s",flexShrink:0},children:(0,o.jsx)("span",{style:{position:"absolute",top:2,left:h?16:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left .2s",boxShadow:"0 1px 2px rgba(0,0,0,.3)"}})}),(0,o.jsx)("span",{style:{fontSize:13,fontWeight:700,color:h?"#16a34a":"var(--cp-faint)"},children:h?"Aktif":"Pasif"})]})}},65671(e,s,a){a.r(s),a.d(s,{default:()=>D});var t=a(53986),i=a(22555),n=a(65043),r=a(54682),l=a(27867),o=a(25133),c=a(6867),d=a(48445),p=a(70579);const u=["color","count"],m=["count","color"],g=["color","count"],x=["color","count"],h={open:{label:"Acik",badge:"bg-p"},in_progress:{label:"Islemde",badge:"bg-b"},waiting_customer:{label:"Beklemede",badge:"bg-y"},resolved:{label:"Cozuldu",badge:"bg-g"},closed:{label:"Kapatildi",badge:"bg-gr"}},b={low:{label:"Dusuk",badge:"bg-gr"},medium:{label:"Normal",badge:"bg-b"},high:{label:"Yuksek",badge:"bg-o"},urgent:{label:"Acil",badge:"bg-r"}},j=[{label:"acil",badge:"bg-r"},{label:"escalation",badge:"bg-o"},{label:"vip-musteri",badge:"bg-p"},{label:"tekrar-eden",badge:"bg-b"},{label:"cozuldu",badge:"bg-g"},{label:"bekleniyor",badge:"bg-y"},{label:"fatura",badge:"bg-p"},{label:"teknik",badge:"bg-b"},{label:"siparis",badge:"bg-o"},{label:"sla-riski",badge:"bg-r"}],y=[{key:"Fatura / Odeme",icon:"\ud83d\udcb3",sla:"2 saat",description:"Odeme ve tahsilat sorunlari"},{key:"Teknik Destek",icon:"\ud83d\udd27",sla:"4 saat",description:"Urun, servis ve entegrasyon sorunlari"},{key:"Siparis / Teslimat",icon:"\ud83d\udce6",sla:"3 saat",description:"Siparis ve teslimat takibi"},{key:"Iade / Degisim",icon:"\ud83d\udd04",sla:"6 saat",description:"Iade, degisim ve iptal islemleri"},{key:"Genel Bilgi",icon:"\ud83d\udccb",sla:"8 saat",description:"Bilgilendirme ve genel destek"},{key:"Guvenlik / Hesap",icon:"\ud83d\udee1\ufe0f",sla:"1 saat",description:"Hesap guvenligi ve erisim sorunlari"}],v=[{id:"welcome",title:"Hosgeldiniz Mesaji",category:"Karsilama",badge:"bg-g",shortcut:"/hosgeldin",text:"Merhaba! Bize ulastiginiz icin tesekkur ederiz. Talebinizi inceliyoruz ve en kisa surede size donus yapacagiz."},{id:"invoice",title:"Odeme Sorunu Bilgilendirme",category:"Fatura",badge:"bg-r",shortcut:"/odeme-sorun",text:"Odeme isleminizdeki sorunu inceliyoruz. Kisa sure icinde size net bir guncelleme paylasacagiz."},{id:"refund",title:"Iade Sureci Bilgilendirme",category:"Iade",badge:"bg-o",shortcut:"/iade-bilgi",text:"Iade talebiniz alindi. Kontroller tamamlandiginda size tekrar bilgi verecegiz."}
1,{id:"technical",title:"Teknik Destek Yonlendirme",category:"Teknik",badge:"bg-b",shortcut:"/teknik-destek",text:"Yasadiginiz teknik sorunu teknik ekibimize ilettik. Cevap alir almaz sizinle paylasacagiz."},{id:"closing",title:"Ticket Kapanma Mesaji",category:"Kapanis",badge:"bg-gr",shortcut:"/kapanis",text:"Talebiniz cozulmustur. Baska bir konuda yardimci olmamizi isterseniz tekrar yazabilirsiniz."}],f={customer_name:"",customer_email:"",customer_phone:"",subject:"",description:"",category:"",priority:"medium",status:"open",resolution_text:"",assigned_user_id:"",tags_input:"",source:"panel"},k={key:"",icon:"\ud83d\udcc1",sla:"4 saat",description:""},N={id:"",title:"",category:"Genel",shortcut:"",text:"",badge:"bg-p"},_={slaHoursByPriority:{urgent:1,high:2,medium:4,low:8},firstResponseMinutes:15,escalationPercent:80,autoAssign:!0,roundRobin:!0,skillRouting:!1,loadBalancing:!0,vipPrioritization:!0,notifyNewTicket:!0,notifySla:!0,notifyEscalation:!0,notifyCustomerReply:!0,notifyCsat:!1,dailySummaryEmail:!0,weekdayStart:"09:00",weekdayEnd:"18:00",saturdayStart:"10:00",saturdayEnd:"14:00",sundayClosed:!0,afterHoursBot:!0,holidayAutoReply:!0,timezone:"UTC+3 (Istanbul)"},w=["#8b5cf6","var(--cp-info)","#fb923c","var(--cp-warn)","var(--cp-danger)","var(--cp-muted)","var(--cp-ok)","#22d3ee"],A=e=>{if(!e)return"\u2014";try{return new Date(e).toLocaleString("tr-TR")}catch(s){return e}},z=e=>{const s=Number(e||0);if(!s)return"\u2014";if(s<60)return"".concat(s,"dk");const a=Math.floor(s/60),t=s%60;return t?"".concat(a,"s ").concat(t,"dk"):"".concat(a,"s")},C=e=>{const s=Number(e||0);return s?"".concat(s>0?"+":"").concat(s):"0"},S=e=>{if(!e)return 0;const s=new Date(e).getTime()-Date.now();if(s<=0)return 100;const a=36e5;return Math.min(100,Math.max(0,Math.round((a-s)/a*100)))},T=e=>{if(!e)return"var(--cp-ok)";if("closed"===e.status||"resolved"===e.status)return"var(--cp-muted)";if(e.sla_breached)return"var(--cp-danger)";const s=S(e.resolution_due_at);return s>=75?"var(--cp-danger)":s>=50?"var(--cp-warn)":"var(--cp-ok)"},B=e=>e?"closed"===e.status?"Kapali":"resolved"===e.status?"Tamam":(e=>{if(!e)return"\u2014";const s=new Date(e).getTime()-Date.now();if(s<=0)return"Gecti";const a=Math.max(0,Math.floor(s/36e5)),t=Math.max(0,Math.floor(s%36e5/6e4));return a>0?"".concat(a,"s ").concat(t,"dk"):"".concat(t,"dk")})(e.resolution_due_at):"\u2014",M=e=>'"'.concat(String(null!==e&&void 0!==e?e:"").replace(/"/g,'""'),'"'),K=(e,s)=>{const a=e.map(e=>e.map(M).join(",")).join("\n");((e,s)=>{const a=window.URL.createObjectURL(e),t=document.createElement("a");t.href=a,t.download=s,document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(a)})(new Blob([a],{type:"text/csv;charset=utf-8;"}),s)},E=e=>(Array.isArray(e)?e:String(e||"").split(",")).map(e=>String(e||"").trim()).filter(Boolean),H=e=>{let{value:s,onChange:a}=e;return(0,p.jsx)("button",{className:"sup-tog".concat(s?" on":""),onClick:()=>a(!s),type:"button"})},D=()=>{const e=(0,d.Yh)({panelKey:"support-tickets"}),[s,a]=(0,n.useState)([]),[M,D]=(0,n.useState)(null),[O,P]=(0,n.useState)(null),[I,L]=(0,n.useState)(null),[R,G]=(0,n.useState)([]),[Y,U]=(0,n.useState)(!1),[W,F]=(0,n.useState)(!1),V=(()=>{try{return new URLSearchParams(window.location.search).get("status")}catch(e){return null}})(),[q,J]=(0,n.useState)(-1!==["open","in_progress","resolved","closed"].indexOf(V)?V:"all"),[X,Q]=(0,n.useState)("all"),[Z,$]=(0,n.useState)("all"),[ee,se]=(0,n.useState)(""),[ae,te]=(0,n.useState)("tickets"),[ie,ne]=(0,n.useState)(null),[re,le]=(0,n.use
1State)(1),[oe,ce]=(0,n.useState)(!1),[de,pe]=(0,n.useState)(!1),[ue,me]=(0,n.useState)(!1),[ge,xe]=(0,n.useState)(null),[he,be]=(0,n.useState)(!1),[je,ye]=(0,n.useState)(!1),[ve,fe]=(0,n.useState)(!1),[ke,Ne]=(0,n.useState)(!1),[_e,we]=(0,n.useState)(!1),[Ae,ze]=(0,n.useState)(f),[Ce,Se]=(0,n.useState)(""),[Te,Be]=(0,n.useState)(!1),[Me,Ke]=(0,n.useState)(_),[Ee,He]=(0,n.useState)(k),[De,Oe]=(0,n.useState)(N),[Pe,Ie]=(0,n.useState)(""),[Le,Re]=(0,n.useState)(""),[Ge,Ye]=(0,n.useState)(""),[Ue,We]=(0,n.useState)(""),[Fe,Ve]=(0,n.useState)("all"),qe=(0,n.useCallback)((e,s)=>a=>{const t=a&&a.target?a.target.value:a,n=s?s(t):t;ze(s=>(0,i.A)((0,i.A)({},s),{},{[e]:n}))},[]),Je=(0,n.useCallback)((e,s)=>a=>{const t=a&&a.target?a.target.value:a,n=s?s(t):t;Ke(s=>(0,i.A)((0,i.A)({},s),{},{[e]:n}))},[]),Xe=(0,n.useCallback)(e=>s=>{const a=s&&s.target?s.target.value:s;He(s=>(0,i.A)((0,i.A)({},s),{},{[e]:a}))},[]),Qe=(0,n.useCallback)(e=>s=>{const a=s&&s.target?s.target.value:s;Oe(s=>(0,i.A)((0,i.A)({},s),{},{[e]:a}))},[]),Ze=(0,n.useCallback)(e=>I&&I.id?o.Ay.post(c.A.tenantSettings.update,(0,i.A)({id:I.id},e)):o.Ay.post(c.A.tenantSettings.create,e),[I]),$e=(0,n.useCallback)(()=>{U(!0);const e=new URLSearchParams({page:"1",limit:"240"});"all"!==q&&e.set("status",q),"all"!==X&&e.set("priority",X),"all"!==Z&&e.set("category",Z),ee.trim()&&e.set("q",ee.trim()),Promise.allSettled([o.Ay.get("".concat(c.A.supportTickets.list,"?").concat(e.toString())),o.Ay.get(c.A.supportTickets.stats),o.Ay.get("".concat(c.A.supportTickets.report,"?period=month")),o.Ay.post(c.A.users.list,{}),o.Ay.post(c.A.tenantSettings.list,{})]).then(e=>{const s=e[0]&&"fulfilled"===e[0].status?e[0].value:null,t=e[1]&&"fulfilled"===e[1].status?e[1].value:null,n=e[2]&&"fulfilled"===e[2].status?e[2].value:null,r=e[3]&&"fulfilled"===e[3].status?e[3].value:null,l=e[4]&&"fulfilled"===e[4].status?e[4].value:null;if(![s,t,n,r,l].filter(Boolean).length)throw new Error("Destek listesi yuklenemedi");a(s&&s.data&&s.data.data||[]),D(t&&t.data&&t.data.data||{}),P(n&&n.data&&n.data.data||{}),G(r&&r.data&&r.data.data||[]),L((e=>{const s=Array.isArray(e)?e.filter(e=>e&&"object"===typeof e):[];return s.length?[...s].sort((e,s)=>Number(e.id||0)-Number(s.id||0)).reduce((e,s)=>(0,i.A)((0,i.A)((0,i.A)({},e),s),{},{support_panel_config_json:(0,i.A)((0,i.A)({},e.support_panel_config_json&&"object"===typeof e.support_panel_config_json?e.support_panel_config_json:{}),s.support_panel_config_json&&"object"===typeof s.support_panel_config_json?s.support_panel_config_json:{})}),{}):null})(l&&l.data&&l.data.data||[]))}).catch(e=>{l.message.error(e&&e.response&&e.response.data&&e.response.data.message||"Destek verileri yuklenemedi")}).finally(()=>{U(!1)})},[Z,X,ee,q]);(0,n.useEffect)(()=>{e.loaded&&$e()},[e.loaded,$e]),(0,n.useEffect)(()=>{Ke((e=>{const s=e&&e.support_panel_config_json&&"object"===typeof e.support_panel_config_json?e.support_panel_config_json:{};return(0,i.A)((0,i.A)((0,i.A)({},_),s),{},{slaHoursByPriority:(0,i.A)((0,i.A)({},_.slaHoursByPriority),s.slaHoursByPriority&&"object"===typeof s.slaHoursByPriority?s.slaHoursByPriority:{})})})(I))},[I]),(0,n.useEffect)(()=>{le(1)},[ee,q,X,Z]);const es=(0,n.useMemo)(()=>((e,s)=>{const a=Array.isArray(e&&e.support_categories_json)&&e.support_categories_json.length?e.support_categories_json:y,t=s&&s.by_category||{};return a.map((e,s)=>(0,i.A)((0,i.A)({},e),{},{count:Number(t[e.key]||0),color:w[s%w.length]}))})(I,M),[I,M]),ss=(0,n.useMemo)(()=>(e=>(e&&Array.isArray(e.support_canned_responses_json)&&e.support_canned_responses_json.length?e.support_canned_responses_json:v).map((e,s)=>(0,i.A)((0,i.A)({badge:e.badge||["bg-g","bg-r","bg-o","bg-b","bg-gr"][s%5]},e),{},{id:e.id||"cr-".concat(s+1)})))(I),[I]),as=(0,n.useMemo)(()=>{const e=ee.trim().toLowerCase();return s.filter(s=>{if("all"!==q&&s.status!==q)return!1;if("all"!==X&&s.priority!==X)return!1;if("all"!==Z&&s.category!==Z)return!1;if(!e)return!0;return[s.subject,s.description,s.category,s.resolution_text,s.customer_name,s.customer_email,s.customer_phone,s.contact&&s.contact.display_name].filter(
1Boolean).join(" ").toLowerCase().includes(e)})},[Z,X,s,ee,q]),ts=Math.max(1,Math.ceil(as.length/30)),is=Math.min(re,ts),ns=as.slice(30*(is-1),30*is),rs=s.find(e=>Number(e.id)===Number(ie))||ns[0]||as[0]||null,ls=(0,n.useMemo)(()=>s.filter(e=>e.sla_breached||e.resolution_due_at&&new Date(e.resolution_due_at).getTime()<Date.now()&&!["resolved","closed"].includes(e.status)).length,[s]),os=(0,n.useMemo)(()=>s.filter(e=>String(e.category||"").toLowerCase().includes("fatura")).length,[s]),cs=(0,n.useMemo)(()=>s.filter(e=>"urgent"===e.priority&&["open","in_progress"].includes(e.status)).length,[s]),ds=(0,n.useMemo)(()=>{const e=new Map;return j.forEach(s=>e.set(s.label,s)),s.forEach(s=>{E(s.tags_json).forEach(s=>{e.has(s)||e.set(s,{label:s,badge:"bg-p"})})}),Array.from(e.values())},[s]),ps=(0,n.useMemo)(()=>{const e=Ge.trim().toLowerCase();return e?es.filter(s=>[s.key,s.description,s.sla].filter(Boolean).join(" ").toLowerCase().includes(e)):es},[es,Ge]),us=(0,n.useMemo)(()=>{const e=Ue.trim().toLowerCase();return ss.filter(s=>("all"===Fe||s.category===Fe)&&(!e||[s.title,s.category,s.shortcut,s.text].filter(Boolean).join(" ").toLowerCase().includes(e)))},[Fe,ss,Ue]),ms=(0,n.useMemo)(()=>R.filter(e=>"active"===String(e.status||"active")),[R]),gs=(0,n.useMemo)(()=>{const e=[],s=[];return us.forEach((a,t)=>{t%2===0?e.push(a):s.push(a)}),[e,s]},[us]),xs=e=>{ne(e.id),xe(e.id),ze({customer_name:e.customer_name||e.contact&&e.contact.display_name||"",customer_email:e.customer_email||e.contact&&e.contact.email||"",customer_phone:e.customer_phone||e.contact&&(e.contact.phone_e164||e.contact.wa_id)||"",subject:e.subject||"",description:e.description||"",category:e.category||"",priority:e.priority||"medium",status:e.status||"open",resolution_text:e.resolution_text||"",assigned_user_id:e.assigned_user_id||"",tags_input:E(e.tags_json).join(", "),source:e.source||"panel"}),me(!0)},hs=e=>{e?(Ie(e.key),He({key:e.key||"",icon:e.icon||"\ud83d\udcc1",sla:e.sla||"4 saat",description:e.description||""})):(Ie(""),He(k)),ye(!0)},bs=e=>{e?(Re(e.id),Oe({id:e.id,title:e.title||"",category:e.category||"Genel",shortcut:e.shortcut||"",text:e.text||"",badge:e.badge||"bg-p"})):(Re(""),Oe(N)),Ne(!0)},js=(0,n.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=e.support_panel_config_json||Me,a=e.support_categories_json||es.map(e=>{let{color:s,count:a}=e;return(0,t.A)(e,u)}),i=e.support_canned_responses_json||ss.map(e=>{let{count:s,color:a}=e;return(0,t.A)(e,m)});return{support_panel_config_json:s,support_categories_json:a,support_categories:JSON.stringify(a.map(e=>e.key)),support_canned_responses_json:i,support_sla_resolution_hours:Number(s.slaHoursByPriority&&s.slaHoursByPriority.medium)||4}},[ss,es,Me]),ys=async function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Ayarlar kaydedildi";const s=js(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});await Ze(s),L(e=>(0,i.A)((0,i.A)({},e||{}),{},{support_panel_config_json:s.support_panel_config_json,support_categories_json:s.support_categories_json,support_categories:s.support_categories,support_canned_responses_json:s.support_canned_responses_json,support_sla_resolution_hours:s.support_sla_resolution_hours})),l.message.success(e)},vs=async e=>{if(!Ae.subject||!Ae.description)return void l.message.error("Konu ve aciklama zorunlu");const s={customer_name:Ae.customer_name||null,customer_email:Ae.customer_email||null,customer_phone:Ae.customer_phone||null,subject:Ae.subject,description:Ae.description,category:Ae.category||"Genel Bilgi",priority:Ae.priority||"medium",status:Ae.status||"open",resolution_text:Ae.resolution_text||null,source:"panel",created_by:"panel",assigned_user_id:Ae.assigned_user_id||null,tags_json:E(Ae.tags_input)};try{"edit"===e?await o.Ay.post(c.A.supportTickets.update,(0,i.A)({id:ge||ie},s)):await o.Ay.post(c.A.supportTickets.create,s),l.message.success("edit"===e?"Ticket guncellendi":"Ticket olusturuldu"),pe(!1),me(!1),xe(null),$e()}catch(a){l.message.error(a&&a.response&&a.response.data&&a.response.data.message||"Ticket kaydedilemedi")}},fs=async(e,s,a)=>{try{await o.Ay.post(c.A.supportTickets.updateStatus,{id:e.id,status:s}),l.message.success(a),ce(!1),$e()}catch(t){l.message.error(t&&t.response&&t.response.data&&t.response.data.message||"Ticket guncellenemedi")}},ks=(0,n.useCallback)(async e=>{if(!e)return null;let s=e.conversation_id||null,a=e.contact_id||null;if(!s&&a){const e=await o.Ay.post(c.A.waContacts.startChat,{contact_id:a});s=e&&e.data&&e.data.data&&e.data.data.id}if(!s&&!a&&e.customer_phone){const t=await o.Ay.post(c.A.whatsappAccounts.list,{}),i=(t&&t.data&&t.data.data||[]).find(e=>e&&"connected"===e.status&&e.id);if(!i)throw new Error("Bagli bir WhatsApp hesabi olmadan mesaj gonderilemez.");const n=await o.Ay.post(c.A.waContacts.create,{whatsapp_account_id:i.id,display_name:e.customer_name||e.contact&&e.contact.display_name||"Musteri",phone_e164:e.customer_phone,wa_id:e.customer_phone}),r=n&&n.data&&n.data.data;if(a=r&&r.id,a){const e=await o.Ay.post(c.A.waContacts.startChat,{contact_id:a});s=e&&e.data&&e.data.data&&e.data.data.id}}return s?((!e.conversation_id||!e.contact_id&&a)&&await o.Ay.post(c.A.supportTickets.update,{id:e.id,conversation_id:s,contact_id:a}),{conversationId:s,contactId:a}):null},[]);if(!e.loaded)return(0,p.jsx)("div",{style:{minHeight:"60vh",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--cp-muted)"},children:"AI calisan paneli yukleniyor..."});
1const Ns=rs&&rs.contact&&rs.contact.is_vip?{label:"VIP",badge:"bg-p"}:rs&&rs.contact&&Number(rs.contact.ticket_count||0)>=3?{label:"Sadik",badge:"bg-b"}:{label:"Standart",badge:"bg-gr"},_s=Number(O&&O.resolved_today||M&&M.resolved_today||0),ws=z(O&&O.avg_resolution_minutes),As=z(O&&O.avg_first_response_minutes),zs="".concat(Number(O&&O.sla_compliance||0),"%");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("style",{children:"\n.sup-page{position:relative;z-index:1;max-width:1440px;margin:0 auto;padding:28px 24px;color:var(--cp-text)}\n.sup-page *{box-sizing:border-box}\n.sup-page::before{content:'';position:fixed;inset:0;background:radial-gradient(ellipse at 50% 30%,rgba(139,92,246,.06) 0%,transparent 55%);pointer-events:none}\n.sup-shell{position:relative;z-index:1}\n.sup-hdr{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px;flex-wrap:wrap;gap:12px}\n.sup-hdr-l{display:flex;align-items:center;gap:14px}\n.sup-av{width:48px;height:48px;border-radius:13px;background:linear-gradient(135deg,#8b5cf6,#6366f1);display:flex;align-items:center;justify-content:center;font-size:24px;box-shadow:0 0 25px rgba(139,92,246,.25)}\n.sup-hdr h1{font-size:22px;font-weight:800;color:var(--cp-title);margin:0}\n.sup-hdr p{font-size:11px;color:var(--cp-faint);margin:1px 0 0}\n.sup-hdr-r{display:flex;gap:8px;flex-wrap:wrap}\n.sup-btn{padding:8px 16px;border-radius:9px;border:1px solid rgba(139,92,246,.2);background:rgba(139,92,246,.07);color:var(--cp-violet);font-size:12px;font-weight:600;cursor:pointer;transition:all .2s;font-family:inherit}\n.sup-btn:hover{background:rgba(139,92,246,.14)}\n.sup-btn:disabled{opacity:.55;cursor:not-allowed}\n.sup-btn-primary{background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff;border:none}\n.sup-btn-primary:hover{box-shadow:0 4px 18px rgba(139,92,246,.35)}\n.sup-btn-danger{border-color:rgba(248,113,113,.25);background:rgba(248,113,113,.07);color:var(--cp-danger)}\n.sup-btn-danger:hover{background:rgba(248,113,113,.14)}\n.sup-btn-warn{border-color:rgba(251,191,36,.25);background:rgba(251,191,36,.07);color:var(--cp-warn)}\n.sup-btn-green{border-color:rgba(74,222,128,.25);background:rgba(74,222,128,.07);color:var(--cp-ok)}\n.sup-btn-sm{padding:5px 10px;font-size:11px;border-radius:7px}\n.sup-alert{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:10px;margin-bottom:18px;font-size:12px;font-weight:500}\n.sup-alert-w{background:rgba(248,113,113,.06);border:1px solid rgba(248,113,113,.12);color:var(--cp-danger)}\n.sup-alert-s{background:rgba(139,92,246,.06);border:1px solid rgba(139,92,246,.12);color:var(--cp-violet)}\n.sup-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px}\n.sup-stat{background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.05);border-radius:12px;padding:16px;text-align:center}\n.sup-stat-i{font-size:22px;margin-bottom:6px}\n.sup-stat-v{font-size:24px;font-weight:800;color:var(--cp-title)}\n.sup-stat-l{font-size:10px;color:var(--cp-faint);margin-top:3px}\n.sup-stat-c{font-size:10px;font-weight:600;margin-top:4px;color:var(--cp-ok)}\n.sup-tabs{display:flex;gap:2px;margin-bottom:18px;border-bottom:1px solid rgba(255,255,255,.05);overflow:auto}\n.sup-tab{padding:9px 16px;font-size:12px;font-weight:600;color:var(--cp-faint);cursor:pointer;border-bottom:2px solid transparent;transition:all .2s;white-space:nowrap}\n.sup-tab:hover{color:var(--cp-violet)}\n.sup-tab.active{color:var(--cp-violet);border-bottom-color:#8b5cf6}\n.sup-card{background:rgba(255,255,255,.025);border:1px solid rgba(255,255,255,.05);border-radius:12px;padding:18px;margin-bottom:14px}\n.sup-card-title{font-size:13px;font-weight:700;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between;gap:12px}\n.sup-card-title span{display:flex;align-items:center;gap:6px}\n.sup-srch{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap}\n.sup-input,.sup-fi{width:100%;padding:9px 13px;border-radius:9px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.025);color:var(--cp-text);font-size:12px;font-family:inherit;outline:none}\n.sup-input:focus,.sup-fi:focus,.sup-ft:focus,.sup-fs:focus{border-color:#8b5cf6}\n.sup-select,.sup-fs{padding:9px 13px;border-radius:9px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.025);color:var(--cp-text);font-size:12px;font-family:inherit;cursor:pointer;appearance:none;outline:none}\n.sup-select option,.sup-fs option{background:var(--cp-border)}\n.sup-textarea,.sup-ft{width:100%;padding:9px 13px;border-radius:9px;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.025);color:var(--cp-text);font-size:12px;font-family:inherit;outline:none;min-height:70px;resize:vertical}\n.sup-g2{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}\n.sup-g3{display:grid;grid-template-columns:2fr 1fr;gap:12px;margin-bottom:14px}\n.sup-table{width:100%;border-collapse:collapse}\n.sup-table th{text-align:left;font-size:10px;color:var(--cp-faint);font-weight:600;padding:7px 8px;border-bottom:1px solid rgba(255,255,255,.05);text-transform:uppercase;letter-spacing:.4px}\n.sup-table td{font-size:12px;padding:8px;border-bottom:1px solid rgba(255,255,255,.03)}\n.sup-table tr:hover td{background:rgba(139,92,246,.02)}\n.sup-row-click{cursor:pointer}\n.sup-badge{font-size:10px;padding:2px 7px;border-radius:5px;font-weight:600;display:inline-block}\n.bg-g{background:rgba(74,222,128,.1);color:var(--cp-ok)}.bg-y{background:rgba(251,191,36,.1);color:var(--cp-warn)}.bg-b{background:rgba(59,130,246,.1);color:var(--cp-info)}.bg-r{background:rgba(248,113,113,.1);color:var(--cp-danger)}.bg-p{background:rgba(139,92,246,.1);color:var(--cp-violet)}.bg-o{background:rgba(251,146,60,.1);color:#fb923c}.bg-gr{background:rgba(148,163,184,.1);color:var(--cp-muted)}\n.sup-ai{background:rgba(139,92,246,.03);border:1px solid rgba(139,92,246,.1);border-radius:9px;padding:12px;margin-bottom:8px}\n.sup-ai:last-child{margin:0}\n.sup-ai-b{font-size:9px;padding:2px 6px;border-radius:4px;font-weight:700;background:rgba(139,92,246,.18);color:var(--cp-violet);text-transform:uppercase;display:inline-block;margin-bottom:4px}\n.sup-ai-t{font-size:11px;color:var(--cp-text2);line-height:1.5}\n.sup-dr{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid rgba(255,255,255,.025);font-size:11px;gap:12px}\n.sup-dr .l{color:var(--cp-faint)}.sup-dr .v{color:var(--cp-text);font-weight:600;text-align:right}\n.sup-drw-s{margin-bottom:18px}\n.sup-drw-s h3{font-size:11px;font-weight:700;color:#8b5cf6;text-transform:uppercase;letter-spacing:.4px;margin-bottom:8px}\n.sup-conv{margin-bottom:14px}\n.sup-msg{padding:10px 14px;border-radius:10px;margin-bottom:8px;font-size:12px;line-height:1.6;max-width:85%}\n.sup-msg-c{background:rgba(59,130,246,.08);border:1px solid rgba(59,130,246,.12);margin-right:auto}\n.sup-msg-a{background:rgba(139,92,246,.08);border:1px solid rgba(139,92,246,.12);margin-left:auto}\n.sup-msg-h{font-size:10px;font-weight:600;margin-bottom:3px;display:flex;justify-content:space-between}\n.sup-msg-h .n{color:var(--cp-violet)}.sup-msg-h .t{color:#475569}\n.sup-sla-bar{height:6px;border-radius:3px;background:rgba(255,255,255,.05);overflow:hidden;margin-top:6px}\n.sup-sla-fill{height:100%;border-radius:3px;transition:width .3s}\n.sup-sla-ok{background:var(--cp-ok)}\n.sup-sla-warn{background:var(--cp-warn)}\n.sup-sla-danger{background:var(--cp-danger)}\n.sup-cr-item{background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.04);border-radius:10px;padding:14px;margin-bottom:8px;transition:all .2s}\n.sup-cr-item:hover{border-color:rgba(139,92,246,.15)}\n.sup-cr-title{font-size:12px;font-weight:700;margin-bottom:4px;display:flex;justify-content:space-between;align-items:center;gap:10px}\n.sup-cr-cat{font-size:10px;color:var(--cp-faint);margin-bottom:6px}\n.sup-cr-text{font-size:11px;color:var(--cp-muted);line-height:1.5}\n.sup-cr-actions{display:flex;gap:4px;margin-top:8px;flex-wrap:wrap}\n.sup-cat-item{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:10px;background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.04);margin-bottom:8px;gap:12px}\n.sup-cat-item:hover{border-color:rgba(139,92,246,.12)}\n.sup-cat-info{display:flex;align-items:center;gap:10px}\n.sup-cat-icon{width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:16px;background:rgba(139,92,246,.08)}\n.sup-cat-name{font-size:12px;font-weight:600}\n.sup-cat-count{font-size:10px;color:var(--cp-faint);margin-top:1px}\n.sup-cat-actions{display:flex;gap:4px}\n.sup-set{display:grid;grid-template-columns:1fr 1fr;gap:14px}\n.sup-set-g{background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.04);border-radius:10px;padding:16px}\n.sup-set-h{font-size:12px;font-weight:700;margin-bottom:12px;display:flex;align-items:center;gap:6px}\n.sup-set-r{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.03);font-size:11px;gap:12px}\n.sup-set-r:last-child{border:none}\n.sup-set-r .sl{color:var(--cp-muted)}.sup-set-r .sv{color:var(--cp-text);font-weight:600}\n.sup-tog{width:36px;height:20px;border-radius:10px;background:rgba(255,255,255,.1);position:relative;cursor:pointer;transition:all .2s;border:none;flex-shrink:0}\n.sup-tog.on{background:rgba(139,92,246,.4)}\n.sup-tog::after{content:'';position:absolute;width:16px;height:16px;border-radius:8px;background:#fff;top:2px;left:2px;transition:all .2s}\n.sup-tog.on::after{left:18px}\n.sup-del-i{width:48px;height:48px;border-radius:14px;background:rgba(248,113,113,.08);display:flex;align-items:center;justify-content:center;font-size:24px;margin:0 auto 12px}\n.sup-form-group{margin-bottom:14px}\n.sup-form-label{display:block;font-size:10px;font-weight:600;color:var(--cp-muted);margin-bottom:5px;text-transform:uppercase;letter-spacing:.3px}\n.sup-form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}\n.sup-empty{padding:24px;border:1px dashed rgba(139,92,246,.2);border-radius:12px;color:var(--cp-muted);text-align:center}\n.sup-note{font-size:10px;color:var(--cp-faint);margin-top:4px}\n.sup-pager{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:14px;flex-wrap:wrap}\n.sup-pager-meta{font-size:11px;color:var(--cp-muted)}\n.sup-pager-actions{display:flex;gap:8px}\n.sup-modal .ant-modal-content,.sup-drawer .ant-drawer-content,.sup-drawer .ant-drawer-content-wrapper,.sup-drawer .ant-drawer-wrapper-body,.sup-drawer .ant-drawer-body{background:var(--cp-elevated);color:var(--cp-text);border-color:rgba(139,92,246,.12)}\n.sup-modal .ant-modal-header,.sup-drawer .ant-drawer-header{background:var(--cp-elevated);border-bottom:1px solid rgba(255,255,255,.05)}\n.sup-drawer.ant-drawer .ant-drawer-mask{background:transparent}\n.sup-drawer.ant-drawer .ant-drawer-content-wrapper{box-shadow:-12px 0 36px rgba(0,0,0,.35)}\n.sup-modal .ant-modal-title,.sup-drawer .ant-drawer-title,.sup-drawer .ant-drawer-close{color:var(--cp-text)}\n.sup-modal .ant-modal-footer{border-top:1px solid rgba(255,255,255,.05)}\n@media(max-width:1100px){.sup-stats{grid-template-columns:repeat(2,1fr)}.sup-g2,.sup-g3,.sup-set{grid-template-columns:1fr}}\n@media(max-width:768px){.sup-stats{grid-template-columns:1fr}.sup-form-row{grid-template-columns:1fr}}\n"}),(0,p.jsx)("div",{className:"sup-page",children:(0,p.jsxs)("div",{className:"sup-shell",children:[(0,p.jsxs)("div",{className:"sup-hdr",children:[(0,p.jsxs)("div",{className:"sup-hdr-l",children:[(0,p.jsx)("div",{className:"sup-av",children:"\ud83c\udfa7"}),(0,p.jsxs)("div",{children:[(0,p.jsx)("h1",{children:"Destek Uzmani"}),(0,p.jsx)("p",{children:"Ticket yonetimi \xb7 SLA takibi \xb7 CSAT analizi \xb7 AI destekli cozum"})]}),(0,p.jsx)(r.A,{botType:"support",style:{marginLeft:12}})]}),(0,p.jsxs)("div",{className:"sup-hdr-r",children:[(0,p.jsx)("button",{className:"sup-btn",onClick:()=>{const e=(new Date).toISOString().slice(0,10),a=[["Destek Raporu",e],["Acik Ticket",M&&M.open?M.open:s.filter(e=>"open"===e.status).length],["Cozulen Bugun",O&&O.resolved_today?O.resolved_today:0],["Ort. Cozum Suresi",z(O&&O.avg_resolution_minutes)],["CSAT",O&&O.avg_csat_score?O.avg_csat_score:"-"],[""],["Ticket ID","Musteri","Konu","Kategori","Oncelik","Durum","SLA","Atanan","Olusturma"],...as.map(e=>["TK-".concat(e.id),e.customer_name||e.contact&&e.contact.display_name||"Musteri",e.subject||"\u2014",e.category||"Genel",(b[e.priority]||b.medium).label,(h[e.status]||h.open).label,B(e),e.assigned_to||"Atanmamis",A(e.created_at)])];K(a,"destek-raporu-".concat(e,".csv")),l.message.success("Destek raporu indirildi")},children:"\ud83d\udcca Rapor"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-primary",onClick:()=>{xe(null),ze(f),pe(!0)},children:"+ Yeni Ticket"})]})]}),(0,p.jsxs)("div",{className:"sup-alert sup-alert-w",children:["\u26a0\ufe0f SLA Uyarisi: ",ls," ticket SLA limitine yaklasti.",rs?" TK-".concat(rs.id," icin kalan sure: ").concat(B(rs),"."):"",(0,p.jsx)("span",{style:{marginLeft:"auto",fontWeight:700,cursor:"pointer",textDecoration:"underline"},onClick:()=>rs&&ce(!0),children:"Detay Gor \u2192"})]}),(0,p.jsxs)("div",{className:"sup-alert sup-alert-s",children:['\ud83e\udd16 AI Oneri: Son 1 saatte "fatura" konulu ',os," ticket acildi. Uygun kayitlara toplu bilgilendirme gonderilebilir.",(0,p.jsx)("span",{style:{marginLeft:"auto",fontWeight:700,cursor:"pointer",textDecoration:"underline"},onClick:async()=>{const e=s.filter(e=>String(e.category||"").toLowerCase().includes("fatura")),a=as.filter(e=>e.conversation_id||e.contact_id||e.customer_phone),t=(e.length?e:a).slice(0,25);if(!t.length)return void l.message.warning("Toplu mesaj gonderecek uygun ticket bulunamadi");const i=e.length?"Fatura talepleriniz inceleniyor. Siradaki tum kayitlar icin toplu durum guncellemesi paylasildi. Gelisme olursa ayrica bilgilendirecegiz.":"Destek talepleriniz inceleniyor. Uygun kayitlar icin toplu durum guncellemesi paylasildi. Gelisme olursa ayrica bilgilendirecegiz.",n=(await Promise.allSettled(t.map(async e=>{const s=await ks(e);if(!s||!s.conversationId)throw new Error("conversation_missing");return o.Ay.post(c.A.messages.send,{conversation_id:s.conversationId,text_body:i})}))).filter(e=>"fulfilled"===e.status).length;n?l.message.success("".concat(n," ticket icin toplu bilgilendirme gonderildi")):l.message.error("Toplu bilgilendirme gonderilemedi")},children:"Gonder \u2192"})]}),(0,p.jsxs)("div",{className:"sup-stats",children:[(0,p.jsxs)("div",{className:"sup-stat",children:[(0,p.jsx)("div",{className:"sup-stat-i",children:"\ud83d\udce8"}),(0,p.jsx)("div",{className:"sup-stat-v",children:Number(M&&M.open||s.filter(e=>"open"===e.status).length||0)}),(0,p.jsx)("div",{className:"sup-stat-l",children:"Acik Ticket"}),(0,p.jsxs)("div",{className:"sup-stat-c",style:{color:cs?"var(--cp-warn)":"var(--cp-muted)"},children:[cs," acil oncelikli"]})]}),(0,p.jsxs)("div",{className:"sup-stat",children:[(0,p.jsx)("div",{className:"sup-stat-i",children:"\u2705"}),(0,p.jsx)("div",{className:"sup-stat-v",children:_s}),(0,p.jsx)("div",{className:"sup-stat-l",children:"Cozulen Bugun"}),(0,p.jsxs)("div",{className:"sup-stat-c",children:[C(O&&O.resolved_today_delta)," onceki doneme gore"]})]}),(0,p.jsxs)("div",{className:"sup-stat",children:[(0,p.jsx)("div",{className:"sup-stat-i",children:"\u23f1\ufe0f"}),(0,p.jsx)("div",{className:"sup-stat-v",children:ws}),(0,p.jsx)("div",{className:"sup-stat-l",children:"Ort. Cozum Suresi"}),(0,p.jsxs)("div",{className:"sup-stat-c",children:[As," ilk yanit"]})]}),(0,p.jsxs)("div",{className:"sup-stat",children:[(0,p.jsx)("div",{className:"sup-stat-i",children:"\u2b50"}),(0,p.jsx)("div",{className:"sup-stat-v",children:O&&O.avg_csat_score||"\u2014"}),(0,p.jsx)("div",{className:"sup-stat-l",children:"CSAT Puani"}),(0,p.jsxs)("div",{className:"sup-stat-c",children:[zs," SLA uyum"]})]})]}),(0,p.jsxs)("div",{className:"sup-tabs",children:[(0,p.jsx)("div",{className:"sup-tab".concat("tickets"===ae?" active":""),onClick:()=>te("tickets"),children:"\ud83d\udccb Ticket Listesi"}),(0,p.jsx)("div",{className:"sup-tab".concat("categories"===ae?" active":""),onClick:()=>te("categories"),children:"\ud83d\udcc1 Kategoriler"}),(0,p.jsx)("div",{className:"sup-tab".concat("canned"===ae?" active":""),onClick:()=>te("c
1anned"),children:"\ud83d\udcac Hazir Yanitlar"}),(0,p.jsx)("div",{className:"sup-tab".concat("settings"===ae?" active":""),onClick:()=>te("settings"),children:"\u2699\ufe0f Ayarlar"})]}),"tickets"===ae&&(0,p.jsxs)("div",{className:"sup-g3",children:[(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"sup-srch",children:[(0,p.jsx)("input",{className:"sup-input",placeholder:"Ticket ara (ID, musteri, konu...)",value:ee,onChange:e=>se(e.target.value)}),(0,p.jsxs)("select",{className:"sup-select",value:q,onChange:e=>J(e.target.value),children:[(0,p.jsx)("option",{value:"all",children:"Tum Durumlar"}),Object.keys(h).map(e=>(0,p.jsx)("option",{value:e,children:h[e].label},e))]}),(0,p.jsxs)("select",{className:"sup-select",value:X,onChange:e=>Q(e.target.value),children:[(0,p.jsx)("option",{value:"all",children:"Tum Oncelikler"}),Object.keys(b).map(e=>(0,p.jsx)("option",{value:e,children:b[e].label},e))]}),(0,p.jsxs)("select",{className:"sup-select",value:Z,onChange:e=>$(e.target.value),children:[(0,p.jsx)("option",{value:"all",children:"Tum Kategoriler"}),es.map(e=>(0,p.jsx)("option",{value:e.key,children:e.key},e.key))]})]}),(0,p.jsx)("div",{className:"sup-card",children:Y?(0,p.jsx)("div",{className:"sup-empty",children:"Ticket listesi yukleniyor..."}):as.length?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{overflowX:"auto"},children:(0,p.jsxs)("table",{className:"sup-table",children:[(0,p.jsx)("thead",{children:(0,p.jsxs)("tr",{children:[(0,p.jsx)("th",{children:"ID"}),(0,p.jsx)("th",{children:"Musteri"}),(0,p.jsx)("th",{children:"Konu"}),(0,p.jsx)("th",{children:"Oncelik"}),(0,p.jsx)("th",{children:"Durum"}),(0,p.jsx)("th",{children:"Kategori"}),(0,p.jsx)("th",{children:"SLA"}),(0,p.jsx)("th",{children:"Tarih"}),(0,p.jsx)("th",{children:"Islem"})]})}),(0,p.jsx)("tbody",{children:ns.map(e=>{const s=h[e.status]||h.open,a=b[e.priority]||b.medium;return(0,p.jsxs)("tr",{className:"sup-row-click",onClick:()=>{ne(e.id),ce(!0)},children:[(0,p.jsxs)("td",{style:{fontWeight:700,color:"var(--cp-violet)"},children:["TK-",e.id]}),(0,p.jsx)("td",{children:e.customer_name||e.contact&&e.contact.display_name||"Musteri"}),(0,p.jsx)("td",{children:e.subject||"\u2014"}),(0,p.jsx)("td",{children:(0,p.jsx)("span",{className:"sup-badge ".concat(a.badge),children:a.label})}),(0,p.jsx)("td",{children:(0,p.jsx)("span",{className:"sup-badge ".concat(s.badge),children:s.label})}),(0,p.jsx)("td",{children:e.category||"Genel"}),(0,p.jsx)("td",{children:(0,p.jsx)("span",{style:{color:T(e),fontWeight:600,fontSize:"11px"},children:B(e)})}),(0,p.jsx)("td",{style:{color:"var(--cp-faint)",fontSize:"11px"},children:A(e.created_at)}),(0,p.jsxs)("td",{onClick:e=>e.stopPropagation(),children:[(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>{ne(e.id),ce(!0)},children:"\ud83d\udc41\ufe0f"})," ",(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>xs(e),children:"\u270f\ufe0f"})," ",(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-danger",onClick:()=>{ne(e.id),be(!0)},children:"\ud83d\uddd1\ufe0f"})]})]},e.id)})})]})}),(0,p.jsxs)("div",{className:"sup-pager",children:[(0,p.jsxs)("div",{className:"sup-pager-meta",children:[as.length," kayit \xb7 Sayfa ",is,"/",ts]}),(0,p.jsxs)("div",{className:"sup-pager-actions",children:[(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",disabled:is<=1,onClick:()=>le(e=>Math.max(1,e-1)),children:"Onceki"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",disabled:is>=ts,onClick:()=>le(e=>Math.min(ts,e+1)),children:"Sonraki"})]})]})]}):(0,p.jsx)("div",{className:"sup-empty",children:"Bu filtrede ticket bulunamadi."})})]}),(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"sup-card",children:[(0,p.jsx)("div",{className:"sup-card-title",children:(0,p.jsx)("span",{children:"\ud83e\udd16 AI Analiz"})}),(0,p.jsxs)("div",{className:"sup-ai",children:[(0,p.jsx)("div",{className:"sup-ai-b",children:"Otomatik Kategorizasyon"}),(0,p.jsx)("div",{className:"sup-ai-t",children:rs?"TK-".concat(rs.id,' icin mevcut kategori "').concat(rs.category||"Genel",'". Gerekirse kategori ve atamayi duzenleyebilirsiniz.'):"Analiz icin bir ticket secin."}),(0,p.jsx)("div",{style:{marginTop:6},children:(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-primary",onClick:()=>rs&&xs(rs),children:"Duzenle"})})]}),(0,p.jsxs)("div",{className:"sup-ai",children:[(0,p.jsx)("div",{className:"sup-ai-b",children:"Duygu Analizi"}),(0,p.jsxs)("div",{className:"sup-ai-t",children:["Son 30 gunluk kayitlarda ortalama CSAT ",O&&O.avg_csat_score||"\u2014"," seviyesinde. En yogun kategori: ",O&&O.top_category||"\u2014","."]})]}),(0,p.jsxs)("div",{className:"sup-ai",children:[(0,p.jsx)("div",{className:"sup-ai-b",children:"SLA Risk Uyarisi"}),(0,p.jsxs)("div",{className:"sup-ai-t",children:[ls," ticket SLA ihlali riski tasiyor. Oncelik sirasina gore aksiyon alinmasi onerilir."]})]}),(0,p.jsxs)("div",{className:"sup-ai",children:[(0,p.jsx)("div",{className:"sup-ai-b",children:"Onerilen Yanit"}),(0,p.jsx)("div",{className:"sup-ai-t",children:rs?'"'.concat(rs.customer_name||rs.contact&&rs.contact.display_name||"Musteri",', talebinizi inceliyoruz. Guncellemeyi birazdan paylasacagiz."'):"Hazir yanit secmek icin bir ticket secin."}),(0,p.jsx)("div",{style:{marginTop:6},children:(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>rs&&Se("".concat(rs.customer_name||rs.contact&&rs.contact.display_name||"Musteri",", talebinizi inceliyoruz. Guncellemeyi birazdan paylasacagiz.")),children:"Yanit Kutusuna Ekle"})})]})]}),(0,p.jsxs)("div",{className:"sup-card",children:[(0,p.jsx)("div",{className:"sup-card-title",children:(0,p.jsx)("span",{children:"\ud83d\udcca Bugunun Ozeti"})}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Toplam acilan"}),(0,p.jsx)("span",{className:"v",children:Number(M&&M.total||s.length||0)})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Cozulen"}),(0,p.jsx)("span",{className:"v",children:Number(M&&M.resolved||0)})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Ilk yanit suresi (ort.)"}),(0,p.jsx)("span",{className:"v",children:As})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"SLA uyum orani"}),(0,p.jsx)("span",{className:"v",style:{color:"var(--cp-ok)"},children:zs})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Eskalasyon"}),(0,p.jsx)("span",{className:"v",style:{color:"var(--cp-warn)"},children:Number(O&&O.escalations||0)})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"En yogun kategori"}),(0,p.jsx)("span",{className:"v",children:O&&O.top_category||"\u2014"})]})]})]})]}),"categories"===ae&&(0,p.jsxs)("div",{className:"sup-g2",children:[(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"sup-srch",children:[(0,p.jsx)("input",{className:"sup-input",placeholder:"Kategori ara...",value:Ge,onChange:e=>Ye(e.target.value)}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-primary",onClick:()=>hs(null),children:"+ Kategori Ekle"})]}),(0,p.jsxs)("div",{className:"sup-card",children:[(0,p.jsx)("div",{className:"sup-card-title",children:(0,p.jsx)("span",{children:"\ud83d\udcc1 Ticket Kategorileri"})}),ps.map(e=>(0,p.jsxs)("div",{className:"sup-cat-item",children:[(0,p.jsxs)("div",{className:"sup-cat-info",children:[(0,p.jsx)("div",{className:"sup-cat-icon",children:e.icon}),(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{className:"sup-cat-name",children:e.key}),(0,p.jsxs)("div",{className:"sup-cat-count",children:[e.count," acik ticket \xb7 SLA: ",e.sla]}),e.description?(0,p.jsx)("div",{className:"sup-note",children:e.description}):null]})]}),(0,p.jsxs)("div",{className:"sup-cat-actions",children:[(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>hs(e),children:"\u270f\ufe0f"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-danger",onClick:()=>{Ie(e.key),fe(!0)},children:"\ud83d\uddd1\ufe0f"})]})]},e.key))]})]}),(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"sup-card",children:[(0,p.jsx)("div",{className:"sup-card-title",children:(0,p.jsx)("span",{children:"\ud83c\udff7\ufe0f Etiketler"})}),(0,p.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:ds.map(e=>(0,p.jsx)("span",{className:"sup-badge ".concat(e.badge),children:e.label},e.label))})]}),(0,p.jsxs)("div",{className:"sup-card",children:[(0,p.jsx)("div",{className:"sup-card-title",children:(0,p.jsx)("span",{children:"\ud83d\udcca Kategori Dagilimi"})}),es.length?es.map((e,a)=>{const t=Math.max(s.length,1),i=Math.round((e.count||0)/t*100),n=w[a%w.length];return(0,p.jsxs)("div",{style:{marginBottom:8},children:[(0,p.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,marginBottom:3},children:[(0,p.jsx)("span",{children:e.key}),(0,p.jsxs)("span",{style:{color:n,fontWeight:600},children:["%",i]})]}),(0,p.jsx)("div",{style:{height:6,borderRadius:3,background:"rgba(255,255,255,.05)"},children:(0,p.jsx)("div",{style:{height:"100%",width:"".concat(i,"%"),borderRadius:3,background:n}})})]},e.key)}):(0,p.jsx)("div",{className:"sup-empty",children:"Hen\xfcz kategori verisi yok"})]})]})]}),"canned"===ae&&(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{className:"sup-srch",children:[(0,p.jsx)("input",{className:"sup-input",placeholder:"Hazir yanit ara...",value:Ue,onChange:e=>We(e.target.value)}
1),(0,p.jsxs)("select",{className:"sup-select",value:Fe,onChange:e=>Ve(e.target.value),children:[(0,p.jsx)("option",{value:"all",children:"Tum Kategoriler"}),Array.from(new Set(ss.map(e=>e.category))).map(e=>(0,p.jsx)("option",{value:e,children:e},e))]}),(0,p.jsx)("button",{className:"sup-btn sup-btn-primary",onClick:()=>bs(null),children:"+ Yeni Hazir Yanit"})]}),(0,p.jsx)("div",{className:"sup-g2",children:gs.map((e,s)=>(0,p.jsx)("div",{children:e.length?e.map(e=>(0,p.jsxs)("div",{className:"sup-cr-item",children:[(0,p.jsxs)("div",{className:"sup-cr-title",children:[(0,p.jsx)("span",{children:e.title}),(0,p.jsx)("span",{className:"sup-badge ".concat(e.badge),children:e.category})]}),(0,p.jsxs)("div",{className:"sup-cr-cat",children:["Kisayol: ",e.shortcut||"\u2014"]}),(0,p.jsx)("div",{className:"sup-cr-text",children:e.text}),(0,p.jsxs)("div",{className:"sup-cr-actions",children:[(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>{navigator.clipboard.writeText(e.text).catch(()=>{}),l.message.success("Yanit kopyalandi")},children:"\ud83d\udccb Kopyala"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>bs(e),children:"\u270f\ufe0f Duzenle"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-danger",onClick:()=>{Re(e.id),we(!0)},children:"\ud83d\uddd1\ufe0f"})]})]},e.id)):(0,p.jsx)("div",{className:"sup-empty",children:"Bu kolonda gosterilecek hazir yanit yok."})},s))})]}),"settings"===ae&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"sup-set",children:[(0,p.jsxs)("div",{className:"sup-set-g",children:[(0,p.jsx)("div",{className:"sup-set-h",children:"\u23f1\ufe0f SLA Sureleri"}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Acil (saat)"}),(0,p.jsx)("input",{className:"sup-fi",type:"number",min:"1",value:Me.slaHoursByPriority.urgent,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{slaHoursByPriority:(0,i.A)((0,i.A)({},s.slaHoursByPriority),{},{urgent:Number(e.target.value||1)})}))})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Yuksek (saat)"}),(0,p.jsx)("input",{className:"sup-fi",type:"number",min:"1",value:Me.slaHoursByPriority.high,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{slaHoursByPriority:(0,i.A)((0,i.A)({},s.slaHoursByPriority),{},{high:Number(e.target.value||1)})}))})]})]}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Normal (saat)"}),(0,p.jsx)("input",{className:"sup-fi",type:"number",min:"1",value:Me.slaHoursByPriority.medium,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{slaHoursByPriority:(0,i.A)((0,i.A)({},s.slaHoursByPriority),{},{medium:Number(e.target.value||1)})}))})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Dusuk (saat)"}),(0,p.jsx)("input",{className:"sup-fi",type:"number",min:"1",value:Me.slaHoursByPriority.low,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{slaHoursByPriority:(0,i.A)((0,i.A)({},s.slaHoursByPriority),{},{low:Number(e.target.value||1)})}))})]})]}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Ilk Yanit (dk)"}),(0,p.jsx)("input",{className:"sup-fi",type:"number",min:"1",value:Me.firstResponseMinutes,onChange:Je("firstResponseMinutes",e=>Number(e||1))})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Eskalasyon Esigi (%)"}),(0,p.jsx)("input",{className:"sup-fi",type:"number",min:"1",max:"100",value:Me.escalationPercent,onChange:Je("escalationPercent",e=>Number(e||1))})]})]})]}),(0,p.jsxs)("div",{className:"sup-set-g",children:[(0,p.jsx)("div",{className:"sup-set-h",children:"\ud83d\udd04 Otomatik Atama"}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Otomatik atama aktif"}),(0,p.jsx)(H,{value:Me.autoAssign,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{autoAssign:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Round-robin dagilim"}),(0,p.jsx)(H,{value:Me.roundRobin,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{roundRobin:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Beceri bazli 
1yonlendirme"}),(0,p.jsx)(H,{value:Me.skillRouting,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{skillRouting:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Yogunluk dengeleme"}),(0,p.jsx)(H,{value:Me.loadBalancing,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{loadBalancing:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"VIP onceliklendirme"}),(0,p.jsx)(H,{value:Me.vipPrioritization,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{vipPrioritization:e}))})]})]}),(0,p.jsxs)("div",{className:"sup-set-g",children:[(0,p.jsx)("div",{className:"sup-set-h",children:"\ud83d\udd14 Bildirim Ayarlari"}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Yeni ticket bildirimi"}),(0,p.jsx)(H,{value:Me.notifyNewTicket,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{notifyNewTicket:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"SLA uyari bildirimi"}),(0,p.jsx)(H,{value:Me.notifySla,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{notifySla:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Eskalasyon bildirimi"}),(0,p.jsx)(H,{value:Me.notifyEscalation,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{notifyEscalation:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Musteri yanit bildirimi"}),(0,p.jsx)(H,{value:Me.notifyCustomerReply,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{notifyCustomerReply:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"CSAT bildirimi"}),(0,p.jsx)(H,{value:Me.notifyCsat,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{notifyCsat:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Gunluk ozet e-postasi"}),(0,p.jsx)(H,{value:Me.dailySummaryEmail,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{dailySummaryEmail:e}))})]})]}),(0,p.jsxs)("div",{className:"sup-set-g",children:[(0,p.jsx)("div",{className:"sup-set-h",children:"\ud83d\udd50 Calisma Saatleri"}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Hafta ici baslangic"}),(0,p.jsx)("input",{className:"sup-fi",type:"time",value:Me.weekdayStart,onChange:Je("weekdayStart")})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Hafta ici bitis"}),(0,p.jsx)("input",{className:"sup-fi",type:"time",value:Me.weekdayEnd,onChange:Je("weekdayEnd")})]})]}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Cumartesi baslangic"}),(0,p.jsx)("input",{className:"sup-fi",type:"time",value:Me.saturdayStart,onChange:Je("saturdayStart")})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Cumartesi bitis"}),(0,p.jsx)("input",{className:"sup-fi",type:"time",value:Me.saturdayEnd,onChange:Je("saturdayEnd")})]})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Pazar kapali"}),(0,p.jsx)(H,{value:Me.sundayClosed,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{sundayClosed:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Mesai disi AI bot"}),(0,p.jsx)(H,{value:Me.afterHoursBot,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{afterHoursBot:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Tatil gunleri otomatik yanit"}),(0,p.jsx)(H,{value:Me.holidayAutoReply,onChange:e=>Ke(s=>(0,i.A)((0,i.A)({},s),{},{holidayAutoReply:e}))})]}),(0,p.jsxs)("div",{className:"sup-set-r",children:[(0,p.jsx)("span",{className:"sl",children:"Saat dilimi"}),(0,p.jsx)("span",{className:"sv",children:Me.timezone})]})]})]}),(0,p.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:16},children:(0,p.jsx)("button",{className:"sup-btn sup-btn-primary",onClick:async()=>{try{F(!0),await ys({support_panel_config_json:Me},"Ayarlar kaydedildi")}catch(e){l.message.error(e&&e.response&&e.response.data&&e.response.data.message||"Ayarlar kaydedilemedi")}finally{F(!1)}},disabled:W,children:W?"Kaydediliyor...":"Ayarlari Kaydet"})})]})]})}),(0,p.jsx)(l.Drawer,{visible:oe,onClose:()=>ce(!1),title:rs?"TK-".concat(rs.id," \xb7 Ticket Detay"):"Ticket detayi",width:500,className:"sup-drawer",drawerStyle:{background:"var(--cp-elevated)"},bodyStyle:{background:"var(--cp-elevated)"},children:rs?(0,p.jsxs)("div",{children:[(0,p.jsxs)("div",{style:{display:"flex",gap:6,marginBottom:16,flexWrap:"wrap"},children:[(0,p.jsx)("span",{className:"sup-badge ".concat((h[rs.status]||h.open).badge),
1children:(h[rs.status]||h.open).label}),(0,p.jsx)("span",{className:"sup-badge ".concat((b[rs.priority]||b.medium).badge),children:(b[rs.priority]||b.medium).label}),(0,p.jsx)("span",{className:"sup-badge bg-p",children:rs.category||"Genel"})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"SLA Durumu"}),(0,p.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:12,marginBottom:4},children:[(0,p.jsxs)("span",{style:{fontWeight:700,color:T(rs)},children:["Kalan Sure: ",B(rs)]}),(0,p.jsxs)("span",{style:{color:"var(--cp-faint)"},children:["SLA: ",Me.slaHoursByPriority[rs.priority||"medium"]||Me.slaHoursByPriority.medium," saat"]})]}),(0,p.jsx)("div",{className:"sup-sla-bar",children:(0,p.jsx)("div",{className:"sup-sla-fill ".concat((Cs=S(rs.resolution_due_at),Cs>=75?"sup-sla-danger":Cs>=50?"sup-sla-warn":"sup-sla-ok")),style:{width:"".concat(S(rs.resolution_due_at),"%")}})})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"Musteri Bilgileri"}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Ad Soyad"}),(0,p.jsx)("span",{className:"v",children:rs.customer_name||rs.contact&&rs.contact.display_name||"Musteri"})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"E-posta"}),(0,p.jsx)("span",{className:"v",children:rs.customer_email||rs.contact&&rs.contact.email||"\u2014"})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Telefon"}),(0,p.jsx)("span",{className:"v",children:rs.customer_phone||rs.contact&&(rs.contact.phone_e164||rs.contact.wa_id)||"\u2014"})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Musteri Tipi"}),(0,p.jsx)("span",{className:"v",children:(0,p.jsx)("span",{className:"sup-badge ".concat(Ns.badge),children:Ns.label})})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Toplam Ticket"}),(0,p.jsx)("span",{className:"v",children:rs.contact&&rs.contact.ticket_count||1})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Ort. CSAT"}),(0,p.jsx)("span",{className:"v",style:{color:"var(--cp-ok)"},children:rs.contact&&rs.contact.avg_csat||"\u2014"})]})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"Ticket Bilgileri"}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Konu"}),(0,p.jsx)("span",{className:"v",children:rs.subject||"\u2014"})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Kategori"}),(0,p.jsx)("span",{className:"v",children:rs.category||"Genel"})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Olusturulma"}),(0,p.jsx)("span",{className:"v",children:A(rs.created_at)})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Atanan"}),(0,p.jsx)("span",{className:"v",children:rs.assigned_to||"Atanmamis"})]}),(0,p.jsxs)("div",{className:"sup-dr",children:[(0,p.jsx)("span",{className:"l",children:"Etiketler"}),(0,p.jsx)("span",{className:"v",children:E(rs.tags_json).length?E(rs.tags_json).map(e=>(0,p.jsx)("span",{className:"sup-badge bg-p",style:{marginLeft:4},children:e},e)):"\u2014"})]})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"AI Analiz"}),(0,p.jsxs)("div",{className:"sup-ai",children:[(0,p.jsx)("div",{className:"sup-ai-b",children:"Duygu Analizi"}),(0,p.jsxs)("div",{className:"sup-ai-t",children:["Musteri ",rs.sentiment_score?"(skor: ".concat(rs.sentiment_score,"/5)"):"(skor verisi yok)"," gorunuyor. C
1ozum odakli yanit onerilir."]})]}),(0,p.jsxs)("div",{className:"sup-ai",children:[(0,p.jsx)("div",{className:"sup-ai-b",children:"Onerilen Yanit"}),(0,p.jsxs)("div",{className:"sup-ai-t",children:['"',rs.customer_name||rs.contact&&rs.contact.display_name||"Sayin Musteri",', talebinizi inceliyoruz. Guncellemeyi en kisa surede paylasacagiz."']}),(0,p.jsx)("div",{style:{marginTop:6},children:(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-primary",onClick:()=>Se("".concat(rs.customer_name||rs.contact&&rs.contact.display_name||"Sayin Musteri",", talebinizi inceliyoruz. Guncellemeyi en kisa surede paylasacagiz.")),children:"Yanit Kutusuna Ekle"})})]})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"Konusma Gecmisi"}),(0,p.jsxs)("div",{className:"sup-conv",children:[(0,p.jsxs)("div",{className:"sup-msg sup-msg-c",children:[(0,p.jsxs)("div",{className:"sup-msg-h",children:[(0,p.jsx)("span",{className:"n",style:{color:"var(--cp-info)"},children:rs.customer_name||rs.contact&&rs.contact.display_name||"Musteri"}),(0,p.jsx)("span",{className:"t",children:A(rs.created_at).split(" ")[1]||""})]}),rs.description||"Destek talebi acildi."]}),rs.resolution_text?(0,p.jsxs)("div",{className:"sup-msg sup-msg-a",children:[(0,p.jsxs)("div",{className:"sup-msg-h",children:[(0,p.jsx)("span",{className:"n",children:"Destek Uzmani"}),(0,p.jsx)("span",{className:"t"})]}
1),rs.resolution_text]}):null]})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"Hizli Islemler"}),(0,p.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-primary",onClick:()=>fs(rs,"in_progress","Durum islemde olarak guncellendi"),children:"Isleme Al"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-warn",onClick:()=>fs(rs,"waiting_customer","Durum beklemede olarak guncellendi"),children:"Beklemeye Al"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-green",onClick:()=>fs(rs,"resolved","Ticket cozuldu olarak isaretlendi"),children:"Cozuldu"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>(async e=>{try{await o.Ay.post(c.A.supportTickets.update,{id:e.id,priority:"urgent",status:"in_progress",resolution_text:[e.resolution_text,"Eskalasyon: Ust seviyeye aktarildi."].filter(Boolean).join("\n")}),l.message.success("Ticket eskalasyon kuyru\u011funa alindi"),$e()}catch(s){l.message.error(s&&s.response&&s.response.data&&s.response.data.message||"Eskalasyon basarisiz")}})(rs),children:"Eskale Et"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm",onClick:()=>{xs(rs),ce(!1)},children:"Duzenle"}),(0,p.jsx)("button",{className:"sup-btn sup-btn-sm sup-btn-danger",onClick:()=>{be(!0),ce(!1)},children:"Sil"})]})]}),(0,p.jsxs)("div",{className:"sup-drw-s",children:[(0,p.jsx)("h3",{children:"Yanit Gonder"}),(0,p.jsx)("div",{style:{marginBottom:8},children:(0,p.jsx)("textarea",{className:"sup-textarea",placeholder:"Musteriye yanitinizi yazin...",value:Ce,onChange:e=>Se(e.target.value)})}),Te?(0,p.jsx)("div",{style:{marginBottom:8},children:(0,p.jsxs)("select",{className:"sup-select",style:{width:"100%"},onChange:e=>{const s=ss.find(s=>s.id===e.target.value);s&&Se(s.text)},children:[(0,p.jsx)("option",{value:"",children:"Hazir yanit secin"}),ss.map(e=>(0,p.jsxs)("option",{value:e.id,children:[e.title," \xb7 ",e.category]},e.id))]})}):null,(0,p.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,p.jsx)("button",{className:"sup-btn sup-btn-primary",onClick:async()=>{if(rs)if(Ce.trim())try{const e=await ks(rs);if(!e||!e.conversationId)return void l.message.error("Bu ticket icin konusma kaydi otomatik olusturulamadi.");await o.Ay.post(c.A.messages.send,{conversation_id:e.conversationId,text_body:Ce.trim()}),await o.Ay.post(c.A.supportTickets.update,{id:rs.id,resolution_text:Ce.trim(),status:"waiting_customer",first_response_at:rs.first_response_at||(new Date).toISOString()}),l.message.success("Yanit gonderildi"),Se(""),Be(!1),$e()}catch(e){l.message.error(e&&e.response&&e.response.data&&e.response.data.message||e.message||"Yanit gonderilemedi")}else l.message.error("Gonderilecek yanit bos olamaz")},children:"Gonder"}),(0,p.jsx)("button",{className:"sup-btn",onClick:()=>Be(e=>!e),children:"Hazir Yanit"})]})]})]}):(0,p.jsx)("div",{className:"sup-empty",children:"Detay gosterilecek ticket bulunamadi."})}),(0,p.jsxs)(l.Modal,{visible:de,onCancel:()=>{pe(!1),xe(null)},onOk:()=>vs("new"),okText:"Olustur",cancelText:"Iptal",title:"Yeni Ticket Olustur",className:"sup-modal",children:[(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Musteri Adi"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.customer_name,onChange:qe("customer_name"),placeholder:"Musteri adi girin"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Musteri E-posta"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.customer_email,onChange:qe("customer_email"),placeholder:"E-posta adresi"})]})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Musteri Telefon"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.customer_phone,onChange:qe("customer_phone"),placeholder:"Telefon numarasi"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Konu"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.subject,onChange:qe("subject"),placeholder:"Ticket konusu"})]}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Oncelik"}),(0,p.jsx)("select",{className:"sup-fs",value:Ae.priority,onChange:qe("priority"),children:Object.keys(b).map(e=>(0,p.jsx)("option",{value:e,children:b[e].label},e))})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Kategori"}),(0,p.jsxs)("select",{className:"sup-fs",value:Ae.category,onChange:qe("category"),children:[(0,p.jsx)("option",{value:"",children:"Kategori secin"}),es.map(e=>(0,p.jsx)("option",{value:e.key,children:e.key},e.key))]})]})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Etiketler"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.tags_input,onChange:qe("tags_input"),placeholder:"Etiket girin (virgul ile ayirin)"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Aciklama"}),(0,p.jsx)("textarea",{className:"sup-ft",placeholder:"Ticket detayini yazin...",value:Ae.description,onChange:qe("description")})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Atanan Uzman"}),(0,p.jsxs)("select",{className:"sup-fs",value:Ae.assigned_user_id,onChange:qe("assigned_user_id"),children:[(0,p.jsx)("option",{value:"",children:"Otomatik Ata"}),ms.map(e=>(0,p.jsx)("option",{value:e.id,children:e.full_name||e.email||"Kullanici ".concat(e.id)},e.id))]})]})]}),(0,p.jsxs)(l.Modal,{visible:ue,onCancel:()=>{me(!1),xe(null)},onOk:()=>vs("edit"),okText:"Kaydet",cancelText:"Iptal",title:ge?"Ticket Duzenle \u2014 TK-".concat(ge):"Ticket Duzenle",className:"sup-modal",forceRender:!0,children:[(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Musteri Adi"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.customer_name,onChange:qe("customer_name"),placeholder:"Musteri adi"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Musteri E-posta"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.customer_email,onChange:qe("customer_email"),placeholder:"Musteri e-posta"})]})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Musteri Telefon"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.customer_phone,onChange:qe("customer_phone"),placeholder:"Musteri telefon"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Konu"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.subject,onChange:qe("subject"),placeholder:"Ticket konusu"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Aciklama"}),(0,p.jsx)("textarea",{className:"sup-ft",placeholder:"Ticket detayini guncelleyin...",value:Ae.description,onChange:qe("description")})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Durum"}),(0,p.jsx)("select",{className:"sup-fs",value:Ae.status,onChange:qe("status"),children:Object.keys(h).map(e=>(0,p.jsx)("option",{value:e,children:h[e].label},e))})]}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Oncelik"}),(0,p.jsx)("select",{className:"sup-fs",value:Ae.priority,onChange:qe("priority"),children:Object.keys(b).map(e=>(0,p.jsx)("option",{value:e,children:b[e].label},e))})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Kategori"}),(0,p.jsx)("select",{className:"sup-fs",value:Ae.category,onChange:qe("category"),children:es.map(e=>(0,p.jsx)("option",{value:e.key,children:e.key},e.key))})]})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Atanan Uzman"}),(0,p.jsxs)("select",{className:"sup-fs",value:Ae.assigned_user_id,onChange:qe("assigned_user_id"),children:[(0,p.jsx)("option",{value:"",children:"Atanmamis"}),ms.map(e=>(0,p.jsx)("option",{value:e.id,children:e.full_name||e.email||"Kullanici ".concat(e.id)},e.id))]})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Etiketler"}),(0,p.jsx)("input",{className:"sup-fi",value:Ae.tags_input,onChange:qe("tags_input"),placeholder:"Etiketler"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Dahili Not"}),(0,p.jsx)("textarea",{className:"sup-ft",placeholder:"Ekip icin dahil
1i not ekleyin...",value:Ae.resolution_text,onChange:qe("resolution_text")})]})]}),(0,p.jsx)(l.Modal,{visible:he,onCancel:()=>be(!1),onOk:async()=>{if(rs)try{await o.Ay.post(c.A.supportTickets.delete,{id:rs.id}),l.message.success("Ticket silindi"),be(!1),ce(!1),ne(null),$e()}catch(e){l.message.error(e&&e.response&&e.response.data&&e.response.data.message||"Ticket silinemedi")}},okText:"Sil",cancelText:"Vazgec",title:"Ticket Sil",className:"sup-modal",okButtonProps:{danger:!0},children:(0,p.jsxs)("div",{style:{textAlign:"center"},children:[(0,p.jsx)("div",{className:"sup-del-i",children:"\ud83d\uddd1\ufe0f"}),(0,p.jsx)("p",{style:{fontSize:14,fontWeight:600,marginBottom:6},children:"Bu ticketi silmek istediginize emin misiniz?"}),(0,p.jsx)("p",{style:{fontSize:12,color:"var(--cp-faint)"},children:"Bu islem geri alinamaz."})]})}),(0,p.jsxs)(l.Modal,{visible:ke,onCancel:()=>Ne(!1),onOk:async()=>{const e=String(De.title||"").trim(),s=String(De.text||"").trim();if(!e||!s)return void l.message.error("Hazir yanit basligi ve metni zorunlu");const a=Le||"cr-".concat(Date.now()),t=ss.map(e=>e).filter(e=>e.id!==Le).concat({id:a,title:e,category:De.category||"Genel",shortcut:De.shortcut||"",text:s,badge:De.badge||"bg-p"});try{await ys({support_canned_responses_json:t},Le?"Hazir yanit guncellendi":"Hazir yanit eklendi"),Ne(!1),Re(""),Oe(N)}catch(i){l.message.error(i&&i.response&&i.response.data&&i.response.data.message||"Hazir yanit kaydedilemedi")}},okText:"Kaydet",cancelText:"Iptal",title:"Hazir Yanit Ekle / Duzenle",className:"sup-modal",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Yanit Basligi"}),(0,p.jsx)("input",{className:"sup-fi",value:De.title,onChange:Qe("title"),placeholder:"Orn: Hosgeldiniz Mesaji"})]}),(0,p.jsxs)("div",{className:"sup-form-row",children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Kategori"}),(0,p.jsx)("select",{className:"sup-fs",value:De.category,onChange:Qe("category"),children:Array.from(new Set(["Genel",...es.map(e=>e.key),...ss.map(e=>e.category)])).map(e=>(0,p.jsx)("option",{value:e,children:e},e))})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Kisayol"}),(0,p.jsx)("input",{className:"sup-fi",value:De.shortcut,onChange:Qe("shortcut"),placeholder:"Orn: /hosgeldin"})]})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Yanit Metni"}),(0,p.jsx)("textarea",{className:"sup-ft",style:{minHeight:120},value:De.text,onChange:Qe("text"),placeholder:"Hazir yanit metnini yazin."})]})]}),(0,p.jsxs)(l.Modal,{visible:je,onCancel:()=>ye(!1),onOk:async()=>{const e=String(Ee.key||"").trim();if(!e)return void l.message.error("Kategori adi zorunlu");const s=es.map(e=>{let{color:s,count:a}=e;return(0,t.A)(e,g)}).filter(e=>e.key!==Pe).concat({key:e,icon:Ee.icon||"\ud83d\udcc1",sla:Ee.sla||"4 saat",description:Ee.description||""});try{await ys({support_categories_json:s},Pe?"Kategori guncellendi":"Kategori eklendi"),ye(!1),Ie(""),He(k)}catch(a){l.message.error(a&&a.response&&a.response.data&&a.response.data.message||"Kategori kaydedilemedi")}},okText:"Kaydet",cancelText:"Iptal",title:"Kategori Ekle / Duzenle",className:"sup-modal",width:420,children:[(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Kategori Adi"}),(0,p.jsx)("input",{className:"sup-fi",value:Ee.key,onChange:Xe("key"),placeholder:"Orn: Fatura / Odeme"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Ikon (Emoji)"}),(0,p.jsx)("input",{className:"sup-fi",value:Ee.icon,onChange:Xe("icon"),placeholder:"Orn: \ud83d\udcb3"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"SLA Suresi"}),(0,p.jsx)("input",{className:"sup-fi",value:Ee.sla,onChange:Xe("sla"),placeholder:"Orn: 2 saat"})]}),(0,p.jsxs)("div",{className:"sup-form-group",children:[(0,p.jsx)("label",{className:"sup-form-label",children:"Aciklama"}),(0,p.jsx)("textarea",{className:"sup-ft",value:Ee.description,onChange:Xe("description"),placeholder:"Kategori aciklamasi..."})]})]}),(0,p.jsx)(l.Modal,{visible:ve,onCancel:()=>fe(!1),onOk:async()=>
1{if(!Pe)return;const e=es.map(e=>{let{color:s,count:a}=e;return(0,t.A)(e,x)}).filter(e=>e.key!==Pe);try{await ys({support_categories_json:e},"Kategori silindi"),fe(!1),Ie("")}catch(s){l.message.error(s&&s.response&&s.response.data&&s.response.data.message||"Kategori silinemedi")}},okText:"Sil",cancelText:"Vazgec",title:"Kategori Sil",className:"sup-modal",okButtonProps:{danger:!0},children:(0,p.jsx)("p",{style:{color:"var(--cp-text2)",marginBottom:0},children:"Secili kategori kayittan kaldirilacak. Ticketlar silinmez, sadece kategori listesi guncellenir."})}),(0,p.jsx)(l.Modal,{visible:_e,onCancel:()=>we(!1),onOk:async()=>{if(!Le)return;const e=ss.filter(e=>e.id!==Le);try{await ys({support_canned_responses_json:e},"Hazir yanit silindi"),we(!1),Re("")}catch(s){l.message.error(s&&s.response&&s.response.data&&s.response.data.message||"Hazir yanit silinemedi")}},okText:"Sil",cancelText:"Vazgec",title:"Hazir Yanit Sil",className:"sup-modal",okButtonProps:{danger:!0},children:(0,p.jsx)("p",{style:{color:"var(--cp-text2)",marginBottom:0},children:"Secili hazir yanit kayittan kaldirilacak."})})]});var Cs}}}]);
2//# sourceMappingURL=5671.2ad34490.chunk.js.map

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.