import{_ as N}from"./ServiceListOrderSelection-DUe6fwsE.js";import{u as O,_ as L}from"./contracts-P7YPBhEI.js";import{_ as B}from"./BlockBalanceAgreement-qtspRQ_B.js";import{r as I,u as V,D as u,f as x,H as W,U as z,c as m,b as p,a as c,C as U,h as E,F as h,i as H,w,n as D,v as $,d as q,g as F,o as d,t as g}from"./index-CmCGXBst.js";import{u as R}from"./services-C54cnl9l.js";import{s as T}from"./multiselect-DhoC9bwZ.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ButtonDefault-BIBStZbJ.js";import"./TotalAmount.vue_vue_type_script_setup_true_lang-CXrtmBc-.js";import"./BasicInput-KlObNzdO.js";import"./component-0WedTVCo.js";import"./BlockSelectContract-uyQ-oMQe.js";import"./ClausesKeeper-CTja-fCz.js";import"./IconClose-B_k4TzXM.js";const G={class:"section"},M={class:"container"},J={class:"section-header"},K={class:"section-nav"},P=["onClick"],Q={class:"multiselect-option"},X={class:"section-body"},Y={__name:"AdditionalServicesOrder",async setup(Z){let n,r;const s=I(3),S=F(),f=q(),k=V(),l=R(),b=O(),o=I(null);[n,r]=u(()=>b.fetchContracts()),await n,r(),[n,r]=u(()=>k.fetchUserOrders()),await n,r(),[n,r]=u(()=>l.fetchDNSmanagerOrders()),await n,r();function v(e){f.replace(`/AdditionalServicesOrder?ServiceID=${e}`),o.value=e}const i=x(()=>Object.keys(l?.ServicesList)?.map(e=>({...l?.ServicesList[e],value:l?.ServicesList[e]?.ID})).filter(e=>e?.ServicesGroupID!=1e3&&e?.IsActive&&!e?.IsHidden).sort((e,a)=>Number(e?.SortID)<Number(a?.SortID)?-1:Number(e?.SortID)>Number(a?.SortID)?1:0));W(()=>{window.addEventListener("resize",_),_()}),z(()=>{window.removeEventListener("resize",_)}),[n,r]=u(()=>l.fetchServices().then(()=>{i.value?.find(e=>e?.ID===S?.query?.ServiceID)?o.value=S?.query?.ServiceID:(o.value=i.value?.[0]?.ID,f.replace(`/AdditionalServicesOrder?ServiceID=${o.value}`))})),await n,r();let _=()=>{window.innerWidth>=1920?s.value=9:window.innerWidth>=1600?s.value=7:window.innerWidth>=1440?s.value=6:window.innerWidth>=1200?s.value=5:window.innerWidth>=992?s.value=4:s.value=3};return(e,a)=>{const C=B,y=L,A=N;return d(),m(h,null,[p(C),c("div",G,[c("div",M,[c("div",J,[c("div",K,[(d(!0),m(h,null,H(i.value?.slice(0,s.value),t=>(d(),m("div",{key:t?.ID,class:D([{"section-link":!0,"section-link-active":o.value===t?.ID},"section-nav__item"]),onClick:ee=>v(t?.ID)},g(t?.Item),11,P))),128)),i.value?.length>s.value?(d(),U($(T),{key:0,modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=t=>o.value=t),class:D([{"multiselect--white additional-service__select":!0,"additional-service__select_active":i.value?.slice(s.value,i.value?.length).find(t=>t?.ID===o.value)},"multiselect-special"]),options:i.value?.slice(s.value,i.value?.length),label:"ID",onSelect:a[1]||(a[1]=t=>v(t))},{option:w(({option:t})=>[c("div",Q,g(t?.Item),1)]),caret:w(()=>[p(y,{class:"icon-arrow_caret"})]),_:1},8,["modelValue","class","options"])):E("",!0)])]),c("div",X,[p(A,{sectionID:o.value,sectionData:i.value?.find(t=>t.ID==o.value),onSwitchTab:v},null,8,["sectionID","sectionData"])])])])],64)}}},pe=j(Y,[["__scopeId","data-v-cac64b84"]]);export{pe as default};
