import{request as t}from"@clevercloud/client/esm/request.fetch.js";import{withCache as e}from"@clevercloud/client/esm/with-cache.js";import{defineSmartComponent as r}from"./lib/define-smart-component.js";import{parseRssFeed as c}from"./lib/xml-parser.js";import"./cc-smart-container.js";import"./cc-article-list.js";const o=144e5;r({selector:"cc-article-list",params:{lang:{type:String},limit:{type:Number}},onContextUpdate({context:r,updateComponent:l,signal:i}){l("state",{type:"loading"});const{lang:a,limit:s}=r;(async function({signal:r,lang:l,limit:i=9}){const a="fr"===l?"https://www.clever-cloud.com/fr/feed/?format=excerpt":"https://www.clever-cloud.com/feed/?format=excerpt",s={method:"get",url:a,headers:{},signal:r},n=await e(s,o,(()=>t(s)));return c(n,i)})({signal:i,lang:a,limit:s}).then((t=>{l("state",{type:"loaded",articles:t})})).catch((t=>{console.error(t),l("state",{type:"error"})}))}});
//# sourceMappingURL=cc-article-list.smart.js.map
