import{fakeString as e}from"./lib/fake-strings.js";import{defineSmartComponent as t}from"./lib/smart/define-smart-component.js";import"./cc-smart-container.js";import{CcAddonHeaderClient as r}from"./cc-addon-header.client.js";import"./cc-addon-header.js";t({selector:'cc-addon-header[smart-mode="materia-kv"]',params:{apiConfig:{type:Object},ownerId:{type:String},addonId:{type:String},explorerUrlPattern:{type:String},productStatus:{type:String,optional:!0}},onContextUpdate({context:t,updateComponent:o,signal:n}){const{apiConfig:a,ownerId:d,addonId:i,productStatus:p}=t,s=new r({apiConfig:a,ownerId:d,addonId:i,providerId:"kv",signal:n});let c="";o("state",{type:"loading",openLinks:[{url:e(15),name:e(5)}],productStatus:e(4)}),s.getAddonWithZone().then((({rawAddon:e,zone:r})=>{c=t.explorerUrlPattern.replace(":id",i),o("state",{type:"loaded",providerId:e.provider.name,providerLogoUrl:e.provider.logoUrl,name:e.name,id:e.realId,zone:r,openLinks:[{name:"KV EXPLORER",url:c}],productStatus:p})})).catch((e=>{console.error(e),o("state",{type:"error"})}))}});
//# sourceMappingURL=cc-addon-header.smart-materia-kv.js.map
