PageSourceSearch

https://partner.restoplatform.com/chunk-KOF36DBO.js

js restoplatform.com collected 2026-09-24 09:41:06 UTC 10,205 bytes, 1 lines download raw bytes

1import{a as xt}from"./chunk-EDI4FRGN.js";import{a as yt}from"./chunk-YDE47OJN.js";import{b as it,c as ot,d as rt,e as lt,f as st,g as mt,h as dt,i as ct,j as pt,k as gt,l as ut,m as _t}from"./chunk-4EOZ4GQM.js";import{a as V,b as Ct}from"./chunk-ABS4HHRO.js";import{a as ft,b as ht}from"./chunk-LOPE2D3P.js";import"./chunk-5Y2IASQK.js";import"./chunk-CJAJU6AD.js";import"./chunk-2X7AQD2Q.js";import{a as et,b as nt}from"./chunk-5HEDMDRO.js";import"./chunk-TA4CGIW5.js";import"./chunk-ERKFY33D.js";import"./chunk-DSUZVMNK.js";import{b as Z,c as tt}from"./chunk-WKH5W2V2.js";import{a as Y}from"./chunk-IBZUQYXW.js";import{b as G,f as J,i as X}from"./chunk-7B5TRSS4.js";import{b as W,g as L,j,u as Q}from"./chunk-4T2PTKQJ.js";import{a as at}from"./chunk-QG57Z74K.js";import{a as A}from"./chunk-6AO5R6CW.js";import"./chunk-KT3675XS.js";import"./chunk-VZ3MNGED.js";import"./chunk-AY76R2MH.js";import"./chunk-JCQ33YRD.js";import{T as $,V as q}from"./chunk-2GKCQ5UO.js";import{a as K,b as U}from"./chunk-AZMSRLP2.js";import{k as H}from"./chunk-J32AD3W7.js";import{$b as z,Ab as u,Cb as _,E as R,Hb as C,I as P,Ib as i,J as O,Jb as o,Kb as b,Ob as f,Pb as h,Rb as x,Vb as y,Xa as s,Xb as m,ac as B,ba as T,bc as N,e as I,ha as p,ia as g,jc as l,kb as k,kc as S,pc as M,qb as c,qc as v,rc as E,ua as w,yc as F}from"./chunk-YOAD7BVF.js";import{a as D}from"./chunk-55GY6K5S.js";var wt=()=>[10,20,50];function Tt(t,n){t&1&&b(0,"mat-progress-bar",6)}function bt(t,n){t&1&&(i(0,"th",24),l(1,"Category"),o())}function Mt(t,n){if(t&1&&(i(0,"td",25),l(1),o()),t&2){let e=n.$implicit;s(),S(e.categoryName)}}function vt(t,n){t&1&&(i(0,"th",24),l(1,"Field"),o())}function Et(t,n){if(t&1&&(i(0,"td",25),l(1),o()),t&2){let e=n.$implicit;s(),S(e.field)}}function Vt(t,n){t&1&&(i(0,"th",24),l(1,"Language"),o())}function Dt(t,n){if(t&1&&(i(0,"td",25),l(1),o()),t&2){let e=n.$implicit;s(),S(e.lang)}}function It(t,n){t&1&&(i(0,"th",24),l(1,"Original"),o())}function Rt(t,n){if(t&1&&(i(0,"td",26),l(1),o()),t&2){let e=n.$implicit;s(),S(e.originalValue)}}function Pt(t,n){t&1&&(i(0,"th",24),l(1,"Translation"),o())}function Ot(t,n){if(t&1){let e=x();i(0,"textarea",31),E("ngModelChange",function(r){p(e);let d=m(3);return v(d.editingRow().translatedValue,r)||(d.editingRow().translatedValue=r),g(r)}),o()}if(t&2){let e=m(3);M("ngModel",e.editingRow().translatedValue)}}function kt(t,n){if(t&1){let e=x();i(0,"input",32),E("ngModelChange",function(r){p(e);let d=m(3);return v(d.editingRow().translatedValue,r)||(d.editingRow().translatedValue=r),g(r)}),o()}if(t&2){let e=m(3);M("ngModel",e.editingRow().translatedValue)}}function zt(t,n){if(t&1&&(i(0,"mat-form-field",27),u(1,Ot,1,1,"textarea",29)(2,kt,1,1,"input",30),o()),t&2){let e,a=m(2);s(),_(a.useTextarea((e=a.editingRow())==null?null:e.field)?1:2)}}function Bt(t,n){if(t&1&&(i(0,"span",28),l(1),o()),t&2){let e=m().$implicit;s(),S(e.translatedValue)}}function Nt(t,n){if(t&1&&(i(0,"td",25),u(1,zt,3,1,"mat-form-field",27)(2,Bt,2,1,"span",28),o()),t&2){let e=n.$implicit,a=m();s(),_(a.isEditing(e)?1:2)}}function Ft(t,n){t&1&&(i(0,"th",33),l(1,"Actions"),o())}function Ht(t,n){if(t&1){let e=x();i(0,"button",36),y("click",function(){p(e);let r=m(2);return g(r.saveEdit())}),i(1,"mat-icon"),l(2,"check"),o()(),i(3,"button",36),y("click",function(){p(e);let r=m(2);return g(r.cancelEdit())}),i(4,"mat-icon"),l(5,"close"),o()()}if(t&2){let e=m(2);C("disabled",e.saving()),s(3),C("disabled",e.saving())}}function Wt(t,n){if(t&1){let e=x();i(0,"button",37),y("click",function(){p(e);let r=m().$implicit,d=m();return g(d.startEdit(r))}),i(1,"mat-icon"),l(2,"edit"),o()()}}function Lt(t,n){if(t&1&&(i(0,"td",34),u(1,Ht,6,2)(2,Wt,3,0,"button",35),o()),t&2){let e=n.$implicit,a=m();s(),_(a.isEditing(e)?1:2)}}function jt(t,n){t&1&&b(0,"tr",38)}function Qt(t,n){t&1&&b(0,"tr",39)}function At(t,n){t&1&&(i(0,"div",22)(1,"mat-icon"),l(2,"category"),o(),i(3,"p"),l(4,"No category translations found."),o()())}function Kt(t,n){if(t&1){let e=x();i(0,"mat-paginator",40),y("page",function(r){p(e);let d=m();return g(d.onPage(r))}),o()}if(t&2){let e=m();C("length",e.totalCount())("pageIndex",e.pageIndex)("pageSize",e.pageSize)("pageSizeOptions",F(4,wt))}}var St=class t{api=T(at);appState=T(A);snackBar=T(et);displayedColumns=["categoryName","field","lang","originalValue","translatedValue","actions"];dataSource=new _t([]);totalCount=w(0);loading=w(!0);saving=w(!1);searchText="";pageIndex=0;pageSize=20;editingRow=w(null);
1searchSubject=new I;searchSubscription;useTextarea=xt;paginator;ngOnInit(){this.loadData(),this.searchSubscription=this.searchSubject.pipe(R(300),P()).subscribe(n=>{n===this.searchText&&this.onSearch()})}ngOnDestroy(){this.searchSubscription?.unsubscribe()}onSearchChange(n){this.searchSubject.next(n)}loadData(){let n=this.appState.selectedRestaurantId;if(!n)return;this.loading.set(!0);let e={searchText:this.searchText,pageIndex:this.pageIndex,pageSize:this.pageSize,sortField:"categoryName",sortDirection:"asc"};this.api.searchTranslations(e,n,"category").subscribe({next:a=>{this.dataSource.data=a.items??[],this.totalCount.set(a.totalCount),this.loading.set(!1)},error:()=>{this.dataSource.data=[],this.loading.set(!1)}})}onSearch(){this.pageIndex=0,this.loadData()}onPage(n){this.pageIndex=n.pageIndex,this.pageSize=n.pageSize,this.loadData()}startEdit(n){this.editingRow.set(D({},n))}cancelEdit(){this.editingRow.set(null)}saveEdit(){let n=this.editingRow(),e=this.appState.selectedRestaurantId;!n||!e||(this.saving.set(!0),yt(this.api,e,"category",n,n.translatedValue??"").pipe(O(()=>this.saving.set(!1))).subscribe({next:()=>{this.snackBar.open("Translation saved","OK",{duration:3e3}),this.editingRow.set(null),this.loadData()},error:a=>{let r=a?.error?.message||a?.message||"Save failed";this.snackBar.open(r,"OK",{duration:4e3})}}))}isEditing(n){return this.editingRow()?.id===n.id}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=k({type:t,selectors:[["app-category-translations"]],viewQuery:function(e,a){if(e&1&&z(V,5),e&2){let r;B(r=N())&&(a.paginator=r.first)}},decls:38,vars:7,consts:[[1,"page-header"],[1,"hint"],[1,"search-bar"],["appearance","outline",1,"search-field"],["matInput","","placeholder","Category, field, original or translation\u2026",3,"ngModelChange","keyup.enter","ngModel"],["mat-icon-button","","matSuffix","","type","button",3,"click"],["mode","indeterminate"],[1,"table-container"],["mat-table","",1,"translation-table",3,"dataSource"],["matColumnDef","categoryName"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","field"],["matColumnDef","lang"],["matColumnDef","originalValue"],["mat-cell","","class","cell-wrap",4,"matCellDef"],["matColumnDef","translatedValue"],["matColumnDef","actions"],["mat-header-cell","","class","actions-col",4,"matHeaderCellDef"],["mat-cell","","class","actions-col",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"empty-state"],["showFirstLastButtons","",3,"length","pageIndex","pageSize","pageSizeOptions"],["mat-header-cell",""],["mat-cell",""],["mat-cell","",1,"cell-wrap"],["appearance","outline",1,"inline-edit"],[1,"cell-wrap"],["matInput","","rows","3",3,"ngModel"],["matInput","",3,"ngModel"],["matInput","","rows","3",3,"ngModelChange","ngModel"],["matInput","",3,"ngModelChange","ngModel"],["mat-header-cell","",1,"actions-col"],["mat-cell","",1,"actions-col"],["mat-icon-button","","type","button"],["mat-icon-button","","type","button",3,"click","disabled"],["mat-icon-button","","type","button",3,"click"],["mat-header-row",""],["mat-row",""],["showFirstLastButtons","",3,"page","length","pageIndex","pageSize","pageSizeOptions"]],template:function(e,a){e&1&&(i(0,"div",0)(1,"h2"),l(2,"Category translations"),o(),i(3,"p",1),l(4,"Title and description per language (matches HQ category translation fields)."),o()(),i(5,"div",2)(6,"mat-form-field",3)(7,"mat-label"),l(8,"Search"),o(),i(9,"input",4),E("ngModelChange",function(d){return v(a.searchText,d)||(a.searchText=d),d}),y("ngModelChange",function(d){return a.onSearchChange(d)})("keyup.enter",function(){return a.onSearch()}),o(),i(10,"button",5),y("click",function(){return a.onSearch()}),i(11,"mat-icon"),l(12,"search"),o()()()(),u(13,Tt,1,0,"mat-progress-bar",6),i(14,"div",7)(15,"table",8),f(16,9),c(17,bt,2,0,"th",10)(18,Mt,2,1,"td",11),h(),f(19,12),c(20,vt,2,0,"th",10)(21,Et,2,1,"td",11),h(),f(22,13),c(23,Vt,2,0,"th",10)(24,Dt,2,1,"td",11),h(),f(25,14),c(26,It,2,0,"th",10)(27,Rt,2,1,"td",15),h(),f(28,16),c(29,Pt,2,0,"th",10)(30,Nt,3,1,"td",11),h(),f(31,17),c(32,Ft,2,0,"th",18)(33,Lt,3,1,"td",19),h(),c(34,jt,1,0,"tr",20)(35,Qt,1,0,"tr",21),o(),u(36,At,5,0,"div",22),o(),u(37,Kt,1,5,"mat-paginator",23)),e&2&&(s(9),M("ngModel",a.searchText),s(4),_(a.loading()?13:-1),s(2),C("dataSource",a.dataSource),s(19),C("matHeaderRowDef",a.displayedColumns),s(),C("matRowDefColumns",a.displayedColumns),s(),_(!a.loading()&&a.dataSource.data.length===0?36:-1),s(),_(!a.loading()&&a.totalCount()>0?37:-1))},dependencies:[H,Q,W,L,j,ut,it,rt,dt,lt,ot,ct,st,mt,pt,gt,Ct,V,Y,X,G,J,tt,Z,q,$,U,K,ht,ft,nt],styles:[".page-header[_ngcontent-%COMP%]{margin-bottom:16px}.page-header[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-weight:500}.page-header[_ngcontent-%COMP%]   .hint[_ngcontent-%COMP%]{margin:8px 0 0;font-size:.875rem;color:var(--mat-sys-on-surface-variant)}.cell-wrap[_ngcontent-%COMP%]{max-width:280px;white-space:pre-wrap;word-break:break-word}
1.search-bar[_ngcontent-%COMP%]{margin-bottom:16px}.search-field[_ngcontent-%COMP%]{width:100%;max-width:480px}.loading-center[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:48px}.table-container[_ngcontent-%COMP%]{overflow-x:auto;border-radius:12px;border:1px solid var(--mat-sys-outline-variant)}.translation-table[_ngcontent-%COMP%]{width:100%}.inline-edit[_ngcontent-%COMP%]{width:100%;margin:-8px 0}.actions-col[_ngcontent-%COMP%]{width:100px;text-align:center}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:48px;color:var(--mat-sys-on-surface-variant)}.empty-state[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;opacity:.5}"]})};export{St as CategoryTranslationsComponent};

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.