import{_ as E}from"./StatusBadge-B65ys1I-.js";import{_ as F,a as H}from"./CardButton-Ym2KFbPf.js";import{_ as U}from"./ServerStatusBadge.vue_vue_type_script_setup_true_lang-6rZqTOev.js";import{r as q,Y as A,v as P,m as Y}from"./bootstrap-vue-next-3DpAa4tb.js";import{_ as z}from"./IconDots-BE2XsWZ6.js";import{_ as G}from"./Helper-BWCpStXX.js";import{_ as J}from"./IconCard-jY7IitfY.js";import{d as K,x as Q,r as W,m as X,E as Z,c as p,o as D,a as o,b as s,w as a,j as d,e as I,h as ee,t as l,F as te,i as se,n as re}from"./index-CipWZKo_.js";import{f as x}from"./time-DenPiOX5.js";import{_ as oe}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ne={class:"btn btn--dots"},ae={class:"tw-flex tw-items-center tw-gap-4 tw-mt-10 xl:tw-mt-0"},ie={class:"tw-flex tw-gap-2 tw-items-center"},de={class:"tw-flex"},le={class:"tw-text-lg"},ce={class:"tw-text-sky-400 tw-mt-2"},ue={class:"tw-flex tw-flex-col lg:tw-items-center lg:tw-flex-row lg:tw-justify-between"},me={class:"tw-flex tw-flex-wrap tw-items-center tw-gap-x-4 tw-gap-y-2 tw-mt-2 tw-text-sm tw-text-gray-500 tw-text-nowrap"},we={class:"last:tw-font-bold"},fe={class:"tw-flex tw-items-center tw-gap-2 tw-mt-2 tw-text-nowrap"},ve={class:"hosting-status__date"},pe={__name:"DSCard",props:{params:{type:Array,default:()=>[]},server:{type:Object,required:!0},isLast:{type:Boolean,default:!1},isSeveral:{type:Boolean,default:!1},selectedRows:{type:Object,required:!0}},emits:["delete","transfer","manage"],setup(t,{emit:S}){const i=t,_=S,O=K(),b=Q("emitter"),f=W({...i.selectedRows}),y=()=>{_("update-selected-rows",f.value)};X(()=>i.selectedRows,r=>{f.value={...r}},{deep:!0});function $(r){if(!r)return x(new Date);const e=new Date,v=new Date(e.getTime()+r*24*60*60*1e3);return x(v)}function k(r){O.push(`/DSOrders/${r}`)}function C(){_("delete",i.server.ID,i.server.OrderID)}function B(){_("transfer",{ServiceOrderID:i.server.ID,ServiceID:i.server.ServiceID})}function h(r){b.emit("open-modal",{component:"StatusHistory",data:{modeID:"DSOrders",rowID:r}})}function R(r){if(!r)return"";const e=new Date(parseInt(r)*1e3),g=new Date-e,c=Math.floor(g/1e3),u=Math.floor(c/60),m=Math.floor(u/60),w=Math.floor(m/24);return c<60?`${c} сек. от статуса`:u<60?`${u} мин. от статуса`:m<24?`${m} ч. от статуса`:`${w} дн. от статуса`}return(r,e)=>{const v=J,g=F,c=G,u=z,m=Z("router-link"),w=q,N=A,V=P,j=Y,M=U,L=H,T=E;return D(),p("div",{onClick:e[7]||(e[7]=n=>k(t.server.OrderID)),class:"tw-relative tw-p-4 tw-border tw-border-gray-200 tw-rounded tw-cursor-pointer hover:tw-bg-sky-100"},[o("div",{onClick:e[3]||(e[3]=d(()=>{},["stop"])),class:"tw-absolute tw-right-4 tw-top-4 tw-flex tw-items-center tw-gap-1"},[s(g,{onClick:e[0]||(e[0]=d(n=>r.$router.push(`/DSOrderPay/${t.server.OrderID}`),["stop"]))},{default:a(()=>[s(v),e[8]||(e[8]=o("div",null,"Оплатить",-1))]),_:1,__:[8]}),s(c,{"user-notice":t.server.UserNotice,id:t.server.OrderID,emit:"updateDSOrdersList",class:"tw-m-0 tw-p-0"},null,8,["user-notice","id"]),s(V,{class:"dropdown-dots",right:""},{"button-content":a(()=>[o("span",ne,[s(u)])]),default:a(()=>[s(w,null,{default:a(()=>[s(m,{to:`DSOrders/${t.server.OrderID}`},{default:a(()=>e[9]||(e[9]=[I("Дополнительная информация",-1)])),_:1,__:[9]},8,["to"])]),_:1}),s(w,{onClick:e[1]||(e[1]=d(n=>B(),["stop"]))},{default:a(()=>e[10]||(e[10]=[I("Передать на другой аккаунт",-1)])),_:1,__:[10]}),s(N),s(w,{class:"color-red",onClick:e[2]||(e[2]=d(n=>C(),["stop"]))},{default:a(()=>e[11]||(e[11]=[I("Удалить",-1)])),_:1,__:[11]})]),_:1})]),o("div",ae,[t.isSeveral?(D(),p("div",{key:0,onClick:e[5]||(e[5]=d(()=>{},["stop"]))},[s(j,{id:"checkbox-"+t.server.OrderID,modelValue:f.value[t.server.OrderID],"onUpdate:modelValue":e[4]||(e[4]=n=>f.value[t.server.OrderID]=n),name:"checkbox-"+t.server.OrderID,onChange:y},null,8,["id","modelValue","name"])])):ee("",!0),o("div",ie,[s(M,{indicators:t.server.Graphs?.Last},null,8,["indicators"]),s(L,{orderId:t.server.OrderID},null,8,["orderId"])]),o("div",de,[o("span",le,l(t.server.IP),1)])]),o("div",ce,l(t.server.Customer),1),o("div",ue,[o("div",me,[(D(!0),p(te,null,se(t.params,n=>(D(),p("div",we,l(n),1))),256))]),o("div",fe,[o("span",{class:re(["hosting-item__date tw-pl-0",{danger:Number(t.server.DaysRemainded)<14}])},l($(t.server.DaysRemainded))+" • "+l(t.server.DaysRemainded||0)+" дн. ",3),s(T,{class:"status-badge",status:t.server.StatusID,"status-table":"DSOrders",onClick:e[6]||(e[6]=d(n=>h(t.server.ID),["stop"]))},null,8,["status"]),o("div",ve,l(R(t.server.StatusDate)),1)])])])}}},ke=oe(pe,[["__scopeId","data-v-208bff2d"]]);export{ke as _};
