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