import{c as w,h as N,i as R,k as B,m as F,n as V,y as j}from"./chunk-AUG6ZMIQ.js";import{a as U}from"./chunk-IQYEAILM.js";import"./chunk-3NZUMR4F.js";import{c as L}from"./chunk-JQJV7TYV.js";import{c as x,f as D}from"./chunk-YM543BQE.js";import{m as _,o as M,p as P}from"./chunk-STBSUBIU.js";import{Ac as I,Ba as S,Ca as b,Cb as A,Hb as l,Jc as v,Kc as c,Ob as y,Tb as r,Ub as n,Vb as d,Zb as E,_ as h,ac as T,fc as f,kb as t,lb as u,oc as C,qa as g,qc as s,rc as m,xb as k}from"./chunk-NW2U37DI.js";import"./chunk-TWZW5B45.js";function G(p,H){p&1&&d(0,"i",19)}var ie=(()=>{class p extends P{constructor(a,i,e,o){super(o),this.adminService=a,this.tostr=i,this.translate=e,this.sendingResponse={}}ngOnInit(){this.loaderService.showLoader(),this.adminService.getenvatoapitoken().pipe(h(this.unSubscribe$)).subscribe({next:a=>{this.apidata=a.apidata,this.loaderService.hideLoader()},error:()=>this.loaderService.hideLoader()})}envatoApiCheck(a,i){if(a.valid){this.sendingResponse[i]=!0;let e=a.value;e.enavto_id=this.apidata?.id,this.adminService.envatoapitoken(e).pipe(h(this.unSubscribe$)).subscribe({next:o=>{o.success&&this.tostr.success(this.translate.transform(o.success)),o.error&&this.tostr.error(this.translate.transform(o.error.errors.message)),this.sendingResponse[i]=!1},error:()=>this.sendingResponse[i]=!1})}}static{this.\u0275fac=function(i){return new(i||p)(u(D),u(_),u(x),u(M))}}static{this.\u0275cmp=g({type:p,selectors:[["app-envato-api-token"]],standalone:!0,features:[k,I],decls:33,vars:24,consts:[["envatoApi","ngForm"],[3,"title"],[1,"col-xl-12","col-lg-12","col-md-12"],[1,"row"],[1,"col-xl-6"],[1,"card"],[1,"card-header","border-0"],[1,"card-title"],[3,"ngSubmit"],[1,"card-body"],[1,"form-group"],[1,"form-label"],["type","text","name","envatoapi",1,"form-control",3,"ngModel","value"],[1,"form-group","mt-3"],["type","text","name","envatoapisecond",1,"form-control",3,"ngModel","value"],["type","text","name","envatoapithird",1,"form-control",3,"ngModel","value"],[1,"card-footer"],[1,"form-group","float-end"],["type","submit",1,"btn","btn-secondary",3,"disabled"],[1,"fa","fa-spinner","fa-spin","mx-1"]],template:function(i,e){if(i&1){let o=E();d(0,"admin-page-header",1),r(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"h4",7),s(7),v(8,"translate"),n()(),r(9,"form",8,0),T("ngSubmit",function(){S(o);let $=C(10);return b(e.envatoApiCheck($,"envatoApi"))}),r(11,"div",9)(12,"div",10)(13,"label",11),s(14),v(15,"translate"),n(),d(16,"input",12),n(),r(17,"div",13)(18,"label",11),s(19),v(20,"translate"),n(),d(21,"input",14),n(),r(22,"div",13)(23,"label",11),s(24),v(25,"translate"),n(),d(26,"input",15),n()(),r(27,"div",16)(28,"div",17)(29,"button",18),s(30),v(31,"translate"),A(32,G,1,0,"i",19),n()()()()()()()()}i&2&&(l("title","Envato API Token"),t(7),m(c(8,14,"Envato Settings")),t(7),m(c(15,16,"Envato Personal Api Token")),t(2),f("value",e.apidata!=null?e.apidata==null?null:e.apidata.envatoapitoken:""),l("ngModel",e.apidata==null?null:e.apidata.envatoapitoken),t(3),m(c(20,18,"Envato Personal second Api Token")),t(2),f("value",e.apidata!=null?e.apidata==null?null:e.apidata.envatoapitokensecond:""),l("ngModel",e.apidata==null?null:e.apidata.envatoapitokensecond),t(3),m(c(25,20,"Envato Personal third Api Token")),t(2),f("value",e.apidata!=null?e.apidata==null?null:e.apidata.envatoapitokenthird:""),l("ngModel",e.apidata==null?null:e.apidata.envatoapitokenthird),t(3),l("disabled",e.sendingResponse.envatoApi),t(),m(c(31,22,"Save")),t(2),y(e.sendingResponse.envatoApi?32:-1))},dependencies:[U,L,j,V,w,N,R,F,B]})}}return p})();export{ie as EnvatoApiTokenComponent};
