import{a2 as e,a3 as s,S as a,a4 as r,a5 as u}from"./main-ef294d92.js";async function i(i,o,t){const n=new e("updateLovelaceResources"),l=await s(i),d="/hacsfiles/"+o.full_name.split("/")[1],c=a({repository:o,version:t}),p=l.find(e=>e.url.includes(d));n.debug({namespace:d,url:c,exsisting:p}),p&&p.url!==c?(n.debug("Updating exsusting resource for "+d),await r(i,{url:c,resource_id:p.id,res_type:p.type})):l.map(e=>e.url).includes(c)||(n.debug(`Adding ${c} to Lovelace resources`),await u(i,{url:c,res_type:"module"}))}export{i as u};
