function e(e,n,r){const t=e.plans.filter((e=>e.zones.length>0));return{name:e.name,productFeatures:i(e.features,r),plans:s(t,n,r)}}const n=720;function r(e){return{sections:[{type:"storage",...o(e,"cellar.storage")},{type:"outbound-traffic",...o(e,"cellar.outbound")}]}}function t(e){return{sections:[{type:"storage",...o(e,"fsbucket.storage")}]}}function a(e){return{sections:[{type:"storage",...o(e,"pulsar_storage_size")},{type:"inbound-traffic",...o(e,"pulsar_throughput_in")},{type:"outbound-traffic",...o(e,"pulsar_throughput_out")}]}}function u(e){return{sections:[{type:"storage",...o(e,"heptapod.storage")},{type:"private-users",progressive:!0,...o(e,"heptapod.private_active_users")},{type:"public-users",progressive:!0,...o(e,"heptapod.public_active_users")}]}}function o(e,r){const t=e.countable.find((e=>e.service===r)),a="insecable"===t?.data_quantity_for_price?.secability?t.data_quantity_for_price.quantity:1,u=("PT1H"===t?.time_interval_for_price?.interval?n:1)/(t?.data_quantity_for_price?.quantity??1);return{secability:a,intervals:t.price_plans.map(((e,n,r)=>({minRange:0===n?0:r[n-1].max_quantity,maxRange:e.max_quantity,price:e.price*u})))}}function i(e,n){return(null==n?e.map((e=>e.name_code)).filter((e=>null!=e)):n).map((n=>e.find((e=>e.name_code===n)))).filter((e=>null!=e)).map((e=>({code:e.name_code,type:e.type.toLowerCase(),value:e.computable_value??"",name:e.name})))}function s(e,n,r){return e.map((e=>{const t=n.runtime.find((n=>n.slug_id.toLowerCase()===e.price_id.toLowerCase()));return{name:e.name,price:t?.price??0,features:i(e.features,r)}}))}function p(e,n){const r=function(e){const n=[{code:"cpu",type:"number-cpu-runtime"},{code:"memory",type:"bytes"}];e.variant.slug.startsWith("ml_")&&n.push({code:"gpu",type:"number"});return n}(e);return{name:e.variant.name,productFeatures:r,plans:c(e.flavors,n,r)}}function c(e,n,r){return e.map((e=>{const t=n.runtime.find((n=>n.slug_id.toLowerCase()===e.price_id.toLowerCase()));return{name:e.name,price:t?.price??0,features:l(r,e)}}))}function l(e,n){return e.map((e=>({...e,value:d(e.code,n)})))}function d(e,n){switch(e){case"cpu":return{cpu:n.cpus,shared:n.microservice,nice:n.nice};case"memory":return n.memory.value;case"gpu":return n.gpus}}function m(e){const n={type:"docker",version:"20211001",name:"Docker",defaultFlavor:null,buildFlavor:null,enabled:!0,comingSoon:!1,maxInstances:40,tags:[],deployments:["git"]};return"jenkins-runner"===e?{...n,variant:{id:"b8093938-4846-4f74-8c4a-82660180093e",slug:"jenkins-runner",name:"Jenkins runner",deployType:"docker",logo:"https://assets.clever-cloud.com/logos/jenkins.svg"},description:"Jenkins runner",flavors:[f("jenkins-runner.","XS",1,2),f("jenkins-runner.","S",2,4),f("jenkins-runner.","M",4,8),f("jenkins-runner.","L",6,12),f("jenkins-runner.","XL",8,16),f("jenkins-runner.","2XL",12,24),f("jenkins-runner.","3XL",16,32)]}:"heptapod-runner"===e?{...n,variant:{id:"9b207292-732b-4594-b48b-09a91ac72f0c",slug:"heptapod-runner",name:"Heptapod runner",deployType:"docker",logo:"https://assets.clever-cloud.com/logos/heptapod.svg"},description:"Heptapod runner",flavors:[f("heptapod-runner.","XS",1,2,!0,5),f("heptapod-runner.","S",2,4,!0,5),f("heptapod-runner.","M",4,8,!0,5),f("heptapod-runner.","L",6,12,!0,5),f("heptapod-runner.","XL",8,16,!0,5),f("heptapod-runner.","2XL",12,24,!0,5),f("heptapod-runner.","3XL",16,32,!0,5)]}:void 0}function f(e,n,r,t,a=!1,u=0){return{name:n,mem:null,cpus:r,gpus:0,disk:null,price:null,available:!0,microservice:a,machine_learning:!1,nice:u,price_id:e+n,memory:{unit:"B",value:t*1024**3,formatted:null}}}export{r as formatAddonCellar,t as formatAddonFsbucket,u as formatAddonHeptapod,e as formatAddonProduct,a as formatAddonPulsar,p as formatRuntimeProduct,m as getRunnerProduct};
//# sourceMappingURL=product.js.map
