const ui=(()=>{function renderCustomServers(data){let htmlCustom="";data.forEach((item=>{const{cpu:cpu,ram:ram,storage:storage,portspeed:portspeed,type:type,price:price}=item;let CPUformatted=cpu.SubItem.replace(/\,/gi,"");CPUformatted=CPUformatted.split(" ");const arrayLength=CPUformatted.length;const titleMaximumWords=4;const title=CPUformatted.slice(0,arrayLength-titleMaximumWords).join(" ");const info=CPUformatted.slice(arrayLength-titleMaximumWords,arrayLength).join(" ");htmlCustom+=`\n
\n

${cpu.Value} x ${title}

\n

${info}

\n\n
\n

ram

\n\n

${ram.Value} GB

\n
\n\n
\n

Storage

\n\n

2 x ${storage.SubItem}

\n
\n\n
\n

Bandwidth

\n\n

${portspeed.Value>=1e3?portspeed.Value/1e3:portspeed.Value} ${portspeed.Value>=1e3?"Gbps":"Mbps"}

\n
\n\n
\n

$${price.toFixed(2)} monthly

\n
\n\n configure\n
\n `}));const randomCustomsContainer=document.getElementById("custom-random-quad-cpu-container");if(randomCustomsContainer){randomCustomsContainer.innerHTML=htmlCustom}}function renderInstantServers(randomInstantsArray){let htmlInstants="";randomInstantsArray.forEach((item=>{const{cpu:cpu,ram:ram,hdd:hdd,traffic:traffic,type:type,price:price,name:name}=item;let CPUformatted=cpu.replace(/\,/gi,"");CPUformatted=CPUformatted.split(" ");const arrayLength=CPUformatted.length;const titleMaximumWords=4;const title=CPUformatted.slice(0,arrayLength-titleMaximumWords).join(" ");const info=CPUformatted.slice(arrayLength-titleMaximumWords,arrayLength).join(" ");htmlInstants+=`\n
\n

${title}

\n

${info}

\n\n
\n

ram

\n\n

${ram} GB

\n
\n\n
\n

Storage

\n\n

${hdd}

\n
\n\n
\n

Bandwidth

\n\n

${traffic}

\n
\n\n
\n

$${price.toFixed(2)} monthly

\n
\n\n instant\n
\n `}));const randomInstantsContainer=document.getElementById("instant-random-quad-cpu-container");if(randomInstantsContainer){randomInstantsContainer.innerHTML=htmlInstants}}return{renderCustomServers:renderCustomServers,renderInstantServers:renderInstantServers}})();