import{l}from"./main-few-lands-burn.js";const d="https://openrouter.ai/api/v1",r=t=>l({headers:{Authorization:["Bearer ",{encryption:"hmac_decrypt",value:t}]},method:"GET",url:`${d}/models`}),c=async t=>{t.setComponent("model-id",o=>{o.loading=!0});try{const o=await t.getConnection();if(!o)return;const s=o.auth_details.value,{data:n,status:a}=await r(s);if(a!=="success"){t.setComponent("model-id",e=>{t.util.isSelectComponent(e)&&(e.status=a,e.invalidMessage=n)});return}if(!n?.data){t.setComponent("model-id",e=>{t.util.isSelectComponent(e)&&(e.options=[])});return}t.setComponent("model-id",e=>{t.util.isSelectComponent(e)&&(e.options=n.data.map(i=>({label:i.name||i.id,value:i.id})))})}finally{t.setComponent("model-id",o=>{o.loading=!1})}};export{c as f};
