import{_ as h}from"./EmptyStateBlock-Dt7jmbAi.js";import{_ as k}from"./BlueButton.vue_vue_type_script_setup_true_lang-CY8chwQm.js";import{e as D,x as B,g as C,o,c as r,a as e,F as p,h as y,t as d,b as v,w as x,f as I,m as $,A as N,B as A,i as S}from"./index-Bb2UEb_P.js";import{u as b}from"./services-DEZoSah0.js";import{k as O,b as L}from"./common-U_VzDrmL.js";import{_ as V}from"./StatusBadge-74LYchi-.js";import{_ as j}from"./HtmlContent-DrkJBX3e.js";const R={key:0,class:"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 xl:tw-grid-cols-3 tw-gap-4 tw-mt-4"},H={class:"tw-text-base tw-font-medium"},et={__name:"BlockAvailableServices",props:{orderId:{type:Number,default:null},serviceSearchParams:{type:Object,default:()=>null}},async setup(u){let m,w;const _=u,f=D(),l=b();[m,w]=B(()=>l.fetchDependServices(_.serviceSearchParams)),await m,w();const n=C(()=>Object.values(l.ServicesList||{}).filter(s=>s.ServicesGroupID!=1e3&&s.IsActive&&!s.IsHidden&&l.DependServicesList.includes(s.ID)).sort((s,a)=>s.SortID-a.SortID));function c(s){f.push(O(s.Code,s.ID,_.orderId))}return(s,a)=>{const t=k,i=h;return o(),r("div",null,[a[1]||(a[1]=e("h2",{class:"tw-text-xl tw-font-medium"},"Доступные услуги",-1)),n.value.length?(o(),r("div",R,[(o(!0),r(p,null,y(n.value,g=>(o(),r("div",{key:g.ID,class:"tw-flex tw-flex-col tw-gap-4 tw-justify-between tw-p-4 tw-border tw-border-gray-200 tw-rounded-lg"},[e("div",H,d(g.Name),1),e("div",null,[v(t,{type:"small",class:"tw-uppercase tw-font-bold",onClick:J=>c(g)},{default:x(()=>a[0]||(a[0]=[I(" Заказать ",-1)])),_:2,__:[0]},1032,["onClick"])])]))),128))])):(o(),$(i,{key:1,label:"Нет доступных дополнительных услуг",class:"tw-mt-4"}))])}}},T={key:0},E={class:"tw-grid tw-grid-cols-1 lg:tw-grid-cols-2 xl:tw-grid-cols-3 tw-gap-4 tw-mt-4"},F={class:"tw-text-lg tw-font-medium"},K={class:"tw-mt-1"},P={class:"tw-text-gray-500 tw-mt-2"},U={key:0,class:"tw-mt-1"},G={class:"tw-space-y-2 tw-mt-4"},q={key:0},z={class:"tw-font-bold"},st={__name:"BlockDependentServices",props:{services:Array},setup(u){const m=D(),w=b(),_=N("emitter");function f(n){_.emit("open-modal",{component:"StatusHistory",data:{modeID:n.Code+"Orders",orderID:n.OrderID}})}function l(n){m.push(L(n.Code,n.OrderID))}return(n,c)=>{const s=V,a=k;return u.services.length?(o(),r("div",T,[c[1]||(c[1]=e("h2",{class:"tw-text-xl tw-font-medium"},"Заказанные услуги",-1)),e("div",E,[(o(!0),r(p,null,y(u.services,t=>(o(),r("div",{key:t.ID,class:"tw-flex tw-flex-col tw-gap-4 tw-justify-between tw-p-4 tw-border tw-border-gray-200 tw-rounded-lg"},[e("div",null,[e("div",F,d(A(w).ServicesList[t.ServiceID]?.Name||t.ServiceName||`Услуга #${t.ServiceID}`),1),e("div",K,[v(s,{status:t.StatusID,"status-table":"Orders",class:"tw-cursor-pointer",onClick:i=>f(t)},null,8,["status","onClick"])]),e("div",P,[e("div",null,"Заказ #"+d(t.ID),1),t.DaysRemainded?(o(),r("div",U," Осталось дней: "+d(t.DaysRemainded),1)):S("",!0)]),e("div",G,[(o(!0),r(p,null,y(t.AdditionalInfo,i=>(o(),r(p,{key:i.Key},[i.Value?(o(),r("div",q,[e("div",z,d(i.Key),1),v(j,{content:i.Value},null,8,["content"])])):S("",!0)],64))),128))])]),e("div",null,[v(a,{type:"small",class:"tw-uppercase tw-font-bold",onClick:i=>l(t)},{default:x(()=>c[0]||(c[0]=[I(" Перейти к заказу ",-1)])),_:2,__:[0]},1032,["onClick"])])]))),128))])])):S("",!0)}}};export{st as _,et as a};
