import{Z as e,$ as s,a0 as u,a1 as a}from"./e.b7f0888b.js";async function r(r,i){const l=new e,n=await s(r),o=`/hacsfiles/${i.full_name.split("/")[1]}`,t=`${o}/${i.file_name}`,c=n.find((e=>e.url.includes(o)));l.debug({namespace:o,url:t,exsisting:c},"updateLovelaceResources"),c&&c.url!==t?(l.debug(`Updating exsusting resource for ${o}`),u(r,{url:t,resource_id:c.id,res_type:c.type})):n.map((e=>e.url)).includes(t)||(l.debug(`Adding ${t} to Lovelace resources`),a(r,{url:t,res_type:"module"}))}export{r as u};
