PageSourceSearch

https://biznas.com/chunk-DYYLFQJ4.js

js biznas.com collected 2026-10-03 22:22:58 UTC 13,540 bytes, 1 lines download raw bytes

1import{f as se,o as me}from"./chunk-I43TBCCP.js";import"./chunk-2YJDS7I7.js";import{a as re,b as le}from"./chunk-OVYHK5U3.js";import"./chunk-N7HCJULI.js";import"./chunk-IP3PUWFP.js";import"./chunk-AB427IMW.js";import"./chunk-GC4IZX5C.js";import"./chunk-K2JPOUCJ.js";import"./chunk-D4TCOIRS.js";import{b as ne}from"./chunk-MRHPGF4Z.js";import{c as te,d as ie}from"./chunk-RD6CMMYT.js";import"./chunk-43QSOUEJ.js";import"./chunk-EYQMV3B5.js";import"./chunk-IRF7SSK4.js";import"./chunk-RJTNPJVP.js";import"./chunk-ZEKO3T4C.js";import{a as Y,b as Z}from"./chunk-CMNKNHZM.js";import{a as U,b as J}from"./chunk-KGLUFYAO.js";import"./chunk-PHU7DBHH.js";import{a as Q,b as X}from"./chunk-DP2Z6ZZS.js";import"./chunk-SXHDWJCP.js";import"./chunk-ZV4QY222.js";import{a as pe}from"./chunk-YBBOOX5L.js";import{e as ae,f as oe}from"./chunk-N6A7VSM7.js";import{a as ee}from"./chunk-XGGGEBNP.js";import"./chunk-DVCUWZW7.js";import"./chunk-JQRWBCXI.js";import"./chunk-FM6R6SQV.js";import"./chunk-YT3SJKED.js";import"./chunk-TBYF2LDC.js";import{a as H}from"./chunk-LIN4B557.js";import{A as O,c as P,d as T,f as A,g as R,k as q,n as z,q as j,y as G,z as B}from"./chunk-K6JXWQGF.js";import{e as W,f as $}from"./chunk-K6TR4ND5.js";import"./chunk-LBKYIKKB.js";import"./chunk-GYMQPV7B.js";import{ma as x,qa as C}from"./chunk-355THWVV.js";import{b as K}from"./chunk-F2YZNH5P.js";import"./chunk-UYEVN2YS.js";import"./chunk-HMPDWT3T.js";import"./chunk-UD64SC5Q.js";import{B as N,m as M}from"./chunk-LXYQMMEZ.js";import{$b as _,Ac as L,Bc as w,Jb as p,Kb as n,Lb as t,Mb as h,Pc as F,Tb as b,Yb as g,_a as s,db as v,la as d,lb as E,lc as k,ma as u,nc as o,oc as y,pc as S,rb as f,uc as D,vc as V,wc as I}from"./chunk-E4JUGTIV.js";import"./chunk-WWX6BADO.js";var ue=()=>[100,200,250,500],ce=()=>({width:"560px"});function ge(l,i){if(l&1){let r=b();n(0,"div",27)(1,"form",28)(2,"div",29),h(3,"input",30)(4,"p-select",31),t(),n(5,"div",32)(6,"p-button",33),g("onClick",function(){d(r);let a=_();return u(a.clearFilters())}),t(),n(7,"p-button",34),g("onClick",function(){d(r);let a=_();return u(a.applyFilters())}),t()()()()}if(l&2){let r=_();s(),p("formGroup",r.filterForm),s(3),p("options",r.languages)("showClear",!0)}}function fe(l,i){l&1&&(n(0,"tr")(1,"th"),o(2,"Key"),t(),n(3,"th",35),o(4,"Language"),t(),n(5,"th"),o(6,"Value"),t(),n(7,"th",36),o(8,"Namespace"),t(),n(9,"th",37),o(10,"Actions"),t()())}function he(l,i){if(l&1){let r=b();n(0,"tr")(1,"td")(2,"span",38),o(3),t()(),n(4,"td")(5,"span",39)(6,"span",40),o(7),t(),o(8),t()(),n(9,"td"),o(10),t(),n(11,"td"),o(12),t(),n(13,"td")(14,"div",41)(15,"p-button",42),g("onClick",function(){let a=d(r).$implicit,m=_();return u(m.editTranslation(a))}),t(),n(16,"p-button",43),g("onClick",function(){let a=d(r).$implicit,m=_();return u(m.confirmDelete(a))}),t()()()()}if(l&2){let r=i.$implicit,e=_();s(3),y(r.key),s(4),S(" ",r.language," "),s(),S(" ",e.getLanguageLabel(r.language)," "),s(2),y(r.value),s(2),y(r.namespace||"-")}}function ve(l,i){l&1&&(n(0,"div",44)(1,"div",45),h(2,"i",46),n(3,"h3",47),o(4,"No Translations Found"),t(),n(5,"p",48),o(6,"Try adjusting your filters or add a new translation."),t()()())}function _e(l,i){l&1&&(n(0,"span",49),o(1,"(cannot be changed after creation)"),t())}function Te(l,i){l&1&&(n(0,"small",50),o(1," Key is required (max 255 characters). "),t())}function be(l,i){l&1&&(n(0,"span",49),o(1,"(cannot be changed after creation)"),t())}function ye(l,i){l&1&&(n(0,"small",50),o(1," Language is required. "),t())}function xe(l,i){l&1&&(n(0,"small",50),o(1," Value is required. "),t())}var de=class l{constructor(i,r,e,a,m,c){this.api=i;this.fb=r;this.messageService=e;this.confirmationService=a;this.i18nLoader=m;this.translate=c;this.filterForm=this.fb.group({search:[""],q:[null]}),this.translationForm=this.fb.group({key:["",[T.required,T.maxLength(255)]],language:["",[T.required]],value:["",[T.required]],namespace:["",[T.maxLength(100)]]})}translations=[];loading=!1;saving=!1;translationDialog=!1;isEditMode=!1;selectedTranslation=null;filterForm;translationForm;totalRecords=0;pageSize=100;page=1;showFilters=!1;languages=[{label:"English",value:"en"},{label:"French",value:"fr"},{label:"Arabic",value:"ar"}];ngOnInit(){this.loadTranslations()}loadTranslations(){this.loading=!0;let{search:i,q:r}=this.filterForm.value,e={page:this.page,pageSize:this.pageSize,search:i,q:r};this.api.getTranslations(e).subscribe({next:a=>{this.translations=a.items,this.totalRecords=a.totalCount,this.loading=!1},error:()=>{this.loading=!1,this.messageService.add({severity:"error",summary:"Error",detail:"Failed to load translations"})}})}onPageChange(i){this.page=Math.floor(i.first/i.rows)+1,this.pageSize=i.rows,this.loadTranslations()}applyFilters(){this.page=1,this.loadTranslations()}clearFilters(){this.filterForm.reset({search:"",q:null}),this.page=1,this.loadTranslations()}
1toggleFilters(){this.showFilters=!this.showFilters}openNew(){this.translationForm.reset({key:"",language:"",value:"",namespace:""}),this.translationForm.get("key").enable(),this.translationForm.get("language").enable(),this.isEditMode=!1,this.selectedTranslation=null,this.translationDialog=!0}editTranslation(i){this.translationForm.patchValue({key:i.key,language:i.language,value:i.value,namespace:i.namespace||""}),this.translationForm.get("key").disable(),this.translationForm.get("language").disable(),this.isEditMode=!0,this.selectedTranslation=i,this.translationDialog=!0}hideDialog(){this.translationDialog=!1,this.translationForm.reset(),this.translationForm.get("key").enable(),this.translationForm.get("language").enable()}saveTranslation(){if(this.translationForm.invalid){this.translationForm.markAllAsTouched();return}this.saving=!0;let{value:i,namespace:r}=this.translationForm.getRawValue();if(this.isEditMode&&this.selectedTranslation){let e={id:this.selectedTranslation.id,key:this.selectedTranslation.key,language:this.selectedTranslation.language,value:i,namespace:r||void 0};this.api.updateTranslation(e).subscribe({next:()=>{this.saving=!1,this.hideDialog(),this.loadTranslations(),this.refreshTranslationCache(e.language),this.messageService.add({severity:"success",summary:"Success",detail:"Translation updated successfully"})},error:a=>{this.saving=!1,this.messageService.add({severity:"error",summary:"Error",detail:a.error?.message||"Failed to update translation"})}})}else{let e=this.translationForm.getRawValue(),a={key:e.key,language:e.language,value:e.value,namespace:e.namespace||void 0};this.api.createTranslation(a).subscribe({next:()=>{this.saving=!1,this.hideDialog(),this.loadTranslations(),this.refreshTranslationCache(a.language),this.messageService.add({severity:"success",summary:"Success",detail:"Translation created successfully"})},error:m=>{this.saving=!1,this.messageService.add({severity:"error",summary:"Error",detail:m.error?.message||"Failed to create translation"})}})}}refreshTranslationCache(i){this.i18nLoader.clearCache(i),this.translate.currentLang===i&&this.translate.reloadLang(i)}confirmDelete(i){this.confirmationService.confirm({message:`Are you sure you want to delete <strong>${i.key}</strong> (${this.getLanguageLabel(i.language)})?`,header:"Confirm Delete",icon:"pi pi-exclamation-triangle",acceptButtonStyleClass:"p-button-danger",accept:()=>{this.api.deleteTranslation(i.id).subscribe({next:()=>{this.loadTranslations(),this.refreshTranslationCache(i.language),this.messageService.add({severity:"success",summary:"Success",detail:"Translation deleted successfully"})},error:()=>{this.messageService.add({severity:"error",summary:"Error",detail:"Failed to delete translation"})}})}})}getLanguageLabel(i){return this.languages.find(r=>r.value===i)?.label??i}static \u0275fac=function(r){return new(r||l)(v(ee),v(G),v(C),v(x),v(pe),v(K))};static \u0275cmp=E({type:l,selectors:[["app-translations"]],features:[L([C,x])],decls:52,vars:25,consts:[["header",""],["body",""],[1,"card","reports-page"],[1,"reports-header","flex","flex-col","md:flex-row","md:justify-between","md:items-center","mb-4"],[1,"header-title","font-semibold","text-xl"],[1,"header-actions","flex","items-center","gap-2","mt-2","md:mt-0"],["icon","pi pi-sliders-h","styleClass","p-button-outlined","pTooltip","Toggle Filters","tooltipPosition","top",3,"onClick"],["label","Add Translation","icon","pi pi-plus",3,"onClick"],["class","filter-section mb-4",4,"ngIf"],[1,"mobile-scroll-table"],["styleClass","p-datatable-gridlines","paginatorDropdownAppendTo","body",3,"onLazyLoad","value","paginator","rows","totalRecords","loading","rowsPerPageOptions","lazy","first"],["class","text-center py-12",4,"ngIf"],[3,"visibleChange","onHide","visible","modal","header"],[3,"ngSubmit","formGroup"],[1,"flex","flex-col","gap-4"],[1,"block","text-sm","font-medium","mb-1"],[1,"text-red-500"],["class","text-xs text-muted-color font-normal ml-1",4,"ngIf"],["pInputText","","formControlName","key","placeholder","e.g., common.save",1,"w-full"],["class","text-red-500 block mt-1",4,"ngIf"],["formControlName","language","optionLabel","label","optionValue","value","placeholder","Select language","appendTo","body",1,"w-full",3,"options"],["pInputTextarea","","formControlName","value","rows","3","placeholder","Translation value",1,"w-full"],["pInputText","","formControlName","namespace","placeholder","e.g., common, auth",1,"w-full"],[1,"text-muted-color","block","mt-1"],[1,"flex","justify-end","gap-3","mt-6","pt-4","border-t","border-surface-200","dark:border-surface-700"],["label","Cancel","icon","pi pi-times","severity","secondary","styleClass","p-button-outlined","type","button",3,"onClick"],["label","Save","icon","pi pi-check","type","submit",3,"loading"],[1,"filter-section","mb-4"],[3,"formGroup"],[1,"grid","grid-cols-1","md:grid-cols-2","xl:grid-cols-3","gap-3","items-center","mb-3"],["pInputText","","formControlName","search","placeholder","Search by key or value",1,"w-full"],["formControlName","q","optionLabel","label","optionValue","value","placeholder","Filter by language","appendTo","body",1,"w-full",3,"options","showClear"],[1,"flex","gap-2"],["label","Reset","icon","pi pi-refresh","severity","secondary",3,"onClick"],["label","Filter","icon","pi pi-filter",3,"onClick"],[2,"width","120px"],[2,"width","130px"],[2,"width","100px"],[1,"font-mono","text-sm"],[1,"inline-flex","items-center","gap-1"],[1,"font-semibold","uppercase","text-xs","bg-surface-100","dark:bg-surface-700","px-2","py-1","rounded"],[1,"flex","gap-1"],["icon","pi pi-pencil","styleClass","p-button-rounded p-button-text p-button-info","pTooltip","Edit","tooltipPosition","top",3,"onClick"],["icon","pi pi-trash","styleClass","p-button-rounded p-button-text p-button-danger","pTooltip","Delete","tooltipPosition","top",3,"onClick"],[1,"text-center","py-12"],[1,"flex","flex-col","items-center","justify-center"],[1,"pi","pi-language","text-6xl","text-gray-400","mb-4"],[1,"text-xl","font-semibold","text-gray-600","mb-2"],[1,"text-gray-500"],[1,"text-xs","text-muted-color","font-normal","ml-1"],[1,"text-red-500","block","mt-1"]],template:function(r,e){if(r&1){let a=b();h(0,"p-toast")(1,"p-confirmDialog"),n(2,"div",2)(3,"div",3)(4,"h4",4),o(5,"Translations"),t(),n(6,"div",5)(7,"p-button",6),g("onClick",function(){return d(a),u(e.toggleFilters())}),t(),n(8,"p-button",7),g("onClick",function(){return d(a),u(e.openNew())}),t()()(),f(9,ge,8,3,"div",8),n(10,"div",9)(11,"p-table",10),g("onLazyLoad",function(c){return d(a),u(e.onPageChange(c))}),f(12,fe,11,0,"ng-template",null,0,F)(14,he,17,5,"ng-template",null,1,F),t()(),f(16,ve,7,0,"div",11),t(),n(17,"p-dialog",12),I("visibleChange",function(c){return d(a),V(e.translationDialog,c)||(e.translationDialog=c),u(c)}),g("onHide",function(){return d(a),u(e.hideDialog())}),n(18,"form",13),g("ngSubmit",function(){return d(a),u(e.saveTranslation())}),n(19,"div",14)(20,"div")(21,"label",15),o(22," Key "),n(23,"span",16),o(24,"*"),t(),f(25,_e,2,0,"span",17),t(),h(26,"input",18),f(27,Te,2,0,"small",19),t(),n(28,"div")(29,"label",15),o(30," Language "),n(31,"span",16),o(32,"*"),t(),f(33,be,2,0,"span",17),t(),h(34,"p-select",20),f(35,ye,2,0,"small",19),t(),n(36,"div")(37,"label",15),o(38,"Value "),n(39,"span",16),o(40,"*"),t()(),h(41,"textarea",21),f(42,xe,2,0,"small",19),t(),n(43,"div")(44,"label",15),o(45,"Namespace"),t(),h(46,"input",22),n(47,"small",23),o(48,"Optional \u2014 max 100 characters."),t()()(),n(49,"div",24)(50,"p-button",25),g("onClick",function(){return d(a),u(e.hideDialog())}),t(),h(51,"p-button",26),t()()()}if(r&2){let a,m,c;s(9),p("ngIf",e.showFilters),s(2),p("value",e.translations)("paginator",!0)("rows",e.pageSize)("totalRecords",e.totalRecords)("loading",e.loading)("rowsPerPageOptions",w(23,ue))("lazy",!0)("first",(e.page-1)*e.pageSize),s(5),p("ngIf",!e.loading&&e.translations.length===0),s(),k(w(24,ce)),D("visible",e.translationDialog),p("modal",!0)("header",e.isEditMode?"Edit Translation":"Add Translation"),s(),p("formGroup",e.translationForm),s(7),p("ngIf",e.isEditMode),s(2),p("ngIf",((a=e.translationForm.get("key"))==null?null:a.invalid)&&
1((a=e.translationForm.get("key"))==null?null:a.touched)),s(6),p("ngIf",e.isEditMode),s(),p("options",e.languages),s(),p("ngIf",((m=e.translationForm.get("language"))==null?null:m.invalid)&&((m=e.translationForm.get("language"))==null?null:m.touched)),s(7),p("ngIf",((c=e.translationForm.get("value"))==null?null:c.invalid)&&((c=e.translationForm.get("value"))==null?null:c.touched)),s(9),p("loading",e.saving)}},dependencies:[N,M,H,q,P,A,R,z,j,B,O,me,se,$,W,J,U,oe,ae,ne,X,Q,Z,Y,le,re,ie,te],encapsulation:2})};export{de as TranslationsComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.