import{r as s,h as e,H as t}from"./p-9f21f85f.js";import{p as i}from"./p-dd7dee94.js";const r=class{constructor(t){s(this,t),this.fetchProduct=async()=>{const{id:s}=this.match.params;this.product=await this.apiDevingen.getProduct(s).catch((s=>this.error=s))},this.renderHeader=()=>{var s;return e("div",{class:"container"},e("div",{class:"row"},e("div",{class:"col d-flex align-items-center pt-2 pb-3"},e("h2",{class:"m-0"},null===(s=this.product)||void 0===s?void 0:s.name," / API Key Settings"))))},this.generatePredefinedScopes=()=>{const{product:s}=this;switch(s.type){case"damga":return[{label:"Target Groups - Write",value:`dri:das:products:${s._id}:damga:target-groups:*.write`}];case"sepet":return[{label:"Files - Write",value:`dri:das:products:${s._id}:sepet:files:*.write`},{label:"Buckets - Write",value:`dri:das:products:${s._id}:sepet:buckets:*.write`}]}}}componentWillLoad(){this.fetchProduct()}render(){const{product:s}=this;if(!s)return e("div",{class:"d-flex justify-content-center pt-3"},e("dvn-progress",{indefinite:!0}));const r={Authorization:this.apiKimlik.api.getDefaults().headers.Authorization,"devingen-product-id":s._id};return e(t,{class:"d-block"},this.renderHeader(),e("kimlik-home",{apiEndpoint:`${i.kimlik}/${i.base}`,apiHeaders:r,shownTabs:["api-keys"],preSelectedTab:"api-keys",predefinedScopesForAPIKeys:this.generatePredefinedScopes(),allowCustomScopesForAPIKeys:!1}))}};export{r as devingen_product_api_keys_page}