import{getAllZones as e}from"@clevercloud/client/esm/api/v4/product.js";import{ONE_DAY as t}from"@clevercloud/client/esm/with-cache.js";import{defineSmartComponent as n}from"./lib/define-smart-component.js";import{sendToApi as o}from"./lib/send-to-api.js";import"./cc-smart-container.js";import"./cc-pricing-header.js";n({selector:"cc-pricing-header",params:{zoneId:{type:String}},onContextUpdate({container:n,component:c,context:r,onEvent:i,updateComponent:a,signal:s}){const{zoneId:p}=r;i("cc-pricing-header:change-zone",(e=>{n.context={...n.context,zoneId:e}})),"loading"===c.state.type?function({signal:n}){return e().then(o({signal:n,cacheDelay:t})).then((e=>e.filter((e=>e.tags.includes("for:applications"))).map((e=>function(e){const t=e.tags.filter((e=>!e.startsWith("for:")));return{...e,tags:t}}(e)))))}({signal:s}).then((e=>{a("state",{type:"loaded",zones:e}),a("selectedZoneId",p)})).catch((e=>{a("state",{type:"error"}),console.error(e)})):a("selectedZoneId",p)}});
//# sourceMappingURL=cc-pricing-header.smart.js.map
