import{fetchPriceSystem as t}from"./lib/api-helpers.js";import{defineSmartComponent as r}from"./lib/define-smart-component.js";import{formatAddonCellar as o,formatAddonFsbucket as n,formatAddonPulsar as e,formatAddonHeptapod as c}from"./lib/product.js";import"./cc-smart-container.js";import"./cc-pricing-product-consumption.js";r({selector:"cc-pricing-product-consumption",params:{productId:{type:String},zoneId:{type:String}},onContextUpdate({updateComponent:r,context:p,signal:i}){const{productId:a,zoneId:d}=p;r("product",{state:"loading"}),function({productId:r,zoneId:p,signal:i}){return t({zoneId:p,signal:i}).then((t=>{if("cellar"===r)return{name:"Cellar",...o(t)};if("fsbucket"===r)return{name:"FS Bucket",...n(t)};if("pulsar"===r)return{name:"Pulsar",...e(t)};if("heptapod"===r)return{name:"Heptapod",...c(t)};throw new Error(`Cannot find product "${r}"`)}))}({productId:a,zoneId:d,signal:i}).then((t=>{r("product",{name:t.name,state:"loaded",sections:t.sections})})).catch((t=>{console.error(t),r("product",{state:"error"})}))}});
//# sourceMappingURL=cc-pricing-product-consumption.smart.js.map
