function l(t){const r=t.Names||[],e=[];for(const[n,a]of Object.entries(r))e.push({label:a,text:t[n]||"-"});return e}function f(t=null){const r=String(t)?.length;let e="";for(let n=0;n<5-r;n++)e="0"+e;return String(e)+String(t)}function o(t){t||(t=0),typeof t=="string"&&(t=t.replace(",","."));const r=Number(t);return isNaN(r)?"0.00 ₽":r.toLocaleString("ru-RU",{style:"currency",currency:"RUB"}).replace(",",".")}function m(){return window.getSelection().toString().length>0}function S(t,r){return["Waiting","Active","Suspended","ForTransfer"].includes(t)?!0:(r.emit("open-modal",{component:"Error",data:{msg:"Заказ домена не может быть оплачен"}}),!1)}function d(t,r){return t==="Default"?`/AdditionalServices/${r}`:`/${t}Orders/${r}`}function g(t,r,e){return t==="Default"?e?`/AdditionalServicesSchemes?ServiceID=${r}&DependOrderID=${e}`:`/AdditionalServicesSchemes?ServiceID=${r}`:e?`/${t}Schemes?DependOrderID=${e}`:`/${t}Schemes`}function h(t,r){return t==="Default"?`/ServiceOrderPay/${r}`:`/${t}OrderPay/${r}`}function i(t){return t?`${t?.Name||""}: ${t?.Value||""}${t?.Unit||""}`:""}function p(t,r){if(!t||r==null)return[];const e=t[r];return e?[{text:e.Name},{text:i(e.SchemeParams?.limit_webdomains)},{text:i(e.SchemeParams?.limit_quota)},{text:i(e.SchemeParams?.limit_emails)},{text:`${o(e.CostMonth)} в месяц`,bold:!0}].filter(a=>a.text):[]}function b(t,r){if(!t||r==null)return[];const e=t[r];if(!e)return[];const n=e?.SchemeParams?.hdd_mib,a=e?.SchemeParams?.ram_mib,s=e?.SchemeParams?.net_bandwidth_mbitps;return[{text:`${e?.Name}`},{text:n?.Value!=null?`${n?.InternalName||"Диск"} ${n.Value} ${n?.Unit||""}`.trim():""},{text:a?.Value!=null?`RAM ${a.Value} ${a?.Unit||""}`.trim():""},{text:s?.Value!=null?`Канал ${s.Value} ${s?.Unit||""}`.trim():""}].filter(c=>c.text)}function $(t,r){if(!t||r==null)return[];const e=t[r];if(!e)return[];let n=[];return e.Name&&n.push(e.Name),e.CPU&&n.push(e.CPU),e.ram&&n.push("RAM "+e?.ram+" GB"),e.disks&&n.push(e?.disks),e.CostMonth&&n.push(e.CostMonth+" / месяц"),n}function P(t){if(!t)return null;const r=t.match(/^\/((?:\\\/|[^\/])+)\/([a-z]*)$/);if(!r)return null;let e=r[1],n=r[2];n.includes("u")&&(e=e.replace(/\\([@_])/g,"$1"));try{return new RegExp(e,n)}catch(a){return console.error("Invalid backend regexp:",a),null}}function x(t=1e3){return new Promise(r=>setTimeout(r,t))}function y(t){const r=new Set(["Stat","Names"]);function e(n){return n==null?[]:Array.isArray(n)?n.flatMap(a=>e(a)):typeof n=="object"?Object.entries(n).flatMap(([a,s])=>r.has(a)?[]:e(s)):[String(n)]}return e(t).join(" ")}function O(t,r){r={bg:!0,border:!1,text:!1,opacity:10,...r};let e="deleted";switch(t){case"Waiting":case"OnForming":case"OnProlong":case"OnFilling":e="waiting";break;case"OnCreate":case"Working":case"Newest":case"Conditionally":case"SchemeChange":case"ForRegister":case"OnRegister":case"ForProlong":case"ForNsChange":case"OnNsChange":case"ForTransfer":case"OnTransfer":case"ClaimForRegister":case"ForContractRegister":case"OnContractRegister":e="create";break;case"Active":case"Opened":case"Payed":case"Complite":case"Public":case"Sended":case"OnDelegating":case"Filled":case"Checked":e="active";break;case"Suspended":case"Rejected":case"NotConfirmed":e="suspended";break;case"OnService":e="service";break;case"Deleted":case"Closed":case"Breaked":case"UnSet":case"OnPrint":case"OnSign":case"Received":e="deleted";break}const n=[];return r.text&&n.push(`tw-text-status-${e}`),r.bg&&n.push(`tw-bg-status-${e}/${r.opacity}`,`hover:tw-bg-status-${e}/${r.opacity>90?100:r.opacity+10}`),r.border&&n.push(`tw-border-status-${e}`),n.join(" ")}export{b as a,d as b,y as c,$ as d,l as e,o as f,O as g,p as h,i,S as j,g as k,h as l,m,P as n,x as p,f as t};
