PageSourceSearch

https://app.inventory-hq.com/chunk-2MZ52RRH.js

js inventory-hq.com collected 2026-10-02 01:33:16 UTC 31,908 bytes, 1 lines download raw bytes

1import{b as nt}from"./chunk-HBJUGWB2.js";import{a as T}from"./chunk-JNWSQRNK.js";import"./chunk-QSDVVFMM.js";import"./chunk-W3OZ4F44.js";import{b as it}from"./chunk-4L74PJ6K.js";import"./chunk-EBSNN2L5.js";import{a as tt}from"./chunk-BPEHRVAX.js";import{a as we}from"./chunk-VDWKEGH5.js";import{a as et}from"./chunk-5KNK55XZ.js";import"./chunk-ZHV4E27D.js";import"./chunk-KYALJWAJ.js";import{b as Te}from"./chunk-VO73WMN2.js";import"./chunk-7NT4NWEP.js";import{a as ye}from"./chunk-TCA7I7WD.js";import{a as He}from"./chunk-EBXY4FYS.js";import{a as Ge}from"./chunk-BP4OJQT5.js";import"./chunk-SDE6QHIA.js";import"./chunk-YZ4JIY5W.js";import"./chunk-HXYKDPUO.js";import{a as Ze}from"./chunk-OBIB7VQE.js";import"./chunk-CJJT7AKL.js";import{b as ge}from"./chunk-B2LJOCVH.js";import{c as he}from"./chunk-6UPE3QPT.js";import"./chunk-VABITLVG.js";import"./chunk-WG52A6SX.js";import{a as rt}from"./chunk-V4KI4HBQ.js";import"./chunk-RA5K7RBV.js";import"./chunk-KEB2KO57.js";import{a as ze}from"./chunk-ZKGBU4QC.js";import"./chunk-DHSOTCDS.js";import"./chunk-ZQNKLNIU.js";import{b as fe,c as Xe}from"./chunk-JSKB5VRW.js";import{a as Q,b as Se}from"./chunk-EGL3HINK.js";import{b as _e}from"./chunk-GHNSCEDG.js";import{a as te}from"./chunk-ATUQWZ6Q.js";import{a as de,b as ue,c as ve}from"./chunk-HZKFC4BO.js";import{a as Qe}from"./chunk-VUODL4RU.js";import"./chunk-7KHBSKJZ.js";import{a as We}from"./chunk-GVYEA7N6.js";import{a as D}from"./chunk-NOU2DUYO.js";import{a as ie}from"./chunk-LYOMTRLM.js";import{A as me,B as pe,e as A,f as W,h as B,i as re,l as ne,m as oe,n as ae,r as se,s as le,t as Ye,u as qe,v as $e,z as ce}from"./chunk-XG2GGTH5.js";import"./chunk-JVIWRQAS.js";import{a as ee}from"./chunk-3FSOHL3E.js";import{g as Ue}from"./chunk-NPNCMWIN.js";import"./chunk-LZF4ZOU3.js";import{B as V,a as X,c as Ne,d as Le,h as Je,i as Ke,s as Z}from"./chunk-MKZSSJNS.js";import{$a as j,Bb as c,Ca as o,Cb as d,Db as F,Gb as L,Hb as J,Ib as K,Ja as S,Kb as w,Ob as m,Oc as P,Pa as N,Pb as p,Pc as O,Qb as q,Ta as G,Ua as R,_b as Re,ab as U,ba as h,bb as x,ca as y,db as C,eb as b,fb as v,gb as n,hb as i,ib as u,kc as $,l as Be,mb as k,nb as E,ob as I,oc as je,rb as _,rc as z,tb as f,vc as H,z as Ve,za as Me,zb as Y}from"./chunk-VEBEK5NG.js";import{a as Ee,b as Fe}from"./chunk-AY4LCFTV.js";var M=class{registrationNo;description;model;year;color;driverName;constructor(s){Object.keys(s).forEach(e=>{let t=s[e];t!=null&&t!==""&&(this[e]=t)})}};var Ce=class a{constructor(s,e,t,r,l){this.servicetruck=s;this.dialogRef=e;this.fb=t;this.servicetrucksService=r;this.alertService=l;this.initializeForm()}servicetruck;dialogRef;fb;servicetrucksService;alertService;form;initializeForm(){this.form=this.fb.group({registrationNo:["",[W.required]],model:[""],year:[null],color:[""],driverName:[""],description:[""]})}createServiceTruck(){let s=new M(this.form.value);this.servicetrucksService.createServiceTruck(s).subscribe({next:e=>{let{isSuccess:t=!1,message:r=""}=e;t&&(this.alertService.successToaster(r),this.onClose(!0))}})}onSubmit(){this.form.valid&&this.createServiceTruck()}onClose(s=!1){this.dialogRef.close({isSuccess:s})}static \u0275fac=function(e){return new(e||a)(S(ue),S(de),S(ce),S(T),S(V))};static \u0275cmp=N({type:a,selectors:[["app-create-service-truck"]],features:[w([T])],decls:64,vars:31,consts:[[1,"dialog-container"],[1,"dialog-header"],[1,"left-section"],[1,"heading"],[1,"right-section"],[1,"close-icon"],["path","assets/images/common/cross-icon.svg",3,"click"],[1,"dialog-content"],["autoFocus","",3,"ngSubmit","formGroup"],[1,"fields-wrapper"],[1,"input-field","required"],["for",""],[1,"field-wrap"],[1,"field"],["type","text","formControlName","registrationNo"],["controlName","registrationNo",3,"form"],[1,"input-field"],["type","text","formControlName","model"],["controlName","model",3,"form"],["type","number","formControlName","year"],["controlName","year",3,"form"],["type","text","formControlName","color"],["controlName","color",3,"form"],["type","text","formControlName","driverName"],["controlName","driverName",3,"form"],["formControlName","description"],["controlName","description",3,"form"],[1,"submit-button"],[1,"rounded-btn","primary-gradient"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),c(4),m(5,"translate"),i()(),n(6,"div",4)(7,"div",5)(8,"app-icon",6),_("click",function(){return t.onClose()}),i()()()(),n(9,"div",7)(10,"form",8),_("ngSubmit",function(){return t.onSubmit()}),n(11,"div",9)(12,"div",10)(13,"label",11),c(14),m(15,"translate"),i(),n(16,"div",12)(17,"div",13),u(18,"input",14),i(),u(19,"app-form-error-message",15),i()(),n(20,"div",16)(21,"label",11),c(22),m(23,"translate"),i(),n(24,"div",12)(25,"div",13),u(26,"input",17),i(),u(27,"app-form-error-message",18),i()(),n(28,"div",16)(29,"label",11),c(30),m(31,"translate"),i(),n(32,"div",12)(33,"div",13),u(34,"input",19),i(),u(35,"app-form-error-message",20),i()(),n(36,"div",16)(37,"label",11),c(38),m(39,"translate"),i(),n(40,"div",12)(41,"div",13),u(42,"input",21),i(),u(43,"app-form-error-message",22),i()(),n(44,"div",16)(45,"label",11),c(46),m(47,"translate"),i(),n(48,"div",12)(49,"div",13),u(50,"input",23),i(),u(51,"app-form-error-message",24),i()(),n(52,"div",16)(53,"label",11),c(54),m(55,"translate"),i(),n(56,"div",12)(57,"div",13),u(58,"textarea",25),i(),u(59,"app-form-error-message",26),i()()(),n(60,"div",27)(61,"button",28),c(62),m(63,"translate"),i()()()()()),e&2&&(o(4),F(" ",p(5,15,t.servicetruck?"editServiceTruck":"createServiceTruck")," "),o(6),v("formGroup",t.form),o(4),d(p(15,17,"registrationNo")),o(5),v("form",t.form),o(3),d(p(23,19,"model")),o(5),v("form",t.form),o(3),d(p(31,21,"year")),o(5),v("form",t.form),o(3),d(p(39,23,"color")),o(5),v("form",t.form),o(3),d(p(47,25,"driverName")),o(5),v("form",t.form),o(3),d(p(55,27,"description")),o(5),v("form",t.form),o(3),d(p(63,29,t.servicetruck?"editServiceTruck":"createServiceTruck")))},dependencies:[ie,D,pe,oe,A,ae,B,re,le,se,O,P],styles:[".dialog-container[_ngcontent-%COMP%]{width:400px;min-width:400px}@media screen and (max-width:430px){.dialog-container[_ngcontent-%COMP%]{width:360px;min-width:360px}}@media screen and (max-width:390px){.dialog-container[_ngcontent-%COMP%]{width:320px;min-width:320px}}.dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]   .fields-wrapper[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:.5rem;max-height:60vh;overflow-y:auto;padding-right:4px}.dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]   .submit-button[_ngcontent-%COMP%], .dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]   .submit-button[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{width:100%}"]})};var be=class{registrationNo;name;description;model;year;color;driverName;isActive;
1constructor(s){Object.keys(s).forEach(e=>{let t=s[e];t!=null&&t!==""&&(this[e]=t)})}};function pt(a,s){if(a&1&&(n(0,"option",30),c(1),m(2,"lowercase"),m(3,"translate"),i()),a&2){let e=s.$implicit,t=f();v("ngValue",e===t.SERVICE_TRUCK_STATUS.ACTIVE),o(),F(" ",p(3,4,p(2,2,e)))}}var Ie=class a{constructor(s,e,t,r,l){this.servicetruck=s;this.dialogRef=e;this.servicetrucksService=r;this.alertService=l;this.form=t.group({registrationNo:[s?.registrationNo??"",[W.required]],name:[s?.name??""],model:[s?.model??""],year:[s?.year??null],color:[s?.color??""],driverName:[s?.driverName??""],description:[s?.description??""],isActive:[s?.isActive??!0,[W.required]]})}servicetruck;dialogRef;servicetrucksService;alertService;form;SERVICE_TRUCK_STATUS=Le;servieTruckStatusOptions=Object.values(this.SERVICE_TRUCK_STATUS);createServiceTruck(){let s=new M(this.form.value);this.servicetrucksService.createServiceTruck(s).subscribe({next:e=>{let{isSuccess:t=!1,message:r=""}=e;t&&(this.alertService.successToaster(r),this.onClose(!0))}})}updateServiceTruck(){let s=new be(this.form.value);this.servicetrucksService.updateServiceTruck(this.servicetruck.id,s).subscribe({next:e=>{let{isSuccess:t=!1,message:r=""}=e;t&&(this.alertService.successToaster(r),this.onClose(!0))}})}onSubmit(){this.form.valid&&(this.servicetruck?this.updateServiceTruck():this.createServiceTruck())}onClose(s=!1){this.dialogRef.close({isSuccess:s})}ngOnInit(){this.form.patchValue(this.servicetruck)}static \u0275fac=function(e){return new(e||a)(S(ue),S(de),S(ce),S(T),S(V))};static \u0275cmp=N({type:a,selectors:[["app-update-service-truck"]],features:[w([T])],decls:82,vars:39,consts:[[1,"dialog-container"],[1,"dialog-header"],[1,"left-section"],[1,"heading"],[1,"right-section"],[1,"close-icon"],["path","assets/images/common/cross-icon.svg",3,"click"],[1,"dialog-content"],["autoFocus","",3,"ngSubmit","formGroup"],[1,"fields-wrapper"],[1,"input-field","required"],["for",""],[1,"field-wrap"],[1,"field"],["type","text","formControlName","registrationNo"],["controlName","registrationNo",3,"form"],[1,"input-field"],["type","text","formControlName","name"],["controlName","name",3,"form"],["type","text","formControlName","model"],["controlName","model",3,"form"],["type","number","formControlName","year"],["controlName","year",3,"form"],["type","text","formControlName","color"],["controlName","color",3,"form"],["type","text","formControlName","driverName"],["controlName","driverName",3,"form"],["formControlName","description"],["controlName","description",3,"form"],["formControlName","isActive"],[3,"ngValue"],["controlName","isActive",3,"form"],[1,"submit-button"],[1,"rounded-btn","primary-gradient"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),c(4),m(5,"translate"),i()(),n(6,"div",4)(7,"div",5)(8,"app-icon",6),_("click",function(){return t.onClose()}),i()()()(),n(9,"div",7)(10,"form",8),_("ngSubmit",function(){return t.onSubmit()}),n(11,"div",9)(12,"div",10)(13,"label",11),c(14),m(15,"translate"),i(),n(16,"div",12)(17,"div",13),u(18,"input",14),i(),u(19,"app-form-error-message",15),i()(),n(20,"div",16)(21,"label",11),c(22),m(23,"translate"),i(),n(24,"div",12)(25,"div",13),u(26,"input",17),i(),u(27,"app-form-error-message",18),i()(),n(28,"div",16)(29,"label",11),c(30),m(31,"translate"),i(),n(32,"div",12)(33,"div",13),u(34,"input",19),i(),u(35,"app-form-error-message",20),i()(),n(36,"div",16)(37,"label",11),c(38),m(39,"translate"),i(),n(40,"div",12)(41,"div",13),u(42,"input",21),i(),u(43,"app-form-error-message",22),i()(),n(44,"div",16)(45,"label",11),c(46),m(47,"translate"),i(),n(48,"div",12)(49,"div",13),u(50,"input",23),i(),u(51,"app-form-error-message",24),i()(),n(52,"div",16)(53,"label",11),c(54),m(55,"translate"),i(),n(56,"div",12)(57,"div",13),u(58,"input",25),i(),u(59,"app-form-error-message",26),i()(),n(60,"div",16)(61,"label",11),c(62),m(63,"translate"),i(),n(64,"div",12)(65,"div",13),u(66,"textarea",27),i(),u(67,"app-form-error-message",28),i()(),n(68,"div",16)(69,"div",12)(70,"label",11),c(71),m(72,"translate"),i(),n(73,"div",13)(74,"select",29),C(75,pt,4,6,"option",30,x),i()(),u(77,"app-form-error-message",31),i()()(),n(78,"div",32)(79,"button",33),c(80),m(81,"translate"),i()()()()()),e&2&&(o(4),F(" ",p(5,19,t.servicetruck?"editServiceTruck":"createServiceTruck")," "),o(6),v("formGroup",t.form),o(4),d(p(15,21,"registrationNo")),o(5),v("form",t.form),o(3),d(p(23,23,"name")),o(5),v("form",t.form),o(3),d(p(31,25,"model")),o(5),v("form",t.form),o(3),d(p(39,27,"year")),o(5),v("form",t.form),o(3),d(p(47,29,"color")),o(5),v("form",t.form),o(3),d(p(55,31,"driverName")),o(5),v("form",t.form),o(3),d(p(63,33,"description")),o(5),v("form",t.form),o(4),F(" ",p(72,35,"status")," "),o(4),b(t.servieTruckStatusOptions),o(2),v("form",t.form),o(3),d(p(81,37,t.servicetruck?"editServiceTruck":"createServiceTruck")))},dependencies:[ie,D,pe,oe,qe,$e,A,ae,Ye,B,re,le,se,O,P,je],styles:[".dialog-container[_ngcontent-%COMP%]{width:400px;min-width:400px}@media screen and (max-width:430px){.dialog-container[_ngcontent-%COMP%]{width:360px;min-width:360px}}@media screen and (max-width:390px){.dialog-container[_ngcontent-%COMP%]{width:320px;min-width:320px}}.dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]   .fields-wrapper[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:.5rem;max-height:60vh;overflow-y:auto;padding-right:4px}.dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]   .submit-button[_ngcontent-%COMP%], .dialog-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]   .submit-button[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{width:100%}"]})};function _t(a,s){if(a&1&&(n(0,"th"),c(1),m(2,"translate"),i()),a&2){let e=s.$implicit;o(),d(p(2,1,e))}}function ht(a,s){if(a&1){let e=I();n(0,"tr")(1,"td"),c(2),i(),n(3,"td"),c(4),m(5,"default"),i(),n(6,"td"),c(7),m(8,"default"),i(),n(9,"td"),c(10),m(11,"default"),i(),n(12,"td"),c(13),m(14,"date"),i(),n(15,"td"),c(16),m(17,"date"),i(),n(18,"td"),c(19),m(20,"date"),i(),n(21,"td")(22,"div",16),k(23),n(24,"app-table-action",17),_("click",function(){let r=h(e).$implicit,l=f();return y(l.openUpdateDialog(r))}),i(),E(),k(25),n(26,"app-table-action",17),_("click",function(){let r=h(e).$implicit,l=f();return y(l.goToDetail(r.warehouseId))}),i(),E(),i()()()}if(a&2){let e=s.$implicit,t=f();o(2),d(e.registrationNo),o(2),d(p(5,9,e.description)),o(3),d(p(8,11,e.model)),o(3),d(p(11,13,e.driverName)),o(3),d(e.expiredAt?p(14,15,e.expiredAt):"-"),o(3),d(e.scheduledExpiryAt?p(17,17,e.scheduledExpiryAt):"-"),o(3),d(q(20,19,e.createdAt,"medium")),o(5),v("type",t.TABLE_ACTIONS.EDIT),o(2),v("type",t.TABLE_ACTIONS.
1VIEW)}}function yt(a,s){a&1&&u(0,"app-data-not-found")}var xe=class a extends te{constructor(e,t,r,l,g,lt,ct){super(e);this.serviceTrucksService=t;this.dialogService=r;this.loaderService=l;this.alertService=g;this.translationService=lt;this.routerService=ct}serviceTrucksService;dialogService;loaderService;alertService;translationService;routerService;columns=["registrationNo","description","model","driverName","expiredAt","scheduledExpiryAt","createdOn","action"];items=[];filteredItems=[];filters=new Q;TABLE_ACTIONS=X;totalServiceTrucks=0;getFilters(){return{limit:10}}getServiceTrucks(){let e=this.getFilters();this.serviceTrucksService.getServiceTrucks(e).subscribe({next:t=>{let{isSuccess:r=!1,data:l}=t;r&&(this.items=l,this.filteredItems=l,this.totalServiceTrucks=l.length)}})}openCreateDialog(){this.dialogService.openDialog(Ce).afterClosed().subscribe({next:({isSuccess:t})=>{t&&this.getServiceTrucks()}})}handleOpenCreateDialog(){if(this.isServiceTruckLimitExceeded){let e=this.translationService.getTranslation("serviceTruckLimitExceededNote"),t=this.translationService.getTranslation("upgradeLimit"),r=this.translationService.getTranslation("goBack");Be(this.alertService.confirmationPopup(e,t,r)).subscribe({next:({isConfirmed:l})=>{l&&this.routerService.navigate("/app/settings/billing-and-subscription/upgrade-limits",{addOnType:"service_truck"})}});return}this.openCreateDialog()}get maxServiceTrucks(){let{maxServiceTrucks:e=0}=this.storageService.currentSubscription.subscription||{};return e}get isServiceTruckLimitExceeded(){return this.totalServiceTrucks>=this.maxServiceTrucks}openUpdateDialog(e=null){this.dialogService.openDialog(Ie,e,!0).afterClosed().subscribe({next:({isSuccess:r})=>{r&&this.getServiceTrucks()}})}onSearchChange(e){let t=e.toLowerCase().trim();if(!t){this.filteredItems=this.items;return}this.filteredItems=this.items.filter(r=>r.registrationNo?.toLowerCase().includes(t)||r.name?.toLowerCase().includes(t)||r.description?.toLowerCase().includes(t)||r.model?.toLowerCase().includes(t)||r.driverName?.toLowerCase().includes(t))}goToDetail(e){this.routerService.navigate("/app/service-trucks/detail",{id:e})}ngOnInit(){this.getServiceTrucks()}static \u0275fac=function(t){return new(t||a)(S(Z),S(T),S(ve),S(_e),S(V),S(We),S(ee))};static \u0275cmp=N({type:a,selectors:[["app-service-trucks-listing"]],features:[w([T,Ge]),G],decls:34,vars:14,consts:[[1,"page-container"],[1,"page-header"],[1,"left-section"],[1,"page-heading"],[1,"page-description"],[1,"right-section"],[1,"rounded-btn","primary-gradient","w-150px",3,"click"],[1,"page-content"],[1,"filter-section"],[1,"search-section","section-bordered-shadow"],["type","search",3,"ngModelChange","placeholder","ngModel"],[1,"filter-icon",3,"click"],["path","assets/images/common/box-search-icon.svg"],[1,"data-table"],[1,"bottom-border-cells"],[4,"ngIf"],[1,"table-action-btns"],[3,"click","type"]],template:function(t,r){t&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),c(4),m(5,"translate"),i(),n(6,"div",4),c(7),m(8,"translate"),i()(),n(9,"div",5),k(10),n(11,"button",6),_("click",function(){return r.handleOpenCreateDialog()}),c(12),m(13,"translate"),i(),E(),i()(),n(14,"div",7)(15,"div",8)(16,"div",2)(17,"div",9)(18,"input",10),m(19,"translate"),K("ngModelChange",function(g){return J(r.filters.search,g)||(r.filters.search=g),g}),_("ngModelChange",function(g){return r.onSearchChange(g)}),i()()(),n(20,"div",5)(21,"div",11),_("click",function(){return r.onSearchChange(r.filters.search)}),u(22,"app-icon",12),i()()(),n(23,"div",13)(24,"table",14)(25,"thead")(26,"tr"),C(27,_t,3,3,"th",null,x),i()(),n(29,"tbody"),C(30,ht,27,22,"tr",null,x),i()()(),k(32),R(33,yt,1,0,"app-data-not-found",15),E(),i()()),t&2&&(o(4),F("",p(5,6,"serviceTrucks")," "),o(3),d(p(8,8,"serviceTrucksDescription")),o(5),F(" ",p(13,10,"addServiceTruck")),o(6),v("placeholder",p(19,12,"serviceTruckSearchPlaceholder")),L("ngModel",r.filters.search),o(9),b(r.columns),o(3),b(r.filteredItems),o(3),v("ngIf",!r.loaderService.loading()&&!r.filteredItems.length))},dependencies:[H,$,Se,fe,me,A,B,ne,D,O,z,P,He],encapsulation:2})};var Tt=(a,s)=>s.label;function Ct(a,s){if(a&1){let e=I();n(0,"div",13),_("click",function(){h(e);let r=f(2);return y(r.openFilterDialog())}),u(1,"app-icon",21),i()}if(a&2){let e=f(2);Y("blink",e.areFiltersApplied)}}function bt(a,s){if(a&1){let e=I();n(0,"th",22),_("sortChange",function(r){h(e);let l=f(2);return y(l.onInventorySortChange(r))}),i()}if(a&2){let e=s.$implicit,t=f(2);v("label",e.label)("sortable",e.sortable??!1)("sortKey",e.sortKey??"")("activeSortKey",t.inventoryFilters.sortBy)("sortOrder",t.inventoryFilters.sortOrder)}}function It(a,s){if(a&1){let e=I();n(0,"app-table-action",28),_("click",function(){h(e);let r=f().$implicit,l=f(2);return y(l.goToDetail(r.id))}),i()}if(a&2){let e=f(3);
1v("type",e.TABLE_ACTIONS.VIEW)}}function xt(a,s){if(a&1){let e=I();n(0,"tr")(1,"td")(2,"div",23)(3,"img",24),_("error",function(r){h(e);let l=f(2);return y(l.onImageNotFound(r))}),i()()(),n(4,"td"),c(5),i(),n(6,"td"),c(7),i(),n(8,"td"),c(9),i(),n(10,"td"),c(11),i(),n(12,"td"),c(13),i(),n(14,"td")(15,"span",25),c(16),m(17,"enumToKey"),m(18,"translate"),i()(),n(19,"td")(20,"div",26),j(21,It,1,1,"app-table-action",27),i()()()}if(a&2){let e=s.$implicit,t=f(2);o(3),v("src",e==null||e.media==null?null:e.media.baseUrlPath,Me),o(2),d(e.materialName),o(2),d(e.categoriesNames||"-"),o(2),d(e==null||e.unit==null?null:e.unit.name),o(2),d(e==null?null:e.quantityInWarehouse),o(2),d(e==null?null:e.minimumStockAlert),o(2),Y("red",e.status===t.INVENTORY_STATUS.INACTIVE),o(),d(p(18,12,p(17,10,e.status))),o(5),U(t.hasPermission(t.PERMISSIONS.VIEW_INVENTORY)?21:-1)}}function kt(a,s){a&1&&u(0,"app-data-not-found")}function Et(a,s){if(a&1){let e=I();n(0,"div",8)(1,"div",9)(2,"div",2)(3,"div",10)(4,"input",11),m(5,"translate"),_("keyup.enter",function(){h(e);let r=f();return y(r.setQueryParams(!0))}),K("ngModelChange",function(r){h(e);let l=f();return J(l.inventoryFilters.search,r)||(l.inventoryFilters.search=r),y(r)}),_("ngModelChange",function(r){h(e);let l=f();return y(l.onSearchChange(r))}),i()()(),n(6,"div",12)(7,"div",13),_("click",function(){h(e);let r=f();return y(r.setQueryParams(!0))}),u(8,"app-icon",14),i(),j(9,Ct,2,2,"div",15),i()(),n(10,"div",16)(11,"table",17)(12,"thead")(13,"tr"),C(14,bt,1,5,"th",18,Tt),i()(),n(16,"tbody"),C(17,xt,22,14,"tr",null,x),i()()(),k(19),R(20,kt,1,0,"app-data-not-found",19),E(),n(21,"app-pagination",20),_("pageChange",function(r){h(e);let l=f();return y(l.onInventoryPageChange(r))})("itemsPerPageChange",function(r){h(e);let l=f();return y(l.onInventoryPerPageChange(r))}),i()()}if(a&2){let e=f();o(4),v("placeholder",p(5,7,"search")),L("ngModel",e.inventoryFilters.search),o(5),U(e.showFilterBtn?9:-1),o(5),b(e.inventoryCols),o(3),b(e.inventories),o(3),v("ngIf",!e.loaderService.loading()&&!e.inventories.length),o(),v("currentPage",e.inventoryFilters.page)("totalItems",e.inventoryFilters.totalItems)("itemsPerPage",e.inventoryFilters.limit)}}function Ft(a,s){if(a&1&&(n(0,"th"),c(1),m(2,"translate"),i()),a&2){let e=s.$implicit;o(),d(p(2,1,e))}}function Nt(a,s){if(a&1){let e=I();n(0,"app-table-action",28),_("click",function(){h(e);let r=f().$implicit,l=f(2);return y(l.goToDetail(r.id))}),i()}if(a&2){let e=f(3);v("type",e.TABLE_ACTIONS.VIEW)}}function wt(a,s){if(a&1&&(n(0,"tr")(1,"td"),c(2),i(),n(3,"td"),c(4),i(),n(5,"td")(6,"span",25),c(7),m(8,"enumToKey"),m(9,"translate"),i()(),n(10,"td"),c(11),m(12,"currencyFormat"),i(),n(13,"td"),c(14),m(15,"date"),i(),n(16,"td")(17,"div",26),j(18,Nt,1,1,"app-table-action",27),i()()()),a&2){let e=s.$implicit,t=f(2);o(2),d(e.name),o(2),d(e.address),o(2),Y("purple",e.status===t.JOB_STATUS.APPROVED)("blue",e.status===t.JOB_STATUS.IN_PROGRESS)("gray",e.status===t.JOB_STATUS.CREATED)("red",e.status===t.JOB_STATUS.REJECTED)("orange",e.status===t.JOB_STATUS.READY_FOR_QC),o(),d(p(9,18,p(8,16,e.status))),o(4),d(p(12,20,e.totalJobCost)),o(3),d(q(15,22,e.createdAt,"M/d/yyyy")),o(4),U(t.hasPermission(t.PERMISSIONS.VIEW_JOBS)?18:-1)}}function Pt(a,s){a&1&&u(0,"app-data-not-found")}function Ot(a,s){if(a&1){let e=I();n(0,"div",8)(1,"div",9)(2,"div",2)(3,"div",10)(4,"input",29),m(5,"translate"),K("ngModelChange",function(r){h(e);let l=f();return J(l.jobsFilters.search,r)||(l.jobsFilters.search=r),y(r)}),_("keyup.enter",function(){h(e);let r=f();return y(r.setQueryParams(!0))})("ngModelChange",function(r){h(e);let l=f();return y(l.onSearchChange(r))}),i()()(),n(6,"div",12)(7,"div",13),_("click",function(){h(e);let r=f();return y(r.setQueryParams(!0))}),u(8,"app-icon",14),i()()(),n(9,"div",16)(10,"table",30)(11,"thead")(12,"tr"),C(13,Ft,3,3,"th",null,x),i()(),n(15,"tbody"),C(16,wt,19,25,"tr",null,x),i()()(),k(18),R(19,Pt,1,0,"app-data-not-found",19),E(),n(20,"app-pagination",20),_("pageChange",function(r){h(e);let l=f();return y(l.onJobsPageChange(r))})("itemsPerPageChange",function(r){h(e);let l=f();return y(l.onJobsPerPageChange(r))}),i()()}if(a&2){let e=f();o(4),v("placeholder",p(5,6,"jobSearchPlaceholder")),L("ngModel",e.jobsFilters.search),o(9),b(e.jobCols),o(3),b(e.jobs),o(3),v("ngIf",!e.loaderService.loading()&&!e.jobs.length),o(),v("currentPage",e.jobsFilters.page)("totalItems",e.jobsFilters.totalItems)("itemsPerPage",e.jobsFilters.limit)}}var st=(e=>(e.INVENTORY="inventory",e.JOBS="jobs",e))(st||{}),ke=class a extends te{constructor(e,t,r,l,g,lt,ct,Dt,At,Bt,Vt){super(l);this.route=e;this.routerService=t;this.warehousesService=r;this.inventoryService=g;this.loaderService=lt;this.jobsService=ct;this.cdr=Dt;this.dialogService=At;this.categoriesService=Bt;this.utilService=Vt}route;routerService;warehousesService;inventoryService;loaderService;jobsService;cdr;dialogService;categoriesService;utilService;warehouse=null;warehouseId=null;activeTab="inventory";tabs=[{title:"inventory",value:"inventory"},{title:"jobs",value:"jobs"}];Tabs=st;TABLE_ACTIONS=X;INVENTORY_STATUS=Ne;inventories=[];inventoryCols=[{label:"image"},{label:"name",sortKey:"materialName",sortable:!0},{label:"categories"}
1,{label:"unitType",sortKey:"unitName",sortable:!0},{label:"quantityInServiceTruck",sortKey:"stockCount",sortable:!0},{label:"minimumStockAlert"},{label:"status"},{label:"action"}];inventoryFilters=new we;inventoryUnits=[];categories=[];JOB_STATUS=Ke;jobCols=["jobName","location","status","totalValue","createDate","action"];jobs=[];jobsFilters=new Q;subscribeQueryParams(){this.route.queryParams.subscribe({next:e=>{if(this.warehouseId=e.id,e.tab?this.activeTab=e.tab:this.activeTab="inventory",this.warehouseId)if(this.getWarehousesById(),this.activeTab==="inventory"){let t=new we(e);this.inventoryFilters.page=t.page,this.inventoryFilters.limit=t.limit,this.inventoryFilters.search=t.search,this.inventoryFilters.status=t.status,this.inventoryFilters.unitId=t.unitId,this.inventoryFilters.categoryId=t.categoryId,this.inventoryFilters.stockStatus=t.stockStatus,this.inventoryFilters.sortBy=t.sortBy,this.inventoryFilters.sortOrder=t.sortOrder,this.getInventories()}else{let t=new Q(e);this.jobsFilters.page=t.page,this.jobsFilters.limit=t.limit,this.jobsFilters.search=t.search,this.getJobs()}}})}getWarehousesById(){this.warehousesService.getWarehouseById(this.warehouseId).subscribe({next:e=>{let{isSuccess:t=!1,data:r}=e;t&&(this.warehouse=r)}})}getFilters(){let e={tab:this.activeTab};return this.activeTab==="inventory"?(e.page=this.inventoryFilters.page,e.limit=this.inventoryFilters.limit,e.search=this.inventoryFilters.search,this.inventoryFilters.status&&(e.status=this.inventoryFilters.status),this.inventoryFilters.unitId&&(e.unitId=this.inventoryFilters.unitId),this.inventoryFilters.categoryId&&(e.categoryId=this.inventoryFilters.categoryId),this.inventoryFilters.stockStatus&&(e.stockStatus=this.inventoryFilters.stockStatus),this.inventoryFilters.sortBy&&(e.sortBy=this.inventoryFilters.sortBy,e.sortOrder=this.inventoryFilters.sortOrder)):(e.page=this.jobsFilters.page,e.limit=this.jobsFilters.limit,e.search=this.jobsFilters.search),e}onTabChange(e){this.activeTab=e,this.setQueryParams(!0)}isTabActive(e){return this.activeTab===e}goToDetail(e){this.activeTab==="inventory"?this.routerService.navigate("app/service-trucks/inventory-detail",{id:e}):this.routerService.navigate("app/service-trucks/job-detail",{id:e})}onImageNotFound(e){e.target.src="assets/images/common/image-placeholder.jpg"}onSearchChange(e){e||this.setQueryParams(!0)}setQueryParams(e=!1){let t={tab:this.activeTab,id:this.warehouseId};this.activeTab==="inventory"?(e&&(this.inventoryFilters.page=1),t.page=this.inventoryFilters.page,t.limit=this.inventoryFilters.limit,t.search=this.inventoryFilters.search,this.inventoryFilters.status&&(t.status=this.inventoryFilters.status),this.inventoryFilters.unitId&&(t.unitId=this.inventoryFilters.unitId),this.inventoryFilters.categoryId&&(t.categoryId=this.inventoryFilters.categoryId),this.inventoryFilters.stockStatus&&(t.stockStatus=this.inventoryFilters.stockStatus),this.inventoryFilters.sortBy&&(t.sortBy=this.inventoryFilters.sortBy,t.sortOrder=this.inventoryFilters.sortOrder)):(e&&(this.jobsFilters.page=1),t.page=this.jobsFilters.page,t.limit=this.jobsFilters.limit,t.search=this.jobsFilters.search),this.routerService.navigate("/app/service-trucks/detail",t)}getInventories(){let e=this.getFilters();delete e.tab,this.inventoryService.getInventoryByWarehouseId(this.warehouseId,e).subscribe({next:t=>{let{isSuccess:r=!1,data:l,paginator:g}=t;r&&(this.inventories=l,this.inventoryFilters.totalPages=g.totalPages,this.inventoryFilters.totalItems=g.totalItems,this.cdr.markForCheck())}})}onInventoryPageChange(e){this.inventoryFilters.page=e,this.setQueryParams()}onInventoryPerPageChange(e){this.inventoryFilters.limit=e,this.inventoryFilters.page=1,this.setQueryParams()}onInventorySortChange({sortBy:e,sortOrder:t}){this.inventoryFilters.sortBy=e,this.inventoryFilters.sortOrder=t,this.setQueryParams(!0)}getJobs(){let e=this.getFilters();delete e.tab,this.jobsService.getJobsByWarehouseId(this.warehouseId,e).subscribe({next:t=>{let{isSuccess:r=!1,data:l,paginator:g}=t;r&&(this.jobs=l,this.jobsFilters.totalPages=g.totalPages,this.jobsFilters.totalItems=g.totalItems)}})}onJobsPageChange(e){this.inventoryFilters.page=e,this.setQueryParams()}onJobsPerPageChange(e){this.inventoryFilters.limit=e,this.inventoryFilters.page=1,this.setQueryParams()}openFilterDialog(){let e=[{label:"activeStock",value:""},...Object.values(Je).map(g=>({label:this.utilService.enumToCamelCase(g),value:g}))],r={fields:[{label:"unitType",key:"unitId",type:"select",options:this.inventoryUnits.map(g=>Fe(Ee({},g),{label:g.name,value:g.id}))},{label:"category",key:"categoryId",type:"select",options:this.categories.map(g=>Fe(Ee({},g),{label:g.name,value:g.id}))},{label:"status",key:"status",type:"select",options:Object.values(Ne).map(g=>({label:this.utilService.enumToCamelCase(g),value:g}))},{label:"stockStatus",key:"stockStatus",type:"select",options:e,hideAllOption:!0}
1],formData:{unitId:this.inventoryFilters.unitId,categoryId:this.inventoryFilters.categoryId,status:this.inventoryFilters.status,stockStatus:this.inventoryFilters.stockStatus}};this.dialogService.openDialog(Ze,r,!0).afterClosed().pipe(Ve(Boolean)).subscribe({next:g=>{this.inventoryFilters.page=1,this.inventoryFilters.unitId=g.unitId,this.inventoryFilters.categoryId=g.categoryId,this.inventoryFilters.status=g.status,this.inventoryFilters.stockStatus=g.stockStatus,this.setQueryParams(!0)}})}get areFiltersApplied(){return!!(this.inventoryFilters.unitId||this.inventoryFilters.categoryId||this.inventoryFilters.status||this.inventoryFilters.stockStatus)}get showFilterBtn(){return this.isTabActive("inventory")}getInventoryUnits(){this.inventoryService.getInventoryUnits().subscribe({next:e=>{let{isSuccess:t=!1,data:r=[]}=e;t&&(this.inventoryUnits=r)}})}getCategories(){this.categoriesService.getAllCategories().subscribe({next:e=>{let{isSuccess:t=!1,data:r=[]}=e;t&&(this.categories=r)}})}ngOnInit(){this.subscribeQueryParams(),this.getInventoryUnits(),this.getCategories()}static \u0275fac=function(t){return new(t||a)(S(Ue),S(ee),S(he),S(Z),S(ge),S(_e),S(Te),S(Re),S(ve),S(ye),S(Qe))};static \u0275cmp=N({type:a,selectors:[["app-service-truck-details"]],features:[w([he,ge,Te,ye]),G],decls:15,vars:7,consts:[[1,"page-container"],[1,"page-header"],[1,"left-section"],[1,"page-heading"],[1,"page-description"],[1,"page-content"],[3,"onChange","tabs","activeTab"],[1,"tables-section"],[1,"particular-table-section"],[1,"filter-section"],[1,"search-section","section-bordered-shadow"],["type","search",3,"keyup.enter","ngModelChange","placeholder","ngModel"],[1,"right-section"],[1,"filter-icon",3,"click"],["path","assets/images/common/box-search-icon.svg"],[1,"filter-icon",3,"blink"],[1,"data-table"],[1,"bottom-border-cells","inventory-table"],["app-table-header","",3,"label","sortable","sortKey","activeSortKey","sortOrder"],[4,"ngIf"],[3,"pageChange","itemsPerPageChange","currentPage","totalItems","itemsPerPage"],["path","assets/images/common/box-filter-icon.svg"],["app-table-header","",3,"sortChange","label","sortable","sortKey","activeSortKey","sortOrder"],[1,"table-image"],[3,"error","src"],[1,"status-badge"],[1,"table-action-btns"],[3,"type"],[3,"click","type"],["type","search",3,"ngModelChange","keyup.enter","placeholder","ngModel"],[1,"bottom-border-cells"]],template:function(t,r){t&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),c(5),m(6,"translate"),i()(),n(7,"div",4),c(8),i()()(),n(9,"div",5),k(10),n(11,"app-tabs-switcher",6),_("onChange",function(g){return r.onTabChange(g)}),i(),E(),n(12,"div",7),j(13,Et,22,9,"div",8)(14,Ot,21,8,"div",8),i()()()),t&2&&(o(5),d(p(6,5,"serviceTruckDetail")),o(3),d(r.warehouse==null?null:r.warehouse.name),o(3),v("tabs",r.tabs)("activeTab",r.activeTab),o(2),U(r.isTabActive(r.Tabs.INVENTORY)?13:14))},dependencies:[O,rt,fe,Xe,Se,D,me,A,B,ne,H,$,tt,P,ze,et,z],styles:[".page-content[_ngcontent-%COMP%]   .particular-table-section[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:1rem}.inventory-table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{text-align:center}"]})};var vr=[{path:"",component:xe},{path:"detail",component:ke},{path:"job-detail",component:nt},{path:"inventory-detail",component:it}];export{vr as SERVICE_TRUCKS_ROUTES};

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.