import{fetchPriceSystem as n}from"./lib/api-helpers.js";import{formatEstimationPrices as t}from"./lib/product.js";import{defineSmartComponent as e}from"./lib/smart/define-smart-component.js";import"./cc-smart-container.js";import"./cc-pricing-estimation.js";e({selector:"cc-pricing-estimation",params:{apiConfig:{type:Object},zoneId:{type:String,optional:!0},currency:{type:String,optional:!0}},onContextUpdate({container:e,context:i,onEvent:r,updateComponent:c,signal:o}){const{apiConfig:a,zoneId:p="par",currency:s="EUR"}=i;r("cc-pricing-currency-change",(n=>{e.context={...e.context,currency:n}})),c("state",{type:"loading"}),function({apiConfig:e,zoneId:i,currency:r,signal:c}){return n({apiConfig:e,zoneId:i,currency:r,signal:c}).then((n=>t(n)))}({apiConfig:a,zoneId:p,currency:s,signal:o}).then((({runtimePrices:n,countablePrices:t})=>{c("state",{type:"loaded",runtimePrices:n,countablePrices:t})})).catch((()=>{c("state",{type:"error"})}))}});
//# sourceMappingURL=cc-pricing-estimation.smart.js.map
