1import{j as e}from"./vendor-radix-08a60bdd.js";import{u as t,r as s}from"./vendor-react-9016e4a2.js";import{s as r,B as a}from"./index-06245da3.js";import{h as d,s as n,m as l,a as o,r as i,d as m,w as x,b as c,c as u,e as g,f as h,g as f}from"./dashboardAggregation-b89a2d0c.js";import{o as p,a as b,b as j}from"./orderStatus-e825b32c.js";import{f as v,c as N,a as y}from"./financePeriods-4da83fad.js";import{f as k,a as w,p as S}from"./vendor-date-f65bd227.js";import{R as _,c as C,d as M,Z as E,e as $,f as T,B as D,g as R,h as A,F as B,T as z,i as I,j as F,k as O,l as G,M as P,m as V,n as Y}from"./vendor-icons-f2656d21.js";import{t as H}from"./tr-9c33e812.js";import"./vendor-supabase-36eb0853.js";import"./vendor-capacitor-43d743f6.js";import"./vendor-motion-a26fe6c4.js";import"./fetchAllRows-05f3b6e2.js";const L=[{key:"today",days:1,offset:0,label:"Bugün"},{key:"yday",days:1,offset:1,label:"Dün"},{key:"d7",days:7,offset:0,label:"7 gün"},{key:"d30",days:30,offset:0,label:"30 gün"}],U=[{key:"orders",label:"SipariÅ",unit:"adet"},{key:"gmv",label:"Ciro",unit:"â¬"},{key:"revenue",label:"Gelir",unit:"â¬"}],q=e=>`â¬${Number(e||0).toFixed(2)}`,Z=e=>Number(e||0).toLocaleString("tr-TR"),J=(e,t)=>"orders"===t?Z(e.orders):q(e[t]);function K({value:t,size:s="sm"}){if(null==t)return null;const r="sm"===s?"text-[10px]":"text-xs";if(0===t)return e.jsxs("span",{className:`inline-flex items-center gap-0.5 ${r} font-semibold text-muted-foreground/60`,children:[e.jsx(P,{className:"h-2.5 w-2.5"}),"0%"]});const a=t>0;return e.jsxs("span",{className:`inline-flex items-center gap-0.5 ${r} font-semibold ${a?"text-emerald-500 dark:text-emerald-400":"text-red-500 dark:text-red-400"}`,children:[a?e.jsx(V,{className:"h-2.5 w-2.5"}):e.jsx(Y,{className:"h-2.5 w-2.5"}),a?"+":"",t.toFixed(1),"%"]})}function Q({icon:t,label:s,value:r,sub:a,trend:d,accent:n,onClick:l}){return e.jsxs("div",{onClick:l,className:`rounded-xl border p-3.5 sm:p-5 transition-colors ${n?"bg-emerald-50 dark:bg-emerald-950/30 border-emerald-200 dark:border-emerald-500/20":"bg-card border-border"} ${l?"cursor-pointer hover:border-primary/30":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2 sm:mb-3",children:[e.jsx("span",{className:"text-[10px] sm:text-[11px] font-semibold text-muted-foreground uppercase tracking-widest leading-tight",children:s}),e.jsx(t,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 shrink-0 "+(n?"text-emerald-500 dark:text-emerald-400":"text-muted-foreground/50")})]}),e.jsx("div",{className:"text-xl sm:text-2xl font-bold tracking-tight "+(n?"text-emerald-600 dark:text-emerald-400":"text-foreground"),children:r}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mt-1 sm:mt-1.5",children:[a&&e.jsx("span",{className:"text-[10px] sm:text-xs text-muted-foreground/70",children:a}),e.jsx(K,{value:d})]})]})}function W({status:t}){return e.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded-full ${b(t)}`,children:j(t)})}function X({values:t}){const s=Math.max(...t,1);return e.jsx("div",{className:"flex items-end gap-[2px] h-6","aria-hidden":"true",children:t.map((r,a)=>e.jsx("div",{className:"w-1 rounded-sm "+(a===t.length-1?"bg-emerald-500/70 dark:bg-emerald-400/70":"bg-muted-foreground/25"),style:{height:`${r>0?Math.max(r/s*100,12):3}%`}},a))})}function ee({rank:t,muted:s}){return e.jsx("span",{className:`shrink-0 w-6 h-6 rounded-lg grid place-items-center text-[11px] font-bold tabular-nums ${s?"bg-muted text-muted-foreground/60":{1:"bg-amber-400/20 text-amber-600 dark:text-amber-300 ring-1 ring-amber-400/40",2:"bg-slate-400/20 text-slate-600 dark:text-slate-300 ring-1 ring-slate-400/40",3:"bg-orange-500/15 text-orange-600 dark:text-orange-400 ring-1 ring-orange-500/30"}[t]||"bg-muted text-muted-foreground"}`,children:t})}function te({entry:t,rank:s,metric:r,leaderValue:a,onClick:d}){const n=t[r]??0,l=a>0?n/a*100:0,o=0===t.orders;return e.jsxs("button",{onClick:d,className:"w-full text-left px-3 sm:px-4 py-2.5 hover:bg-muted/40 transition-colors flex items-center gap-2.5 sm:gap-3",children:[e.jsx(ee,{rank:s,muted:o}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs sm:text-sm font-medium truncate "+(o?"text-muted-foreground":"text-foreground"),children:t.restaurant.name}),t.restaurant.is_test&&e.jsx(B,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Test restoranı"})]}),e.jsx("div",{className:"mt-1 h-1 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500 "+(1===s?"bg-emerald-500 dark:bg-emerald-400":"bg-muted-foreground
1/40"),style:{width:`${Math.max(l,o?0:2)}%`}})}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-muted-foreground/70",children:[t.restaurant.city&&e.jsx("span",{className:"truncate",children:t.restaurant.city}),t.completed>0&&e.jsxs("span",{children:["ort. ",q(t.avgBasket)]}),t.cancelled>0&&e.jsxs("span",{className:"text-red-500/80 dark:text-red-400/80",children:["%",Math.round(t.cancelRate)," iptal"]})]})]}),e.jsx("div",{className:"hidden sm:block shrink-0",children:e.jsx(X,{values:t.spark})}),e.jsxs("div",{className:"text-right shrink-0 w-[76px] sm:w-[92px]",children:[e.jsx("div",{className:"text-sm font-bold tabular-nums "+(o?"text-muted-foreground/60":"text-foreground"),children:J(t,r)}),e.jsx("div",{className:"flex items-center justify-end gap-1 mt-0.5",children:null===t.trend[r]?e.jsx(P,{className:"h-2.5 w-2.5 text-muted-foreground/40"}):e.jsx(K,{value:t.trend[r]})})]})]})}function se(){const b=t(),[j,P]=s.useState(!0),[V,Y]=s.useState(!1),[J,X]=s.useState(null),[ee,se]=s.useState(null),[re,ae]=s.useState([]),[de,ne]=s.useState(null),[le,oe]=s.useState([]),[ie,me]=s.useState([]),[xe,ce]=s.useState([]),[ue,ge]=s.useState("today"),[he,fe]=s.useState("orders"),[pe,be]=s.useState(!1),je=s.useCallback(async(e=!1)=>{e?Y(!0):P(!0),X(null);try{const[e,t,s,a,d]=await Promise.all([r.from("restaurants").select("id, name, city, status, is_test, created_at, billing_model, flat_fee_net, commission_own_site, commission_marketplace").order("created_at",{ascending:!1}),v(75),r.from("orders").select("id, short_id, restaurant_id, total_price, total_amount, status, created_at, order_type, restaurants(name)").order("created_at",{ascending:!1}).limit(15),r.from("invoices").select("id, commission_amount, status, due_date, restaurant_id, restaurants(name)").in("status",["PENDING","OVERDUE"]).order("due_date",{ascending:!0}).limit(50),r.from("billing_settings").select("default_unit_fee, marketplace_unit_fee").eq("id",1).maybeSingle()]);if(e.error)throw new Error(`Restoranlar: ${e.error.message}`);if(t.error)throw new Error(`Günlük istatistik: ${t.error.message}`);if(s.error)throw new Error(`Son sipariÅler: ${s.error.message}`);ae(e.data||[]),oe(t.data||[]),me(s.data||[]),ce(a.data||[]),ne(d.data||null),se(new Date)}catch(t){X(t.message)}finally{P(!1),Y(!1)}},[]);s.useEffect(()=>{je()},[je]),s.useEffect(()=>{let e=null;const t=()=>{e||(e=setInterval(()=>{"visible"===document.visibilityState&&je(!0)},12e4))},s=()=>{e&&(clearInterval(e),e=null)},r=()=>{"visible"===document.visibilityState?t():s()};return"visible"===document.visibilityState&&t(),document.addEventListener("visibilitychange",r),()=>{s(),document.removeEventListener("visibilitychange",r)}},[je]);const ve=s.useMemo(()=>new Map(re.map(e=>[e.id,e])),[re]),Ne=s.useMemo(()=>{const e=d(),t=n(e,-1),s=l(e),r=(e,t)=>g(i(le,e,t),ve,de),a=r(e,e),x=r(t,t),c=r(s.from,s.to),u=r(s.prevFrom,s.prevTo),f=N(y("this_month",e),e),p=f?r(f.from,f.to):null,b=f?r(f.prevFrom,f.prevTo):null,j=e=>f?h(p[e],b[e]):null,v=n(e,-6),k=o(i(le,v,e)),w=o(i(le,e,e)).size,S=re.filter(e=>"active"===e.status&&!e.is_test&&!k.has(e.id)),_=new Date,C=xe.filter(e=>"OVERDUE"===e.status||"PENDING"===e.status&&new Date(e.due_date)<_),M=m(le,v,e,ve,de);return{today:e,todayStats:a,yestStats:x,monthStats:c,prevMonthStats:u,monthTrend:{revenue:j("revenue"),gmv:j("gmv"),orders:j("orders")},activeToday:w,totalActive:re.filter(e=>"active"===e.status).length,totalRestaurants:re.length,silentRestaurants:S,overdueInvoices:C,overdueAmount:C.reduce((e,t)=>e+(Number(t.commission_amount)||0),0),chart:M,maxChartOrders:Math.max(...M.map(e=>e.orders),1),newThisMonth:re.filter(e=>(e.created_at||"").slice(0,10)>=s.from).length,flatYearlyCount:re.filter(e=>"flat_yearly"===e.billing_model).length,flatMonthlyCount:re.filter(e=>"flat_monthly"===e.billing_model).length,lifetimeCount:re.filter(e=>"lifetime"===e.billing_model).length}},[le,re,ve,xe,de]),ye=s.useMemo(()=>{const e=d(),t=L.find(e=>e.key===ue)??L[0],s=x(n(e,-t.offset),t.days),r={from:n(e,-6),to:e},a=o(i(le,s.from,s.to)),l=re.filter(e=>"active"===e.status||a.has(e.id)),m=c({rows:le,restaurants:l,win:s,billingSettings:de,spark:r}),h=m.filter(e=>e.restaurant.is_test),f=m.filter(e=>!e.restaurant.is_test),p=u(pe?m:f,he);return{win:s,conf:t,rows:p,totals:g(i(le,s.from,s.to),ve,de),testCount:h.length,testOrders:h.reduce((e,t)=>
1e+t.orders,0),hasAny:p.some(e=>e.orders>0)}},[le,re,ve,de,ue,he,pe]),ke=(new Date).getHours(),we=ke<5?"İyi geceler":ke<12?"Günaydın":ke<17?"İyi günler":"İyi akÅamlar";if(j)return e.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[e.jsx("div",{className:"h-10 w-48 sm:w-64 bg-muted rounded-lg animate-pulse"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:gap-3 lg:grid-cols-4",children:[1,2,3,4].map(t=>e.jsx("div",{className:"h-24 sm:h-28 bg-card border border-border rounded-xl animate-pulse"},t))}),e.jsx("div",{className:"h-72 bg-card border border-border rounded-xl animate-pulse"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-3 sm:gap-4",children:[e.jsx("div",{className:"lg:col-span-3 h-40 sm:h-48 bg-card border border-border rounded-xl animate-pulse"}),e.jsx("div",{className:"lg:col-span-2 h-40 sm:h-48 bg-card border border-border rounded-xl animate-pulse"})]})]});const Se=U.find(e=>e.key===he)?.label??"";return e.jsxs("div",{className:"space-y-5",lang:"tr",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-lg sm:text-xl font-bold text-foreground truncate",children:we}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground font-normal",children:k(new Date,"d MMMM yyyy, EEEE",{locale:H})}),e.jsx("p",{className:"text-xs text-muted-foreground/50 mt-0.5",children:ee?`${w(ee,{addSuffix:!0,locale:H})} güncellendi`:"Yükleniyorâ¦"})]}),e.jsxs(a,{variant:"outline",size:"sm",onClick:()=>je(!0),disabled:V,className:"h-8 shrink-0",children:[e.jsx(_,{className:"h-3.5 w-3.5 mr-1.5 "+(V?"animate-spin":"")}),e.jsx("span",{className:"hidden sm:inline",children:"Yenile"})]})]}),J&&e.jsxs("div",{className:"flex items-center gap-3 bg-red-500/10 border border-red-500/20 rounded-xl px-4 py-3 text-sm text-red-600 dark:text-red-300",children:[e.jsx(C,{className:"h-4 w-4 shrink-0 text-red-500 dark:text-red-400"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold",children:"Veri yüklenemedi â "}),J,e.jsx("button",{onClick:()=>je(),className:"underline ml-2 hover:text-red-500 dark:hover:text-red-200",children:"Tekrar dene"})]})]}),Ne.overdueInvoices.length>0&&e.jsxs("button",{onClick:()=>b("/admin/super/finance"),className:"w-full flex items-center gap-3 bg-red-500/8 border border-red-500/20 rounded-xl px-4 py-3 text-sm text-left hover:border-red-500/40 transition-colors",children:[e.jsx(C,{className:"h-4 w-4 shrink-0 text-red-500 dark:text-red-400"}),e.jsxs("span",{className:"text-red-600 dark:text-red-300 font-medium",children:[Ne.overdueInvoices.length," vadesi geçmiÅ fatura"," · ",q(Ne.overdueAmount)," ödenmemiÅ"]}),e.jsx(M,{className:"h-4 w-4 text-red-500 ml-auto"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(E,{className:"h-3.5 w-3.5 text-amber-500 dark:text-amber-400"}),e.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-widest",children:"Bugünün nabzı"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3 lg:grid-cols-4",children:[e.jsx(Q,{icon:$,label:"Bugünkü sipariÅ",value:Z(Ne.todayStats.orders),sub:`${Ne.todayStats.completed} tamamlandı`,trend:h(Ne.todayStats.orders,Ne.yestStats.orders)}),e.jsx(Q,{icon:T,label:"Bugünkü ciro",value:q(Ne.todayStats.gmv),sub:"Brüt sipariÅ hacmi",trend:h(Ne.todayStats.gmv,Ne.yestStats.gmv)}),e.jsx(Q,{icon:D,label:"Bugünkü gelir",value:q(Ne.todayStats.revenue),sub:f(de,Ne.flatYearlyCount,Ne.flatMonthlyCount,Ne.lifetimeCount),trend:h(Ne.todayStats.revenue,Ne.yestStats.revenue),accent:!0}),e.jsx(Q,{icon:R,label:"SipariÅ alan restoran",value:String(Ne.activeToday),sub:`${Ne.totalActive} aktif restoran içinde`,onClick:()=>b("/admin/super/restaurants")})]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"px-3.5 sm:px-5 py-3 sm:py-4 border-b border-border space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4 text-amber-500 dark:text-amber-400"}),e.jsx("h3",{className:"text-xs sm:text-sm font-semibold text-foreground",children:"Restoran ligi"}),e.jsxs("span",{className:"ml-auto text-[10px] sm:text-xs text-muted-foreground
1/70 tabular-nums",children:[Z(ye.totals.orders)," sipariŠ· ",q(ye.totals.gmv)," ciro · ",q(ye.totals.revenue)," gelir"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5 bg-muted/40",children:L.map(t=>e.jsx("button",{onClick:()=>ge(t.key),className:"px-2.5 py-1 text-[11px] font-semibold rounded-md transition-colors "+(ue===t.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.label},t.key))}),e.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5 bg-muted/40",children:U.map(t=>e.jsx("button",{onClick:()=>fe(t.key),className:"px-2.5 py-1 text-[11px] font-semibold rounded-md transition-colors "+(he===t.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.label},t.key))}),e.jsxs("span",{className:"text-[10px] text-muted-foreground/60 ml-auto hidden sm:block",children:[Se," · önceki ",1===ye.win.days?"güne":`${ye.win.days} güne`," göre",ye.conf.offset>0&&` · ${ye.win.to}`]})]})]}),ye.hasAny?e.jsx("div",{className:"divide-y divide-border/60",children:ye.rows.map((t,s)=>e.jsx(te,{entry:t,rank:s+1,metric:he,leaderValue:ye.rows[0]?.[he]??0,onClick:()=>b(`/admin/super/restaurants/${t.restaurant.id}/orders`)},t.restaurant.id))}):e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(A,{className:"h-8 w-8 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Bu dönemde hiç sipariÅ yok."}),e.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Daha geniÅ bir pencere seçmeyi deneyin."})]}),ye.testCount>0&&e.jsxs("button",{onClick:()=>be(e=>!e),className:"w-full px-3.5 sm:px-5 py-2.5 border-t border-border text-[11px] text-muted-foreground hover:text-foreground flex items-center gap-2 transition-colors",children:[e.jsx(B,{className:"h-3 w-3 text-amber-500"}),pe?`${ye.testCount} test restoranı listede â gizle`:`${ye.testCount} test restoranı listede deÄil (${Z(ye.testOrders)} sipariÅ) â göster`,e.jsx(M,{className:"h-3 w-3 ml-auto transition-transform "+(pe?"rotate-90":"")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-4",children:[e.jsxs("div",{className:"lg:col-span-3 bg-card border border-border rounded-xl p-3.5 sm:p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3 sm:mb-5",children:[e.jsx(z,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"text-xs sm:text-sm font-semibold text-foreground",children:"SipariÅ â son 7 gün"}),e.jsxs("span",{className:"ml-auto text-[10px] sm:text-xs text-muted-foreground/60",children:["toplam ",Z(Ne.chart.reduce((e,t)=>e+t.orders,0))]})]}),e.jsx("div",{className:"flex items-end gap-1.5 sm:gap-2",style:{height:80},children:Ne.chart.map(t=>{const s=t.orders/Ne.maxChartOrders*100,r=t.orders>0?Math.max(s,5):0,a=t.day===Ne.today;return e.jsxs("div",{className:"group relative flex-1 flex flex-col items-center h-full justify-end",children:[e.jsx("div",{className:"w-full rounded-t transition-all duration-500 "+(a?"bg-emerald-500/40 border-t-2 border-emerald-500 dark:border-emerald-400":"bg-muted-foreground/20 border-t-2 border-muted-foreground/30"),style:{height:`${r}%`}}),t.orders>0&&e.jsx("div",{className:"absolute bottom-full mb-2 left-1/2 -translate-x-1/2 hidden group-hover:block z-20 pointer-events-none",children:e.jsxs("div",{className:"bg-popover border border-border text-[10px] px-2.5 py-1.5 rounded-lg shadow-xl whitespace-nowrap",children:[e.jsx("div",{className:"font-semibold text-foreground",children:k(S(t.day),"d MMMM, EEEE",{locale:H})}),e.jsxs("div",{className:"text-foreground/80",children:[t.orders," sipariÅ"]}),e.jsxs("div",{className:"text-muted-foreground",children:[q(t.gmv)," ciro"]}),e.jsxs("div",{className:"text-emerald-600 dark:text-emerald-400",children:[q(t.revenue)," gelir"]})]})})]},t.day)})}),e.jsx("div",{className:"flex gap-1.5 sm:gap-2 mt-2",children:Ne.chart.map(t=>e.jsx("div",{className:"flex-1 text-center",children:e.jsx("span",{className:"text-[10px] font-medium "+(t.day===Ne.today?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground
1/60"),children:k(S(t.day),"EEE",{locale:H})})},t.day))})]}),e.jsxs("div",{className:"lg:col-span-2 bg-card border border-border rounded-xl p-3.5 sm:p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3 sm:mb-4",children:[e.jsx(I,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"text-xs sm:text-sm font-semibold text-foreground",children:"Platform saÄlıÄı"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 dark:bg-emerald-400 animate-pulse"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Aktif restoran"})]}),e.jsxs("span",{className:"text-sm font-bold text-foreground",children:[Ne.totalActive," / ",Ne.totalRestaurants]})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg cursor-pointer transition-colors "+(xe.length>0?"bg-amber-500/10 hover:bg-amber-500/15":"bg-muted/50"),onClick:()=>b("/admin/super/finance"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-3.5 w-3.5 "+(xe.length>0?"text-amber-500 dark:text-amber-400":"text-muted-foreground/50")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"ÃdenmemiÅ fatura"})]}),e.jsx("span",{className:"text-sm font-bold "+(xe.length>0?"text-amber-600 dark:text-amber-400":"text-foreground"),children:xe.length})]}),Ne.silentRestaurants.length>0&&e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50 cursor-pointer hover:bg-muted",onClick:()=>b("/admin/super/restaurants"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-muted-foreground/50"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"7 gündür sipariÅ yok"})]}),e.jsx("span",{className:"text-sm font-bold text-muted-foreground",children:Ne.silentRestaurants.length})]})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-border space-y-2",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground/60 uppercase tracking-widest font-semibold mb-2",children:"Hızlı iÅlemler"}),e.jsxs("button",{onClick:()=>b("/admin/super/restaurants"),className:"w-full flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Restoranları yönet",e.jsx(M,{className:"h-3.5 w-3.5 ml-auto"})]}),e.jsxs("button",{onClick:()=>b("/admin/super/finance"),className:"w-full flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",children:[e.jsx(D,{className:"h-3.5 w-3.5"}),"Finans ve faturalama",e.jsx(M,{className:"h-3.5 w-3.5 ml-auto"})]}),e.jsxs("button",{onClick:()=>b("/admin/super/audit"),className:"w-full flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),"Denetim kayıtları",e.jsx(M,{className:"h-3.5 w-3.5 ml-auto"})]})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(I,{className:"h-3.5 w-3.5 text-blue-500 dark:text-blue-400"}),e.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-widest",children:["Bu ay · ",k(new Date,"MMMM yyyy",{locale:H})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"trend: geçen ayın aynı günlerine göre, bugün hariç"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3 sm:grid-cols-3 lg:grid-cols-4",children:[e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3 sm:p-4",children:[e.jsx("div",{className:"text-[10px] sm:text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-1.5 sm:mb-2",children:"Aylık gelir"}),e.jsx("div",{className:"text-lg sm:text-xl font-bold text-emerald-600 dark:text-emerald-400",children:q(Ne.monthStats.revenue)}),e.jsx(K,{value:Ne.monthTrend.revenue}),e.jsxs("div",{className:"text-[10px] sm:text-xs text-muted-foreground
1/60 mt-0.5 sm:mt-1",children:["geçen ay ",q(Ne.prevMonthStats.revenue)]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3 sm:p-4",children:[e.jsx("div",{className:"text-[10px] sm:text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-1.5 sm:mb-2",children:"Aylık ciro"}),e.jsx("div",{className:"text-lg sm:text-xl font-bold text-foreground",children:q(Ne.monthStats.gmv)}),e.jsx(K,{value:Ne.monthTrend.gmv}),e.jsxs("div",{className:"text-[10px] sm:text-xs text-muted-foreground/60 mt-1",children:["geçen ay ",q(Ne.prevMonthStats.gmv)]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3 sm:p-4",children:[e.jsx("div",{className:"text-[10px] sm:text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-1.5 sm:mb-2",children:"Aylık sipariÅ"}),e.jsx("div",{className:"text-lg sm:text-xl font-bold text-foreground",children:Z(Ne.monthStats.orders)}),e.jsx(K,{value:Ne.monthTrend.orders}),e.jsxs("div",{className:"text-[10px] sm:text-xs text-muted-foreground/60 mt-1",children:["ort. sepet ",q(Ne.monthStats.avgBasket)]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl p-3 sm:p-4",children:[e.jsx("div",{className:"text-[10px] sm:text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-1.5 sm:mb-2",children:"Yeni restoran"}),e.jsx("div",{className:"text-lg sm:text-xl font-bold text-foreground",children:Ne.newThisMonth}),e.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground/60 mt-1",children:"bu ay katılan"})]})]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-3.5 sm:px-5 py-3 sm:py-4 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"text-xs sm:text-sm font-semibold text-foreground",children:"Son sipariÅler"})]}),e.jsxs("button",{onClick:()=>b("/admin/super/orders"),className:"text-xs text-muted-foreground hover:text-foreground flex items-center gap-1 transition-colors",children:["Tümünü gör ",e.jsx(M,{className:"h-3.5 w-3.5"})]})]}),0===ie.length?e.jsxs("div",{className:"py-12 text-center",children:[e.jsx($,{className:"h-8 w-8 text-muted-foreground/30 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Henüz sipariÅ yok."}),e.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"SipariÅler geldikçe burada görünecek."})]}):e.jsx("div",{className:"divide-y divide-border/60",children:ie.map(t=>{const s=Number(t.total_price)||Number(t.total_amount)||0;return e.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 px-3.5 sm:px-5 py-2.5 sm:py-3 hover:bg-muted/30 transition-colors",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsx("span",{className:"text-xs sm:text-sm font-medium text-foreground truncate",children:t.restaurants?.name||"Bilinmiyor"}),t.short_id&&e.jsxs("span",{className:"text-[10px] text-muted-foreground/60 font-mono shrink-0",children:["#",t.short_id]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(W,{status:t.status}),t.order_type&&e.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:p(t.order_type)})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsx("div",{className:"text-xs sm:text-sm font-semibold text-foreground",children:q(s)}),e.jsx("div",{className:"text-[10px] text-muted-foreground/60 mt-0.5",children:w(new Date(t.created_at),{addSuffix:!0,locale:H})})]})]},t.id)})})]})]})}export{se 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.