PageSourceSearch

https://b2b.cafe/assets/dashboard-B_c13_qz.js

js b2b.cafe collected 2026-09-24 14:36:43 UTC 20,394 bytes, 1 lines download raw bytes

1import{bH as je,bI as at,ab as T,bJ as rt,bK as Be,r as u,aY as st,u as a,bk as Ce,bL as ee,aX as nt,bM as Q,a2 as Se,bN as ot,L as lt,bO as ct}from"./vendor-DzWMmZj2.js";import{d as dt,a as it}from"./vendor-tanstack-D-s8FawA.js";import{V as ut,u as Ue,k as N,U as c,F as te,a as b,W as mt,p as Ae,b as X,l as W,O as ht,w as ft,d as xt,X as Ee,Y as De,o as Re,Z as Me,_ as _e,$ as k,v as bt,a0 as Ie,T as pt,a1 as Pe,S as Te,a2 as yt,q as Ke,m as gt}from"./index-B-ZZKIlh.js";import{u as Nt,B as vt}from"./useTable-CFZmHKgO.js";import{i as x,u as wt}from"./vendor-i18n-C7hD56hb.js";import"./DashboardFinanceBlock-DY75xbnk.js";import"./vendor-socket-CdJ84v18.js";import"./vendor-phone-CDRp5aFf.js";const B=({from:s,to:p,lang:o})=>{const d=ut(o!=null?o:"ru"),f=new Date,h=je(s),y=p||f,l=[];let v=y;for(;!at(v,h);)l.push({from:T(je(v),"yyyy-MM-dd"),to:T(rt(v),"yyyy-MM-dd"),value:T(v,"yyyy-MM"),label:T(v,"LLLL yyyy",{locale:d})}),v=Be(v,1);return l};function jt({default:s=!1,MIN_TIMEOUT:p=300}={}){const[o,d]=u.useState(s),f=u.useRef(null),h=u.useRef(0);u.useInsertionEffect(()=>{s&&(h.current=Date.now())},[s]);const y=u.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),l=u.useCallback((v,m={})=>{var A;y();const C=Date.now();if(v)m.timeout!==void 0?f.current=setTimeout(()=>{d(!0),h.current=Date.now()},m.timeout):(d(!0),h.current=Date.now());else{const P=(A=m.timeout)!=null?A:p,E=h.current?C-h.current:0;m.hard||E>=P?(d(!1),h.current=0):f.current=setTimeout(()=>{d(!1),h.current=0},P-E)}return y},[p,y]);return[o,l]}const Ct=(s,p)=>{const{isAuthed:o,userId:d,userRole:f,user:h}=Ue("appStore");u.useLayoutEffect(()=>{const y=st(()=>({isAuthed:o,userId:d,userRole:f,user:h}),l=>{s(l)||p(l)},{fireImmediately:!0});return()=>y()},[o,d,f,h,s,p])},St={b2m:"1",b2b:"0"},At=(s,p,o)=>{if(N(s,[c.ADMIN])){const d=o===0?"distributor":"manager",f=St[p];return{entity:d,b2m:f}}if(N(s,[c.DISTRIBUTOR,c.SENIOR_MANAGER]))return{entity:o===0?"manager":"client"};if(N(s,[c.MANAGER,c.AGENT,c.SALESMAN]))return{entity:"client"}},Le=s=>T(ee(s),"dd.MM.yyyy"),Oe=(s,p,o,d,f)=>{if(!d)return;const h={from:Le(p),to:Le(o),excludeStatuses:"1"};return f&&(h.orderType="order"),s&&(h[d.entity]=String(s)),d.b2m!==void 0&&(h.b2m=d.b2m),"/order/list?".concat(new URLSearchParams(h).toString())},Z=(s=0)=>"".concat(s||0),Et=(s={})=>{const{value:p,past:o,deltaPercent:d}=s;return{value:Z(p),past:Z(o),deltaPercent:Z(d)}},w=({accessorKey:s,currency:p,withGhost:o,linkConfig:d,isOrdered:f,className:h,...y})=>({row:l})=>{var D,R,U;const{currencySymbol:v}=l.original||{},m=((D=l.original)==null?void 0:D[s])||{},{value:C,past:A,deltaPercent:P}=Et(m),E=(R=l.original)==null?void 0:R.id,r=d?At(d.userRole,d.businessModel,(U=l.depth)!=null?U:0):void 0,K=r?Oe(E,d.dateFrom,d.dateTo,r,f):void 0,G=r&&(d!=null&&d.ghostDateFrom)?Oe(E,d.ghostDateFrom,d.ghostDateTo,r,f):void 0;return a.jsx(mt,{withGhost:o,value:C,past:A,delta:P,suffix:p?v:null,href:K,ghostHref:G,className:b("w-full",h),...y})},Dt=({userRole:s,businessModel:p,withGhost:o,dateFrom:d,dateTo:f,ghostDateFrom:h,ghostDateTo:y})=>{if(!s)return[];const l={userRole:s,businessModel:p,dateFrom:d,dateTo:f,ghostDateFrom:h,ghostDateTo:y};return N(s,[c.ADMIN])&&["b2c"].includes(p)?[{accessorKey:"name",header:()=>a.jsx("div",{className:"font-medium text-xs",children:x.t("dashboard:dashboard.table.columns.distributor")}),meta:{separators:{right:"full"},columnProps:{minWidth:200}},cell:({row:v})=>{const{name:m,countryCode:C}=v.original||{};return a.jsxs("div",{className:"text-conte-button-m flex items-center gap-2",children:[!!C&&a.jsx(te,{code:C}),m]})}},{id:"amounts",header:x.t("dashboard:dashboard.table.columns.order_amount"),meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({currency:!0,accessorKey:"amount",withGhost:o})},{id:"ordersCount",header:x.t("dashboard:dashboard.table.columns.order_count"),meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"ordersCount",withGhost:o})},{id:"boughtAvg",header:x.t("dashboard:dashboard.table.columns.percentage"),meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"boughtAvg",withGhost:o,color:"black",suffix:"%",precision:2})},{id:"amountAvg",header:x.t("dashboard:dashboard.table.columns.average_check"),meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({currency:!0,accessorKey:"amountAvg",withGhost:o,color:"black"})},{id:"itemsAvg",header:x.t("dashboard:dashboard.table.columns.average_items"),meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"itemsAvg",withGhost:o,color:"black"})},{id:"revenuePercent",header:x.t("dashboard:dashboard.table.columns.revenue_share"),meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"revenuePercent",withGhost:o,color:"black",suffix:"%",withDelta:!1,precision:2})}]:[{accessorKey:"name",header:()=>N(s,[c.ADMIN])?a.jsx("div",{className:"font-medium text-xs",children:x.t("dashboard:dashboard.table.columns.distributor")}):N(s,[c.DISTRIBUTOR,c.SENIOR_MANAGER])?a.jsx("div",{className:"font-medium text-xs",children:x.t("dashboard:dashboard.table.columns.manager")}):a.jsx("div",{className:"font-medium text-xs",children:x.t("dashboard:dashboard.table.columns.client")}
1),meta:{separators:{right:"full"},columnProps:{minWidth:200},childCell:({row:v})=>{const{name:m}=v.original||{};return a.jsxs("div",{className:"text-conte-button-s flex items-center gap-2",children:[a.jsx(Ce,{className:"shrink-0 size-4"}),m]})}},cell:({row:v})=>{const{name:m,countryCode:C}=v.original||{};return N(s,[c.ADMIN])?a.jsxs("div",{className:"text-conte-button-m flex items-center gap-2",children:[!!C&&a.jsx(te,{code:C}),m]}):a.jsxs("div",{className:"text-conte-button-m flex items-center gap-2",children:[a.jsx(Ce,{className:"shrink-0 size-4"}),m]})}},{id:"amounts",header:x.t("dashboard:dashboard.table.columns.order_amount"),columns:[{accessorKey:"amount",meta:{separators:{right:"part"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},header:()=>a.jsx("div",{className:b("font-medium text-xs"),children:x.t("dashboard:dashboard.table.columns.completed")}),cell:w({currency:!0,accessorKey:"amount",withGhost:o})},{accessorKey:"amountOrdered",meta:{separators:{left:"part",right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},header:()=>a.jsx("div",{className:b("font-medium text-xs text-nowrap"),children:x.t("dashboard:dashboard.table.columns.ordered")}),cell:w({currency:!0,accessorKey:"amountOrdered",color:"blue",withGhost:o})}]},{id:"orders",header:x.t("dashboard:dashboard.table.columns.order_count"),columns:[{accessorKey:"ordersCount",meta:{separators:{right:"part"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},header:()=>a.jsx("div",{className:b("font-medium text-xs"),children:x.t("dashboard:dashboard.table.columns.completed")}),cell:w({accessorKey:"ordersCount",withGhost:o,linkConfig:l})},{accessorKey:"ordersCountOrdered",meta:{separators:{left:"part",right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},header:()=>a.jsx("div",{className:b("font-medium text-xs text-nowrap"),children:x.t("dashboard:dashboard.table.columns.ordered")}),cell:w({accessorKey:"ordersCountOrdered",color:"blue",withGhost:o,linkConfig:l,isOrdered:!0})}]},{id:"items",header:x.t("dashboard:dashboard.table.columns.items"),columns:[{accessorKey:"itemsCount",meta:{separators:{right:"part"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},header:()=>a.jsx("div",{className:b("font-medium text-xs"),children:x.t("dashboard:dashboard.table.columns.completed")}),cell:w({accessorKey:"itemsCount",withGhost:o})},{accessorKey:"itemsCountOrdered",meta:{separators:{left:"part",right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},header:()=>a.jsx("div",{className:b("font-medium text-xs text-nowrap"),children:x.t("dashboard:dashboard.table.columns.ordered")}),cell:w({accessorKey:"itemsCountOrdered",color:"blue",withGhost:o})}]},...N(s,[c.MANAGER,c.AGENT,c.SALESMAN])?[]:[{header:x.t("dashboard:dashboard.table.columns.clients"),accessorKey:"clientsCount",meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"clientsCount",color:"black",withGhost:o})},{header:x.t("dashboard:dashboard.table.columns.new_clients"),accessorKey:"newClientsCount",meta:{separators:{right:"full"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"newClientsCount",color:"black",withGhost:o})}],{header:x.t("dashboard:dashboard.table.columns.revenue_percent"),accessorKey:"revenuePercent",meta:{separators:{right:"none"},mainCellProps:{className:"w-full flex justify-end min-w-25"},columnProps:{maxWidth:"max-content"}},cell:w({accessorKey:"revenuePercent",color:"black",suffix:"%",withGhost:o,withDelta:!1,precision:2})}]},Fe="dashboard-filters",{settingsCountries:Rt}=xt(),{mainDashboardDistributors:Mt,mainDashboardManagers:We,mainDashboardClients:ke}=ht(),_t=nt(()=>{var me,he,fe,xe;const{t:s,i18n:p}=wt("dashboard"),{language:o}=p,d=dt({from:"/dashboard"}),f=it(),{isAuthed:h,userId:y,userRole:l,currentRole:v,user:m,storeCurrency:C}=Ue("appStore"),A=u.useMemo(()=>B({from:Be(new Date().getTime(),60),lang:o}),[o]),[P,E]=jt({default:!0,MIN_TIMEOUT:500}),[r,K]=u.useState(()=>{var L,_,Y,z,be,pe,ye,ge,Ne,ve;
1const e=T(new Date,"yyyy-MM"),t=(L=A.find(O=>O.value===e))!=null?L:A[0],[n,i]=t.value.split("-").map(Number),j=B({from:new Date(n-1,i-1),to:new Date(n-1,i-1)})[0],g={dates:t,compare_with:j,type:"b2b",currency:(Y=(_=Ae.features.dashboard)==null?void 0:_.defaultCurrency)!=null?Y:"RUB",withVat:!1,withCompare:!1,search:null,countries:null};try{const O=sessionStorage.getItem(Fe);if(!O)return g;const I=JSON.parse(O),we=(z=A.find(q=>{var F;return q.value===((F=I.dates)==null?void 0:F.value)}))!=null?z:t,[Ze,et]=we.value.split("-").map(Number),tt=(be=B({from:Q(new Date,6),to:new Date(Ze,et-2)}).find(q=>{var F;return q.value===((F=I.compare_with)==null?void 0:F.value)}))!=null?be:j;return{...g,type:(pe=I.type)!=null?pe:g.type,currency:(ye=I.currency)!=null?ye:g.currency,withVat:(ge=I.withVat)!=null?ge:g.withVat,withCompare:(Ne=I.withCompare)!=null?Ne:g.withCompare,countries:(ve=I.countries)!=null?ve:g.countries,dates:we,compare_with:tt}}catch(O){return g}}),G=u.useMemo(()=>{if(!r.dates)return[];const[e,t]=r.dates.value.split("-").map(Number);return B({from:Q(new Date,6),to:new Date(e,t-2),lang:o})},[r.dates,o]),[D,R]=u.useState([]),[U,Ve]=u.useState(""),[$,ae]=u.useState(null),re=e=>{var n;const t={...e};return t.dates&&(t.dates={from:t.dates.from,to:t.dates.to}),t.withCompare||delete t.compare_with,t.compare_with&&(t.compare_with={from:t.compare_with.from,to:t.compare_with.to}),(n=t.countries)!=null&&n.length||delete t.countries,t},{mutateAsync:se}=X({mutationKey:["dashboard-main-data",y,l,(me=m==null?void 0:m.distributor)==null?void 0:me.id],abortable:!0,generationKey:r,mutationFn:async(e={},{signal:t})=>{var j;const n=re(e);if(!l)return null;if(N(l,[c.ADMIN]))return Mt({filters:n},{signal:t});const i=(j=m==null?void 0:m.distributor)==null?void 0:j.id;return i?N(l,[c.DISTRIBUTOR,c.SENIOR_MANAGER])?We(i,{filters:n},{signal:t}):y&&N(l,[c.MANAGER,c.AGENT,c.SALESMAN])?ke(y,{filters:n},{signal:t}):null:null},retry:1,retryDelay:1e3,errorFn:e=>{E(!1),R([]),Se.error(s("common:common.errors.load_data")),W.error("Error loading dashboard data:",e)},successFn:e=>{if(E(!1),!e)return R([]),[];const{currencySymbol:t,items:n=[],total:i}=e.result||{},j=[{...i,canExpand:!1,name:s("dashboard.table.total")},...n].map(g=>({...g,currencySymbol:t,children:[]}));return R(j||[]),Ve(t),ae(g=>g!==null?g:new Set(n.map(_=>
1_.countryCode).filter(Boolean))),j}}),Ye=ft(se,1200),{mutateAsync:ne}=X({mutationKey:["dashboard-children-data"],mutationFn:async({id:e,filters:t})=>{if(!e||!l)return;const n=re(t);return N(l,[c.ADMIN])?await We(e,{filters:n}):N(l,[c.DISTRIBUTOR,c.SENIOR_MANAGER])?await ke(e,{filters:n}):null},retry:1,retryDelay:1e3,errorFn:(e,{id:t})=>{t&&(Se.error(s("common:common.errors.load_data")),W.error("Error loading children data:",e),R(n=>n==null?void 0:n.map(i=>(i==null?void 0:i.id)!=t?i:{...i,children:[],isLoadedChildren:!0})))},successFn:(e,t)=>{var i;const n=t.id;return n?(R(j=>j==null?void 0:j.map(g=>{if((g==null?void 0:g.id)!=n)return g;if(!e)return{...g,children:[],isLoadedChildren:!0};const{currencySymbol:L,items:_=[]}=e.result||{},Y=_==null?void 0:_.map(z=>({...z,currencySymbol:L,children:[]}));return{...g,children:Y||[],isLoadedChildren:!0}})),((i=e==null?void 0:e.result)==null?void 0:i.items)||[]):[]}}),{data:H,mutateAsync:oe}=X({mutationKey:["countries"],mutationFn:()=>Rt({}),successFn:e=>{var t;return((t=e.result)==null?void 0:t.map(({code:n,name:i})=>({id:n,name:i,code:n})))||[]}});u.useEffect(()=>{oe()},[oe]);const J=N(l,[c.ADMIN]),V=(he=m==null?void 0:m.currency)==null?void 0:he.code,[ze,Ge]=u.useState(!1);u.useEffect(()=>{const e=J?C:V!=null?V:C;e&&(K(t=>({...t,currency:e})),Ge(!0))},[J,C,V]),u.useEffect(()=>{ae(null),K(e=>({...e,countries:null}))},[r.dates,r.type,r.currency,r.withVat,r.withCompare,r.compare_with,r.search]),u.useEffect(()=>{y&&l&&(E(!0),se(r).catch(()=>{}))},[r,y,l]);const[le,ce]=u.useState(()=>new Date().getTime()),de=u.useRef(r);u.useEffect(()=>{de.current=r},[r]);const M=u.useCallback(e=>{K(t=>{const n={...t,...e};try{sessionStorage.setItem(Fe,JSON.stringify(n))}catch(i){}return n}),ce(new Date().getTime())},[]),ie=u.useMemo(()=>{var e,t;return Dt({userRole:l,businessModel:r.type,withGhost:r.withCompare,dateFrom:r.dates.from,dateTo:r.dates.to,ghostDateFrom:r.withCompare?(e=r.compare_with)==null?void 0:e.from:void 0,ghostDateTo:r.withCompare?(t=r.compare_with)==null?void 0:t.to:void 0})},[l,r.type,r.withCompare,r.dates,r.compare_with]),$e=u.useMemo(()=>[{key:"countries",title:s("dashboard.filter.countries.title"),items:$?(H||[]).filter(e=>$.has(e.code)):H||[]}],[H,$]),He={countries:r==null?void 0:r.countries},ue=u.useEffectEvent(e=>{W.debug("handleRefresh",e),ce(new Date().getTime()),Ee(f,{mutationKey:["dashboard-main-data"],exact:!1}),Ee(f,{mutationKey:["dashboard-children-data"],exact:!1});const t=de.current;ot(new Date,{start:ee(t.dates.from),end:ee(t.dates.to)})&&Ye(t)}),Je=u.useEffectEvent(({userId:e,userRole:t})=>{if(!e)return;const n=(()=>{if(!(!e||!t)){if(N(t,[c.ADMIN]))return"admin";if(N(t,[c.DISTRIBUTOR,c.SENIOR_MANAGER]))return"manager";if(N(t,[c.MANAGER,c.AGENT,c.SALESMAN]))return"client"}})();return[n&&De.subscribe(n,i=>ue(i)),De.subscribe("private:".concat(e),i=>ue(i))]});u.useEffect(()=>{if(!y)return;const e=Je({userId:y,userRole:l});return()=>{e==null||e.forEach(t=>t==null?void 0:t())}},[y,l]);const S=u.useMemo(()=>{var n;if(!l)return[];const e=(n=Ae.features.dashboard)==null?void 0:n.availableBusinessModels;if((e==null?void 0:e.length)===1)return e;const t=N(l,[c.ADMIN])?["all","b2b","b2c","b2m"]:["b2b"];return e!=null&&e.length?t.filter(i=>e.includes(i)):t},[l]);u.useEffect(()=>{S.length&&(S.includes(r.type)||M({type:S[0]}))},[S]);const{table:qe,expandHandler:Qe,layout:Xe}=Nt({data:D,dataVersion:le,columns:ie,withExpanded:r.type!=="b2c"&&!N(l,[c.MANAGER,c.AGENT,c.SALESMAN]),onExpandRow:e=>{W.debug("onExpandRow",e),ne({id:e==null?void 0:e.id,filters:r})}});return Ct(({userId:e,userRole:t,user:n})=>{var i;return gt()?!e||!t?!0:Ke({userRole:t,currentRole:(i=n==null?void 0:n.roles)==null?void 0:i.id})==="/dashboard":!1},({userRole:e})=>{var t;return d({to:Ke({userRole:e,currentRole:(t=m==null?void 0:m.roles)==null?void 0:t.id}),from:void 0})}),!h||!l?a.jsx("div",{className:"flex-center py-[30%]",children:a.jsx(lt,{className:"animate-spin size-8 text-muted-foreground"})}):a.jsxs("div",{className:"relative pb-20",children:[a.jsxs(Re,{id:"filters-level-1",top:"#header-sticky",zIndex:40,className:b("flex-1 flex justify-between py-2.5 border-b flex-wrap gap-y-1 bg-background/90 backdrop-blur-md"),children:[(S==null?void 0:S.length)>1?a.jsx(Me,{value:r.type,onValueChange:e=>M({type:e}),children:a.jsx(_e,{children:S==null?void 0:S.map(e=>a.jsx(k,{value:e,children:s("dashboard.business_models.".concat(e))},e))})}):a.jsx("div",{}),a.jsxs("div",{className:b("w-fit flex items-center gap-3"),children:[ze&&(J?a.jsx(Me,{value:r.currency,onValueChange:e=>{M({currency:e})},children:a.jsxs(_e,{children:[a.jsx(k,{value:"RUB",children:"RUB"}),a.jsx(k,{value:"BYN",children:"BYN"}),a.jsx(k,{value:"USD",children:"USD"}),a.jsx(k,{value:"EUR",children:"EUR"})]})}):a.jsx("span",{className:"text-conte-body-l font-medium",children:r.currency})),a.jsx(bt,{orientation:"vertical"}),a.jsxs("div",{className:b("flex items-center space-x-2"),children:[a.jsxs(Ie,{htmlFor:"nds-mode",children:[a.jsx(pt,{children:s("dashboard.filter.vat.tooltip")}),s("dashboard.filter.vat")]}),a.jsx(Pe,{id:"nds-mode",checked:r.withVat,onCheckedChange:e=>{M({withVat:e})}})]})]})]}),a.jsxs("div",{className:b("py-10.5 flex-1 flex justify-center items-center text-[64px] lg:text-[124px] transition-all duration-300 text-primary"),children:[a.jsx(ct,{value:((xe=(fe=D==null?void 0:D[0])==null?void 0:fe.amount)==null?void 0:xe.value)||0,format:{style:"decimal",maximumFractionDigits:0},className:b("font-bold")}),a.jsx("sup",{className:b("left-[0.25em] mt-10.5 text-[24px] lg:text-[48px]"),children:U})]}),a.jsxs(Re,{id:"filters-level-2",top:"#filters-level-1",zIndex:40,className:b("border-t border-border flex items-center justify-between py-3.5 flex-wrap gap-y-1 bg-background/90 backdrop-blur-md"),activeClass:"border-t-0",children:[a.jsxs("div",{className:b("flex items-center gap-2"),children:[a.jsx("h2",{className:b("text-conte-heading3 text-foreground"),children:s("dashboard.statistics.title")}),a.jsx(Te,{size:"md",className:"min-w-42.5",items:A,value:r.dates.value,onChange:e=>{const[t,n]=e.value.split("-").map(Number),i=Q(new Date(t,n-1),1),j=B({from:i,to:i,lang:o})[0];M({dates:e,compare_with:j})},SelectedItemSlot:({item:e})=>a.jsxs("div",{className:"text-conte-button-s",children:[s("dashboard.peri
1od_prefix")," ",e==null?void 0:e.label]})})]}),a.jsxs("div",{className:b("mex-w-fit flex items-center overflow-hidden"),children:[a.jsxs("div",{className:b("flex items-center gap-2"),children:[a.jsx(Ie,{htmlFor:"with-compare",children:s("dashboard.filter.ghost")}),a.jsx(Pe,{id:"with-compare",checked:r.withCompare,onCheckedChange:e=>{M({withCompare:e})}})]}),a.jsx(Te,{size:"md",classNames:{wrapper:b("ml-5 grow-0 w-42.5",!r.withCompare&&"w-0 ml-0")},items:G,value:r.compare_with.value,onChange:e=>{M({compare_with:e})},SelectedItemSlot:({item:e})=>a.jsxs("div",{className:"text-conte-button-s",children:[s("dashboard.period_prefix")," ",e==null?void 0:e.label]})})]})]}),a.jsx(vt,{isLoading:P,table:qe,expandHandler:Qe,layout:Xe,data:D,dataVersion:le,columns:ie,stickyHeaderProps:{top:"#filters-level-2"},withExpanded:r.type!=="b2c"&&!N(l,[c.MANAGER,c.AGENT,c.SALESMAN]),empty:a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("div",{className:b("text-muted-foreground text-lg"),children:s("dashboard.no_data")}),a.jsx("div",{className:b("text-muted-foreground text-sm mt-1"),children:s("dashboard.try_change_filters")})]}),emptyChildren:()=>a.jsx("div",{className:"h-8 py-2 w-full flex-center",children:s("dashboard.no_data_short")}),onExpandRow:e=>{W.debug("onExpandRow",e),ne({id:e==null?void 0:e.id,filters:r})}}),a.jsx(yt,{title:s("dashboard.filter.countries.title"),groups:$e,value:He,onChange:({countries:e})=>{M({countries:e})},renderItem:({item:e})=>a.jsxs("div",{className:"flex-1 flex flex-row items-center gap-2",children:[a.jsx(te,{code:e.code,className:"h-3"}),a.jsx("span",{className:"flex-1 truncate",children:e.name})]})})]})}),Bt=_t;export{Bt as component};

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.