import{_ as N}from"./EmptyStateBlock-D6U_EDq6.js";import{f as O,_ as E}from"./BlockBalanceAgreement-2iQbaweR.js";import{_ as G}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{E as L,c as a,o as r,a as s,h as D,t as m,v as P,L as j,b as S,F as h,i as f,w as A,e as V,n as w,r as T,f as k,D as F,C as b}from"./index-CipWZKo_.js";import{_ as q}from"./ClausesKeeper-DVJgfLR3.js";import{u as z}from"./hosting-Fz3P7c2t.js";import{u as M}from"./server-DA2BhLHe.js";import{u as R}from"./testTransforms-CtLjUrql.js";import"./contracts-CILh9uSu.js";import"./ButtonDefault-CghIUDY0.js";import"./IconClose-ChC2G6HM.js";const J={class:"hosting-order-item__wrapper"},K={class:"hosting-order-item__header"},Q={class:"hosting-order-item__name"},U={key:0,class:"hosting-order-item__price"},W={class:"hosting-order-item__content"},X={class:"hosting-order-item__row"},Y={class:"hosting-order-item__list"},Z={class:"hosting-order-item__row"},ee={class:"hosting-order-item__note"},te={__name:"HostingOrderItem",props:{data:{type:Object,default:()=>{}}},setup(n){return(p,_)=>{const c=L("router-link");return r(),a("div",{class:w(["hosting-order-item",{"hosting-order-item--special":n.data?.note}])},[s("div",J,[s("div",K,[s("div",Q,m(n.data?.name),1),n.data?.price?(r(),a("div",U,m(P(O)(n.data?.price))+" в месяц",1)):D("",!0)]),s("div",W,[s("div",X,[s("ul",Y,[(r(!0),a(h,null,f(n.data?.specifications,l=>(r(),a("li",{key:l},m(l),1))),128))])]),n.data?.note?j(p.$slots,"default",{key:0},()=>[s("div",Z,[s("div",ee,m(n.data?.note),1)])],!0):D("",!0),S(c,{class:"btn btn--wide btn--border btn--wide",to:`/HostingSchemes/${n.data?.ID}`},{default:A(()=>_[0]||(_[0]=[V(" Заказать ",-1)])),_:1,__:[0]},8,["to"])])])],2)}}},se=G(te,[["__scopeId","data-v-90358e3f"]]),re={class:"tw-px-4 md:tw-px-8 tw-mb-6"},oe={class:"section-nav"},ne=["data-title","onClick"],ae={class:"section-text section-text--margin"},ie={key:0,class:"list"},ce={__name:"HostingSchemes",async setup(n){let p,_;const c=z(),l=M(),u=T(0),{formDescriptionLine:d}=R(),g=k(()=>{let e=[];return c.hostingSchemes&&(Object.keys(c.hostingSchemes).forEach(t=>{c.hostingSchemes[t]?.ServersGroupID==u.value&&e.push(c.hostingSchemes[t])}),e=e.filter(t=>t.IsActive),e.sort((t,o)=>t.SortID-o.SortID)),e});function x(e){u.value=e}function C(e){return{ID:e?.ID,name:e?.Name,price:e?.CostMonth,specifications:[d(e?.SchemeParams?.limit_webdomains),d(e?.SchemeParams?.limit_quota),d(e?.SchemeParams?.limit_emails),d(e?.SchemeParams?.disklimit),d(e?.SchemeParams?.maillimit)],note:e?.Comment}}const y=k(()=>l?.serverGroupsList?.Servers);function I(){let e={};return Object.values(y.value).forEach(t=>{if(t.ServiceID==1e4){const o=t.ServersGroupID;e[o]||(e[o]={SortID:t.SortID,ServersGroupID:o,servers:[]}),e[o].servers.push(t)}}),Object.values(e).sort((t,o)=>t.SortID-o.SortID)}function v(e){return l?.serverGroupsList?.ServersGroups?.[e]}return[p,_]=F(()=>c.fetchHostingSchemes()),await p,_(),u.value=I()?.[0]?.ServersGroupID,(e,t)=>{const o=E,$=q,B=se,H=N;return r(),a(h,null,[S(o),s("div",re,[t[0]||(t[0]=s("h1",{class:"tw-text-xl sm:tw-text-4xl tw-mb-4"},"Заказать хостинг",-1)),S($),s("div",oe,[(r(!0),a(h,null,f(I(),(i,me)=>(r(),a("div",{class:w(["section-nav__item",{active:String(u.value)===String(i?.ServersGroupID)}]),key:i?.ServersGroupID,"data-title":v(i?.ServersGroupID)?.Comment,onClick:_e=>x(i?.ServersGroupID)},m(v(i?.ServersGroupID)?.Name),11,ne))),128))]),s("div",ae,m(v(u.value)?.Comment),1),g.value?(r(),a("div",ie,[(r(!0),a(h,null,f(g.value,i=>(r(),b(B,{key:i?.ID,data:C(i)},null,8,["data"]))),128))])):(r(),b(H,{key:1,label:"Нет доступных тарифов"}))])],64)}}},ke=G(ce,[["__scopeId","data-v-b5a65c39"]]);export{ke as default};
