dealpos 12.0.2 → 12.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/POS/2312.945cbaad72d2f8d8.js +1 -0
- package/POS/3515.7df2ba52edb3a875.js +1 -0
- package/POS/3571.7ec3176b666ed9df.js +1 -0
- package/POS/4205.76e7666742064185.js +1 -0
- package/POS/4537.6fbc3f1f9d9b2be5.js +1 -0
- package/POS/5471.4b5bea86a7259686.js +1 -0
- package/POS/{6099.d3ced32e3c90ded6.js → 6099.c3787c4d35807c30.js} +1 -1
- package/POS/7298.2ba647fa096d8149.js +1 -0
- package/POS/7767.d46c10206e3461c1.js +1 -0
- package/POS/8094.425eede93123c5b2.js +1 -0
- package/POS/8105.6b04a0e7820b0dd4.js +1 -0
- package/POS/{8126.8f7c1a16de9cf8a1.js → 8126.f5a598e074230c87.js} +1 -1
- package/POS/9844.67d1575326c5853f.js +1 -0
- package/POS/index.html +2 -2
- package/POS/{main.146a085cee0784af.js → main.aeb8a61c70968822.js} +1 -1
- package/POS/runtime.059a88194041ec90.js +1 -0
- package/package.json +1 -1
- package/POS/2312.f0c496070b454e1e.js +0 -1
- package/POS/3515.ddda0858e268542c.js +0 -1
- package/POS/3571.9465c05c07e6c566.js +0 -1
- package/POS/4537.90ab8c7e3d63d725.js +0 -1
- package/POS/6413.c91ff2813a732e23.js +0 -1
- package/POS/7298.250e6b1617a07386.js +0 -1
- package/POS/8094.40f7720b93edf888.js +0 -1
- package/POS/8105.c3713da0d9a3e267.js +0 -1
- package/POS/9844.c7d6bf51b4fecc1a.js +0 -1
- package/POS/9974.d4516cdb583ebf54.js +0 -1
- package/POS/9985.053380d0e77eab58.js +0 -1
- package/POS/runtime.fd12c1ed3dd68b02.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[2312],{62312:(rt,k,d)=>{d.r(k),d.d(k,{ProductModule:()=>Wu});var c=d(36895),l=d(36806),A=d(15861),P=d(4077),C=d(65412),I=d(42046),t=d(94650),M=d(63165),s=d(24006),T=d(88796);let y=(()=>{class n{constructor(e,o){this.dialogRef=e,this.data=o,this.Model=o,this.configModal=new I.O,this.configModal.title="Move to Category"}onOk(){this.dialogRef.close({Model:this.Model})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.so),t.Y36(C.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-move-category"]],decls:6,vars:3,consts:[[3,"config","onOk","onCancel","onClose"],[1,"section-content",2,"width","332px","max-width","100%"],[1,"row"],[1,"col-sm-12"],["bindLabel","Value","bindValue","Key","appendTo","body","placeholder","Choose a Category",3,"items","ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"ng-select",4),t.NdJ("ngModelChange",function(r){return o.Model.Form.CategoryID=r}),t.qZA()()()()()()),2&e&&(t.Q6J("config",o.configModal),t.xp6(5),t.Q6J("items",null==o.Model.Options?null:o.Model.Options.Categories)("ngModel",o.Model.Form.CategoryID))},dependencies:[M.M,s.JJ,s.On,T.w9]}),n})();var u=d(67327),h=(()=>{return(n=h||(h={}))[n.NEVER=0]="NEVER",n[n.QUERY=1]="QUERY",n[n.ALWAYS=2]="ALWAYS",h;var n})(),_=d(96700);let f=(()=>{class n{constructor(e,o){this.data=e,this.dialogRef=o,this.modalConfig=new I.O,this.modalConfig.title=e.title,this.modalConfig.headerType=_.n.Success,this.modalConfig.hideFooter=!0}exportCSV(){this.dialogRef.close(1)}ExportXlsx(){this.dialogRef.close(2)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.WI),t.Y36(C.so))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-export-product"]],decls:9,vars:1,consts:[[3,"config","onCancel"],[1,"container-fluid"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-file-csv","me-1","fs-4"],[1,"btn","btn-outline-secondary","ms-5",3,"click"],[1,"fa-solid","fa-file-excel","me-1","fs-4"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2),t.NdJ("click",function(){return o.exportCSV()}),t._UZ(4,"i",3),t._uU(5," Export CSV "),t.qZA(),t.TgZ(6,"div",4),t.NdJ("click",function(){return o.ExportXlsx()}),t._UZ(7,"i",5),t._uU(8," Export XLSX "),t.qZA()()()()),2&e&&t.Q6J("config",o.modalConfig)},dependencies:[M.M]}),n})();var m=d(89156),v=d(97185),J=d(24424),x=d(51161),b=d(10266),Z=d(30273),H=d(24537),F=d(11594),lt=d(3077),D=d(93669);function Bt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",10)(1,"input",11),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectAllProducts(a.target.checked))}),t.qZA()()}}function $t(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Price"),t.qZA())}function jt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td",10)(1,"input",22),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)}}const vt=function(n){return{width:n}};function Wt(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"img",23),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw().$implicit,p=t.oxw();return t.KtG(p.onOpenBigPicture(r,a))}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Akn(t.VKq(3,vt,o.data.ThumbnailWidth+"px")),t.Q6J("src",e.ThumbnailUrl,t.LSH)}}const xt=function(){return["/menu/Products/Catalog/Products/Info"]},ct=function(n){return{ID:n}};function zt(n,i){if(1&n&&(t.TgZ(0,"a",24),t._UZ(1,"img",25),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw();t.Q6J("routerLink",t.DdM(5,xt))("queryParams",t.VKq(6,ct,e.ID)),t.xp6(1),t.Akn(t.VKq(8,vt,o.data.ThumbnailWidth+"px")),t.MGl("src","//res.cloudinary.com/pos/image/upload/w_",o.data.ThumbnailWidth,"/POS/Images/Icon/products_thumb.png",t.LSH)}}function Xt(n,i){if(1&n&&(t.TgZ(0,"i",26),t._UZ(1,"br"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.hij(" ( ",t.lcZ(3,1,t.xi3(4,3,e.Variants,"Inventory"))," On Hand ) ")}}function te(n,i){if(1&n&&(t.TgZ(0,"i",33),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Oqu(" - "+e.Allocated+" Allocated ")}}function ee(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"i",26),t._uU(2),t.qZA(),t.YNc(3,te,2,1,"i",32),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.hij("( ",e.Inventory??0," On Hand )"),t.xp6(1),t.Q6J("ngIf",e.Allocated)}}const ne=function(){return["/menu/Products/Catalog/Variants/Info"]},Ct=function(n){return{"text-decoration-line-through":n}};function oe(n,i){if(1&n&&(t.TgZ(0,"li",29)(1,"a",30)(2,"span"),t._uU(3),t.qZA()(),t.TgZ(4,"small",31),t._uU(5),t.qZA(),t.YNc(6,ee,4,2,"ng-container",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(1),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(8,ne))("queryParams",t.VKq(9,ct,e.ID)),t.xp6(1),t.Tol(t.VKq(11,Ct,e.Discontinued)),t.xp6(1),t.Oqu(e.Model),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View&&(o.pageData.InventoryRenderScenario==o.renderScenario.ALWAYS||o.pageData.InventoryRenderScenario==o.renderScenario.QUERY&&o.pageData.Filter.Text))}}function ae(n,i){if(1&n&&(t.TgZ(0,"ul",27),t.YNc(1,oe,7,13,"li",28),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",e.Variants)}}function ie(n,i){if(1&n&&(t.TgZ(0,"td",34),t._uU(1),t.ALo(2,"MinToMax"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Variants,"UnitPrice")," ")}}function re(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,jt,2,1,"td",3),t.TgZ(2,"td")(3,"div",13)(4,"div",14),t.YNc(5,Wt,2,5,"ng-container",15),t.ynx(6),t.YNc(7,zt,2,10,"a",16),t.BQk(),t.qZA(),t.TgZ(8,"div",17)(9,"a",18),t._uU(10),t.qZA()()()(),t.TgZ(11,"td"),t._uU(12),t.YNc(13,Xt,5,6,"i",19),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.qZA(),t.TgZ(16,"td"),t.YNc(17,ae,2,1,"ul",20),t.qZA(),t.YNc(18,ie,3,4,"td",21),t.TgZ(19,"td"),t._uU(20),t.ALo(21,"date"),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete||o.roleService.product.Edit),t.xp6(4),t.Q6J("ngIf",e.ImageUrl),t.xp6(2),t.Q6J("ngIf",!e.ImageUrl),t.xp6(2),t.Tol(t.VKq(18,Ct,e.Discontinued)),t.Q6J("routerLink",t.DdM(20,xt))("queryParams",t.VKq(21,ct,e.ID))("target",o.pageData.LinkTarget),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.hij("",e.Code," "),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View&&(o.pageData.InventoryRenderScenario==o.renderScenario.ALWAYS||o.pageData.InventoryRenderScenario==o.renderScenario.QUERY&&o.pageData.Filter.Text)),t.xp6(2),t.Oqu(e.Category),t.xp6(2),t.Q6J("ngIf",e.Variants),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(2),t.Oqu(t.xi3(21,15,e.Released,"dd MMM yy"))}}let le=(()=>{class n{constructor(e){this.roleService=e,this.selectAllProducts=new t.vpe,this.openBigPicture=new t.vpe,this.renderScenario=h}onSelectAllProducts(e){this.selectAllProducts.emit(e)}onOpenBigPicture(e,o){this.openBigPicture.emit({product:e,pEvent:o})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-product-list-desktop"]],inputs:{data:"data",pageData:"pageData"},outputs:{selectAllProducts:"selectAllProducts",openBigPicture:"openBigPicture"},decls:17,vars:3,consts:[["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","320px"],[2,"width","120px"],[2,"width","110px"],["class","text-end","style","width: 140px;",4,"ngIf"],[2,"width","80px"],[4,"ngFor","ngForOf"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"text-end",2,"width","140px"],[1,"d-flex","flex-row"],[2,"cursor","pointer"],[4,"ngIf"],["class","d-block",3,"routerLink","queryParams",4,"ngIf"],[1,"ps-2"],[1,"align-top",3,"routerLink","queryParams","target"],["class","text-danger small",4,"ngIf"],["class","nav",4,"ngIf"],["class","text-end",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltipPosition","above","matTooltip","Click to zoom",3,"src","click"],[1,"d-block",3,"routerLink","queryParams"],[1,"border","rounded",3,"src"],[1,"text-danger","small"],[1,"nav"],["class","nav-item me-8",4,"ngFor","ngForOf"],[1,"nav-item","me-8"],[1,"nav-link",2,"padding","0",3,"routerLink","queryParams","target"],[1,"d-block"],["class","small",4,"ngIf"],[1,"small"],[1,"text-end"]],template:function(e,o){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr",2),t.YNc(3,Bt,2,0,"th",3),t.TgZ(4,"th",4),t._uU(5,"Product"),t.qZA(),t.TgZ(6,"th",5),t._uU(7,"Code"),t.qZA(),t.TgZ(8,"th",6),t._uU(9,"Category"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Variants"),t.qZA(),t.YNc(12,$t,2,0,"th",7),t.TgZ(13,"th",8),t._uU(14,"Released"),t.qZA()()(),t.TgZ(15,"tbody"),t.YNc(16,re,22,23,"tr",9),t.qZA()()),2&e&&(t.xp6(3),t.Q6J("ngIf",o.roleService.product.Delete||o.roleService.product.Edit),t.xp6(9),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(4),t.Q6J("ngForOf",o.data.Data))},dependencies:[l.yS,b.gM,c.sg,c.O5,s.Wl,s.JJ,s.On,c.JJ,c.uU,D.qU,D.Mj],changeDetection:0}),n})();function ce(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",21),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.httpPostListID("catalog/product/DeleteProductList"))}),t._UZ(1,"i",22),t._uU(2," Delete"),t.qZA()}}function se(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",23),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.mergeData())}),t._UZ(1,"i",24),t._uU(2," Merge "),t.qZA()}}function pe(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",25),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.moveProduct("catalog/product/MoveProduct"))}),t._UZ(1,"i",26),t._uU(2," Move "),t.qZA()}}const de=function(){return["/menu/Products/Catalog/Products/Import"]};function ue(n,i){1&n&&(t.TgZ(0,"a",27),t._UZ(1,"i",28),t._uU(2," Import"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,de))}function _e(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",29),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.Select_Export())}),t._UZ(1,"i",30),t._uU(2," Export "),t.qZA()}}function me(n,i){1&n&&t._UZ(0,"button",31)}function ge(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"ul",32)(1,"li",33)(2,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithOutletPrice","ProductWithOutletPrice.csv"))}),t._uU(3," Export With Outlet Price "),t.qZA()(),t.TgZ(4,"li",33)(5,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithPricebook","ProductWithPricebook.csv"))}),t._uU(6," Export With Pricebook "),t.qZA()(),t.TgZ(7,"li",33)(8,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithComponents","ProductListWithComponents.csv"))}),t._uU(9," Export With Components "),t.qZA()(),t.TgZ(10,"li",33)(11,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithParent","ProductListWithParent.csv"))}),t._uU(12,"Export With Parent"),t.qZA()(),t.TgZ(13,"li",33)(14,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithSerial","ProductListWithSerial.csv"))}),t._uU(15," Export With Serial "),t.qZA()(),t.TgZ(16,"li",33)(17,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithSerialAndRow","ProductListWithSerialAndRow.csv"))}),t._uU(18," Export With Serial / Row "),t.qZA()(),t.TgZ(19,"li",33)(20,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithTags","ProductListWithTags.csv"))}),t._uU(21," Export With Tags "),t.qZA()(),t.TgZ(22,"li",33)(23,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithSalesGroupCommission","ProductListWithSalesGroupCommission.csv"))}),t._uU(24," Export With Commission "),t.qZA()(),t.TgZ(25,"li",33)(26,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithInventory","ProductListWithInventory.csv"))}),t._uU(27," Export With Inventory "),t.qZA()(),t.TgZ(28,"li",33)(29,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListMinMaxWithInventory","ProductListMinMaxWithInventory.csv"))}),t._uU(30," Export With ROP & MAX Inventory "),t.qZA()(),t.TgZ(31,"li",33)(32,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithPreapaid","ProductListWithPrepaid.csv"))}),t._uU(33," Export With Prepaid "),t.qZA()(),t.TgZ(34,"li",33)(35,"a",34),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/ExportProductListWithStorageLocation","ProductListWithStorageLocationcsv"))}),t._uU(36," Export With Storage Location "),t.qZA()()()}}const fe=function(){return["/menu/Products/Catalog/Products/Form"]};function he(n,i){1&n&&(t.TgZ(0,"a",35),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,fe))}function ve(n,i){if(1&n&&(t.TgZ(0,"div",42),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("matTooltip",e.Value),t.xp6(1),t.Oqu(e.Value)}}function xe(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",36)(1,"div",37)(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",38),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.CategoryID=a)}),t.YNc(5,ve,2,2,"ng-template",39),t.qZA()(),t.TgZ(6,"div")(7,"h6"),t._uU(8,"Brand"),t.qZA(),t.TgZ(9,"ng-select",38),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.BrandID=a)}),t.qZA()(),t.TgZ(10,"div")(11,"h6"),t._uU(12,"Product Discontinued"),t.qZA(),t.TgZ(13,"radio-options",40),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.ProductDiscontinued=a)}),t.qZA()(),t.TgZ(14,"div")(15,"h6"),t._uU(16,"Variant Discontinued"),t.qZA(),t.TgZ(17,"radio-options",41),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.VariantDiscontinued=a)}),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Categories)("ngModel",e.pageData.Filter.CategoryID),t.xp6(5),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Brands)("ngModel",e.pageData.Filter.BrandID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ProductDiscontinued)("options",e.radioOption),t.xp6(4),t.Q6J("model",e.pageData.Filter.VariantDiscontinued)("options",e.radioOption)}}function Ce(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Inventory By Group"),t.qZA(),t.TgZ(3,"ng-select",38),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.pageData.Filter.EntityGroupID=a)}),t.qZA()()}if(2&n){const e=t.oxw(3);t.xp6(3),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.EntityGroups)("ngModel",e.pageData.Filter.EntityGroupID)}}const Te=function(n){return{show:n}};function Ze(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",43)(1,"div")(2,"h6"),t._uU(3,"Tags"),t.qZA(),t.TgZ(4,"ng-select",44),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.TagsID=a)}),t.qZA()(),t.TgZ(5,"div")(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",45),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.From=a)}),t.qZA(),t.TgZ(9,"datepicker",46),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.To=a)}),t.qZA()(),t.YNc(10,Ce,4,2,"div",47),t.qZA()}if(2&n){const e=t.oxw(2);t.Tol(t.VKq(7,Te,e.more)),t.xp6(4),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Tags)("ngModel",e.pageData.Filter.TagsID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(1),t.Q6J("ngIf",e.pageData.Options.EntityGroups.length>0)}}const be=function(n){return{width:n}};function ye(n,i){if(1&n&&(t.TgZ(0,"a",57),t._UZ(1,"img",58),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(3);t.s9C("href",e.ImageUrl?e.ImageUrl:"Info?ID="+e.ID,t.LSH),t.s9C("target",o.pageData.LinkTarget),t.xp6(1),t.Akn(t.VKq(5,be,o.data.ThumbnailWidth+"px")),t.s9C("src",e.ThumbnailUrl,t.LSH)}}const Tt=function(){return["/menu/Products/Catalog/Products/Info"]},st=function(n){return{ID:n}};function Ie(n,i){if(1&n&&(t.TgZ(0,"a",59),t._UZ(1,"img",60),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(3);t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(4,Tt))("queryParams",t.VKq(5,st,e.ID)),t.xp6(1),t.MGl("src","//res.cloudinary.com/pos/image/upload/w_",o.data.ThumbnailWidth,"/POS/Images/Icon/products_thumb.png",t.LSH)}}function Pe(n,i){if(1&n&&(t.TgZ(0,"small"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" - ",e.Code,"")}}function Me(n,i){if(1&n&&(t.TgZ(0,"span")(1,"s"),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.Oqu(e.Model)}}function Ae(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Model)}}function De(n,i){if(1&n&&(t.TgZ(0,"i",66),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Oqu(" - "+e.Allocated+" Allocated ")}}function Se(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"i",64),t._uU(2),t.qZA(),t.YNc(3,De,2,1,"i",65),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.hij("( ",e.Inventory??0," On Hand )"),t.xp6(1),t.Q6J("ngIf",e.Allocated)}}const Ne=function(){return["/menu/Products/Catalog/Variants/Info"]};function qe(n,i){if(1&n&&(t.TgZ(0,"li",61)(1,"a",62),t.YNc(2,Me,3,1,"span",47),t.YNc(3,Ae,2,1,"span",47),t.qZA(),t.TgZ(4,"small",63),t._uU(5),t.qZA(),t.YNc(6,Se,4,2,"ng-container",47),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(4);t.xp6(1),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(7,Ne))("queryParams",t.VKq(8,st,e.ID)),t.xp6(1),t.Q6J("ngIf",e.Discontinued),t.xp6(1),t.Q6J("ngIf",!e.Discontinued),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View&&(o.pageData.InventoryRenderScenario==o.renderScenario.ALWAYS||o.pageData.InventoryRenderScenario==o.renderScenario.QUERY&&o.pageData.Filter.Text))}}function we(n,i){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"MinToMax"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Variants,"UnitPrice")," ")}}const Ue=function(n){return{"text-decoration-line-through":n}};function Oe(n,i){if(1&n&&(t.TgZ(0,"div",50),t.YNc(1,ye,2,7,"a",51),t.YNc(2,Ie,2,7,"a",52),t.TgZ(3,"div",53)(4,"a",54),t._uU(5),t.qZA(),t.YNc(6,Pe,2,1,"small",47),t.TgZ(7,"ul",55),t.YNc(8,qe,7,10,"li",56),t.qZA()(),t.YNc(9,we,3,4,"div",47),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(1),t.Q6J("ngIf",e.ImageUrl),t.xp6(1),t.Q6J("ngIf",!e.ImageUrl),t.xp6(2),t.Tol(t.VKq(11,Ue,e.Discontinued)),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(13,Tt))("queryParams",t.VKq(14,st,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",e.Code),t.xp6(2),t.Q6J("ngForOf",e.Variants),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction)}}function Je(n,i){if(1&n&&(t.TgZ(0,"div",48),t.YNc(1,Oe,10,16,"div",49),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function Ve(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Text=a)})("onSubmit",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,ce,3,0,"a",2),t.YNc(3,se,3,0,"a",3),t.YNc(4,pe,3,0,"a",4),t.TgZ(5,"div",5),t.YNc(6,ue,3,2,"a",6),t.YNc(7,_e,3,0,"a",7),t.YNc(8,me,1,0,"button",8),t.YNc(9,ge,37,0,"ul",9),t.qZA(),t.YNc(10,he,2,2,"a",10),t.qZA(),t.TgZ(11,"filters")(12,"div",11),t.YNc(13,xe,18,8,"div",12),t.YNc(14,Ze,11,9,"div",13),t.TgZ(15,"a",14),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.more=!a.more)}),t._uU(16,"More "),t._UZ(17,"i",15),t.qZA()()(),t.TgZ(18,"content")(19,"div",16)(20,"div",17)(21,"POS-product-list-desktop",18),t.NdJ("selectAllProducts",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectAllData(a))})("openBigPicture",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.openBiggerPicture(a))}),t.qZA()(),t.YNc(22,Je,2,1,"div",19),t.TgZ(23,"POS-complex-pagination",20),t.NdJ("jumpToPage",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getListData())})("previousPage",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getListData())})("nextPage",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getListData())}),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Text),t.xp6(2),t.Q6J("ngIf",e.getSelectedData().length>0&&e.roleService.product.Delete),t.xp6(1),t.Q6J("ngIf",e.getSelectedData().length>1&&e.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",e.getSelectedData().length>0&&e.roleService.product.Edit),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.global.Export),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.global.Export),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.global.Export),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(3),t.Q6J("ngIf",e.data&&e.pageData.Filter),t.xp6(1),t.Q6J("ngIf",e.data&&e.pageData.Filter),t.xp6(7),t.Q6J("data",e.data)("pageData",e.pageData),t.xp6(1),t.Q6J("ngIf",e.data),t.xp6(1),t.Q6J("total",e.data.Data.length)("pageData",e.pageData)}}const ke=BiggerPicture({target:document.body});let Fe=(()=>{class n extends P.n{constructor(e,o,a,r,p){super(e,"catalog/product/GetProductList","catalog/ProductLoader/ProductList",o),this.httpService=e,this.csvConverter=a,this.matDialog=r,this.roleService=p,this.renderScenario=h,this.radioOption=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"},{Key:null,Value:"All"}]}Select_Export(){this.matDialog.open(f,{data:{title:"Export Products"}}).afterClosed().subscribe(o=>{1==o?this.exportCSV(this.csvConverter,"ProductExport/ExportProductList","Product.csv"):2==o&&this.ExportXlsx("ProductExport/ExportProductListExcel")})}moveProduct(e){const o=this.getSelectedData();this.matDialog.open(y,{data:{Form:{CategoryID:null},Options:this.pageData.Options}}).afterClosed().subscribe(r=>{if(r){const p=r.Model.Form.CategoryID,g=o.map(N=>N.ID);this.postData(e,{ID:p,List:g})}})}s2ab(e){for(var o=new ArrayBuffer(e.length),a=new Uint8Array(o),r=0;r!=e.length;++r)a[r]=255&e.charCodeAt(r);return o}ExportXlsx(e){this.httpService.post(`/api/${e}`,JSON.stringify(this.pageData.Filter)).subscribe(o=>{let a="Product.xlsx";a=decodeURI(a);const r=window.URL.createObjectURL(new Blob([this.s2ab(atob(o))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),p=document.createElement("a");p.href=r,p.setAttribute("download",a),document.body.appendChild(p),p.click(),window.URL.revokeObjectURL(r),p.remove()})}mergeData(){this.httpPostListID("catalog/product/MergeProduct","Are you sure you want to merge these records?")}openBiggerPicture(e){return(0,A.Z)(function*(){e.pEvent.preventDefault();try{const o=yield(0,u.FI)(e.product.ImageUrl);ke.open({items:[o],intro:"fadeup"})}catch(o){alert(o)}})()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(J.O),t.Y36(C.uw),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-product"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["role","button","data-cy","DeleteProduct","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary ms-5",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Move","class","btn btn-outline-secondary ms-5",3,"click",4,"ngIf"],[1,"btn-group","ms-5","me-5"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm dropdown-toggle","data-bs-toggle","dropdown",4,"ngIf"],["class","dropdown-menu",4,"ngIf"],["data-cy","AddProduct","class","btn btn-success","role","button","matTooltipPosition","above","matTooltip","Add Product",3,"routerLink",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","class","collapse","container","",3,"class",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],[1,"container-fluid","mt-5"],[1,"d-none","d-sm-block"],[3,"data","pageData","selectAllProducts","openBigPicture"],["class","table d-sm-none",4,"ngIf"],["api","catalog/product/ProductRowsCount",3,"total","pageData","jumpToPage","previousPage","nextPage"],["role","button","data-cy","DeleteProduct",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-outline-secondary","ms-5",3,"click"],[1,"fa-solid","fa-network-wired"],["matTooltipPosition","above","matTooltip","Move",1,"btn","btn-outline-secondary","ms-5",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrows-alt"],[1,"btn","btn-outline-secondary",3,"routerLink"],["aria-hidden","true",1,"fa-solid","fa-download"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item"],[3,"click"],["data-cy","AddProduct","role","button","matTooltipPosition","above","matTooltip","Add Product",1,"btn","btn-success",3,"routerLink"],["container",""],[1,"category-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["ng-option-tmp",""],["name","ProductDiscontinued",3,"model","options","modelChange"],["name","VariantDiscontinued",3,"model","options","modelChange"],["matTooltipPosition","above",3,"matTooltip"],["id","more-filter","container","",1,"collapse"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[4,"ngIf"],[1,"table","d-sm-none"],["class","d-flex border-1 border-bottom m-2",4,"ngFor","ngForOf"],[1,"d-flex","border-1","border-bottom","m-2"],[3,"href","target",4,"ngIf"],["class","d-block float-start",3,"routerLink","queryParams","target",4,"ngIf"],[1,"flex-grow-1"],[1,"ms-3",3,"routerLink","queryParams","target"],[1,"list-inline","mt-5"],["class","list-inline-item",4,"ngFor","ngForOf"],[3,"href","target"],[3,"src"],[1,"d-block","float-start",3,"routerLink","queryParams","target"],[1,"border","rounded",3,"src"],[1,"list-inline-item"],[1,"d-block","ms-3",3,"routerLink","queryParams","target"],[1,"me-3"],[1,"text-danger","small"],["class","small",4,"ngIf"],[1,"small"]],template:function(e,o){1&e&&t.YNc(0,Ve,24,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.sg,c.O5,s.JJ,s.On,T.w9,T.ir,H.QB,F.P,lt.v,le,D.Mj],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]}),n})();var U=d(41206),Zt=d(29521),q=d(88651),V=d(16571),pt=d(77579),Qe=d(54968),Le=d(78372),dt=d(82722),z=d(39300);let Ee=(()=>{class n{constructor(e,o){switch(this.dialogRef=e,this.data=o,this.Title="",this.Model=o,this.configModal=new I.O,o.form.Status){case"Category":this.Model.form.url="CreateProductCategory",this.configModal.title="New Category",this.Title="Name";break;case"Brand":this.Model.form.url="CreateBrand",this.configModal.title="New Brand",this.Title="Add New Brand";break;case"Tag":this.Model.form.url="CreateTags",this.configModal.title="New Tags",this.Title="Add New Tags";break;case"UOM":this.Model.form.url="CreateProductUOM",this.configModal.title="New UOM",this.Title="Add New UOM"}}onOk(){this.dialogRef.close(this.Model.form)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.so),t.Y36(C.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-form-product-attribute"]],decls:6,vars:3,consts:[[3,"config","onOk","onCancel","onClose"],[1,"form-floating-outline"],["id","name","type","text","placeholder","Buying Cost",1,"form-control",2,"width","300px",3,"ngModel","ngModelChange"],["for","name"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"input",2),t.NdJ("ngModelChange",function(r){return o.Model.form.Name=r}),t.qZA(),t.TgZ(4,"label",3),t._uU(5),t.qZA()()()()),2&e&&(t.Q6J("config",o.configModal),t.xp6(3),t.Q6J("ngModel",o.Model.form.Name),t.xp6(2),t.Oqu(o.Title))},dependencies:[M.M,s.Fj,s.JJ,s.On]}),n})(),bt=(()=>{class n{constructor(e,o){this.data=e,this.dialogRef=o,this.modalConfig=new I.O,this.modalConfig.title=e.title,this.modalConfig.headerType=_.n.Error}onOk(){this.dialogRef.close("REMOVE")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.WI),t.Y36(C.so))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-confirm-remove"]],decls:7,vars:2,consts:[[3,"config","onOk","onCancel","onClose"],[1,"section-content",2,"width","100%"],[1,"row"],[1,"col-sm-12"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"h5"),t._uU(6),t.qZA()()()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(6),t.Oqu(o.data.message))},dependencies:[M.M]}),n})();var w=d(83902);function Ye(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",11)(2,"input",30),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.item.UnitCost=a)}),t.qZA(),t.TgZ(3,"label",31),t._uU(4,"Cost"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngModel",e.item.UnitCost)}}function He(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",8)(2,"div",9)(3,"div",10)(4,"div",11)(5,"input",12),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Model=a)}),t.qZA(),t.TgZ(6,"label",13),t._uU(7,"Model"),t.qZA()()(),t.TgZ(8,"div",14)(9,"div",11)(10,"input",15),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Code=a)}),t.qZA(),t.TgZ(11,"label",16),t._uU(12,"Variant Code"),t.qZA()()()(),t.TgZ(13,"div",9),t.YNc(14,Ye,5,1,"div",17),t.TgZ(15,"div",18)(16,"div",11)(17,"input",19),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UnitPrice=a)}),t.qZA(),t.TgZ(18,"label",20),t._uU(19,"Price"),t.qZA()()(),t.TgZ(20,"div",21)(21,"div",11)(22,"input",22),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Discount=a)}),t.qZA(),t.TgZ(23,"label",23),t._uU(24,"Disc%"),t.qZA()()(),t.TgZ(25,"div",24)(26,"div",11)(27,"input",25),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Weight=a)}),t.qZA(),t.TgZ(28,"label",26),t._uU(29,"Weight"),t.qZA()()()(),t.TgZ(30,"div",27)(31,"div",11)(32,"textarea",28),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Description=a)}),t.qZA(),t.TgZ(33,"label",29),t._uU(34,"Description"),t.qZA()()()(),t.BQk()}if(2&n){const e=t.oxw();t.xp6(5),t.Q6J("ngModel",e.item.Model),t.xp6(5),t.Q6J("ngModel",e.item.Code),t.xp6(4),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Cost),t.xp6(3),t.Q6J("ngModel",e.item.UnitPrice),t.xp6(5),t.Q6J("ngModel",e.item.Discount),t.xp6(5),t.Q6J("ngModel",e.item.Weight),t.xp6(5),t.Q6J("ngModel",e.item.Description)}}function Ke(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",37)(1,"div",11)(2,"input",51),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.item.Ratio=a)}),t.qZA(),t.TgZ(3,"label",52),t._uU(4,"Ratio"),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngModel",e.item.Ratio)}}const K=function(n){return{selected:n}},Ge=function(n){return{"Choose UOM":n}};function Re(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",32)(1,"div",33)(2,"div",11)(3,"label",34),t._uU(4,"Type"),t.qZA(),t.TgZ(5,"ng-select",35),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.TypeID=a)}),t.qZA()()(),t.YNc(6,Ke,5,1,"div",36),t.TgZ(7,"div",37)(8,"div",11)(9,"input",38),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UnitQuantity=a)}),t.qZA(),t.TgZ(10,"label",39),t._uU(11,"Unit Qty"),t.qZA()()(),t.TgZ(12,"div",18)(13,"div",11)(14,"ng-select",40),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UOM=a)}),t.qZA(),t.TgZ(15,"label",41),t._uU(16,"Choose UOM"),t.qZA()()(),t.TgZ(17,"div",42)(18,"div",11)(19,"ng-select",43),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UOMQ=a)}),t.qZA(),t.TgZ(20,"label",44)(21,"i"),t._uU(22,"Sub UOM"),t.qZA()()()()(),t.TgZ(23,"div",9)(24,"div",45)(25,"div",11)(26,"input",46),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Name=a)}),t.qZA(),t.TgZ(27,"label",47)(28,"i"),t._uU(29,"Name "),t.qZA(),t._uU(30,"(Auto Generated)"),t.qZA()()(),t.TgZ(31,"div",48)(32,"div",49)(33,"label"),t._uU(34,"Discontinued"),t.qZA(),t.TgZ(35,"radio-options",50),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Discontinued=a)}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(2),t.Tol(t.VKq(21,K,null!=e.item.TypeID)),t.xp6(3),t.Q6J("clearable",!1)("ngModel",e.item.TypeID)("items",e.data.Options.Types),t.xp6(1),t.Q6J("ngIf",7==e.item.TypeID),t.xp6(3),t.Q6J("ngModel",e.item.UnitQuantity),t.xp6(4),t.Tol(t.VKq(23,K,e.IsNotEmpty(e.item.UOM))),t.xp6(1),t.Q6J("clearable",!1)("ngModel",e.item.UOM)("items",e.data.Options.UOMs),t.uIk("placeholder",t.VKq(25,Ge,e.IsEmpty(e.item.UOM))),t.xp6(4),t.Tol(t.VKq(27,K,e.IsNotEmpty(e.item.UOMQ))),t.xp6(1),t.Q6J("clearable",e.IsNotEmpty(e.item.UOMQ))("ngModel",e.item.UOMQ)("items",e.data.Options.UOMs),t.xp6(7),t.Q6J("ngModel",e.item.Name),t.xp6(9),t.Q6J("disabled",e.data.parentDiscontinued)("model",e.item.Discontinued)}}let Be=(()=>{class n{constructor(e,o,a){this.dialogRef=e,this.data=o,this.roleService=a,this.currentTabState="GENERAL",this.item=Object.assign({},o.form),this.configModal=new I.O,this.configModal.title="Add New Variant?",u.gT.IsNotEmpty(this.item)&&(this.configModal.title="Edit Variant"),this.configModal.headerType=_.n.Success,this.configModal.customWidth="650px"}onOk(){this.setVariantName(),this.dialogRef.close(this.item)}setVariantName(){this.item.Name=this.data.productName+`(${this.item.Model})`}IsEmpty(e){return u.gT.IsEmpty(e)}IsNotEmpty(e){return u.gT.IsNotEmpty(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.so),t.Y36(C.WI),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-add-variant-product"]],decls:12,vars:9,consts:[[3,"config","keydown.F2","onOk","onCancel","onClose"],[1,"container-fluid","w-100"],[1,"row","border-bottom"],[1,"col-12"],["data-cy","discount",1,"btn","btn-link-tab",3,"ngClass","click"],["data-cy","calculator",1,"btn","btn-link-tab",3,"ngClass","click"],[4,"ngIf","ngIfElse"],["ADVANCED",""],[1,"pb-0","px-0","mt-8"],[1,"row"],[1,"col-sm-8"],[1,"form-floating-outline"],["type","text","id","inputModel","placeholder","Model",1,"form-control",3,"ngModel","ngModelChange"],["for","inputModel"],[1,"col-sm-4"],["type","text","id","inputCode","placeholder","Variant Code",1,"w-100","form-control",3,"ngModel","ngModelChange"],["for","inputCode"],["class","col-sm-3",4,"ngIf"],[1,"col-sm-3"],["id","txtPrice","type","text","autoNum","","placeholder","Price",1,"w-100","form-control",3,"ngModel","ngModelChange"],["for","txtPrice"],[1,"col-sm-2"],["type","text","id","txtDisc","autoNum","","maxlength","5","placeholder","Disc%",1,"d-inline","w-70","form-control","percentage-input",3,"ngModel","ngModelChange"],["for","txtDisc"],[1,"col-sm"],["id","txtWeight","type","text","autoNum","","placeholder","Weight",1,"w-100","form-control",3,"ngModel","ngModelChange"],["for","txtWeight"],[1,"mb-8"],["id","variantDesc","placeholder","Description",1,"form-control","border-top-1","border-start-1","border-end-1",2,"height","120px",3,"ngModel","ngModelChange"],["for","variantDesc"],["id","txtCost","type","text","autoNum","","placeholder","Cost",1,"w-100","form-control",3,"ngModel","ngModelChange"],["for","txtCost"],[1,"row","mt-8"],[1,"col-sm-3","ps-0"],["for","type-uom",1,"ng-select",2,"z-index","9999"],["appendTo","body","id","type-uom","bindLabel","Value","bindValue","Key","placeholder","Choose Type",3,"clearable","ngModel","items","ngModelChange"],["class","col",4,"ngIf"],[1,"col"],["id","unitQTY","type","text","placeholder","Unit Qty","autoNum","",1,"w-100","form-control",3,"ngModel","ngModelChange"],["for","unitQTY"],["appendTo","body","id","inputUOM","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","ngModel","items","ngModelChange"],["for","inputUOM",1,"ng-select"],[1,"col-sm-3","pe-0"],["appendTo","body","id","labelUOM","bindLabel","Name","bindValue","ID",3,"clearable","ngModel","items","ngModelChange"],["for","labelUOM",1,"ng-select"],[1,"col-sm-6","ps-0"],["type","text","id","generator-name","maxlength","5","placeholder","Disc%",1,"d-inline","form-control","percentage-input",3,"ngModel","ngModelChange"],["for","generator-name"],[1,"col-sm-6","pe-0"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","20px"],["name","discontinued",3,"disabled","model","modelChange"],["type","text","autoNum","","id","ratio","placeholder","Ratio",1,"w-100","form-control",3,"ngModel","ngModelChange"],["for","ratio"]],template:function(e,o){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("keydown.F2",function(){return o.onOk()})("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"a",4),t.NdJ("click",function(){return o.currentTabState="GENERAL"}),t._uU(6," General "),t.qZA(),t.TgZ(7,"a",5),t.NdJ("click",function(){return o.currentTabState="ADVANCED"}),t._uU(8," Advanced "),t.qZA()()(),t.YNc(9,He,35,7,"ng-container",6),t.YNc(10,Re,36,29,"ng-template",null,7,t.W1O),t.qZA()()()),2&e){const a=t.MAs(11);t.Q6J("config",o.configModal),t.xp6(5),t.Q6J("ngClass",t.VKq(5,K,"GENERAL"==o.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(7,K,"ADVANCED"==o.currentTabState)),t.xp6(2),t.Q6J("ngIf","GENERAL"==o.currentTabState)("ngIfElse",a)}},dependencies:[c.mk,c.O5,M.M,s.Fj,s.JJ,s.nD,s.On,T.w9,F.P,w.b]}),n})();var yt=d(22414),O=d(10805),$e=d(59549),S=d(96308),G=d(77331),E=d(58393),ut=d(54825),je=d(91795),Q=d(37340),L=d(19592),Y=d(74369),X=d(60982);const We=["container"],ze=["focusInput"],Xe=["filter"],tn=["tree"];function en(n,i){1&n&&t.GkF(0)}const nn=function(n,i){return{$implicit:n,placeholder:i}};function on(n,i){if(1&n&&(t.ynx(0),t.YNc(1,en,1,0,"ng-container",13),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngTemplateOutlet",e.valueTemplate)("ngTemplateOutletContext",t.WLB(2,nn,e.value,e.placeholder))}}function an(n,i){if(1&n&&(t.ynx(0),t._uU(1),t.BQk()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.label||"empty"," ")}}function rn(n,i){if(1&n&&(t.TgZ(0,"div",17)(1,"span",18),t._uU(2),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.label)}}function ln(n,i){if(1&n&&(t.ynx(0),t._uU(1),t.BQk()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.placeholder||"empty")}}function cn(n,i){if(1&n&&(t.YNc(0,rn,3,1,"div",15),t.YNc(1,ln,2,1,"ng-container",16)),2&n){const e=t.oxw(2);t.Q6J("ngForOf",e.value),t.xp6(1),t.Q6J("ngIf",e.emptyValue)}}function sn(n,i){if(1&n&&(t.YNc(0,an,2,1,"ng-container",7),t.YNc(1,cn,2,2,"ng-template",null,14,t.W1O)),2&n){const e=t.MAs(2),o=t.oxw();t.Q6J("ngIf","comma"===o.display)("ngIfElse",e)}}function pn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"i",19),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.clear(a))}),t.qZA()}}function dn(n,i){1&n&&t.GkF(0)}function un(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",26)(1,"div",27)(2,"input",28,29),t.NdJ("keydown.enter",function(a){return a.preventDefault()})("input",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onFilterInput(a))}),t.qZA(),t._UZ(4,"span",30),t.qZA(),t.TgZ(5,"button",31),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.hide())}),t._UZ(6,"span",32),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("value",e.filterValue),t.uIk("placeholder",e.filterPlaceholder)}}function _n(n,i){1&n&&t.GkF(0)}function mn(n,i){if(1&n&&t.YNc(0,_n,1,0,"ng-container",34),2&n){const e=t.oxw(3);t.Q6J("ngTemplateOutlet",e.emptyTemplate)}}function gn(n,i){1&n&&(t.ynx(0),t.YNc(1,mn,1,1,"ng-template",33),t.BQk())}function fn(n,i){1&n&&t.GkF(0)}const hn=function(n,i){return{showTransitionParams:n,hideTransitionParams:i}},vn=function(n){return{value:"visible",params:n}},It=function(n,i){return{$implicit:n,options:i}},xn=function(n){return{"max-height":n}};function Cn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",20,21),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onOverlayClick(a))})("@overlayAnimation.start",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onOverlayAnimationStart(a))})("@overlayAnimation.done",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onOverlayAnimationDone(a))}),t.YNc(2,dn,1,0,"ng-container",13),t.YNc(3,un,7,2,"div",22),t.TgZ(4,"div",23)(5,"p-tree",24,25),t.NdJ("selectionChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectionChange(a))})("onNodeExpand",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.nodeExpand(a))})("onNodeCollapse",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.nodeCollapse(a))})("onNodeSelect",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelect(a))})("onNodeUnselect",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onUnselect(a))}),t.YNc(7,gn,2,0,"ng-container",16),t.qZA()(),t.YNc(8,fn,1,0,"ng-container",13),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("@overlayAnimation",t.VKq(24,vn,t.WLB(21,hn,e.showTransitionOptions,e.hideTransitionOptions))),t.xp6(2),t.Q6J("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",t.WLB(26,It,e.value,e.options)),t.xp6(1),t.Q6J("ngIf",e.filter),t.xp6(1),t.Q6J("ngStyle",t.VKq(29,xn,e.scrollHeight)),t.xp6(1),t.Q6J("value",e.options)("propagateSelectionDown",e.propagateSelectionDown)("propagateSelectionUp",e.propagateSelectionUp)("selectionMode",e.selectionMode)("selection",e.value)("metaKeySelection",e.metaKeySelection)("emptyMessage",e.emptyMessage)("filterBy",e.filterBy)("filterMode",e.filterMode)("filterPlaceholder",e.filterPlaceholder)("filterLocale",e.filterLocale)("filterInputAutoFocus",e.filterInputAutoFocus)("filteredNodes",e.filteredNodes),t.xp6(2),t.Q6J("ngIf",e.emptyTemplate),t.xp6(1),t.Q6J("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",t.WLB(31,It,e.value,e.options))}}const Tn={provide:s.JU,useExisting:(0,t.Gpc)(()=>Pt),multi:!0};let Pt=(()=>{class n{constructor(e,o,a,r){this.config=e,this.cd=o,this.el=a,this.overlayService=r,this.type="button",this.scrollHeight="400px",this.metaKeySelection=!0,this.display="comma",this.selectionMode="single",this.emptyMessage="",this.filter=!1,this.filterBy="label",this.filterMode="lenient",this.filterInputAutoFocus=!0,this.propagateSelectionDown=!0,this.propagateSelectionUp=!0,this.showClear=!1,this.resetFilterOnHide=!0,this.showTransitionOptions=".12s cubic-bezier(0, 0, 0.2, 1)",this.hideTransitionOptions=".1s linear",this.onNodeExpand=new t.vpe,this.onNodeCollapse=new t.vpe,this.onShow=new t.vpe,this.onHide=new t.vpe,this.onClear=new t.vpe,this.onFilter=new t.vpe,this.onNodeUnselect=new t.vpe,this.onNodeSelect=new t.vpe,this.filterValue=null,this.expandedNodes=[],this.onModelChange=()=>{},this.onModelTouched=()=>{}}get options(){return this._options}set options(e){this._options=e,this.updateTreeState()}ngOnInit(){this.updateTreeState()}ngAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"value":default:this.valueTemplate=e.template;break;case"header":this.headerTemplate=e.template;break;case"empty":this.emptyTemplate=e.template;break;case"footer":this.footerTemplate=e.template}})}onOverlayAnimationStart(e){"visible"===e.toState&&(this.overlayEl=e.element,this.onOverlayEnter())}onOverlayAnimationDone(e){"void"===e.toState&&this.onOverlayLeave()}onSelectionChange(e){this.value=e,this.onModelChange(this.value),this.cd.markForCheck()}onClick(e){!this.disabled&&(!this.overlayEl||!this.overlayEl.contains(e.target))&&!L.p.hasClass(e.target,"p-treeselect-close")&&(this.overlayVisible?this.hide():this.show(),this.focusInput.nativeElement.focus())}onKeyDown(e){switch(e.which){case 40:if(!this.overlayVisible&&e.altKey)this.show(),e.preventDefault();else if(this.overlayVisible&&this.overlayEl){let o=L.p.getFocusableElements(this.overlayEl);o&&o.length>0&&o[0].focus(),e.preventDefault()}break;case 32:this.overlayVisible||(this.show(),e.preventDefault());break;case 13:case 27:this.overlayVisible&&(this.hide(),e.preventDefault());break;case 9:this.hide()}}onFilterInput(e){this.filterValue=e.target.value,this.treeViewChild._filter(this.filterValue),this.onFilter.emit({originalEvent:e,filteredValue:this.treeViewChild.filteredNodes})}show(){this.overlayVisible=!0}hide(){this.overlayVisible=!1,this.resetFilter(),this.cd.markForCheck()}clear(e){this.value=null,this.resetExpandedNodes(),this.onModelChange(this.value),this.onClear.emit(),e.stopPropagation()}checkValue(){return null!==this.value&&X.gb.isNotEmpty(this.value)}resetFilter(){this.filter&&!this.resetFilterOnHide?(this.filteredNodes=this.treeViewChild.filteredNodes,this.treeViewChild.resetFilter()):this.filterValue=null}onOverlayClick(e){this.overlayService.add({originalEvent:e,target:this.el.nativeElement})}updateTreeState(){if(this.value){let e="single"===this.selectionMode?[this.value]:[...this.value];this.resetExpandedNodes(),e&&this.options&&this.updateTreeBranchState(null,null,e)}}updateTreeBranchState(e,o,a){if(e){if(this.isSelected(e)&&(this.expandPath(o),a.splice(a.indexOf(e),1)),a.length>0&&e.children)for(let r of e.children)o.push(e),this.updateTreeBranchState(r,o,a)}else for(let r of this.options)this.updateTreeBranchState(r,[],a)}expandPath(e){for(let o of e)o.expanded=!0;this.expandedNodes=[...e]}nodeExpand(e){this.onNodeExpand.emit(e),this.expandedNodes.push(e.node)}nodeCollapse(e){this.onNodeCollapse.emit(e),this.expandedNodes.splice(this.expandedNodes.indexOf(e.node),1)}resetExpandedNodes(){for(let e of this.expandedNodes)e.expanded=!1;this.expandedNodes=[]}findSelectedNodes(e,o,a){if(e){if(this.isSelected(e)&&(a.push(e),delete o[e.key]),Object.keys(o).length&&e.children)for(let r of e.children)this.findSelectedNodes(r,o,a)}else for(let r of this.options)this.findSelectedNodes(r,o,a)}isSelected(e){return-1!=this.findIndexInSelection(e)}findIndexInSelection(e){let o=-1;if(this.value)if("single"===this.selectionMode)o=this.value.key&&this.value.key===e.key||this.value==e?0:-1;else for(let a=0;a<this.value.length;a++){let r=this.value[a];if(r.key&&r.key===e.key||r==e){o=a;break}}return o}onSelect(e){this.onNodeSelect.emit(e),"single"===this.selectionMode&&this.hide()}onUnselect(e){this.onNodeUnselect.emit(e)}onOverlayEnter(){X.P9.set("overlay",this.overlayEl,this.config.zIndex.overlay),this.filter&&this.filterInputAutoFocus&&this.filterViewChild.nativeElement.focus(),this.appendContainer(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.onShow.emit()}onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),X.P9.clear(this.overlayEl),this.overlayEl=null,this.onHide.emit()}onFocus(){this.focused=!0}onBlur(){this.focused=!1}writeValue(e){this.value=e,this.updateTreeState(),this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}appendContainer(){this.appendTo&&("body"===this.appendTo?document.body.appendChild(this.overlayEl):document.getElementById(this.appendTo).appendChild(this.overlayEl))}restoreAppend(){this.overlayEl&&this.appendTo&&("body"===this.appendTo?document.body.removeChild(this.overlayEl):document.getElementById(this.appendTo).removeChild(this.overlayEl))}alignOverlay(){this.appendTo?(L.p.absolutePosition(this.overlayEl,this.containerEl.nativeElement),this.overlayEl.style.minWidth=L.p.getOuterWidth(this.containerEl.nativeElement)+"px"):L.p.relativePosition(this.overlayEl,this.containerEl.nativeElement)}bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlayEl&&!this.containerEl.nativeElement.contains(e.target)&&!this.overlayEl.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))}unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)}bindScrollListener(){this.scrollHandler||(this.scrollHandler=new L.V(this.containerEl.nativeElement,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener()}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!L.p.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))}unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}ngOnDestroy(){this.restoreAppend(),this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlayEl&&(X.P9.clear(this.overlayEl),this.overlayEl=null)}containerClass(){return{"p-treeselect p-component p-inputwrapper":!0,"p-treeselect-chip":"chip"===this.display,"p-disabled":this.disabled,"p-focus":this.focused}}labelClass(){return{"p-treeselect-label":!0,"p-placeholder":this.label===this.placeholder,"p-treeselect-label-empty":!this.placeholder&&this.emptyValue}}get emptyValue(){return!this.value||0===Object.keys(this.value).length}get emptyOptions(){return!this.options||0===this.options.length}get label(){let e=this.value||[];return e.length?e.map(o=>o.label).join(", "):"single"===this.selectionMode&&this.value?e.label:this.placeholder}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.b4),t.Y36(t.sBO),t.Y36(t.SBq),t.Y36(O.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["p-treeSelect"]],contentQueries:function(e,o,a){if(1&e&&t.Suo(a,O.jx,4),2&e){let r;t.iGM(r=t.CRH())&&(o.templates=r)}},viewQuery:function(e,o){if(1&e&&(t.Gf(We,5),t.Gf(ze,5),t.Gf(Xe,5),t.Gf(tn,5)),2&e){let a;t.iGM(a=t.CRH())&&(o.containerEl=a.first),t.iGM(a=t.CRH())&&(o.focusInput=a.first),t.iGM(a=t.CRH())&&(o.filterViewChild=a.first),t.iGM(a=t.CRH())&&(o.treeViewChild=a.first)}},hostAttrs:[1,"p-element","p-inputwrapper"],hostVars:6,hostBindings:function(e,o){2&e&&t.ekj("p-inputwrapper-filled",!o.emptyValue)("p-inputwrapper-focus",o.focused||o.overlayVisible)("p-treeselect-clearable",o.showClear&&!o.disabled)},inputs:{type:"type",inputId:"inputId",scrollHeight:"scrollHeight",disabled:"disabled",metaKeySelection:"metaKeySelection",display:"display",selectionMode:"selectionMode",tabindex:"tabindex",ariaLabelledBy:"ariaLabelledBy",placeholder:"placeholder",panelClass:"panelClass",emptyMessage:"emptyMessage",appendTo:"appendTo",filter:"filter",filterBy:"filterBy",filterMode:"filterMode",filterPlaceholder:"filterPlaceholder",filterLocale:"filterLocale",filterInputAutoFocus:"filterInputAutoFocus",propagateSelectionDown:"propagateSelectionDown",propagateSelectionUp:"propagateSelectionUp",showClear:"showClear",resetFilterOnHide:"resetFilterOnHide",options:"options",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions"},outputs:{onNodeExpand:"onNodeExpand",onNodeCollapse:"onNodeCollapse",onShow:"onShow",onHide:"onHide",onClear:"onClear",onFilter:"onFilter",onNodeUnselect:"onNodeUnselect",onNodeSelect:"onNodeSelect"},features:[t._Bn([Tn])],decls:14,vars:11,consts:[[3,"ngClass","click"],["container",""],[1,"p-hidden-accessible"],["type","text","role","listbox","readonly","","aria-haspopup","true",3,"disabled","focus","blur","keydown"],["focusInput",""],[1,"p-treeselect-label-container"],[3,"ngClass"],[4,"ngIf","ngIfElse"],["defaultValueTemplate",""],["class","p-treeselect-clear-icon pi pi-times",3,"click",4,"ngIf"],[1,"p-treeselect-trigger"],[1,"p-treeselect-trigger-icon","pi","pi-chevron-down"],["class","p-treeselect-panel p-component",3,"click",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["chipsValueTemplate",""],["class","p-treeselect-token",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"p-treeselect-token"],[1,"p-treeselect-token-label"],[1,"p-treeselect-clear-icon","pi","pi-times",3,"click"],[1,"p-treeselect-panel","p-component",3,"click"],["overlayRef",""],["class","p-treeselect-header",4,"ngIf"],[1,"p-treeselect-items-wrapper",3,"ngStyle"],[3,"value","propagateSelectionDown","propagateSelectionUp","selectionMode","selection","metaKeySelection","emptyMessage","filterBy","filterMode","filterPlaceholder","filterLocale","filterInputAutoFocus","filteredNodes","selectionChange","onNodeExpand","onNodeCollapse","onNodeSelect","onNodeUnselect"],["tree",""],[1,"p-treeselect-header"],[1,"p-treeselect-filter-container"],["type","text","autocomplete","off",1,"p-treeselect-filter","p-inputtext","p-component",3,"value","keydown.enter","input"],["filter",""],[1,"p-treeselect-filter-icon","pi","pi-search"],[1,"p-treeselect-close","p-link",3,"click"],[1,"p-treeselect-filter-icon","pi","pi-times"],["pTemplate","empty"],[4,"ngTemplateOutlet"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0,1),t.NdJ("click",function(r){return o.onClick(r)}),t.TgZ(2,"div",2)(3,"input",3,4),t.NdJ("focus",function(){return o.onFocus()})("blur",function(){return o.onBlur()})("keydown",function(r){return o.onKeyDown(r)}),t.qZA()(),t.TgZ(5,"div",5)(6,"div",6),t.YNc(7,on,2,5,"ng-container",7),t.YNc(8,sn,3,2,"ng-template",null,8,t.W1O),t.qZA(),t.YNc(10,pn,1,0,"i",9),t.qZA(),t.TgZ(11,"div",10),t._UZ(12,"span",11),t.qZA(),t.YNc(13,Cn,9,34,"div",12),t.qZA()),2&e){const a=t.MAs(9);t.Q6J("ngClass",o.containerClass()),t.xp6(3),t.Q6J("disabled",o.disabled),t.uIk("id",o.inputId)("tabindex",o.tabindex)("aria-expanded",o.overlayVisible)("aria-labelledby",o.ariaLabelledBy),t.xp6(3),t.Q6J("ngClass",o.labelClass()),t.xp6(1),t.Q6J("ngIf",o.valueTemplate)("ngIfElse",a),t.xp6(3),t.Q6J("ngIf",o.checkValue()&&!o.disabled&&o.showClear),t.xp6(3),t.Q6J("ngIf",o.overlayVisible)}},dependencies:[c.mk,c.sg,c.O5,c.tP,c.PC,O.jx,Y.mp],styles:[".p-treeselect{display:inline-flex;cursor:pointer;position:relative;-webkit-user-select:none;user-select:none}.p-treeselect-trigger{display:flex;align-items:center;justify-content:center;flex-shrink:0}.p-treeselect-label-container{overflow:hidden;flex:1 1 auto;cursor:pointer}.p-treeselect-label{display:block;white-space:nowrap;cursor:pointer;overflow:hidden;text-overflow:ellipsis}.p-treeselect-label-empty{overflow:hidden;visibility:hidden}.p-treeselect-token{cursor:default;display:inline-flex;align-items:center;flex:0 0 auto}.p-treeselect .p-treeselect-panel{min-width:100%}.p-treeselect-panel{position:absolute;top:0;left:0}.p-treeselect-items-wrapper{overflow:auto}.p-treeselect-header{display:flex;align-items:center;justify-content:space-between}.p-treeselect-filter-container{position:relative;flex:1 1 auto}.p-treeselect-filter-icon{position:absolute;top:50%;margin-top:-.5rem}.p-treeselect-filter-container .p-inputtext{width:100%}.p-treeselect-close{display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;position:relative;margin-left:auto}.p-treeselect-clear-icon{position:absolute;top:50%;margin-top:-.5rem}.p-fluid .p-treeselect{display:flex}.p-treeselect-clear-icon{position:absolute;top:50%;margin-top:-.5rem;cursor:pointer}.p-treeselect-clearable{position:relative}\n"],encapsulation:2,data:{animation:[(0,Q.X$)("overlayAnimation",[(0,Q.eR)(":enter",[(0,Q.oB)({opacity:0,transform:"scaleY(0.8)"}),(0,Q.jt)("{{showTransitionParams}}")]),(0,Q.eR)(":leave",[(0,Q.jt)("{{hideTransitionParams}}",(0,Q.oB)({opacity:0}))])])]},changeDetection:0}),n})(),Zn=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[c.ez,je.T,O.m8,Y.xc,O.m8,Y.xc]}),n})();function bn(n,i){1&n&&(t.TgZ(0,"span",51),t._uU(1," Name required."),t.qZA())}function yn(n,i){1&n&&(t.TgZ(0,"span",51),t._uU(1," Product name + code combination already exists"),t.qZA())}function In(n,i){if(1&n&&(t.TgZ(0,"div",52),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("matTooltip",e.selectedCategoryLabel),t.xp6(1),t.hij(" ",e.selectedCategoryLabel," ")}}function Pn(n,i){1&n&&(t.TgZ(0,"div",10)(1,"div",53),t._UZ(2,"i",54),t._uU(3," Your internet might have some problem, you can not upload any image. "),t.qZA()())}function Mn(n,i){1&n&&(t.TgZ(0,"div",72),t._uU(1,"Main Image"),t.qZA())}function An(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",63),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.KtG(r.Selected=!r.Selected)})("cdkDropListDropped",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.drop(a))}),t.TgZ(1,"div",64),t._UZ(2,"img",65),t.TgZ(3,"div",66)(4,"a",67),t.NdJ("click",function(a){const p=t.CHM(e).$implicit,g=t.oxw(3);return t.KtG(g.onZoomImage(p.URL,a))}),t._UZ(5,"i",68),t.qZA(),t.TgZ(6,"a",69),t.NdJ("click",function(){const r=t.CHM(e).index,p=t.oxw(3);return t.KtG(p.onRemoveImage(r))}),t._UZ(7,"i",70),t.qZA()(),t.YNc(8,Mn,2,0,"div",71),t.qZA()()}if(2&n){const e=i.$implicit,o=i.index;t.Q6J("cdkDropListData",o),t.xp6(2),t.Q6J("src",e.URL,t.LSH),t.xp6(6),t.Q6J("ngIf",0==o)}}function Dn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",10)(2,"fieldset",55)(3,"legend",56),t._uU(4,"Image "),t.TgZ(5,"span"),t._uU(6),t.qZA()(),t.TgZ(7,"div",57)(8,"div",58)(9,"div",59),t.YNc(10,An,9,3,"div",60),t.TgZ(11,"button",61),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.uploadPicture())}),t._UZ(12,"i",62),t._uU(13," Upload "),t.qZA()()()()()()()}if(2&n){const e=t.oxw(2);t.xp6(6),t.hij("",e.productImages.length,"/5"),t.xp6(4),t.Q6J("ngForOf",e.productImages),t.xp6(1),t.Q6J("disabled",(null==e.productImages?null:e.productImages.length)>4)}}function Sn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",85)(1,"div",11)(2,"input",86),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.data.Product.VariantUnitCost=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw(3);return t.KtG(a.ChangeVariant(a.data.Product.VariantUnitCost,"UnitCost"))}),t.qZA(),t.TgZ(3,"label",87),t._uU(4,"Buying Cost"),t.qZA()()()}if(2&n){const e=t.oxw(3);t.xp6(2),t.Q6J("ngModel",e.data.Product.VariantUnitCost)}}function Nn(n,i){1&n&&(t.TgZ(0,"span",88),t._uU(1,"[override all variants price]"),t.qZA())}const qn=function(n){return{"mb-4":n}};function wn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",73)(1,"div",8)(2,"h3"),t._uU(3,"Pricing and Variants"),t.qZA()(),t.TgZ(4,"div",9)(5,"div",5),t.YNc(6,Sn,5,1,"div",74),t.TgZ(7,"div",75)(8,"div",11)(9,"input",76),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantUnitPrice=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.ChangeVariant(a.data.Product.VariantUnitPrice,"UnitPrice"))}),t.qZA(),t.TgZ(10,"label",77),t._uU(11,"Selling Price"),t.qZA(),t.YNc(12,Nn,2,0,"span",78),t.qZA()(),t.TgZ(13,"div",32)(14,"div",16)(15,"div",79)(16,"div",80),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.FocusOnTagsInput(!1))}),t.TgZ(17,"div"),t._UZ(18,"i",81),t.qZA(),t.TgZ(19,"div",82),t._uU(20," Single "),t.qZA()()(),t.TgZ(21,"div",79)(22,"div",83),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.FocusOnTagsInput(!0))}),t.TgZ(23,"div"),t._UZ(24,"i",84),t.qZA(),t.TgZ(25,"div",82),t._uU(26," Multiple "),t.qZA()()()()()()()()}if(2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(6,qn,e.multipleVariants)),t.xp6(6),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(3),t.Q6J("ngModel",e.data.Product.VariantUnitPrice),t.xp6(3),t.Q6J("ngIf",e.EditMode),t.xp6(4),t.Q6J("ngClass",e.multipleVariants?" border-end-0":"bg-info text-white"),t.xp6(6),t.Q6J("ngClass",e.multipleVariants?"bg-info text-white":" border-start-0")}}function Un(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mat-chip",103),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,p=t.oxw(3);return t.KtG(p.removeVariant(r))}),t._uU(1),t.TgZ(2,"mat-icon",104),t._uU(3,"x"),t.qZA()()}if(2&n){const e=i.$implicit;t.Q6J("selectable",!0)("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function On(n,i){1&n&&(t.TgZ(0,"th",122),t._uU(1,"UnitCost "),t.qZA())}function Jn(n,i){1&n&&(t.TgZ(0,"th",123),t._uU(1,"Ratio"),t.qZA())}function Vn(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().index;t.xp6(1),t.Oqu(e+1)}}function kn(n,i){if(1&n&&(t.TgZ(0,"small",132),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("( ",null==e?null:e.ActivePromotionCount," Active promotions )")}}function Fn(n,i){if(1&n&&(t.TgZ(0,"td",128),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function Qn(n,i){if(1&n&&(t.TgZ(0,"td",119),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",0==e.Ratio&&7!=e.TypeID?1:t.lcZ(2,1,e.Ratio),"")}}const Ln=function(n){return{"text-decoration":n}};function En(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr",124),t.NdJ("click",function(){const a=t.CHM(e),r=a.$implicit,p=a.index,g=t.oxw(4);return t.KtG(g.openDialogVariant(r,p))}),t.TgZ(1,"td")(2,"i",125),t.NdJ("click",function(){const r=t.CHM(e).index,p=t.oxw(4);return t.KtG(p.data.Product.Variants.splice(r,1))}),t.qZA()(),t.TgZ(3,"td")(4,"div",126),t._uU(5),t.YNc(6,Vn,2,1,"span",118),t.qZA(),t.YNc(7,kn,2,1,"small",127),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td",128),t._uU(11),t.ALo(12,"number"),t.qZA(),t.YNc(13,Fn,3,3,"td",129),t.TgZ(14,"td",128),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",130),t._uU(18),t.ALo(19,"number"),t.qZA(),t.YNc(20,Qn,3,3,"td",131),t.qZA()}if(2&n){const e=i.$implicit,o=t.oxw(4);t.Q6J("cdkDragDisabled","small"==o.screenSize),t.xp6(3),t.Akn(t.VKq(20,Ln,e.Discontinued?"line-through":"none")),t.ekj("bg-gradient-warning",e.Discontinued),t.xp6(2),t.hij(" ",e.Model," "),t.xp6(1),t.Q6J("ngIf",!e.Model),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.ActivePromotionCount)&&(null==e?null:e.ActivePromotionCount)>0),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(12,14,e.Weight)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Oqu(t.lcZ(16,16,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(19,18,e.Discount)),t.xp6(2),t.Q6J("ngIf",o.hasMultipleUOM)}}function Yn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",133),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(4);return t.KtG(r.data.Product.VariantWeight=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw(4);return t.KtG(a.ChangeVariant(a.data.Product.VariantWeight,"Weight"))}),t.qZA()()}if(2&n){const e=t.oxw(4);t.xp6(1),t.Q6J("ngModel",e.data.Product.VariantWeight)}}function Hn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",105)(1,"div",58)(2,"div",106)(3,"table",107),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.sortData(a))})("cdkDropListDropped",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.dropVariant(a))}),t.TgZ(4,"thead",108)(5,"tr"),t._UZ(6,"th",109),t.TgZ(7,"th",110),t._uU(8,"Variant"),t.qZA(),t.TgZ(9,"th",111),t._uU(10,"Code"),t.qZA(),t.TgZ(11,"th",112),t._uU(12,"Weight (GR)"),t.qZA(),t.YNc(13,On,2,0,"th",113),t.TgZ(14,"th",114),t._uU(15,"UnitPrice"),t.qZA(),t.TgZ(16,"th",114),t._uU(17,"%"),t.qZA(),t.YNc(18,Jn,2,0,"th",115),t.qZA()(),t.TgZ(19,"tbody"),t.YNc(20,En,21,22,"tr",116),t.qZA(),t.TgZ(21,"tfoot")(22,"tr"),t._UZ(23,"td",117),t.YNc(24,Yn,2,1,"td",118),t.TgZ(25,"td",119)(26,"input",120),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.data.Product.VariantUnitCost=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw(3);return t.KtG(a.ChangeVariant(a.data.Product.VariantUnitCost,"UnitCost"))}),t.qZA()(),t.TgZ(27,"td",119)(28,"input",120),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.data.Product.VariantUnitPrice=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw(3);return t.KtG(a.ChangeVariant(a.data.Product.VariantUnitPrice,"UnitPrice"))}),t.qZA()(),t.TgZ(29,"td")(30,"input",121),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.VariantDiscount=a)})("keyup",function(){t.CHM(e);const a=t.oxw(3);return t.KtG(a.UpdateVariantDiscount())}),t.qZA()()()()()()()()}if(2&n){const e=t.oxw(3);t.xp6(13),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(5),t.Q6J("ngIf",e.hasMultipleUOM),t.xp6(2),t.Q6J("ngForOf",e.data.Product.Variants),t.xp6(4),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(2),t.Q6J("ngModel",e.data.Product.VariantUnitCost),t.xp6(2),t.Q6J("ngModel",e.data.Product.VariantUnitPrice),t.xp6(2),t.Q6J("ngModel",e.VariantDiscount)}}const Kn=function(n,i){return{"mb-6":n,"mb-3":i}},Gn=function(n){return{"text-danger":n}};function Rn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7)(1,"div",8)(2,"h3"),t._uU(3,"Variants"),t.qZA()(),t.TgZ(4,"div",89)(5,"div",90)(6,"div",91)(7,"mat-form-field",92)(8,"mat-chip-list",93,94),t.YNc(10,Un,4,3,"mat-chip",95),t.TgZ(11,"input",96),t.NdJ("matChipInputTokenEnd",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.addVariant(a))}),t.qZA()()()(),t.TgZ(12,"div",97)(13,"div",98),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.addMultipleVariants())}),t.TgZ(14,"span",99),t._UZ(15,"i",100),t.TgZ(16,"strong",101),t._uU(17,"ADD"),t.qZA()()()()(),t.YNc(18,Hn,31,7,"div",102),t.qZA()()}if(2&n){const e=t.MAs(9),o=t.oxw(2);t.xp6(5),t.Q6J("ngClass",t.WLB(8,Kn,o.EditMode||o.data.Product.Variants.length>0,!(o.EditMode||o.data.Product.Variants.length>0))),t.xp6(2),t.uIk("disabled",!!o.isNameAndCodeExist||null),t.xp6(3),t.Q6J("ngForOf",o.NewVariantInputs),t.xp6(1),t.Q6J("matChipInputFor",e)("ngClass",t.VKq(11,Gn,o.statVariantAdd.length>0))("matChipInputSeparatorKeyCodes",o.separatorKeysCodes)("matChipInputAddOnBlur",!0),t.xp6(7),t.Q6J("ngIf",o.EditMode||o.data.Product.Variants.length>0)}}const Bn=function(n){return{"bg-light":n}};function $n(n,i){if(1&n&&t._UZ(0,"span",148),2&n){const e=t.oxw(4);t.Q6J("ngClass",t.VKq(1,Bn,!e.roleService.inventory.Edit))}}function jn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",147),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.UnitsInStock=a)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.UnitsInStock)}}function Wn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td",144),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4,":"),t.qZA(),t.TgZ(5,"td"),t.YNc(6,$n,1,3,"span",145),t.YNc(7,jn,1,1,"input",146),t.qZA(),t.TgZ(8,"td")(9,"input",147),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.MinStock=a)}),t.qZA()(),t.TgZ(10,"td")(11,"input",147),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.MaxStock=a)}),t.qZA()()()}if(2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.Oqu(e.Name),t.xp6(4),t.Q6J("ngIf",!o.roleService.inventory.Edit),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.Edit),t.xp6(2),t.Q6J("ngModel",e.MinStock),t.xp6(2),t.Q6J("ngModel",e.MaxStock)}}function zn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",153),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(4);return t.KtG(r.Stock=a)})("keyup",function(a){t.CHM(e);const r=t.oxw(4);return t.KtG(r.UpdateStock(a))}),t.qZA()}if(2&n){const e=t.oxw(4);t.Q6J("ngModel",e.Stock)}}function Xn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tfoot")(1,"tr"),t._UZ(2,"td",149),t.TgZ(3,"td"),t.YNc(4,zn,1,1,"input",150),t.qZA(),t.TgZ(5,"td")(6,"input",151),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.MinStock=a)})("keyup",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.UpdateMinStock(a))}),t.qZA()(),t.TgZ(7,"td")(8,"input",152),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.MaxStock=a)})("keyup",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.UpdateMaxStock(a))}),t.qZA()()()()}if(2&n){const e=t.oxw(3);t.xp6(4),t.Q6J("ngIf",e.roleService.inventory.Edit),t.xp6(2),t.Q6J("ngModel",e.MinStock),t.xp6(2),t.Q6J("ngModel",e.MaxStock)}}function to(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7)(1,"div",8)(2,"h3"),t._uU(3,"Inventory"),t.qZA()(),t.TgZ(4,"div",9)(5,"div",106)(6,"table",134),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.sortDataInventrory(a))}),t.TgZ(7,"thead",135)(8,"tr",136)(9,"th",137),t._uU(10,"Outlet "),t._UZ(11,"i",138),t.qZA(),t._UZ(12,"th",139),t.TgZ(13,"th",140),t._uU(14,"On Hand"),t.qZA(),t.TgZ(15,"th",141),t._uU(16," ROP "),t.qZA(),t.TgZ(17,"th",142),t._uU(18," Max "),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,Wn,12,5,"tr",143),t.qZA(),t.YNc(21,Xn,9,3,"tfoot",118),t.qZA()()()()}if(2&n){const e=t.oxw(2);t.xp6(20),t.Q6J("ngForOf",e.data.Options.Entities),t.xp6(1),t.Q6J("ngIf",e.data.Options.Entities.length>1)}}const tt=function(n){return{selected:n}};function eo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",36)(1,"ng-select",154),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantTypeID=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectVariantType(a))}),t.qZA(),t.TgZ(2,"label",155),t._uU(3,"Type"),t.qZA()()}if(2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(4,tt,e.IsNotEmpty(e.data.Product.VariantTypeID))),t.xp6(1),t.Q6J("ngModel",e.data.Product.VariantTypeID)("clearable",!1)("items",e.data.Options.Types)}}function no(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",33)(2,"div",11)(3,"input",156),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantWeight=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.ChangeVariant(a.data.Product.VariantWeight,"Weight"))}),t.qZA(),t.TgZ(4,"label",157),t._uU(5,"Weight (gr)"),t.qZA()()()()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.data.Product.VariantWeight)}}function oo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16)(1,"div",33)(2,"div",36)(3,"ng-select",158),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantUOM=a)}),t.qZA(),t.TgZ(4,"label",159),t._uU(5,"Units of Measurement"),t.qZA()()(),t.TgZ(6,"div",39)(7,"h2",160),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.openDialog("UOM"))}),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,tt,e.IsNotEmpty(e.data.Product.VariantUOM))),t.xp6(1),t.Q6J("clearable",!1)("ngModel",e.data.Product.VariantUOM)("items",e.data.Options.UOMs)}}function ao(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td")(4,"ng-select",163),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).index,g=t.oxw(3);return t.KtG(g.selectedStorages[p].Key=a)})("change",function(a){const p=t.CHM(e).$implicit,g=t.oxw(3);return t.KtG(g.onSelectStorage(p.ID,a))}),t.qZA()()()}if(2&n){const e=i.$implicit,o=i.index,a=t.oxw(3);t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Q6J("items",a.options.Storages)("ngModel",a.selectedStorages[o].Key)}}function io(n,i){if(1&n&&(t.TgZ(0,"div",9)(1,"div",106)(2,"table",161)(3,"thead",108)(4,"tr")(5,"th",162),t._uU(6,"Outlet"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"Storage"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,ao,5,3,"tr",143),t.qZA()()()()),2&n){const e=t.oxw(2);t.xp6(10),t.Q6J("ngForOf",e.options.Entities)}}const ro=function(){return["/menu/Products/Catalog/Products"]},lo=function(n){return{"border border-danger":n}};function co(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.validate())}),t._uU(5,"Save"),t.qZA()(),t.TgZ(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h3"),t._uU(13,"General"),t.qZA()(),t.TgZ(14,"div",9)(15,"div",5)(16,"div",10)(17,"div",11)(18,"input",12,13),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Name=a)})("change",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.ValidateNameCode())}),t.qZA(),t.TgZ(20,"label",14),t._uU(21,"Name"),t.qZA(),t.YNc(22,bn,2,0,"span",15),t.YNc(23,yn,2,0,"span",15),t.qZA(),t.TgZ(24,"div",16)(25,"div",17)(26,"div",11)(27,"input",18),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Code=a)})("change",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.ValidateNameCode())}),t.qZA(),t.TgZ(28,"label",19),t._uU(29,"Code"),t.qZA()()(),t.TgZ(30,"div",20)(31,"span",21)(32,"p-treeSelect",22),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.selectedCategory=a)})("onNodeSelect",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectCategory(a.node))}),t.YNc(33,In,2,2,"ng-template",23),t.qZA(),t.TgZ(34,"label",24),t._uU(35,"Category"),t.qZA()()(),t.TgZ(36,"div",25)(37,"h2",26),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.openDialog("Category"))}),t.qZA()()(),t.YNc(38,Pn,4,0,"div",27),t.YNc(39,Dn,14,3,"div",28),t.qZA()()()(),t.YNc(40,wn,27,8,"div",29),t.YNc(41,Rn,19,13,"div",30),t.YNc(42,to,22,2,"div",30),t.TgZ(43,"div",7)(44,"div",8)(45,"h3"),t._uU(46,"Description"),t.qZA()(),t.TgZ(47,"div",9)(48,"div",11)(49,"POS-tinymce-editor",31),t.NdJ("valueChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Description=a)}),t.qZA()()()()(),t.TgZ(50,"div",32)(51,"div",7)(52,"div",8)(53,"h3"),t._uU(54,"Properties"),t.qZA()(),t.TgZ(55,"div",9)(56,"div",5)(57,"div",33),t.YNc(58,eo,4,6,"div",34),t.qZA()(),t.TgZ(59,"div",5)(60,"div",33)(61,"div",11)(62,"autocompleteV2",35),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.SupplierID=a)}),t.qZA()()()(),t.TgZ(63,"div",16)(64,"div",33)(65,"div",36)(66,"ng-select",37),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.BrandID=a)}),t.qZA(),t.TgZ(67,"label",38),t._uU(68,"Brands"),t.qZA()()(),t.TgZ(69,"div",39)(70,"h2",40),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.openDialog("Brand"))}),t.qZA()()(),t.TgZ(71,"div",16)(72,"div",33)(73,"div",36)(74,"ng-select",41),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.TagIDs=a)}),t.qZA(),t.TgZ(75,"label",42),t._uU(76,"Tags"),t.qZA()()(),t.TgZ(77,"div",39)(78,"h2",43),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.openDialog("Tag"))}),t.qZA()()()()(),t.TgZ(79,"div",7)(80,"div",8)(81,"h3"),t._uU(82,"Extras"),t.qZA()(),t.TgZ(83,"div",9),t.YNc(84,no,6,1,"div",28),t.TgZ(85,"div",5)(86,"div",33)(87,"datepicker",44),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Released=a)}),t.qZA()()(),t.TgZ(88,"div",45)(89,"label"),t._uU(90,"Discontinued"),t.qZA(),t.TgZ(91,"radio-options",46),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Discontinued=a)})("modelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.toggleDiscontinue())}),t.qZA()(),t.YNc(92,oo,8,6,"div",47),t.TgZ(93,"div",11)(94,"input",48),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.NextProductName=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.NextProductID=a)}),t.qZA(),t.TgZ(95,"label",49),t._uU(96,"Cross Sell Product"),t.qZA()()()(),t.TgZ(97,"div",7)(98,"div",8)(99,"h3"),t._uU(100,"Storage Location"),t.qZA()(),t.YNc(101,io,11,1,"div",50),t.qZA()()()()()()}if(2&n){const e=t.MAs(19),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(40,ro)),t.xp6(2),t.Q6J("disabled",!(null!=o.data.Product&&o.data.Product.Name)),t.xp6(14),t.Q6J("ngClass",t.VKq(41,lo,o.isNameAndCodeExist))("ngModel",o.data.Product.Name),t.xp6(4),t.Q6J("ngIf",e.invalid&&(e.dirty||e.touched)),t.xp6(1),t.Q6J("ngIf",o.isNameAndCodeExist),t.xp6(4),t.Q6J("ngModel",o.data.Product.Code),t.xp6(5),t.Q6J("options",null==o.data||null==o.data.Options?null:o.data.Options.Categories)("ngModel",o.selectedCategory),t.xp6(6),t.Q6J("ngIf",o.isCloudinaryErrored),t.xp6(1),t.Q6J("ngIf",o.roleService.product.ImageEditor),t.xp6(1),t.Q6J("ngIf",!o.EditMode),t.xp6(1),t.Q6J("ngIf",o.multipleVariants||o.EditMode),t.xp6(1),t.Q6J("ngIf",!o.EditMode),t.xp6(7),t.Q6J("value",o.data.Product.Description),t.xp6(9),t.Q6J("ngIf",!o.EditMode),t.xp6(4),t.Q6J("customStyle",!0)("customLabel","Supplier")("ngModel",o.data.Product.SupplierID)("inputTextValue",o.data.SupplierName),t.xp6(3),t.Q6J("ngClass",t.VKq(43,tt,o.IsNotEmpty(o.data.Product.BrandID))),t.xp6(1),t.Q6J("clearable",o.IsNotEmpty(o.data.Product.BrandID))("ngModel",o.data.Product.BrandID)("items",o.data.Options.Brands),t.xp6(7),t.Q6J("ngClass",t.VKq(45,tt,o.IsNotEmpty(0!=o.data.Product.TagIDs.length))),t.xp6(1),t.Q6J("multiple",!0)("clearable",!1)("ngModel",o.data.Product.TagIDs)("items",o.data.Options.Tags),t.xp6(10),t.Q6J("ngIf",!o.EditMode),t.xp6(3),t.Q6J("date",o.data.Product.Released)("showPlaceholder",!0),t.xp6(4),t.Q6J("model",o.data.Product.Discontinued),t.xp6(1),t.Q6J("ngIf",!o.EditMode),t.xp6(2),t.Q6J("ngModel",o.data.NextProductName)("ngModel",o.data.Product.NextProductID),t.xp6(7),t.Q6J("ngIf",(null==o.selectedStorages?null:o.selectedStorages.length)>0)}}const so=BiggerPicture({target:document.body});let po=(()=>{class n extends q.U{constructor(e,o,a,r,p,g,N){super(e,"catalog/ProductLoader/ProductForm",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.cloudinaryService=p,this.matDialog=g,this.roleService=N,this.separatorKeysCodes=[Zt.K5,Zt.OC],this.statVariantAdd=[],this.NewVariantInputs=[],this.selectedStorages=[],this.smallBreakpoints=576,this.selectedCategoryLabel=null,this.isCloudinaryErrored=!1,this.destroy$=new pt.x,this.EditMode=!1,this.NewVariantInputs=[],this.Stock=0,this.MinStock=null,this.MaxStock=null,this.screenSize=this.getCurrentBreakpoints(window.innerWidth),this.subscribeWindowSizeChanges()}getCurrentBreakpoints(e){return e<=this.smallBreakpoints?"small":"large"}subscribeWindowSizeChanges(){(0,Qe.R)(window,"resize").pipe((0,Le.b)(500),(0,dt.R)(this.destroy$)).subscribe(e=>this.screenSize=this.getCurrentBreakpoints(e.target.innerWidth))}postBindForm(e){this.menuData.H=e.PageTitle,this.ProductName=e.Product.Name,this.data.Options.Entities=e.Options.Entities.sort(this.dynamicSort("Name")),this.EditMode=u.gT.IsNotEmpty(this.data.Product.CategoryID),e.Options.Entities.forEach(o=>{const a=e.ProductLocations.find(r=>r.OutletID==o.ID);o.Key=u.gT.IsEmpty(a)?null:a.StorageID}),this.selectedStorages=e.Options.Entities,this.initCloudinary(),this.productImages=this.data.Product.ProductImages,this.initSelectedCategory()}initSelectedCategory(){const e=this.data.Options.Categories;let o;this.EditMode?o=this.data.Product.CategoryID:(o=e.length>0?e[0].id:null,this.data.Product.CategoryID=o),this.selectedCategory=this.findSelectedCategory(e,o),this.generateLabelSelectedCategory(this.selectedCategory)}initCloudinary(){this.productImages=[];try{this.cloudinaryService.initUploadImageWidget(cloudinary,this.data.CloudinaryFolder).pipe((0,dt.R)(this.destroy$)).subscribe(e=>{this.productImages=[...this.productImages,{URL:e.ImageURL}]})}catch{this.isCloudinaryErrored=!0}}onRemoveImage(e){this.matDialog.open(bt,{data:{message:"Are you sure you want to delete this image?",title:"Confirm Delete"},width:"335px"}).afterClosed().subscribe(o=>{"REMOVE"==o&&(this.productImages=this.productImages.filter((a,r)=>r!=e))})}drop(e){(0,U.bA)(this.productImages,e.previousContainer.data,e.container.data)}dropVariant(e){(0,U.bA)(this.data.Product.Variants,e.previousIndex,e.currentIndex)}uploadPicture(){this.productImages.length<5&&this.cloudinaryService.openUploadWidget()}IsNotEmpty(e){return u.gT.IsNotEmpty(e)}validate(){this.isNameAndCodeExist?this.toaster.error("Product with the same name is already exist",_.n.Error):this.onSubmit("catalog/product/SubmitProduct")}ValidateNameCode(){if(this.EditMode&&this.data.Product.Name.toLowerCase()===this.ProductName.toLowerCase())return void(this.isNameAndCodeExist=!1);const e={Name:this.data.Product.Name,Code:this.data.Product.Code};null!=e&&this.httpService.post("/API/catalog/product/IsExistNameCode",JSON.stringify(e)).subscribe(o=>{this.isNameAndCodeExist=o.exist})}openDialog(e){this.matDialog.open(Ee,{data:{form:{Name:null,Status:e}}}).afterClosed().subscribe(r=>{r&&this.httpService.post(`/api/catalog/${"CreateProductCategory"==r.url?"category":"product"}/${r.url}`,{name:r.Name,parentID:"undefined"}).subscribe(N=>{switch(r.Status){case"Category":let W={children:[],collapsedIcon:"fas fa-folder",expandedIcon:"fas fa-folder-open",id:N.ID,label:r.Name};this.data.Options.Categories=[...this.data.Options.Categories,W],this.data.Product.CategoryID=N.ID,this.selectedCategory=W,this.generateLabelSelectedCategory(W);break;case"Brand":this.data.Options.Brands=[...this.data.Options.Brands,{ID:N.ObjectID,Name:r.Name}],this.data.Product.BrandID=N.ObjectID;break;case"Tag":this.data.Options.Tags=[...this.data.Options.Tags,{ID:N.ObjectID,Name:r.Name}],this.data.Product.TagIDs=[...this.data.Product.TagIDs,N.ObjectID];break;case"UOM":this.data.Options.UOMs=[...this.data.Options.UOMs,{ID:N.ObjectID,Name:r.Name}],this.data.Product.VariantUOM=N.ObjectID}})})}onSelectVariantType(e){e==V.J.MultipleUOM&&this.handlingVariantTypeUOM()}handlingVariantTypeUOM(){const e=this.data.Product.Variants;this.data.Product.Variants=e.map((o,a)=>(o.TypeID=this.data.Product.VariantTypeID,a===e.length-1&&(o.TypeID=1,o.Ratio=1),o))}ChangeVariant(e,o){this.data.Product.Variants&&(this.data.Product.Variants=this.data.Product.Variants.map(a=>(a[o]=e,a)))}FocusOnTagsInput(e){this.multipleVariants=e}removeVariant(e){const o=this.NewVariantInputs.indexOf(e);o>=0&&this.NewVariantInputs.splice(o,1)}addVariant(e){const o=e.input,a=e.value;a&&(this.statVariantAdd=this.NewVariantInputs.filter(function(r){return r==a}),0==this.statVariantAdd.length&&(this.NewVariantInputs.push(a),o.value=""))}openDialogVariant(e,o){this.matDialog.open(Be,{data:{form:e,Options:this.data.Options,Role:this.data.Role,parentDiscontinued:this.data.Product.Discontinued,productName:this.data.Product.Name}}).afterClosed().pipe((0,z.h)(a=>u.gT.IsNotEmpty(a))).subscribe(a=>{this.data.Product.Variants[o]=a})}AddOrUpdateVariant(e){!e.Model||!e.Name||(void 0===e.index?(e.ID=u.gT.GuidEmpty,this.data.Product.ID!==u.gT.GuidEmpty?(e.ProductID=this.data.Product.ID,e.TypeID=1,e.CostCurrencyID=1,e.PriceCurrencyID=1):e.ProductID=u.gT.GuidEmpty,this.data.Product.Variants.push(e)):this.data.Product.Variants[e.index]=e)}addMultipleVariants(){this.hasMultipleUOM=7===this.data.Product.VariantTypeID;const e=this.NewVariantInputs.length;let o;for(let a=0;a<e;a++){const r=this.NewVariantInputs[a];o={Index:a+1,Name:this.data.Product.Name+"("+r+")",Model:r,UnitCost:this.data.Product.VariantUnitCost,UnitPrice:this.data.Product.VariantUnitPrice,TypeID:this.data.Product.VariantTypeID,Weight:this.data.Product.VariantWeight,UOM:this.data.Product.VariantUOM,Discount:this.VariantDiscount},this.hasMultipleUOM&&a===e-1&&(o.TypeID=1,o.Ratio=1),this.AddOrUpdateVariant(o)}this.NewVariantInputs=[]}UpdateVariantDiscount(){for(const e of this.data.Product.Variants)e.Discount=this.VariantDiscount}sortData(e){const o=this.data.Product.Variants.slice();this.data.Product.Variants=e.active&&""!==e.direction?o.sort((a,r)=>"Variant"===e.active?(a.Model<r.Model?-1:1)*("asc"===e.direction?1:-1):0):o}sortDataInventrory(e){let a="desc"==e.direction?"-":"";a+="Name",this.data.Options.Entities=this.data.Options.Entities.sort(this.dynamicSort(a))}dynamicSort(e){let o=1;return"-"===e[0]&&(o=-1,e=e.substr(1)),function(a,r){return-1==o?r[e].localeCompare(a[e]):a[e].localeCompare(r[e])}}UpdateStock(e){for(const o of this.data.Options.Entities)o.UnitsInStock=e.target.value}UpdateMinStock(e){for(const o of this.data.Options.Entities)o.MinStock=e.target.value}UpdateMaxStock(e){for(const o of this.data.Options.Entities)o.MaxStock=e.target.value}preSubmitForm(){if(this.checkVariantInput(),!this.EditMode){this.data.Product.OutletStocks=[];for(const e of this.data.Options.Entities){let o={},a={},r={};e.UnitsInStock&&(r={UnitsInStock:e.UnitsInStock}),e.MinStock&&(o={MinStock:e.MinStock}),e.MaxStock&&(a={MaxStock:e.MaxStock}),this.data.Product.OutletStocks.push({EntityID:e.ID,Name:e.Name,...o,...a,...r})}}this.data.Product.ProductImages=this.getProductImage(),this.data.Product.ImageUrl=this.productImages[0]?this.productImages[0].URL:null,this.data.Form=this.data.Product}getProductImage(){return this.isRemoveImg&&(this.productImages=this.productImages.filter(e=>!e.Selected)),this.productImages=this.productImages.map(e=>(delete e.Selected,e.URL=e.URL.substring(e.URL.lastIndexOf("/")+1),e)),this.productImages}onZoomImage(e,o){return(0,A.Z)(function*(){o.preventDefault();try{const a=yield(0,u.FI)(e.replace("w_80/",""));so.open({items:[a],intro:"fadeup"})}catch(a){alert(a)}})()}checkVariantInput(){let e;this.NewVariantInputs.forEach((o,a)=>{e={Index:a+1,Name:this.data.Product.Name+"("+o+")",Model:o,UnitCost:this.data.Product.VariantUnitCost,UnitPrice:this.data.Product.VariantUnitPrice,TypeID:this.data.Product.VariantTypeID,Weight:this.data.Product.VariantWeight,UOM:this.data.Product.VariantUOM,Ratio:0},this.AddOrUpdateVariant(e)}),this.NewVariantInputs=[]}onSubmitSuccess(e){this.toaster.success("Product has been submitted successfully!",_.n.Success),"Variant"==e.RedirectTo?this.router.navigate(["/menu/Products/Catalog/Variants/Form"],{queryParams:{ID:e.FirstVariantID}}):this.router.navigate(["/menu/Products/Catalog/Products"])}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}toggleDiscontinue(){this.data.Product.Variants.forEach(this.data.Product.Discontinued?e=>e.Discontinued=!0:e=>e.Discontinued=!1)}onSelectStorage(e,o){let a;u.gT.IsEmpty(this.data.Product.ProductLocations)&&(this.data.Product.ProductLocations=[]),a=u.gT.IsEmpty(o)?u.gT.GuidEmpty:o.Key,u.gT.IsEmpty(this.data.Product.ProductLocations.find(r=>r.OutletID==e))&&this.data.Product.ProductLocations.push({OutletID:e,StorageID:a})}onSelectCategory(e){this.generateLabelSelectedCategory(e),this.data.Product.CategoryID=e.id}generateLabelSelectedCategory(e){if(e){let o=[];this.selectedCategoryLabel="";do{o=[...o,e.label],e=e.parent}while(void 0!==e);this.selectedCategoryLabel=o.reverse().join("/")}else this.selectedCategoryLabel="Select Category"}findSelectedCategory(e,o){if(!u.gT.IsNotEmpty(o))return null;for(const a of e){if(a.id===o)return a;{a.children=a.children?a.children:[],a.children=a.children.map(p=>(p.parent=a,p));const r=this.findSelectedCategory(a.children,o);if(r)return r}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W),t.Y36(yt.q),t.Y36(C.uw),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-product"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["data-cy","SaveProduct","type","button","role","button",1,"btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","pt-5"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-12"],[1,"form-floating-outline"],["data-cy","ProductName","id","inputName","type","text","placeholder","Name","name","productName","required","",1,"form-control",3,"ngClass","ngModel","ngModelChange","change"],["productName","ngModel"],["for","productName"],["class","control-label text-danger",4,"ngIf"],[1,"row","g-0"],[1,"col-4","pe-6"],["data-cy","ProductCode","id","inputCode","type","text","placeholder","Code",1,"form-control",3,"ngModel","ngModelChange","change"],["for","inputCode"],[1,"col-7","pe-2","field"],[1,"p-float-label"],["selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory",3,"options","ngModel","ngModelChange","onNodeSelect"],["pTemplate","value"],["for","selectCategory"],[1,"col","text-center"],["id","btnCategory","matTooltipPosition","above","matTooltip","Add New Category?",1,"fa-solid","fa-circle-plus","align-middle","pt-10","pointer",3,"click"],["class","col-12",4,"ngIf"],["class","row",4,"ngIf"],["class","card",3,"ngClass",4,"ngIf"],["class","card",4,"ngIf"],["height","210px",3,"value","valueChange"],[1,"col-md-4"],[1,"col"],["class","form-floating-outline",3,"ngClass",4,"ngIf"],["id","inputSupplier","placeholder","Supplier","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"customStyle","customLabel","ngModel","inputTextValue","ngModelChange"],[1,"form-floating-outline",3,"ngClass"],["id","inputBrand","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","ngModel","items","ngModelChange"],[1,"ng-select"],[1,"col-auto"],["matTooltipPosition","above","matTooltip","Add New Brand?",1,"fa-solid","fa-circle-plus","align-middle","ps-5","pt-10",3,"click"],["bindLabel","Name","bindValue","ID","id","inputTags",1,"productform",3,"multiple","clearable","ngModel","items","ngModelChange"],["for","inputTags",1,"ng-select"],["matTooltipPosition","above","matTooltip","Add New Tags?",1,"fa-solid","fa-circle-plus","align-middle","ps-5","pt-10",3,"click"],["name","expired","placeholder","Release Date","appearance","outline",2,"height","auto","font-size","16px","width","100%",3,"date","showPlaceholder","dateChange"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","20px"],[3,"model","modelChange"],["class","row g-0",4,"ngIf"],["type","text","id","inputNextProduct","placeholder","Cross Sell Product","autocomplete","on","wsmethod","GetProductSuggestion",1,"form-control",3,"ngModel","ngModelChange"],["for","inputNextProduct"],["class","card-body",4,"ngIf"],[1,"control-label","text-danger"],["matTooltipPosition","above",3,"matTooltip"],[1,"alert","alert-warning","mb-0"],[1,"fa-solid","fa-circle-info"],[1,"form-group","p-3","border","rounded"],[1,"w-auto","px-2","text-secondary"],[1,"row","mt-3"],[1,"col-md-12"],["cdkDropListGroup","",1,"upload_trigger","d-flex","align-items-center"],["class","image_temporary\n productUpload_defaultSize me-2 image-upload","cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListData","click","cdkDropListDropped",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-light","btn-sm",2,"height","32px",3,"disabled","click"],[1,"fa","fa-upload"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"image_temporary","productUpload_defaultSize","me-2","image-upload",3,"cdkDropListData","click","cdkDropListDropped"],["cdkDrag","",1,"imgContainer"],[1,"imgUpload",3,"src"],[1,"overlay","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above","matTooltip","Zoom image",1,"eye-icon","image_upload_icon",3,"click"],[1,"fa","fa-eye"],["matTooltipPosition","above","matTooltip","Remove image",1,"trash-icon","image_upload_icon",3,"click"],[1,"fa","fa-trash"],["class","overlay-title",4,"ngIf"],[1,"overlay-title"],[1,"card",3,"ngClass"],["class","col-md-4 pe-3",4,"ngIf"],[1,"col-md-4","ps-3"],["id","inputPrice","placeholder","Selling Price","type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPrice"],["class","notes",4,"ngIf"],[1,"col-6"],["data-toggle","tooltip","data-placement","bottom","matTooltipPosition","above","matTooltip","This product only has 1 variant",1,"text-center","py-4","pointer","rounded-left","border",3,"ngClass","click"],[1,"fa-solid","fa-archive","fa-lg"],[1,"h5","mt-3"],["data-toggle","tooltip","data-placement","bottom","data-html","true","matTooltipPosition","above","matTooltip","This product has multiple variants e.g. Multiple sizes or colors",1,"text-center","py-4","pointer","rounded-end","border",3,"ngClass","click"],[1,"fa-solid","fa-boxes","fa-lg"],[1,"col-md-4","pe-3"],["id","inputCost","type","text","placeholder","Buying Cost","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCost"],[1,"notes"],[1,"card-body","mat-chip-custom"],[1,"input-group",3,"ngClass"],[1,"col","px-0"],["appearance","outline",1,"w-100","pe-0"],["aria-label","New Variant Inputs"],["chipList",""],[3,"selectable","removable","removed",4,"ngFor","ngForOf"],["placeholder","e.g. Red, Green, Blue",3,"matChipInputFor","ngClass","matChipInputSeparatorKeyCodes","matChipInputAddOnBlur","matChipInputTokenEnd"],[1,"col-auto","px-0"],[1,"input-group-append","pointer",3,"click"],[1,"input-group-text","rounded-right"],["aria-hidden","true",1,"fa","fa-plus","me-3"],[1,"headings-font-family","h4","font-weight-bold"],["class","form-group row",4,"ngIf"],[3,"selectable","removable","removed"],["matChipRemove",""],[1,"form-group","row"],[1,"table-responsive"],["matSort","","cdkDropList","",1,"table","table-bordered",3,"matSortChange","cdkDropListDropped"],[1,"table-light"],["width","15px",1,"border-end"],["mat-sort-header","Variant",1,"border-end"],["width","120px",1,"border-end"],["width","120px",1,"text-end","border-end","pe-10"],["width","100px","class","text-end border-end pe-10",4,"ngIf"],["width","110px",1,"text-end","border-end","pe-10"],["width","40px","class","text-end border-end",4,"ngIf"],["style","cursor: pointer;","cdkDrag","",3,"cdkDragDisabled","click",4,"ngFor","ngForOf"],["colspan","3"],[4,"ngIf"],[1,"text-end"],["type","text","placeholder","set all price","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"],["type","text","placeholder","set all discount","autoNum","","percentage","",1,"form-control","text-end",3,"ngModel","ngModelChange","keyup"],["width","100px",1,"text-end","border-end","pe-10"],["width","40px",1,"text-end","border-end"],["cdkDrag","",2,"cursor","pointer",3,"cdkDragDisabled","click"],["aria-hidden","true",1,"fa","fa-xmark","text-danger","fa-2x",3,"click"],[2,"line-height","1"],["class","text-danger fst-italic",4,"ngIf"],[1,"text-end","pe-10"],["class","text-end pe-10",4,"ngIf"],[1,"text-end","text-danger","pe-10"],["class","text-end",4,"ngIf"],[1,"text-danger","fst-italic"],["type","text","placeholder","set all weight","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"],["matSort","",1,"table","table-bordered","custom-table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom-0"],["mat-sort-header","Outlet",1,"border-end"],[1,"glyphicon","glyphicon-sort"],[1,"border-end",2,"width","10px"],[1,"text-end","border-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","ROP Inventory for this outlet before it gets re-alerted",1,"text-end","border-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Max Inventory that this outlet should have",1,"text-end","border-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"align-middle"],["class","form-control text-end",3,"ngClass",4,"ngIf"],["type","text","class","form-control text-end","autoNum","",3,"ngModel","ngModelChange",4,"ngIf"],["type","text","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"],[1,"form-control","text-end",3,"ngClass"],["colspan","2"],["type","text","placeholder","set all outlet","class","form-control text-end","name","Stock","autoNum","",3,"ngModel","ngModelChange","keyup",4,"ngIf"],["type","text","placeholder","set all outlet","name","MinStock","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange","keyup"],["type","text","placeholder","set all outlet","name","MaxStock","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange","keyup"],["type","text","placeholder","set all outlet","name","Stock","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange","keyup"],["id","inputType","bindLabel","Value","bindValue","Key",1,"productform","w-100",3,"ngModel","clearable","items","ngModelChange"],["for","inputType",1,"ng-select"],["id","extra-weight","placeholder","Weight","type","text","autoNum","",1,"form-control","w-100",3,"ngModel","ngModelChange"],["for","extra-weight"],["id","inputUOM","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","ngModel","items","ngModelChange"],["for","inputUOM",1,"ng-select"],["matTooltipPosition","above","matTooltip","Add New UOM?",1,"fa-solid","fa-circle-plus","ps-5","pt-10",3,"click"],[1,"table","table-bordered"],[1,"border-end",2,"width","40%"],["bindLabel","Value","bindValue","Key",3,"items","ngModel","ngModelChange","change"]],template:function(e,o){1&e&&t.YNc(0,co,102,47,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data.Options)},dependencies:[O.jx,l.yS,U.Wj,U.Fd,U.Zt,b.gM,Z.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.Q7,s.On,$e.KE,T.w9,S.YE,S.nU,H.QB,F.P,w.b,G.qn,G.HS,G.oH,G.qH,E.J,ut.V,Pt,c.JJ],styles:[".mat-chip-custom .mat-form-field-infix{border:0;height:37px!important} .mat-chip-custom .mat-form-field-wrapper{margin:0!important} .mat-chip-custom .mat-form-field-outline-end{border-radius:unset!important} .mat-chip-custom .mat-standard-chip{min-height:auto;height:auto} .mat-chip-custom .mat-chip-list-wrapper input.mat-input-element, .mat-chip-custom .mat-chip-list-wrapper .mat-standard-chip{margin:1.5px!important;height:22px} .mat-chip-custom .mat-standard-chip.mat-chip-with-trailing-icon{padding-top:0!important;padding-bottom:0!important;padding-right:8px} .mat-chip-custom .mat-standard-chip .mat-chip-remove, .mat-chip-custom .mat-standard-chip .mat-chip-trailing-icon{margin-left:4px;margin-right:0} .mat-chip-custom .mat-standard-chip .mat-chip-remove, .mat-chip-custom .mat-standard-chip .mat-chip-trailing-icon{width:8px}.upload_trigger[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;vertical-align:top;width:100%}.image_temporary[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;background:#fff;border:1px solid #dde2f0;border-radius:6px;cursor:auto}.productUpload_defaultSize[_ngcontent-%COMP%]{width:100px;height:100px}.imgUpload[_ngcontent-%COMP%]{position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;object-fit:scale-down}.imgContainer[_ngcontent-%COMP%]{width:95px;height:95px}.fa-camera[_ngcontent-%COMP%]{font-size:26px;color:#5f5f5f75}.image_upload_icon[_ngcontent-%COMP%]{font-size:20px;color:#5f5f5f75}.image-upload[_ngcontent-%COMP%]{border:1px solid #dde2f0;position:relative}.overlay[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;opacity:0;transition:.3s ease;background-color:#6e6e6e9a;border:1px solid rgba(110,110,110,.603);border-radius:6px}.imgContainer[_ngcontent-%COMP%]:hover .overlay[_ngcontent-%COMP%]{opacity:1}.overlay-title[_ngcontent-%COMP%]{position:absolute;bottom:0px;left:0px;background:rgba(0,0,0,.5);width:100%;transition:.5s ease;opacity:1;color:#fff;font-size:12px;padding-top:0;text-align:center;top:80px;border:1px solid rgba(88,88,88,.5);border-bottom-right-radius:6px;border-bottom-left-radius:6px}.eye-icon[_ngcontent-%COMP%]{color:#d4d4d4;font-size:18px;position:absolute;top:50%;left:35%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;cursor:pointer}.eye-icon-center[_ngcontent-%COMP%]{position:static;top:0;left:0;transform:none}.trash-icon[_ngcontent-%COMP%]{color:#d4d4d4;font-size:18px;position:absolute;top:50%;left:65%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;cursor:pointer}@media only screen and (max-width: 650px){.upload_trigger[_ngcontent-%COMP%]{flex-wrap:wrap;margin-top:.625rem!important;justify-content:center}}@media only screen and (min-device-width: 768px) and (max-device-width: 1112px){.upload_trigger[_ngcontent-%COMP%]{flex-wrap:wrap;margin-top:.625rem!important;justify-content:center}}fieldset[_ngcontent-%COMP%], legend[_ngcontent-%COMP%]{all:revert}legend[_ngcontent-%COMP%]{color:#9da2a6!important}[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;padding:11px;font-size:.875rem!important;min-height:3.6rem} .p-treeselect-panel{z-index:10002!important}"]}),n})();var uo=d(29881),Mt=d(11481),R=d(1591);const mo=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},At=function(n){return{ProductID:n}},go=function(){return["/menu/Reports/Purchases_Report/History"]};function fo(n,i){if(1&n&&(t.TgZ(0,"div",18)(1,"a",41),t._UZ(2,"i",42),t._uU(3," Sales History"),t.qZA(),t._UZ(4,"button",43),t.TgZ(5,"ul",44)(6,"li",45)(7,"a",46),t._uU(8,"Purchase History "),t.qZA()()()()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(4,mo))("queryParams",t.VKq(5,At,e.data.Product.ID)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,go))("queryParams",t.VKq(8,At,e.data.Product.ID))}}const ho=function(){return["/menu/Products/Catalog/Products/Form"]},B=function(n){return{ID:n}};function vo(n,i){if(1&n&&(t.TgZ(0,"a",47),t._UZ(1,"i",48),t._uU(2," Edit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,ho))("queryParams",t.VKq(3,B,e.data.Product.ID))}}function xo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",49),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.removeProduct())}),t._UZ(1,"i",50),t._uU(2," Delete"),t.qZA()}}function Co(n,i){1&n&&(t.TgZ(0,"div",68),t._uU(1,"Main Image"),t.qZA())}function To(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",60),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.KtG(r.Selected=!r.Selected)})("cdkDropListDropped",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.drop(a))}),t.TgZ(1,"div",61),t._UZ(2,"img",62),t.TgZ(3,"div",63)(4,"a",64),t.NdJ("click",function(a){const p=t.CHM(e).$implicit,g=t.oxw(3);return t.KtG(g.onZoomImage(p.URL,a))}),t._UZ(5,"i",65),t.qZA(),t.TgZ(6,"a",66),t.NdJ("click",function(){const r=t.CHM(e).index,p=t.oxw(3);return t.KtG(p.onRemoveImage(r))}),t._UZ(7,"i",50),t.qZA()(),t.YNc(8,Co,2,0,"div",67),t.qZA()()}if(2&n){const e=i.$implicit,o=i.index;t.Q6J("cdkDropListData",o),t.xp6(2),t.Q6J("src",e.URL,t.LSH),t.xp6(6),t.Q6J("ngIf",0==o)}}function Zo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7)(1,"div",51)(2,"fieldset",52)(3,"legend",53),t._uU(4,"Image "),t.TgZ(5,"span"),t._uU(6),t.qZA()(),t.TgZ(7,"div",54)(8,"div",55)(9,"div",56),t.YNc(10,To,9,3,"div",57),t.TgZ(11,"button",58),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.uploadPicture())}),t._UZ(12,"i",59),t._uU(13," Upload "),t.qZA()()()()()()()}if(2&n){const e=t.oxw(2);t.xp6(6),t.hij("",e.productImages.length,"/5"),t.xp6(4),t.Q6J("ngForOf",e.productImages),t.xp6(1),t.Q6J("disabled",(null==e.productImages?null:e.productImages.length)>4)}}const bo=function(){return["/menu/Products/Catalog/Products/Inventory"]};function yo(n,i){if(1&n&&(t.TgZ(0,"a",69),t._uU(1,"Outlet Inventory"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,bo))("queryParams",t.VKq(3,B,e.data.Product.ID))}}function Io(n,i){1&n&&(t.TgZ(0,"th",70),t._uU(1,"UnitCost"),t.qZA())}function Po(n,i){1&n&&(t.TgZ(0,"th",70),t._uU(1," UnitPrice"),t.qZA())}function Mo(n,i){1&n&&(t.TgZ(0,"th",26),t._uU(1,"Ratio"),t.qZA())}function Ao(n,i){if(1&n&&(t.TgZ(0,"td",72),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function Do(n,i){if(1&n&&(t.TgZ(0,"td",72),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitPrice))}}function So(n,i){if(1&n&&(t.TgZ(0,"td",72),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.RatioDisplay)}}const No=function(n){return{"text-decoration":n}},qo=function(){return["/menu/Products/Catalog/Variants/Info"]};function wo(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"a",71),t._uU(3),t.qZA()(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td",72),t._uU(7),t.ALo(8,"number"),t.qZA(),t.YNc(9,Ao,3,3,"td",73),t.YNc(10,Do,3,3,"td",73),t.TgZ(11,"td",72),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,So,2,1,"td",73),t.TgZ(15,"td",72),t._uU(16),t.ALo(17,"number"),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Akn(t.VKq(20,No,e.Discontinued?"line-through":"none")),t.ekj("bg-gradient-warning",e.Discontinued),t.xp6(1),t.Q6J("routerLink",t.DdM(22,qo))("queryParams",t.VKq(23,B,e.ID)),t.xp6(1),t.Oqu(e.Model),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(8,14,e.Weight)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(2),t.Oqu(t.lcZ(13,16,e.PriceDiscount)),t.xp6(2),t.Q6J("ngIf",o.ratioConfig),t.xp6(2),t.Oqu(t.lcZ(17,18,e.Inventory))}}function Uo(n,i){if(1&n&&(t.TgZ(0,"span",78),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function Oo(n,i){if(1&n&&(t.TgZ(0,"div",74)(1,"div",75),t.YNc(2,Uo,2,1,"span",76),t.qZA(),t.TgZ(3,"label",77),t._uU(4,"Tags"),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngForOf",e.data.Form.Tags)}}function Jo(n,i){1&n&&t._UZ(0,"POS-info-page-input",79)}function Vo(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.OutletName),t.xp6(2),t.hij(" ",e.StorageName," ")}}function ko(n,i){if(1&n&&(t.TgZ(0,"div",80),t._UZ(1,"i",81),t.TgZ(2,"span")(3,"b"),t._uU(4,"Created:"),t.qZA(),t._uU(5),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(5),t.AsE("\xa0",e.data.Product.Created," / ",e.data.CreatedBy," ")}}const Fo=function(){return["/menu/Contacts/Contact/Suppliers/Info"]};function Qo(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,fo,9,10,"div",2),t.TgZ(3,"div",3),t.YNc(4,vo,3,5,"a",4),t.YNc(5,xo,3,0,"a",5),t.qZA()(),t.TgZ(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h3"),t._uU(13,"General"),t.qZA()(),t.TgZ(14,"div",11)(15,"div",12)(16,"div",13),t._UZ(17,"POS-info-page-input",14),t.qZA(),t.TgZ(18,"div",8),t._UZ(19,"POS-info-page-input",15),t.qZA()(),t.YNc(20,Zo,14,3,"div",16),t.qZA()(),t.TgZ(21,"div",9)(22,"div",17)(23,"div")(24,"h2"),t._uU(25,"Pricing and Variants"),t.qZA()(),t.TgZ(26,"div",18),t.YNc(27,yo,2,5,"a",19),t.qZA()(),t.TgZ(28,"div",11)(29,"div",20)(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),t._uU(34,"Variant"),t.qZA(),t.TgZ(35,"th",24),t._uU(36,"Code"),t.qZA(),t.TgZ(37,"th",24),t._uU(38,"Weight (gr)"),t.qZA(),t.YNc(39,Io,2,0,"th",25),t.YNc(40,Po,2,0,"th",25),t.TgZ(41,"th",26),t._uU(42,"%"),t.qZA(),t.YNc(43,Mo,2,0,"th",27),t.TgZ(44,"th",28),t._uU(45,"Inventory"),t.qZA()()(),t.TgZ(46,"tbody"),t.YNc(47,wo,18,25,"tr",29),t.qZA()()()()(),t.TgZ(48,"div",9)(49,"div",10)(50,"h3"),t._uU(51,"Description"),t.qZA()(),t.TgZ(52,"div",11),t._UZ(53,"POS-info-page-input",30),t.qZA()()(),t.TgZ(54,"div",13)(55,"div",31)(56,"div",10)(57,"h3"),t._uU(58,"Properties"),t.qZA()(),t.TgZ(59,"div",11),t._UZ(60,"POS-info-page-input",32)(61,"POS-info-page-input",33),t.YNc(62,Oo,5,1,"div",34),t.YNc(63,Jo,1,0,"ng-template",null,35,t.W1O),t.qZA()(),t.TgZ(65,"div",9)(66,"div",10)(67,"h3"),t._uU(68,"Extras"),t.qZA()(),t.TgZ(69,"div",11),t._UZ(70,"POS-info-page-input",36),t.ALo(71,"date"),t._UZ(72,"POS-info-page-input",37),t.ALo(73,"YesNo"),t._UZ(74,"POS-info-page-input",38),t.qZA()(),t.TgZ(75,"div",9)(76,"div",10)(77,"h3"),t._uU(78,"Storage Location"),t.qZA()(),t.TgZ(79,"div",11)(80,"div",20)(81,"table",21)(82,"thead",22)(83,"tr")(84,"th",39),t._uU(85,"Outlet"),t.qZA(),t.TgZ(86,"th"),t._uU(87,"Storage"),t.qZA()()(),t.TgZ(88,"tbody"),t.YNc(89,Vo,5,2,"tr",29),t.qZA()()()()()()(),t.YNc(90,ko,6,2,"div",40),t.qZA()()()),2&n){const e=t.MAs(64),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.roleService.report.View),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete),t.xp6(12),t.Q6J("inputValue",o.data.Product.Code),t.xp6(2),t.Q6J("queryParams",t.VKq(33,B,o.data.Product.CategoryID))("inputValue",o.data.Form.Name),t.xp6(1),t.Q6J("ngIf",o.roleService.product.ImageEditor),t.xp6(7),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(12),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(3),t.Q6J("ngIf",o.ratioConfig),t.xp6(4),t.Q6J("ngForOf",o.data.Variant),t.xp6(6),t.Q6J("inputValue",o.data.Product.Description)("labelVisible",!1),t.xp6(7),t.Q6J("routerLink",t.DdM(35,Fo))("queryParams",t.VKq(36,B,o.data.Product.SupplierID))("inputValue",o.data.Product.SupplierName),t.xp6(1),t.Q6J("inputValue",o.data.Product.Brand),t.xp6(1),t.Q6J("ngIf",o.data.Form.Tags)("ngIfElse",e),t.xp6(8),t.Q6J("inputValue",t.xi3(71,28,o.data.Product.Released,"dd MMM yyyy")),t.xp6(2),t.Q6J("inputValue",t.lcZ(73,31,o.data.Product.Discontinued)),t.xp6(2),t.Q6J("inputValue",o.data.Product.NextProductName),t.xp6(15),t.Q6J("ngForOf",o.data.ProductLocation),t.xp6(1),t.Q6J("ngIf",!o.roleService.users.LogRestriction)}}const Lo=BiggerPicture({target:document.body});let Eo=(()=>{class n extends uo.O{constructor(e,o,a,r,p,g,N,W){super(e,"catalog/ProductLoader/ProductInfoInitial",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.cloudinaryService=p,this.matDialog=g,this.title=N,this.roleService=W,this.productImages=[],this.destroy$=new pt.x}initRoles(){this.ratioConfig=this.data?.Variant?.filter(e=>e.TypeID==V.J.MultipleUOM).length>0}postBindData(){this.menuData.H=this.data.PageTitle;const e=this.title.getTitle().split("|")[0];this.title.setTitle(`${e}| ${this.data.Product.Name}`),this.initCloudinaryService(),this.productImages=this.data.ProductImages,this.initRoles()}initCloudinaryService(){this.productImages=[],this.cloudinaryService.initUploadImageWidget(cloudinary,this.data.CloudinaryFolder).pipe((0,dt.R)(this.destroy$)).subscribe(e=>{this.productImages=[...this.productImages,{URL:e.ImageURL,ProductID:this.data.Product.ID}],this.uploadEditedImage()})}uploadEditedImage(){this.sliceImageUrl(),this.httpService.post(u.Wz.UpdateProductImage,{ID:this.data.Product.ID,ImageUrl:this.productImages[0]?this.productImages[0].URL:null,ProductImages:this.productImages}).subscribe(o=>{this.productImages=o.ProductImages,this.toaster.success("Image has been updated",_.n.Success)})}sliceImageUrl(){this.productImages=this.productImages.map(e=>(e.URL=e.URL.substring(e.URL.lastIndexOf("/")+1),e))}onRemoveImage(e){this.matDialog.open(bt,{data:{message:"Are you sure you want to delete this image?",title:"Confirm Delete"},width:"335px"}).afterClosed().subscribe(o=>{"REMOVE"==o&&(this.productImages=this.productImages.filter((a,r)=>r!=e),this.uploadEditedImage())})}IsNotEmpty(e){return u.gT.IsNotEmpty(e)?e:""}uploadPicture(){this.productImages.length<5&&this.cloudinaryService.openUploadWidget()}removeProduct(){confirm("Are you sure you want to delete this record?")&&(this.redirect=!0,this.data.Form={ID:this.data.Product.ID},this.httpService.post("/API/catalog/product/DeleteProductInfo",JSON.stringify(this.data.Form)).subscribe({next:o=>{this.onDeleteSuccess(o)}}))}onDeleteSuccess(e){let o;this.redirect?(o=e,this.router.navigate(["/menu/Products/Catalog/Products"])):o="Image success change",this.toaster.success(o,_.n.Success)}onZoomImage(e,o){return(0,A.Z)(function*(){o.preventDefault();try{const a=yield(0,u.FI)(e.replace("w_80/",""));Lo.open({items:[a],intro:"fadeup"})}catch(a){alert(a)}})()}drop(e){(0,U.bA)(this.productImages,e.previousContainer.data,e.container.data),this.uploadEditedImage()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W),t.Y36(yt.q),t.Y36(C.uw),t.Y36(Mt.Dx),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-product"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn-group",4,"ngIf"],[1,"btn-group","ms-5"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","bg-light-gray","pt-5"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-10"],[1,"col-md-4"],["labelValue","Code",3,"inputValue"],["routerLink","/menu/Products/Catalog/Categories/Info","labelValue","Category",3,"queryParams","inputValue"],["class","row",4,"ngIf"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm","matTooltipPosition","above","matTooltip","Send Delivery",3,"routerLink","queryParams",4,"ngIf"],[1,"table-responsive"],[1,"table","table-bordered"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","100px"],["class","border-end text-end","style","width: 120px",4,"ngIf"],[1,"border-end",2,"width","25px"],["class","border-end","style","width: 25px",4,"ngIf"],[1,"border-end","text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["labelValue","Description","inputType","textarea",3,"inputValue","labelVisible"],[1,"card","pb-8"],["labelValue","Supplier",3,"routerLink","queryParams","inputValue"],["labelValue","Brand",3,"inputValue"],["class","form-floating-outline label-floating",4,"ngIf","ngIfElse"],["emptyTags",""],["labelValue","Release Date",3,"inputValue"],["labelValue","Discontinued",3,"inputValue"],["labelValue","Cross Sell Product",3,"inputValue"],[1,"border-end",2,"width","40%"],["class","alert alert-warning",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-chart-bar"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item"],["role","button",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],[1,"col-12"],[1,"form-group","p-3","border","rounded"],[1,"w-auto","px-2","text-secondary"],[1,"row","mt-3"],[1,"col-md-12"],["cdkDropListGroup","",1,"upload_trigger","d-flex","align-items-center"],["class","image_temporary\n productUpload_defaultSize me-2 image-upload","cdkDropList","","cdkDropListOrientation","horizontal",3,"cdkDropListData","click","cdkDropListDropped",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-light","btn-sm",2,"height","32px",3,"disabled","click"],[1,"fa","fa-upload"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"image_temporary","productUpload_defaultSize","me-2","image-upload",3,"cdkDropListData","click","cdkDropListDropped"],["cdkDrag","",1,"imgContainer"],[1,"imgUpload",3,"src"],[1,"overlay","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above","matTooltip","Zoom image",1,"eye-icon","image_upload_icon",3,"click"],[1,"fa","fa-eye"],["matTooltipPosition","above","matTooltip","Remove image",1,"trash-icon","image_upload_icon",3,"click"],["class","overlay-title",4,"ngIf"],[1,"overlay-title"],["role","button","matTooltipPosition","above","matTooltip","Send Delivery",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"border-end","text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"form-floating-outline","label-floating"],[1,"form-control","tags"],["class","bg-secondary",4,"ngFor","ngForOf"],["for","inputTitle"],[1,"bg-secondary"],["labelValue","Tags",3,"inputValue"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file","me-3"]],template:function(e,o){1&e&&t.YNc(0,Qo,91,38,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",null==o.data?null:o.data.Product)},dependencies:[l.rH,l.yS,U.Wj,U.Fd,U.Zt,b.gM,Z.p,c.sg,c.O5,R.o,c.JJ,c.uU,D.l],styles:[".supplier-info[_ngcontent-%COMP%] div.form-floating-outline input{color:#0976b4!important}.upload_trigger[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;vertical-align:top;width:100%}.image_temporary[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;background:#fff;border:1px solid #dde2f0;border-radius:6px;cursor:auto}.productUpload_defaultSize[_ngcontent-%COMP%]{width:100px;height:100px}.imgUpload[_ngcontent-%COMP%]{position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;object-fit:scale-down}.imgContainer[_ngcontent-%COMP%]{width:95px;height:95px}.fa-camera[_ngcontent-%COMP%]{font-size:26px;color:#5f5f5f75}.image_upload_icon[_ngcontent-%COMP%]{font-size:20px;color:#5f5f5f75}.image-upload[_ngcontent-%COMP%]{border:1px solid #dde2f0;position:relative}.overlay[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;opacity:0;transition:.3s ease;background-color:#6e6e6e9a;border:1px solid rgba(110,110,110,.603);border-radius:6px}.imgContainer[_ngcontent-%COMP%]:hover .overlay[_ngcontent-%COMP%]{opacity:1}.overlay-title[_ngcontent-%COMP%]{position:absolute;bottom:0px;left:0px;background:rgba(0,0,0,.5);width:100%;transition:.5s ease;opacity:1;color:#fff;font-size:12px;padding-top:0;text-align:center;top:80px;border:1px solid rgba(88,88,88,.5);border-bottom-right-radius:6px;border-bottom-left-radius:6px}.eye-icon[_ngcontent-%COMP%]{color:#d4d4d4;font-size:18px;position:absolute;top:50%;left:35%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;cursor:pointer}.eye-icon-center[_ngcontent-%COMP%]{position:static;top:0;left:0;transform:none}.trash-icon[_ngcontent-%COMP%]{color:#d4d4d4;font-size:18px;position:absolute;top:50%;left:65%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;cursor:pointer}@media only screen and (max-width: 650px){.upload_trigger[_ngcontent-%COMP%]{flex-wrap:wrap;margin-top:.625rem!important;justify-content:center}}@media only screen and (min-device-width: 768px) and (max-device-width: 1112px){.upload_trigger[_ngcontent-%COMP%]{flex-wrap:wrap;margin-top:.625rem!important;justify-content:center}}fieldset[_ngcontent-%COMP%], legend[_ngcontent-%COMP%]{all:revert}legend[_ngcontent-%COMP%]{color:#9da2a6!important}"]}),n})();var et=d(59798);function Yo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.httpPostListID("catalog/variant/DeleteVariantList"))}),t._UZ(1,"i",18),t._uU(2," Delete "),t.qZA()}}const Ho=function(){return["/menu/Products/Add-Ons/Variant_History"]};function Ko(n,i){1&n&&(t.TgZ(0,"a",19),t._UZ(1,"i",20),t._uU(2," Update Log "),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Ho))}function Go(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",21),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/VariantExport","Variant.csv"))}),t._UZ(1,"i",22),t._uU(2," Export "),t.qZA()}}const Ro=function(){return["Form"]};function Bo(n,i){1&n&&(t.TgZ(0,"a",23),t._uU(1," Add Variant "),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Ro))}function $o(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",34)(1,"input",35),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onSelectAllData(a.target.checked))}),t.qZA()()}}function jo(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Description"),t.qZA())}function Wo(n,i){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Buying Cost "),t.qZA())}function zo(n,i){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Last Buy Cost "),t.qZA())}function Xo(n,i){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Selling Price"),t.qZA())}function ta(n,i){1&n&&(t.TgZ(0,"th",36),t._uU(1,"%"),t.qZA())}function ea(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td",34)(1,"input",45),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}function na(n,i){if(1&n&&t._UZ(0,"td",46),2&n){const e=t.oxw().$implicit;t.Q6J("innerHTML",e.Description,t.oJD)}}function oa(n,i){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function aa(n,i){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.OrderPrice))}}function ia(n,i){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitPrice))}}function ra(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",0!=e.PriceDiscount?e.PriceDiscount:"","")}}const la=function(n){return{ID:n}},ca=function(n){return{"text-decoration-line-through":n}};function sa(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,ea,2,2,"td",27),t.TgZ(2,"td",38)(3,"a",39)(4,"span",40),t._uU(5),t.qZA()()(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.YNc(10,na,1,1,"td",41),t.YNc(11,oa,3,3,"td",42),t.YNc(12,aa,3,3,"td",42),t.YNc(13,ia,3,3,"td",42),t.YNc(14,ra,2,1,"td",43),t.TgZ(15,"td",44),t._uU(16),t.ALo(17,"number"),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete),t.xp6(2),t.Q6J("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",t.VKq(15,la,e.ID)),t.xp6(1),t.Q6J("ngClass",t.VKq(17,ca,null==e?null:e.Discontinued)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.hij(" ",e.TypeLabel," "),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",o.data.Description),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.Discount),t.xp6(2),t.Oqu(t.lcZ(17,13,e.UnitsInStock))}}function pa(n,i){if(1&n&&(t.TgZ(0,"table",24)(1,"thead",25)(2,"tr",26),t.YNc(3,$o,2,0,"th",27),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",28),t._uU(7,"Type"),t.qZA(),t.TgZ(8,"th",28),t._uU(9,"Code"),t.qZA(),t.YNc(10,jo,2,0,"th",29),t.YNc(11,Wo,2,0,"th",30),t.YNc(12,zo,2,0,"th",31),t.YNc(13,Xo,2,0,"th",30),t.YNc(14,ta,2,0,"th",30),t.TgZ(15,"th",32),t._uU(16,"Inventory"),t.qZA()()(),t.TgZ(17,"tbody"),t.YNc(18,sa,18,19,"tr",33),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(7),t.Q6J("ngIf",e.data.Description),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",!e.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.Discount),t.xp6(4),t.Q6J("ngForOf",e.data.Data)}}function da(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",50),t.NdJ("page",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onPaginationChange(a))}),t.qZA()}if(2&n){const e=t.oxw(3);t.Q6J("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("showFirstLastButtons",!0)("pageIndex",0==e.pageData.Filter.PageNumber?0:e.pageData.Filter.PageNumber-1)}}function ua(n,i){if(1&n&&(t.TgZ(0,"div",48),t.YNc(1,da,1,4,"mat-paginator",49),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.pagination.listTotal>0)}}function _a(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Text=a)})("onSubmit",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,Yo,3,0,"a",2),t.YNc(3,Ko,3,2,"a",3),t.YNc(4,Go,3,0,"a",4),t.YNc(5,Bo,2,2,"a",5),t.qZA(),t.TgZ(6,"filters")(7,"div",6)(8,"div",7)(9,"div",8)(10,"h6"),t._uU(11,"Category"),t.qZA(),t.TgZ(12,"ng-select",9),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.CategoryID=a)}),t.qZA()(),t.TgZ(13,"div")(14,"h6"),t._uU(15,"Supplier"),t.qZA(),t.TgZ(16,"autocompleteV2",10),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.SupplierID=a)}),t.qZA()(),t.TgZ(17,"div")(18,"h6"),t._uU(19,"Type"),t.qZA(),t.TgZ(20,"ng-select",9),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.TypeID=a)}),t.qZA()(),t.TgZ(21,"div")(22,"h6"),t._uU(23,"Discontinued"),t.qZA(),t.TgZ(24,"radio-options",11),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Discontinued=a)}),t.qZA()(),t.TgZ(25,"div")(26,"h6"),t._uU(27,"Description"),t.qZA(),t.TgZ(28,"radio-options",12),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Description=a)}),t.qZA()()()()(),t.TgZ(29,"content")(30,"div",13)(31,"div",14),t.YNc(32,pa,19,7,"table",15),t.qZA(),t.YNc(33,ua,2,1,"div",16),t.qZA()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Text),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Delete&&e.getSelectedData().length>0),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",e.roleService.global.Export),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(7),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Categories)("ngModel",e.pageData.Filter.CategoryID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Types)("ngModel",e.pageData.Filter.TypeID),t.xp6(4),t.Q6J("options",e.options)("model",e.pageData.Filter.Discontinued),t.xp6(4),t.Q6J("options",e.options)("model",e.pageData.Filter.Description),t.xp6(4),t.Q6J("ngIf",e.data),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter)}}let ma=(()=>{class n extends P.n{constructor(e,o,a,r){super(e,"catalog/variant/GetVariantList","catalog/VariantLoader/VariantList",o),this.httpService=e,this.csvConverter=a,this.roleService=r,this.options=[{Key:0,Value:"No"},{Key:1,Value:"Yes"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(J.O),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-variant"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-6","role","button","confirm-message","Are you sure you want to delete this record?",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-6","role","button",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],["class","btn btn-success","role","button","matTooltipPosition","above","matTooltip","Add Variant",3,"routerLink",4,"ngIf"],[1,"d-flex"],["container",""],[1,"category-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100",3,"ngModel","ngModelChange"],["name","Discontinued",3,"options","model","modelChange"],["name","Description",3,"options","model","modelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom",4,"ngIf"],["class","d-sm-block mt-2",4,"ngIf"],["role","button","confirm-message","Are you sure you want to delete this record?",1,"btn","btn-outline-secondary","me-6",3,"click"],[1,"fa","fa-trash"],["role","button",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],["aria-hidden","true",1,"fa","fa-list-ul"],[1,"btn","btn-outline-secondary","me-6",3,"click"],[1,"fa","fa-upload"],["role","button","matTooltipPosition","above","matTooltip","Add Variant",1,"btn","btn-success",3,"routerLink"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],[4,"ngIf"],["class","text-end","style","width: 100px;",4,"ngIf"],["class","text-end","style","width: 200px;",4,"ngIf"],[2,"width","85px"],[4,"ngFor","ngForOf"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"text-end",2,"width","100px"],[1,"text-end",2,"width","200px"],[2,"max-width","10px"],[1,"text-break",3,"routerLink","queryParams"],[3,"ngClass"],[3,"innerHTML",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end","style","color: red;",4,"ngIf"],[1,"text-end"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"innerHTML"],[1,"text-end",2,"color","red"],[1,"d-sm-block","mt-2"],[3,"length","pageSize","showFirstLastButtons","pageIndex","page",4,"ngIf"],[3,"length","pageSize","showFirstLastButtons","pageIndex","page"]],template:function(e,o){1&e&&t.YNc(0,_a,34,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.mk,c.sg,c.O5,s.Wl,s.JJ,s.On,et.NW,T.w9,F.P,E.J,c.JJ],styles:[".break-word[_ngcontent-%COMP%]{overflow-wrap:break-word;word-wrap:break-word}.category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]}),n})();class Dt{}class St{}class ga{constructor(){this.CostCurrencyID=1,this.Discontinued=!1,this.LoyaltyPoint=!0,this.PackSize=1,this.PaymentTypeID=0,this.PriceCurrencyID=1,this.Taxable=!0,this.UnitPrice=0}}var fa=d(50494);function ha(n,i){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Minimum Quantity"),t.qZA())}function va(n,i){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Minimum Amount"),t.qZA())}function xa(n,i){1&n&&(t.TgZ(0,"th",6),t._uU(1,"Extra Cost"),t.qZA())}function Ca(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.MinimumQty>0?t.lcZ(2,1,e.MinimumQty):"-")}}function Ta(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.MinimumAmount>0?"Rp "+t.lcZ(2,1,e.MinimumAmount):"-")}}function Za(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Oqu(o.hasExtraCost?"Rp "+t.lcZ(2,1,e.ExtraCost):"-")}}function ba(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.YNc(5,Ca,3,3,"td",10),t.YNc(6,Ta,3,3,"td",10),t.TgZ(7,"td"),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td"),t._uU(11),t.ALo(12,"number"),t.qZA(),t.YNc(13,Za,3,3,"td",10),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(2),t.hij(" ",e.PromotionName," "),t.xp6(2),t.hij(" ",e.PromotionTypeName," "),t.xp6(1),t.Q6J("ngIf",o.hasMinimumQuantity),t.xp6(1),t.Q6J("ngIf",o.hasMinimumAmount),t.xp6(2),t.Oqu("Rp "+t.lcZ(9,7,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(12,9,e.Discount)+"%"),t.xp6(2),t.Q6J("ngIf",o.hasExtraCost)}}let ya=(()=>{class n{constructor(e,o){this.promotions=e,this.dialogRef=o,this.modalConfig=new I.O,this.modalConfig.hideOk=!0,this.modalConfig.title="Promotions Detail",this.modalConfig.cancelText="Close",this.checkHasMinimumQty(),this.checkHasMinimumAmount(),this.checkHasExtraCost()}ngOnInit(){}onClose(){this.dialogRef.close()}checkHasMinimumQty(){this.hasMinimumQuantity=!1,this.promotions.filter(o=>o.MinimumQty>0).length>0&&(this.hasMinimumQuantity=!0)}checkHasMinimumAmount(){this.hasMinimumAmount=!1,this.promotions.filter(o=>o.MinimumAmount>0).length>0&&(this.hasMinimumAmount=!0)}checkHasExtraCost(){this.hasExtraCost=!1,this.promotions.filter(o=>o.ExtraCost>0).length>0&&(this.hasExtraCost=!0)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.WI),t.Y36(C.so))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-promotion-detail"]],decls:18,vars:5,consts:[[3,"config","onCancel"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end",2,"width","10rem"],[1,"border-end",2,"width","4rem"],["class","border-end","style","width: 8rem;",4,"ngIf"],[1,"border-end",2,"width","5rem"],["class","border-end","style","width: 5rem;",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","8rem"],[4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return o.onClose()}),t.TgZ(1,"content")(2,"table",1)(3,"thead")(4,"tr",2)(5,"th",3),t._uU(6,"Name"),t.qZA(),t.TgZ(7,"th",4),t._uU(8,"Type"),t.qZA(),t.YNc(9,ha,2,0,"th",5),t.YNc(10,va,2,0,"th",5),t.TgZ(11,"th",6),t._uU(12,"Promotion Price"),t.qZA(),t.TgZ(13,"th",6),t._uU(14,"Discount"),t.qZA(),t.YNc(15,xa,2,0,"th",7),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,ba,14,11,"tr",8),t.qZA()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(9),t.Q6J("ngIf",o.hasMinimumQuantity),t.xp6(1),t.Q6J("ngIf",o.hasMinimumAmount),t.xp6(5),t.Q6J("ngIf",o.hasExtraCost),t.xp6(2),t.Q6J("ngForOf",o.promotions))},dependencies:[c.sg,c.O5,M.M,c.JJ]}),n})();var $=d(71948);class Nt{}let Ia=(()=>{class n{constructor(e,o,a,r){this._httpService=o,this.dialogRef=a,this.toastr=r,this.composite=Object.assign(new Nt,e)}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new I.O,this.modalConfig.title="Add New Composite?"}onSelectProduct(e){this._httpService.post("/API/catalog/variant/GetVariantByID",JSON.stringify({id:e})).pipe((0,z.h)(o=>u.gT.IsNotEmpty(o))).subscribe(o=>{this.setComposite(o)})}setComposite(e){let o={ComponentID:e.ID,Variant:{Variant:{Code:e.Code,Name:e.Name,UOMName:e.UOMName,UnitCost:e.UnitCost}},CostCurrency:e.CostCurrencyID,PriceCurrency:e.PriceCurrencyID};this.composite=Object.assign(new Nt,o)}onOk(){u.gT.IsEmpty(this.composite.ComponentID)?this.toastr.info("Choose one variant",_.n.Info):this.composite.Quantity>0?this.dialogRef.close(this.composite):this.toastr.info("Quantity can not be zero",_.n.Info)}onClose(){this.dialogRef.close()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.WI),t.Y36(m.O),t.Y36(C.so),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-variant-component"]],decls:12,vars:6,consts:[[3,"config","onOk","onCancel"],[1,"container-fluid"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["id","inputSupplier","placeholder","Input product name / code :","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"customStyle","customLabel","inputTextValue","displayText","onSelect"],[1,"col-sm-12",2,"width","100%"],["type","text","id","QtyComposite","placeholder","Quantity","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","QtyComposite"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"autocompleteV2",5),t.NdJ("onSelect",function(r){return o.onSelectProduct(r)}),t.qZA()()(),t.TgZ(7,"div",6)(8,"div",4)(9,"input",7),t.NdJ("ngModelChange",function(r){return o.composite.Quantity=r}),t.qZA(),t.TgZ(10,"label",8),t._uU(11,"Quantity"),t.qZA()()()()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(6),t.Q6J("customStyle",!0)("customLabel","Input product name / code :")("inputTextValue",null==o.composite||null==o.composite.Variant||null==o.composite.Variant.Variant?null:o.composite.Variant.Variant.Name)("displayText",null==o.composite||null==o.composite.Variant||null==o.composite.Variant.Variant?null:o.composite.Variant.Variant.Name),t.xp6(3),t.Q6J("ngModel",o.composite.Quantity))},dependencies:[M.M,s.Fj,s.JJ,s.On,w.b,E.J]}),n})();function Pa(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Unit Cost"),t.qZA())}function Ma(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Total"),t.qZA())}function Aa(n,i){if(1&n&&(t.TgZ(0,"td",16),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Variant.Variant.UnitCost))}}function Da(n,i){if(1&n&&(t.TgZ(0,"td",16),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Variant.Variant.UnitCost*e.Quantity))}}function Sa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr",13),t.NdJ("click",function(){const a=t.CHM(e),r=a.$implicit,p=a.index,g=t.oxw();return t.KtG(g.onEditComposite(r,p))}),t.TgZ(1,"td",14)(2,"i",15),t.NdJ("click",function(){const r=t.CHM(e).index,p=t.oxw();return t.KtG(p.form.splice(r,1))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td",16),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.YNc(11,Aa,3,3,"td",17),t.YNc(12,Da,3,3,"td",17),t.qZA()}if(2&n){const e=i.$implicit,o=t.oxw();t.xp6(4),t.Oqu(e.Variant.Variant.Name),t.xp6(2),t.Oqu(e.Variant.Variant.Code),t.xp6(2),t.Oqu(e.Quantity),t.xp6(2),t.Oqu(e.Variant.Variant.UOMName),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost)}}function Na(n,i){if(1&n&&(t.TgZ(0,"tfoot")(1,"tr")(2,"td",18),t._uU(3,"Total"),t.qZA(),t.TgZ(4,"td",16),t._uU(5),t.ALo(6,"number"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.hij(" ",t.lcZ(6,1,e.calculateComposite()),"")}}let qa=(()=>{class n{constructor(e,o){this.matDialog=e,this.roleService=o,this.formChange=new t.vpe}ngOnInit(){}onAddComposite(){this.openDialog()}onEditComposite(e,o){this.openDialog(e,o)}calculateComposite(){let e=0;return this.form.forEach(o=>{e+=o.Variant.Variant.UnitCost*o.Quantity}),e}checkingList(e){let o=null;return this.form.forEach((a,r)=>{a.ComponentID==e&&(o=r)}),o}openDialog(e,o){let a={ComponentID:u.gT.GuidEmpty,Quantity:0};e&&(a=e),this.matDialog.open(Ia,{data:a}).afterClosed().subscribe(p=>{p&&(e?this.form[o]=p:null==this.checkingList(p.ComponentID)?this.form.push(p):this.form[this.checkingList(p.ComponentID)]=p)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.uw),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-tab-component"]],inputs:{form:"form",data:"data"},outputs:{formChange:"formChange"},decls:19,vars:4,consts:[[1,"table","table-bordered","custom-table"],[1,"table-light"],["width","15px",1,"border-end"],["type","button","matTooltipPosition","above","matTooltip","Add Component",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],[1,"border-end"],["width","200px",1,"border-end"],["width","65px",1,"border-end","text-end"],["width","65px",1,"border-end"],["class","border-end text-end","width","100px",4,"ngIf"],[3,"click",4,"ngFor","ngForOf"],[4,"ngIf"],["width","100px",1,"border-end","text-end"],[3,"click"],[1,"text-center"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[1,"text-end"],["class","text-end",4,"ngIf"],["colspan","6"]],template:function(e,o){1&e&&(t.TgZ(0,"table",0)(1,"thead")(2,"tr",1)(3,"th",2)(4,"button",3),t.NdJ("click",function(){return o.onAddComposite()}),t._UZ(5,"i",4),t.qZA()(),t.TgZ(6,"th",5),t._uU(7,"Name"),t.qZA(),t.TgZ(8,"th",6),t._uU(9,"Code"),t.qZA(),t.TgZ(10,"th",7),t._uU(11,"Qty"),t.qZA(),t.TgZ(12,"th",8),t._uU(13,"Uom"),t.qZA(),t.YNc(14,Pa,2,0,"th",9),t.YNc(15,Ma,2,0,"th",9),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,Sa,13,6,"tr",10),t.qZA(),t.YNc(18,Na,7,3,"tfoot",11),t.qZA()),2&e&&(t.xp6(14),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Q6J("ngForOf",o.form),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost))},dependencies:[b.gM,c.sg,c.O5,c.JJ]}),n})();const _t=function(n){return{"bg-light":n}};function wa(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Tol(t.VKq(3,_t,!o.roleService.inventory.Edit)),t.xp6(1),t.Oqu(e.OnHand)}}function Ua(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",14),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.OnHand=a)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.OnHand)}}function Oa(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Tol(t.VKq(3,_t,!o.roleService.product.Create&&!o.roleService.product.Edit)),t.xp6(1),t.hij(" ",e.MinStock," ")}}function Ja(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",14),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.MinStock=a)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.MinStock)}}function Va(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Tol(t.VKq(3,_t,!o.roleService.product.Create&&!o.roleService.product.Edit)),t.xp6(1),t.hij(" ",e.MaxStock," ")}}function ka(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",14),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.MaxStock=a)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.MaxStock)}}function Fa(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td",10),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4,":"),t.qZA(),t.TgZ(5,"td"),t.YNc(6,wa,2,5,"span",11),t.YNc(7,Ua,1,1,"input",12),t.qZA(),t.TgZ(8,"td"),t.YNc(9,Oa,2,5,"span",11),t.YNc(10,Ja,1,1,"input",12),t.qZA(),t.TgZ(11,"td"),t.YNc(12,Va,2,5,"span",11),t.YNc(13,ka,1,1,"input",12),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Name),t.xp6(4),t.Q6J("ngIf",!o.roleService.inventory.Edit),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.Edit),t.xp6(2),t.Q6J("ngIf",!o.roleService.product.Create&&!o.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Create||o.roleService.product.Edit),t.xp6(2),t.Q6J("ngIf",!o.roleService.product.Create&&!o.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Create||o.roleService.product.Edit)}}function Qa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",17),t.NdJ("input",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateMinStock(a.target.value))}),t.qZA()}}function La(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",17),t.NdJ("input",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateMaxStock(a.target.value))}),t.qZA()}}function Ea(n,i){if(1&n&&(t.TgZ(0,"tfoot")(1,"tr"),t._UZ(2,"td",15),t.TgZ(3,"td"),t.YNc(4,Qa,1,0,"input",16),t.qZA(),t.TgZ(5,"td"),t.YNc(6,La,1,0,"input",16),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngIf",e.roleService.product.Create||e.roleService.product.Edit),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Create||e.roleService.product.Edit)}}function Ya(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"table",1),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.sortDataInventrory(a))}),t.TgZ(1,"thead")(2,"tr",2)(3,"th",3),t._uU(4," Outlet "),t.qZA(),t._UZ(5,"th",4),t.TgZ(6,"th",5),t._uU(7," ON HAND "),t.qZA(),t.TgZ(8,"th",6),t._uU(9," ROP "),t.qZA(),t.TgZ(10,"th",7),t._uU(11," Max "),t.qZA()()(),t.TgZ(12,"tbody"),t.YNc(13,Fa,14,7,"tr",8),t.qZA(),t.YNc(14,Ea,7,2,"tfoot",9),t.qZA()}if(2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.form),t.xp6(1),t.Q6J("ngIf",e.form.length>1)}}let Ha=(()=>{class n{constructor(e){this.roleService=e}ngOnChanges(e){e&&e.form.firstChange&&(this.sourceData=Object.assign([],this.form))}dynamicSort(e){var o=1;return"-"===e[0]&&(o=-1,e=e.substr(1)),function(a,r){return-1==o?r[e].localeCompare(a[e]):a[e].localeCompare(r[e])}}sortDataInventrory(e){const o=this.form;let a="desc"==e.direction?"-":"";u.gT.IsEmpty(e.direction)?this.form=Object.assign([],this.sourceData):(a+="Name",this.form=o.sort(this.dynamicSort(a)))}updateMaxStock(e){this.form.map(o=>{o.MaxStock=e})}updateMinStock(e){this.form.map(o=>{o.MinStock=e})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-tab-inventory"]],inputs:{form:"form",data:"data",editForm:"editForm"},features:[t.TTD],decls:1,vars:1,consts:[["class","table table-bordered custom-table","matSort","",3,"matSortChange",4,"ngIf"],["matSort","",1,"table","table-bordered","custom-table",3,"matSortChange"],[1,"table-light"],["mat-sort-header","Outlet","arrowPosition","before",1,"border-end","align-left"],[1,"border-end",2,"width","10px"],["matTooltipPosition","above","matTooltip","the number of Physical Inventory at your Outlet",1,"border-end","text-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Reorder Point Threshold - calculate by multiplying [Lead Time] with [Average Daily Sales]",1,"border-end","text-end",2,"width","120px"],["matTooltipPosition","above","matTooltip","Maximum Inventory you should have after PurchaseOrder or TransferOrder operation",1,"border-end","text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[2,"vertical-align","middle"],["class","form-control text-end",3,"class",4,"ngIf"],["type","text","class","form-control text-end","autoNum","",3,"ngModel","ngModelChange",4,"ngIf"],[1,"form-control","text-end"],["type","text","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"],["colspan","3"],["placeholder","set all outlet","class","form-control text-end","autoNum","",3,"input",4,"ngIf"],["placeholder","set all outlet","autoNum","",1,"form-control","text-end",3,"input"]],template:function(e,o){1&e&&t.YNc(0,Ya,15,2,"table",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[b.gM,c.sg,c.O5,s.Fj,s.JJ,s.On,S.YE,S.nU,w.b]}),n})();class Ka{}function Ga(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",2)(1,"div",8)(2,"div",9)(3,"input",17),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.outletPrice.ExtraCost=a)}),t.qZA(),t.TgZ(4,"label",18),t._uU(5,"Extra Cost"),t.qZA()()(),t.TgZ(6,"div",12)(7,"div",13)(8,"ng-select",14),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.outletPrice.CostCurrencyID=a)}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.outletPrice.ExtraCost)("disabled",!e.roleService.product.Cost),t.xp6(5),t.Q6J("items",e.data.Currencies)("ngModel",e.outletPrice.CostCurrencyID)("clearable",!1)}}const Ra=function(n){return{selected:n}};let Ba=(()=>{class n{constructor(e,o,a){this.dialogRef=o,this.roleService=a,this.outletPrice=Object.assign(new Ka,e.form),this.data=e.data,this.initModalConfig()}IsNotEmpty(e){return u.gT.IsNotEmpty(e)}onOk(){this.dialogRef.close(this.outletPrice)}onClose(){this.dialogRef.close()}initModalConfig(){this.modalConfig=new I.O,this.modalConfig.title="Add New Outlet Price?"}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.WI),t.Y36(C.so),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-variant-outlet-price"]],decls:25,vars:13,consts:[[3,"config","onOk","onCancel"],[1,"container-fluid",2,"width","500px"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","typeID","bindLabel","Name","bindValue","ID","appendTo","body",1,"productform",3,"items","clearable","ngModel","ngModelChange"],["for","selectedOutlet",1,"ng-select"],["class","row",4,"ngIf"],[1,"col-sm-8"],[1,"form-floating-outline","flexRow"],["type","text","appendTo","body","id","outletPrice","placeholder","Price","autoNum","",1,"form-control","with-currency","me-3",3,"ngModel","ngModelChange"],["for","outletPrice"],[1,"col-sm-4"],[1,"form-floating-outline"],["id","typeID","bindLabel","Symbol","bindValue","ID","appendTo","body",1,"productform",3,"items","ngModel","clearable","ngModelChange"],["type","text","id","outletDisc","placeholder","Disc%","autoNum","",1,"form-control","percentage-input",3,"ngModel","ngModelChange"],["for","outletDisc"],["type","text","id","outletCost","placeholder","Extra Cost","autoNum","",1,"form-control","with-currency","me-3",3,"ngModel","disabled","ngModelChange"],["for","outletCost"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"ng-select",5),t.NdJ("ngModelChange",function(r){return o.outletPrice.EntityID=r}),t.qZA(),t.TgZ(7,"label",6),t._uU(8,"Choose Outlet"),t.qZA()()()(),t.YNc(9,Ga,9,5,"div",7),t.TgZ(10,"div",2)(11,"div",8)(12,"div",9)(13,"input",10),t.NdJ("ngModelChange",function(r){return o.outletPrice.UnitPrice=r}),t.qZA(),t.TgZ(14,"label",11),t._uU(15,"Price"),t.qZA()()(),t.TgZ(16,"div",12)(17,"div",13)(18,"ng-select",14),t.NdJ("ngModelChange",function(r){return o.outletPrice.PriceCurrencyID=r}),t.qZA()()()(),t.TgZ(19,"div",2)(20,"div",8)(21,"div",13)(22,"input",15),t.NdJ("ngModelChange",function(r){return o.outletPrice.PriceDiscount=r}),t.qZA(),t.TgZ(23,"label",16),t._uU(24,"Disc%"),t.qZA()()()()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(5),t.Q6J("ngClass",t.VKq(11,Ra,o.IsNotEmpty(o.outletPrice.EntityID))),t.xp6(1),t.Q6J("items",o.data.Entities)("clearable",!1)("ngModel",o.outletPrice.EntityID),t.xp6(3),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(4),t.Q6J("ngModel",o.outletPrice.UnitPrice),t.xp6(5),t.Q6J("items",o.data.Currencies)("ngModel",o.outletPrice.PriceCurrencyID)("clearable",!1),t.xp6(4),t.Q6J("ngModel",o.outletPrice.PriceDiscount))},dependencies:[c.mk,c.O5,M.M,s.Fj,s.JJ,s.On,T.w9,w.b]}),n})();function $a(n,i){1&n&&(t.TgZ(0,"th",7),t._uU(1,"Extra Cost"),t.qZA())}function ja(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Oqu(null==e.ExtraCost?"":o.getCurrencySymbolByID(e.CostCurrencyID)+" "+t.lcZ(2,1,e.ExtraCost))}}function Wa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr",10),t.NdJ("click",function(){const a=t.CHM(e),r=a.$implicit,p=a.index,g=t.oxw();return t.KtG(g.onUpdateOutletPrice(r,p))}),t.TgZ(1,"td")(2,"i",11),t.NdJ("click",function(){const r=t.CHM(e).index,p=t.oxw();return t.KtG(p.form.splice(r,1))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.YNc(5,ja,3,3,"td",12),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA()()}if(2&n){const e=i.$implicit,o=t.oxw();t.xp6(4),t.Oqu(o.getEntityNameByID(e.EntityID)),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Oqu(null==e.UnitPrice?"":o.getCurrencySymbolByID(e.PriceCurrencyID)+" "+t.lcZ(8,4,e.UnitPrice)),t.xp6(3),t.Oqu(null==e.PriceDiscount?"":e.PriceDiscount+"%")}}let za=(()=>{class n{constructor(e,o){this.matDialog=e,this.roleService=o}ngOnInit(){}onAddOutletPrice(){this.openDialog({data:this.data,form:{EntityID:u.gT.GuidEmpty,CostCurrencyID:this.data.Currencies[0].ID,PriceCurrencyID:this.data.Currencies[0].ID}})}onUpdateOutletPrice(e,o){this.openDialog({data:this.data,form:e},o)}getCurrencySymbolByID(e){let a;return this.data.Currencies.forEach(r=>{r.ID==e&&(a=r.Symbol)}),a}getEntityNameByID(e){let a;return this.data.Entities.forEach(r=>{r.ID==e&&(a=r.Name)}),a}openDialog(e,o){let a={data:e.data,form:e.form};o&&(a=e),this.matDialog.open(Ba,{data:a}).afterClosed().pipe((0,z.h)(p=>u.gT.IsNotEmpty(p))).subscribe(p=>{p&&(o||0==o?this.form[o]=p:this.form.push(p))})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.uw),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-tab-outlet-price"]],inputs:{data:"data",form:"form"},decls:15,vars:2,consts:[[1,"table","table-bordered","custom-table"],[1,"table-light"],["width","15px",1,"border-end"],["type","button","matTooltipPosition","above","matTooltip","Add Outlet Price",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click"],["aria-hidden","true",1,"fa","fa-plus"],[1,"border-end"],["class","border-end","width","150px",4,"ngIf"],["width","150px",1,"border-end"],["width","50px",1,"border-end"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"table",0)(1,"thead")(2,"tr",1)(3,"th",2)(4,"button",3),t.NdJ("click",function(){return o.onAddOutletPrice()}),t._UZ(5,"i",4),t.qZA()(),t.TgZ(6,"th",5),t._uU(7,"Outlet"),t.qZA(),t.YNc(8,$a,2,0,"th",6),t.TgZ(9,"th",7),t._uU(10,"Price"),t.qZA(),t.TgZ(11,"th",8),t._uU(12,"Disc."),t.qZA()()(),t.TgZ(13,"tbody"),t.YNc(14,Wa,11,6,"tr",9),t.qZA()()),2&e&&(t.xp6(8),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(6),t.Q6J("ngForOf",o.form))},dependencies:[b.gM,c.sg,c.O5,c.JJ]}),n})();function Xa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",7),t._uU(4),t.qZA(),t.TgZ(5,"td")(6,"input",8),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.UnitPrice=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onChange())}),t.qZA()(),t.TgZ(7,"td")(8,"input",9),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.PriceDiscount=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onChange())}),t.qZA()()()}if(2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name?e.Name:e.PricebookName),t.xp6(2),t.Oqu(e.MinimumQuantity),t.xp6(2),t.Q6J("ngModel",e.UnitPrice),t.xp6(2),t.Q6J("ngModel",e.PriceDiscount)}}let ti=(()=>{class n{constructor(){this.formChange=new t.vpe}ngOnInit(){}onChange(){this.formChange.emit(this.form)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-tab-pricebook"]],inputs:{form:"form",data:"data"},outputs:{formChange:"formChange"},decls:13,vars:1,consts:[[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],["width","120px",1,"border-end"],["width","150px",1,"border-end"],["width","100px",1,"border-end"],[4,"ngFor","ngForOf"],[1,"text-end"],["type","text","onchange","","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"],["type","text","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"table",0)(1,"thead")(2,"tr",1)(3,"th",2),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th",3),t._uU(6,"Minimum Quantity"),t.qZA(),t.TgZ(7,"th",4),t._uU(8,"Price"),t.qZA(),t.TgZ(9,"th",5),t._uU(10,"Price Discount %"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,Xa,9,4,"tr",6),t.qZA()()),2&e&&(t.xp6(12),t.Q6J("ngForOf",o.form))},dependencies:[c.sg,s.Fj,s.JJ,s.On,w.b]}),n})();function ei(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td")(4,"input",18),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.Amount=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onChange())}),t.qZA()()()}if(2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Q6J("ngModel",e.Amount)}}let ni=(()=>{class n{constructor(){this.formChange=new t.vpe}ngOnInit(){}calculateCommission(){this.salesCommission.commission=this.salesCommission.discount/100*this.data.UnitPrice}onChange(){this.formChange.emit(this.form)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-nav-commission"]],inputs:{salesCommission:"salesCommission",form:"form",data:"data"},outputs:{formChange:"formChange"},decls:28,vars:3,consts:[[1,"row","bg-white"],[1,"col-sm-6"],[1,"form-floating-outline"],["type","text","id","inputCommission","placeholder","Commission","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCommission"],[1,"col-sm-6","bg-white"],[1,"row"],[1,"col-sm-11"],["type","text","id","inputPercentage","placeholder","Commission (%) Calculator","max","100","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPercentage"],[1,"col-sm-1","ps-0"],[1,"mt-10"],[1,"col-sm-12","bg-white"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","120px"],[4,"ngFor","ngForOf"],["type","text","autoNum","",1,"form-control","text-end",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"input",3),t.NdJ("ngModelChange",function(r){return o.salesCommission.commission=r}),t.qZA(),t.TgZ(4,"label",4),t._uU(5,"Commission"),t.qZA()()(),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",2)(10,"input",8),t.NdJ("ngModelChange",function(r){return o.salesCommission.discount=r})("ngModelChange",function(){return o.calculateCommission(),o.onChange()}),t.qZA(),t.TgZ(11,"label",9),t._uU(12,"Commission (%) Calculator"),t.qZA()()(),t.TgZ(13,"div",10)(14,"label",11),t._uU(15,"%"),t.qZA()()()()(),t.TgZ(16,"div",6)(17,"div",12)(18,"div",2)(19,"table",13)(20,"thead")(21,"tr",14)(22,"th",15),t._uU(23,"Sales Group"),t.qZA(),t.TgZ(24,"th",16),t._uU(25,"Commission"),t.qZA()()(),t.TgZ(26,"tbody"),t.YNc(27,ei,5,2,"tr",17),t.qZA()()()()()),2&e&&(t.xp6(3),t.Q6J("ngModel",o.salesCommission.commission),t.xp6(7),t.Q6J("ngModel",o.salesCommission.discount),t.xp6(17),t.Q6J("ngForOf",o.form))},dependencies:[c.sg,s.Fj,s.JJ,s.On,w.b]}),n})(),oi=(()=>{class n{constructor(){this.formChange=new t.vpe}onChange(){this.formChange.emit(this.form)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-nav-description"]],inputs:{form:"form"},outputs:{formChange:"formChange"},decls:2,vars:1,consts:[[1,"form-floating-outline"],["height","210px",3,"value","valueChange"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"POS-tinymce-editor",1),t.NdJ("valueChange",function(r){return o.form.Description=r}),t.qZA()()),2&e&&(t.xp6(1),t.Q6J("value",o.form.Description))},dependencies:[ut.V]}),n})();var ai=d(77890);const nt=function(n){return{selected:n}};let ii=(()=>{class n{constructor(){this.paymentType=ai._,this.sellPriceOptions=[{Key:0,Value:"Require Authorization"},{Key:1,Value:"Do Not Require Authorization"},{Key:2,Value:"Do Not Require Authorization and Sync Cost"}],this.sellPriceTootips=["Only user with UnitPriceEditor can change the price","All user can change the price","All user can change the price and the cost will follow the price"],this.formChange=new t.vpe}isNotEmpty(e){return u.gT.IsNotEmpty(e)}onChange(){this.formChange.emit(this.form)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-nav-advanced"]],inputs:{form:"form",data:"data"},outputs:{formChange:"formChange"},decls:65,vars:34,consts:[[1,"row"],[1,"col-sm-4","bg-white"],[1,"form-floating-outline","radio","border","rounded"],["aria-label","Select an option",3,"ngModel","ngModelChange"],[3,"value"],[1,"ps-3","mt-4",3,"value"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","inputCostCurrency","bindLabel","Symbol","bindValue","ID",1,"productform",3,"items","clearable","ngModel","ngModelChange"],["for","inputCostCurrency",2,"z-index","9999"],["id","inputPriceCurrency","bindLabel","Symbol","bindValue","ID",1,"productform",3,"items","clearable","ngModel"],["for","inputPriceCurrency",2,"z-index","9999"],[1,"col-sm-6","bg-white"],[1,"col-sm-4"],[1,"col-sm-8"],[1,"form-floating-outline"],["type","text","id","inputContent","placeholder","Content","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputContent"],[1,"col-sm-4","ps-0"],[1,"mt-10"],["type","text","id","inputPackSize","placeholder","Pack Size",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPackSize"],["type","text","id","inputIndex","placeholder","Index",1,"form-control",3,"ngModel","ngModelChange"],["for","inputIndex"],[1,"col-sm-6"],[1,"form-floating-outline",3,"ngClass"],["id","CategoryID","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","items","ngModel","ngModelChange"],["for","inputUOMSubQuantity"],["id","inputMeasurement","bindLabel","Name","bindValue","ID",1,"productform",3,"clearable","items","ngModel","ngModelChange"],["for","inputMeasurement"],[1,"col-sm-12","bg-white"],[1,"form-floating-outline","radio","border","rounded","mt-5"],[1,"mt-4"],[3,"model","options","title","modelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"label"),t._uU(4,"Payment Type"),t.qZA(),t.TgZ(5,"mat-radio-group",3),t.NdJ("ngModelChange",function(r){return o.form.PaymentTypeID=r}),t.TgZ(6,"mat-radio-button",4),t._uU(7,"Cash And Point"),t.qZA(),t._uU(8,"\xa0 "),t.TgZ(9,"mat-radio-button",4),t._uU(10,"Cash"),t.qZA(),t.TgZ(11,"mat-radio-button",5),t._uU(12,"Point"),t.qZA()()()(),t.TgZ(13,"div",1)(14,"div",6)(15,"ng-select",7),t.NdJ("ngModelChange",function(r){return o.form.CostCurrencyID=r}),t.qZA(),t.TgZ(16,"label",8),t._uU(17,"Cost Currency"),t.qZA()()(),t.TgZ(18,"div",1)(19,"div",6),t._UZ(20,"ng-select",9),t.TgZ(21,"label",10),t._uU(22,"Price Currency"),t.qZA()()()(),t.TgZ(23,"div",0)(24,"div",11)(25,"div",0)(26,"div",12)(27,"div",0)(28,"div",13)(29,"div",14)(30,"input",15),t.NdJ("ngModelChange",function(r){return o.form.UnitQuantity=r}),t.qZA(),t.TgZ(31,"label",16),t._uU(32,"Content"),t.qZA()()(),t.TgZ(33,"div",17)(34,"label",18),t._uU(35,"/ unit"),t.qZA()()()(),t.TgZ(36,"div",1)(37,"div",14)(38,"input",19),t.NdJ("ngModelChange",function(r){return o.form.PackSize=r}),t.qZA(),t.TgZ(39,"label",20),t._uU(40,"Pack Size"),t.qZA()()(),t.TgZ(41,"div",1)(42,"div",14)(43,"input",21),t.NdJ("ngModelChange",function(r){return o.form.ProductIndex=r}),t.qZA(),t.TgZ(44,"label",22),t._uU(45,"Index"),t.qZA()()()()(),t.TgZ(46,"div",23)(47,"div",0)(48,"div",11)(49,"div",24)(50,"ng-select",25),t.NdJ("ngModelChange",function(r){return o.form.UOMQ=r}),t.qZA(),t.TgZ(51,"label",26),t._uU(52,"UOM Sub Quantity"),t.qZA()()(),t.TgZ(53,"div",11)(54,"div",24)(55,"ng-select",27),t.NdJ("ngModelChange",function(r){return o.form.MeasurementID=r}),t.qZA(),t.TgZ(56,"label",28),t._uU(57,"Measurements"),t.qZA()()()()()(),t.TgZ(58,"div",0)(59,"div",29)(60,"div",30)(61,"label"),t._uU(62,"Sell Price Type"),t.qZA(),t.TgZ(63,"div",31)(64,"radio-options",32),t.NdJ("modelChange",function(r){return o.form.SellPriceType=r}),t.qZA()()()()()),2&e&&(t.xp6(5),t.Q6J("ngModel",o.form.PaymentTypeID),t.xp6(1),t.Q6J("value",o.paymentType.CashAndPoint),t.xp6(3),t.Q6J("value",o.paymentType.Cash),t.xp6(2),t.Q6J("value",o.paymentType.Point),t.xp6(3),t.Q6J("ngClass",t.VKq(26,nt,o.isNotEmpty(o.form.CostCurrencyID))),t.xp6(1),t.Q6J("items",o.data.Currencies)("clearable",!1)("ngModel",o.form.CostCurrencyID),t.xp6(4),t.Q6J("ngClass",t.VKq(28,nt,o.isNotEmpty(o.form.PriceCurrencyID))),t.xp6(1),t.Q6J("items",o.data.Currencies)("clearable",!1)("ngModel",o.form.PriceCurrencyID),t.xp6(10),t.Q6J("ngModel",o.form.UnitQuantity),t.xp6(8),t.Q6J("ngModel",o.form.PackSize),t.xp6(5),t.Q6J("ngModel",o.form.ProductIndex),t.xp6(6),t.Q6J("ngClass",t.VKq(30,nt,o.isNotEmpty(o.form.UOMQ))),t.xp6(1),t.Q6J("clearable",!0)("items",o.data.UOMs)("ngModel",o.form.UOMQ),t.xp6(4),t.Q6J("ngClass",t.VKq(32,nt,o.isNotEmpty(o.form.MeasurementID))),t.xp6(1),t.Q6J("clearable",!0)("items",o.data.Measurements)("ngModel",o.form.MeasurementID),t.xp6(9),t.Q6J("model",o.form.SellPriceType)("options",o.sellPriceOptions)("title",o.sellPriceTootips))},dependencies:[c.mk,s.Fj,s.JJ,s.On,$.VQ,$.U0,T.w9,F.P,w.b]}),n})();function ri(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h3"),t._uU(5,"1 (one)"),t.qZA()(),t.TgZ(6,"div",5)(7,"div",6)(8,"ng-select",7),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.form.ParentID=a)}),t.qZA()()(),t.TgZ(9,"div",8)(10,"h3",9),t._uU(11," = "),t.qZA()(),t.TgZ(12,"div",10)(13,"div",11)(14,"input",12),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.form.Ratio=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onChange())}),t.qZA(),t.TgZ(15,"label",13),t._uU(16,"Ratio"),t.qZA()()(),t.TgZ(17,"div",14)(18,"h3",9),t._uU(19),t.qZA()()()()()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngModel",e.form.ParentID)("items",e.option)("clearable",!1),t.xp6(6),t.Q6J("ngModel",e.form.Ratio),t.xp6(5),t.Oqu(e.variant.Model)}}let li=(()=>{class n{constructor(){this.formChange=new t.vpe}set _form(e){e?(this.form=e,console.log(this.form)):this.form=new St}onChange(){this.formChange.emit(this.form)}ngOnInit(){}onSelectParent(e){this.form.ParentID=e,console.log(e)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant-tab-multi-UOM"]],inputs:{_form:["form","_form"],variant:"variant",option:"option"},outputs:{formChange:"formChange"},decls:1,vars:1,consts:[["class","card",4,"ngIf"],[1,"card"],[1,"card-body"],[1,"row"],[1,"col-sm-auto","pt-8"],[1,"col-sm-4","ps-2"],[1,"form-floating-outline","flexRow"],["id","inputType","placeholder","Parent","bindLabel","Name","bindValue","ID",1,"productform",3,"ngModel","items","clearable","ngModelChange"],[1,"col-sm-auto","ms-0",2,"width","40px"],[1,"text-start","pt-8"],[1,"col-sm-3"],[1,"form-floating-outline"],["type","text","id","inputRatio","placeholder","Ratio","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputRatio"],[1,"col-sm-auto"]],template:function(e,o){1&e&&t.YNc(0,ri,20,5,"div",0),2&e&&t.Q6J("ngIf",o.form)},dependencies:[c.O5,s.Fj,s.JJ,s.On,T.w9,w.b]}),n})();function ci(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"small",64),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.onShowPromotionDetail())}),t._uU(1),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(1),t.hij("( ",null==e.promotions?null:e.promotions.length," Active promotions )")}}function si(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",5)(2,"div",65)(3,"div",11)(4,"input",66),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.UnitCost=a)}),t.qZA(),t.TgZ(5,"label",67),t._uU(6,"Buying Cost"),t.qZA()()(),t.TgZ(7,"div",68)(8,"div",11)(9,"input",69),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.OrderPriceDiscount=a)}),t.qZA(),t.TgZ(10,"label",70),t._uU(11,"Disc %"),t.qZA()()()()()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngModel",null==e.variant?null:e.variant.UnitCost),t.xp6(5),t.Q6J("ngModel",null==e.variant?null:e.variant.OrderPriceDiscount)}}function pi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",5)(2,"div",65)(3,"div",11)(4,"input",71),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.UnitPrice=a)}),t.qZA(),t.TgZ(5,"label",72),t._uU(6,"Selling Price"),t.qZA()()(),t.TgZ(7,"div",68)(8,"div",11)(9,"input",73),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.PriceDiscount=a)}),t.qZA(),t.TgZ(10,"label",74),t._uU(11,"Disc %"),t.qZA()()()()()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngModel",null==e.variant?null:e.variant.UnitPrice),t.xp6(5),t.Q6J("ngModel",null==e.variant?null:e.variant.PriceDiscount)}}function di(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",29)(2,"div",11)(3,"input",75),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.VariantPoint.Point=a)}),t.qZA(),t.TgZ(4,"label",76),t._uU(5,"Point"),t.qZA()()()()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",null==e.VariantPoint?null:e.VariantPoint.Point)}}function ui(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",10)(2,"div",11)(3,"input",77),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.VariantPoint.ExpiredDay=a)}),t.qZA(),t.TgZ(4,"label",78),t._uU(5,"Day(s) +"),t.qZA()()(),t.TgZ(6,"div",10)(7,"div",11)(8,"input",79),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.VariantPoint.ExpiredMonth=a)}),t.qZA(),t.TgZ(9,"label",80),t._uU(10,"Month(s)"),t.qZA()()()()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",null==e.VariantPoint?null:e.VariantPoint.ExpiredDay),t.xp6(5),t.Q6J("ngModel",null==e.VariantPoint?null:e.VariantPoint.ExpiredMonth)}}function _i(n,i){1&n&&(t.TgZ(0,"li",39)(1,"a",81),t._uU(2,"Inventory"),t.qZA()())}function mi(n,i){1&n&&(t.TgZ(0,"li",39)(1,"a",82),t._uU(2,"Component"),t.qZA()())}function gi(n,i){1&n&&(t.TgZ(0,"a",83),t._uU(1,"MultiUOM"),t.qZA())}function fi(n,i){1&n&&(t.ynx(0),t.TgZ(1,"div",7)(2,"div",88)(3,"p"),t._uU(4," This variant type does not have an inventory "),t.qZA()()(),t.BQk())}function hi(n,i){if(1&n&&t._UZ(0,"POS-form-variant-tab-inventory",89),2&n){const e=t.oxw(4);t.Q6J("form",e.entities)("editForm",e.getQueryParams)("data",e.data)}}function vi(n,i){if(1&n&&(t.TgZ(0,"div",52),t.YNc(1,fi,5,0,"ng-container",86),t.YNc(2,hi,1,3,"ng-template",null,87,t.W1O),t.qZA()),2&n){const e=t.MAs(3),o=t.oxw(3);t.xp6(1),t.Q6J("ngIf",o.variant.TypeID==o.variantTypeID.NonInventory||o.variant.TypeID==o.variantTypeID.Composite||o.variant.TypeID==o.variantTypeID.PrepaidPoint||o.variant.TypeID==o.variantTypeID.PrepaidPackage)("ngIfElse",e)}}function xi(n,i){if(1&n&&(t.TgZ(0,"div",84)(1,"div",49)(2,"div",9)(3,"div",50)(4,"div",5)(5,"div",51)(6,"div",5),t.YNc(7,vi,4,2,"div",85),t.qZA()()()()()()()),2&n){const e=t.oxw(2);t.xp6(7),t.Q6J("ngIf",e.entities.length>0&&e.data)}}function Ci(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"POS-form-variant-tab-multi-UOM",90),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variantParent=a)}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("form",e.variantParent)("variant",e.variant)("option",e.variantParentList)}}const Ti=function(){return["/menu/Products/Catalog/Products"]},qt=function(n){return{selected:n}};function Zi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.validateSubmit())}),t._uU(5,"Submit"),t.qZA()(),t.TgZ(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h3"),t._uU(13,"General"),t.qZA()(),t.TgZ(14,"div",9)(15,"div",5)(16,"div",10)(17,"div",11)(18,"autocompleteV2",12),t.NdJ("optionSelected",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectProduct(a))})("ngModel",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.ProductID=a)}),t.qZA()()(),t.TgZ(19,"div",13)(20,"div",11)(21,"input",14),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return r.variant.Model=a,t.KtG(r.updateDisplayName())}),t.qZA(),t.TgZ(22,"label",15),t._uU(23,"Variant"),t.qZA()()(),t.TgZ(24,"div",13)(25,"div",11)(26,"input",16),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return r.variant.Code=a,t.KtG(r.updateDisplayName())}),t.qZA(),t.TgZ(27,"label",17),t._uU(28,"Code"),t.qZA()()()(),t.TgZ(29,"div",5)(30,"div",10)(31,"div",11)(32,"input",18),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Name=a)}),t.qZA(),t.TgZ(33,"label",19),t._uU(34,"Display Name"),t.qZA()()(),t.TgZ(35,"div",13)(36,"div",11)(37,"input",20),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Weight=a)}),t.qZA(),t.TgZ(38,"label",21),t._uU(39,"Weight (gr)"),t.qZA()()(),t.TgZ(40,"div",13)(41,"div",22)(42,"ng-select",23),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.UOM=a)}),t.qZA(),t.TgZ(43,"label",24),t._uU(44,"UOM"),t.qZA()()()()()(),t.TgZ(45,"div",7)(46,"div",25)(47,"h3"),t._uU(48,"Price"),t.qZA(),t.YNc(49,ci,2,1,"small",26),t.qZA(),t.TgZ(50,"div",9)(51,"div",5),t.YNc(52,si,12,2,"div",27),t.YNc(53,pi,12,2,"div",27),t.qZA()()()(),t.TgZ(54,"div",28)(55,"div",5)(56,"div",29)(57,"div",7)(58,"div",8)(59,"h3"),t._uU(60,"Properties"),t.qZA()(),t.TgZ(61,"div",9)(62,"div",5)(63,"div",29)(64,"div",22)(65,"ng-select",30),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.getVariantWithSameProductID(a))}),t.qZA(),t.TgZ(66,"label",31),t._uU(67,"Type"),t.qZA()()()(),t.YNc(68,di,6,1,"div",32),t.YNc(69,ui,11,2,"div",32),t.TgZ(70,"div",5)(71,"div",29)(72,"div",33)(73,"label"),t._uU(74,"Taxable"),t.qZA(),t.TgZ(75,"mat-radio-group",34),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Taxable=a)}),t.TgZ(76,"mat-radio-button",35),t._uU(77,"No"),t.qZA(),t.TgZ(78,"mat-radio-button",36),t._uU(79,"Yes"),t.qZA()()()()(),t.TgZ(80,"div",5)(81,"div",29)(82,"div",33)(83,"label"),t._uU(84,"Loyalty Point Enabled"),t.qZA(),t.TgZ(85,"mat-radio-group",34),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.LoyaltyPoint=a)}),t.TgZ(86,"mat-radio-button",35),t._uU(87,"No"),t.qZA(),t.TgZ(88,"mat-radio-button",36),t._uU(89,"Yes"),t.qZA()()()()(),t.TgZ(90,"div",5)(91,"div",29)(92,"div",33)(93,"label"),t._uU(94,"Discontinued"),t.qZA(),t.TgZ(95,"mat-radio-group",34),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Discontinued=a)}),t.TgZ(96,"mat-radio-button",35),t._uU(97,"No"),t.qZA(),t.TgZ(98,"mat-radio-button",36),t._uU(99,"Yes"),t.qZA()()()()()()()()()()(),t.TgZ(100,"div",5)(101,"div",29)(102,"ul",37),t.YNc(103,_i,3,0,"li",38),t.YNc(104,mi,3,0,"li",38),t.TgZ(105,"li",39)(106,"a",40),t._uU(107,"Outlet Price"),t.qZA()(),t.TgZ(108,"li",39)(109,"a",41),t._uU(110,"Pricebook"),t.qZA()(),t.TgZ(111,"li",39)(112,"a",42),t._uU(113,"Commission"),t.qZA()(),t.TgZ(114,"li",39)(115,"a",43),t._uU(116,"Description"),t.qZA()(),t.TgZ(117,"li",39)(118,"a",44),t._uU(119,"Advanced"),t.qZA()(),t.TgZ(120,"li",39),t.YNc(121,gi,2,0,"a",45),t.qZA()(),t.TgZ(122,"div",46),t.YNc(123,xi,8,1,"div",47),t.TgZ(124,"div",48)(125,"div",49)(126,"div",9)(127,"div",50)(128,"div",5)(129,"div",51)(130,"div",5)(131,"div",52)(132,"POS-form-variant-tab-component",53),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.composites=a)}),t.qZA()()()()()()()()(),t.TgZ(133,"div",54)(134,"div",49)(135,"div",9)(136,"div",50)(137,"div",5)(138,"div",51)(139,"div",5)(140,"div",52)(141,"POS-form-variant-tab-outlet-price",53),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.outletPrices=a)}),t.qZA()()()()()()()()(),t.TgZ(142,"div",55)(143,"div",49)(144,"div",9)(145,"div",50)(146,"div",5)(147,"div",51)(148,"div",5)(149,"div",52)(150,"POS-form-variant-tab-pricebook",53),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pricebooks=a)}),t.qZA()()()()()()()()(),t.TgZ(151,"div",56)(152,"div",49)(153,"div",9)(154,"div",50)(155,"div",5)(156,"div",51)(157,"div",5)(158,"div",52)(159,"POS-form-variant-nav-commission",57),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.salesGroups=a)}),t.qZA()()()()()()()()(),t.TgZ(160,"div",58)(161,"div",49)(162,"div",9)(163,"div",50)(164,"div",5)(165,"div",51)(166,"div",5)(167,"div",52)(168,"POS-form-variant-nav-description",59),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant=a)}),t.qZA()()()()()()()()(),t.TgZ(169,"div",60)(170,"div",49)(171,"div",9)(172,"div",50)(173,"div",61)(174,"div",51)(175,"div",5)(176,"div",52)(177,"POS-form-variant-nav-advanced",53),t.NdJ("formChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.variant=a)}),t.qZA()()()()()()()()(),t.TgZ(178,"div",62)(179,"div",49)(180,"div",9)(181,"div",50)(182,"div",61)(183,"div",51)(184,"div",5)(185,"div",52),t.YNc(186,Ci,1,3,"POS-form-variant-tab-multi-UOM",63),t.qZA()()()()()()()()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(52,Ti)),t.xp6(2),t.Q6J("disabled",!e.productName),t.xp6(14),t.Q6J("customStyle",!0)("customLabel","Selected Product")("inputTextValue",e.productName)("displayText",e.productName),t.xp6(3),t.Q6J("ngModel",null==e.variant?null:e.variant.Model),t.xp6(5),t.Q6J("ngModel",null==e.variant?null:e.variant.Code),t.xp6(6),t.Q6J("ngModel",null==e.variant?null:e.variant.Name),t.xp6(5),t.Q6J("ngModel",null==e.variant?null:e.variant.Weight),t.xp6(4),t.Q6J("ngClass",t.VKq(53,qt,e.IsNotEmpty(e.variant.UOM))),t.xp6(1),t.Q6J("items",e.data.UOMs)("clearable",e.IsNotEmpty(e.variant.UOM))("ngModel",null==e.variant?null:e.variant.UOM),t.xp6(7),t.Q6J("ngIf",(null==e.promotions?null:e.promotions.length)>0),t.xp6(3),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",!(null!=e.roleService&&e.roleService.sell.PriceVisibleRestriction)),t.xp6(11),t.Q6J("ngClass",t.VKq(55,qt,e.IsNotEmpty(e.variant.TypeID))),t.xp6(1),t.Q6J("items",null==e.data?null:e.data.Types)("clearable",!1)("ngModel",null==e.variant?null:e.variant.TypeID),t.xp6(3),t.Q6J("ngIf",10==(null==e.variant?null:e.variant.TypeID)||8==(null==e.variant?null:e.variant.TypeID)),t.xp6(1),t.Q6J("ngIf",10==(null==e.variant?null:e.variant.TypeID)||8==(null==e.variant?null:e.variant.TypeID)),t.xp6(6),t.Q6J("ngModel",null==e.variant?null:e.variant.Taxable),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0),t.xp6(7),t.Q6J("ngModel",null==e.variant?null:e.variant.LoyaltyPoint),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0),t.xp6(7),t.Q6J("ngModel",null==e.variant?null:e.variant.Discontinued),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0),t.xp6(5),t.Q6J("ngIf",e.roleService.inventory.View),t.xp6(1),t.Q6J("ngIf",e.variant.TypeID==e.variantTypeID.Standard||e.variant.TypeID==e.variantTypeID.NonInventory||e.variant.TypeID==e.variantTypeID.Composite||e.variant.TypeID==e.variantTypeID.Manufactured||e.variant.TypeID==e.variantTypeID.MultipleUOM),t.xp6(17),t.Q6J("ngIf",e.variant.TypeID==e.variantTypeID.MultipleUOM),t.xp6(2),t.Q6J("ngIf",e.roleService.inventory.View),t.xp6(9),t.Q6J("form",e.composites)("data",e.data),t.xp6(9),t.Q6J("form",e.outletPrices)("data",e.data),t.xp6(9),t.Q6J("form",e.pricebooks)("data",e.data),t.xp6(9),t.Q6J("salesCommission",e.sales)("form",e.salesGroups)("data",e.variant),t.xp6(9),t.Q6J("form",e.variant),t.xp6(9),t.Q6J("form",e.variant)("data",e.data),t.xp6(9),t.Q6J("ngIf",e.variant.TypeID==e.variantTypeID.MultipleUOM)}}let bi=(()=>{class n extends q.U{constructor(e,o,a,r,p,g){super(e,"catalog/variant/GetVariantFormInitialData",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.matDialog=p,this.roleService=g,this.variantTypeID=V.J,this.getQueryParams=null,this.variantParentList=[],this.isEdit=!1,this.variant=new ga,this.composites=[],this.outletPrices=[],this.pricebooks=[],this.salesGroups=[],this.entities=[],this.VariantPoint={ExpiredDay:0,Point:0,ExpiredMonth:0},this.variantParent=new St,this.sales={commission:0,discount:0}}onSelectProduct(e){let o=JSON.parse(e);this.variant.ProductID=o.Key,this.productName=o.Value,this.updateDisplayName()}updateDisplayName(){this.variant.Name=JSON.parse(JSON.stringify(this.productName?this.productName:"")),this.variant.Model&&(this.variant.Name=`${this.productName} (${this.variant.Model})`)}generateOutletStock(e){let o;return e.map(r=>(o=new Dt,u.gT.IsEmpty(r.EntityID)&&(r.EntityID=r.ID),o=(0,fa.d8)(Dt,r),o))}calculateCompositeCost(e){let a,r,o=0;return e.forEach(p=>{a=p.Variant.Variant.UnitCost,r=p.Quantity,o+=a*r}),o}generateVariantSubmitData(){let e=this.generateOutletStock(this.entities),o=this.calculateCompositeCost(this.composites),a={};(this.variant?.TypeID==this.variantTypeID.PrepaidPackage||this.variant?.TypeID==this.variantTypeID.PrepaidPoint)&&(a=this.VariantPoint);let r={Composites:this.composites,OutletPrices:this.outletPrices,OutletStocks:e,Pricebooks:this.pricebooks,QueryString:null,TotalCompositeCost:o,Variant:this.variant,VariantParent:this.variantParent,VariantPoint:a};return u.gT.IsNotEmpty(this.getQueryParams.ID)?(r.Commission=this.salesGroups,r.QueryString=this.getQueryParams.ID,r.Entities=this.entities,r.PageTitle=this.PageTitle,r.ParentName=this.ParentName,r.ProductName=this.ProductName,r.SupplierName=this.SupplierName,r.VariantParent=this.variantParent?this.variantParent:{},this.isEdit=!0):r.Commission=this.salesGroups,r.Variant.SalesCommission=this.sales.commission,r}IsNotEmpty(e){return u.gT.IsNotEmpty(e)}postBindForm(e){this.variant.TypeID=e.Types[0].Key,this.pricebooks=e.Pricebooks,this.salesGroups=e.SalesGroup,this.loadEditForm()}loadEditForm(){this.getQueryParams=this.activatedRoute.snapshot.queryParams,Object.entries(this.getQueryParams).length>0&&this.httpService.post("/API/catalog/variant/GetVariantFormModelById",JSON.stringify(this.getQueryParams)).subscribe(e=>{this.productName=e.ProductName,this.menuData.H=e.PageTitle,this.variant=e.Variant,this.composites=e.Composites,this.outletPrices=e.OutletPrices,this.pricebooks=e.Pricebooks,this.salesGroups=e.Commission,this.entities=e.OutletStocks,this.promotions=e.Promotion,this.VariantPoint=u.gT.IsEmpty(e.VariantPoint)?{ExpiredDay:0,Point:0,ExpiredMonth:0}:e.VariantPoint,e.Variant.SalesCommission>0&&(this.sales.commission=e.Variant.SalesCommission,this.sales.discount=e.Variant.SalesCommission/e.Variant.UnitPrice*100),this.variantParent=e.VariantParent?e.VariantParent:this.variantParent,this.PageTitle=e.PageTitle,this.ParentName=e.ParentName,this.ProductName=e.ProductName,this.SupplierName=e.SupplierName,this.initVariantParentList(e.Variant.TypeID),this.getVariantWithSameProductID(e.Variant.TypeID,!0)})}getVariantWithSameProductID(e,o=!1){this.variant.TypeID==V.J.MultipleUOM&&!o&&(this.variantParent=null),this.variant.TypeID=e,this.initVariantParentList(e)}initVariantParentList(e){e==this.variantTypeID.MultipleUOM&&this.httpService.post("/API/catalog/variant/GetVariantWithSameProductID",JSON.stringify({productID:this.variant.ProductID,variantID:this.variant.ID})).subscribe(a=>{this.variantParentList=a,a.length>0&&!this.variantParent.ParentID&&(this.variantParent.ParentID=a[0].ID)})}onShowPromotionDetail(){this.matDialog.open(ya,{data:this.promotions?this.promotions:[],width:"700px"})}validateSubmit(){let e=this.variant.Description;this.data.Form=this.generateVariantSubmitData(),this.data.Form.Variant.Name=this.data.Form.Variant.Name.trim(),u.gT.IsEmpty(this.data.Form.Variant.Name)?this.toaster.warning("Display name cannot be empty",_.n.Warning):e&&e.length>500?this.toaster.warning("Maximum 500 characters allowed","Warning"):7==this.variant.TypeID&&u.gT.IsEmpty(this.formData.VariantParent.ParentID)?this.toaster.warning("Parent must be set for MultiUOM Product","Warning"):this.onSubmit("catalog/variant/SubmitVariant")}onSubmitSuccess(e){this.toaster.success(`Success ${this.isEdit?"update ":"add "}variant`,_.n.Success),this.router.navigate(["/menu/Products/Catalog/Variants/Info"],{queryParams:{ID:e}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W),t.Y36(C.uw),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-variant"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray"],[1,"row"],[1,"col-md-8","mt-5"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-6"],[1,"form-floating-outline"],["id","inputSupplier","placeholder","Selected Product","requestUrl","/API/AC/GetProductSuggestionByCodeNName",1,"w-100",3,"customStyle","customLabel","inputTextValue","displayText","optionSelected","ngModel"],[1,"col-sm-3"],["type","text","id","inputVariant","placeholder","Variant","name","variant",1,"form-control",3,"ngModel","ngModelChange"],["for","inputVariant"],["type","text","id","inputCode","name","code","placeholder","Code",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCode"],["type","text","id","inputName","placeholder","Display Name","name","name",1,"form-control",3,"ngModel","ngModelChange"],["for","inputName"],["type","text","id","inputWeight","placeholder","Weight (gr)","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputWeight"],[1,"form-floating-outline",3,"ngClass"],["id","CategoryID","bindLabel","Name","bindValue","ID",1,"productform",3,"items","clearable","ngModel","ngModelChange"],["for","CategoryID"],[1,"card-header","d-flex","align-items-center"],["class","text-danger ms-1 cursor fst-italic",3,"click",4,"ngIf"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-4","mt-5"],[1,"col-sm-12"],["id","typeID","bindLabel","Value","bindValue","Key",1,"productform",3,"items","clearable","ngModel","ngModelChange"],["for","typeID",1,"ng-select"],["class","row",4,"ngIf"],[1,"form-floating-outline","radio","border","rounded"],["aria-label","Select an option",3,"ngModel","ngModelChange"],[3,"value"],[1,"ps-3","mt-4",3,"value"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["class","nav-item",4,"ngIf"],[1,"nav-item"],["id","pricing-tab","data-bs-toggle","tab","href","#outlet-price","role","tab","aria-controls","pricing","aria-selected","false",1,"nav-link"],["id","pricebook-tab","data-bs-toggle","tab","href","#pricebook","role","tab","aria-controls","pricebook","aria-selected","false",1,"nav-link"],["id","commission-tab","data-bs-toggle","tab","href","#commission","role","tab","aria-controls","commission","aria-selected","false",1,"nav-link"],["id","description-tab","data-bs-toggle","tab","href","#description","role","tab","aria-controls","description","aria-selected","false",1,"nav-link"],["id","advanced-tab","data-bs-toggle","tab","href","#advanced","role","tab","aria-controls","advanced","aria-selected","false",1,"nav-link"],["class","nav-link","id","multi-UOM-tab","data-bs-toggle","tab","href","#multi-UOM","role","tab","aria-controls","multiuom","aria-selected","false",4,"ngIf"],["id","myTabContent",1,"tab-content"],["class","tab-pane fade show active mt-0 pt-0","id","inventory","role","tabpanel",4,"ngIf"],["id","component","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],[1,"card","border-top-0"],[1,"container-fluid","ps-5","pe-5"],[1,"col-sm-12","p-0"],[1,"col-sm-12","bg-white"],[3,"form","data","formChange"],["id","outlet-price","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","pricebook","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],["id","commission","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],[3,"salesCommission","form","data","formChange"],["id","description","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],[3,"form","formChange"],["id","advanced","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],[1,"row","border-bottom"],["id","multi-UOM","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],[3,"form","variant","option","formChange",4,"ngIf"],[1,"text-danger","ms-1","cursor","fst-italic",3,"click"],[1,"col"],["type","text","id","inputCost","placeholder","Cost","autoNum","",1,"form-control","with-currency",3,"ngModel","ngModelChange"],["for","inputCost"],[1,"ps-0","col-auto",2,"width","75px"],["type","text","id","inputDiscCost","placeholder","Disc %","maxlength","5","autoNum","","percentage","",1,"form-control","percentage-input",3,"ngModel","ngModelChange"],["for","inputDiscCost"],["type","text","id","inputPrice","placeholder","Price","autoNum","",1,"form-control","with-currency",3,"ngModel","ngModelChange"],["for","inputPrice"],["type","text","id","inputDiscPrice","placeholder","Disc %","autoNum","","percentage","",1,"form-control","percentage-input",3,"ngModel","ngModelChange"],["for","inputDiscPrice"],["type","text","id","inputPoint","placeholder","Point","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPoint"],["type","text","id","inputDays","placeholder","Day(s) +","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDays"],["type","text","id","inputMonth","placeholder","Month(s)","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputMonth"],["id","inventory-tab","data-bs-toggle","tab","href","#inventory","role","tab","aria-controls","inventory","aria-selected","true",1,"nav-link","active"],["id","component-tab","data-bs-toggle","tab","href","#component","role","tab","aria-controls","component","aria-selected","false",1,"nav-link"],["id","multi-UOM-tab","data-bs-toggle","tab","href","#multi-UOM","role","tab","aria-controls","multiuom","aria-selected","false",1,"nav-link"],["id","inventory","role","tabpanel",1,"tab-pane","fade","show","active","mt-0","pt-0"],["class","col-sm-12 bg-white",4,"ngIf"],[4,"ngIf","ngIfElse"],["TABLE",""],[1,"card-body","mb-10"],[3,"form","editForm","data"],[3,"form","variant","option","formChange"]],template:function(e,o){1&e&&t.YNc(0,Zi,187,57,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[l.yS,Z.p,c.mk,c.O5,s.Fj,s.JJ,s.nD,s.On,$.VQ,$.U0,T.w9,w.b,E.J,qa,Ha,za,ti,ni,oi,ii,li]}),n})();var ot=(()=>{return(n=ot||(ot={}))[n.CashAndPoint=0]="CashAndPoint",n[n.Cash=1]="Cash",n[n.Point=2]="Point",ot;var n})(),at=d(54004);function yi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getSalesHistory())}),t._uU(1,"View"),t.qZA()}}const Pi=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Mi=function(n){return{VariantID:n}};function Ai(n,i){if(1&n&&(t.TgZ(0,"a",11),t._uU(1,"more"),t.qZA()),2&n){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,Pi))("queryParams",t.VKq(3,Mi,null==e.variant?null:e.variant.ID))}}function Di(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function Si(n,i){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function Ni(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net "),t.qZA())}function qi(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Total),"")}}function wi(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Discount),"")}}function Ui(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.TotalAfterDiscount),"")}}const Oi=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Ji=function(n){return{ID:n}};function Vi(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td")(5,"a",20),t._uU(6),t.qZA()(),t.TgZ(7,"td"),t._uU(8),t.ALo(9,"number"),t.qZA(),t.YNc(10,qi,3,3,"td",15),t.YNc(11,wi,3,3,"td",15),t.YNc(12,Ui,3,3,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().ngIf,a=t.oxw();t.xp6(2),t.Oqu(t.xi3(3,8,e.Date,"dd/MM/yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(13,Oi))("queryParams",t.VKq(14,Ji,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.lcZ(9,11,e.Quantity)),t.xp6(2),t.Q6J("ngIf",!a.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",!a.roleService.sell.PriceVisibleRestriction&&(null==o?null:o.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",!a.roleService.sell.PriceVisibleRestriction&&(null==o?null:o.DiscountCount)>0)}}function ki(n,i){if(1&n&&(t.TgZ(0,"div",12)(1,"table",13)(2,"thead")(3,"tr",14)(4,"th"),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Invoice"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Qty"),t.qZA(),t.YNc(10,Di,2,0,"th",15),t.YNc(11,Si,2,0,"th",16),t.YNc(12,Ni,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,Vi,13,16,"tr",17),t.qZA()()()),2&n){const e=i.ngIf,o=t.oxw();t.xp6(10),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction&&(null==e?null:e.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction&&(null==e?null:e.DiscountCount)>0),t.xp6(2),t.Q6J("ngForOf",null==e?null:e.Data)}}let Fi=(()=>{class n{constructor(e,o){this.httpService=e,this.roleService=o}ngOnInit(){}getSalesHistory(){this.salesHistory$=this.httpService.post("/Api/catalog/product/GetSalesHistory",this.variant).pipe((0,at.U)(e=>(e.Data=e.Data.sort((o,a)=>new Date(o.Date).getTime()>new Date(a.Date).getTime()?-1:1),e))),this.salesHistoryRequested=!this.salesHistoryRequested}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-sales-history"]],inputs:{variant:"variant"},decls:14,vars:5,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm","target","_blank",3,"routerLink","queryParams",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"content"],[1,"table","mt-5"],[1,"table-light"],["class","text-end",4,"ngIf"],["style","width: 45px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end",2,"width","45px"],["target","_blank",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),t._uU(4,"Sales History"),t.qZA()(),t.TgZ(5,"div",2),t.YNc(6,yi,2,0,"a",3),t.YNc(7,Ai,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,ki,15,4,"div",9),t.ALo(13,"async"),t.qZA()()()()()),2&e&&(t.xp6(6),t.Q6J("ngIf",!o.salesHistoryRequested),t.xp6(1),t.Q6J("ngIf",o.salesHistoryRequested),t.xp6(5),t.Q6J("ngIf",t.lcZ(13,3,o.salesHistory$)))},dependencies:[l.yS,c.sg,c.O5,c.Ov,c.JJ,c.uU]}),n})();function Qi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getHistory())}),t._uU(1,"View"),t.qZA()}}const Li=function(){return["/menu/Logistics/Report/Transfer/Product"]},wt=function(n){return{ID:n}};function Ei(n,i){if(1&n&&(t.TgZ(0,"a",11),t._uU(1,"more"),t.qZA()),2&n){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,Li))("queryParams",t.VKq(3,wt,null==e.variant?null:e.variant.ID))}}const Yi=function(){return["/menu/Logistics/Archive/Transfer_Order/Info"]};function Hi(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td")(5,"a",18),t._uU(6),t.qZA()(),t.TgZ(7,"td")(8,"span",15),t._uU(9),t.qZA(),t._UZ(10,"br"),t.TgZ(11,"span",16),t._uU(12),t.qZA()(),t.TgZ(13,"td"),t._uU(14),t.ALo(15,"number"),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.xi3(3,7,e.Date,"dd/MM/yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Yi))("queryParams",t.VKq(13,wt,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(3),t.hij("",e.Source," "),t.xp6(3),t.Oqu(e.Destination),t.xp6(2),t.Oqu(t.lcZ(15,10,e.Quantity))}}function Ki(n,i){if(1&n&&(t.TgZ(0,"div",12)(1,"table",13)(2,"thead")(3,"tr",14)(4,"th"),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th")(9,"span",15),t._uU(10,"Source"),t.qZA(),t._UZ(11,"br"),t.TgZ(12,"span",16),t._uU(13,"Destination"),t.qZA()(),t.TgZ(14,"th"),t._uU(15,"Qty"),t.qZA()()(),t.TgZ(16,"tbody"),t.YNc(17,Hi,16,15,"tr",17),t.qZA()()()),2&n){const e=t.oxw();t.xp6(17),t.Q6J("ngForOf",null==e.History?null:e.History.Data)}}let Gi=(()=>{class n{constructor(e,o){this.httpService=e,this.roleService=o,this.isMore=!1}ngOnInit(){}getHistory(){this.httpService.post("/Api/catalog/product/GetTransferOrder",this.variant).subscribe(e=>{this.History=e,this.isMore=!0})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-transfer-order"]],inputs:{variant:"variant"},decls:13,vars:3,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm","target","_blank",3,"routerLink","queryParams",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"content"],[1,"table","mt-5"],[1,"table-light"],[1,"text-danger"],[1,"text-success"],[4,"ngFor","ngForOf"],["target","_blank",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),t._uU(4,"Transfer Order"),t.qZA()(),t.TgZ(5,"div",2),t.YNc(6,Qi,2,0,"a",3),t.YNc(7,Ei,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,Ki,18,1,"div",9),t.qZA()()()()()),2&e&&(t.xp6(6),t.Q6J("ngIf",!o.isMore),t.xp6(1),t.Q6J("ngIf",o.isMore),t.xp6(5),t.Q6J("ngIf",(null==o.History?null:o.History.Data.length)>0))},dependencies:[l.yS,c.sg,c.O5,c.JJ,c.uU]}),n})();function Ri(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getPurchaseHistory())}),t._uU(1,"View"),t.qZA()}}const Bi=function(){return["/menu/Reports/Purchases_Report/History"]},$i=function(n){return{VariantID:n}};function ji(n,i){if(1&n&&(t.TgZ(0,"a",11),t._uU(1,"more"),t.qZA()),2&n){const e=t.oxw();t.Q6J("routerLink",t.DdM(2,Bi))("queryParams",t.VKq(3,$i,e.variant.ID))}}function Wi(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function zi(n,i){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function Xi(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net"),t.qZA())}function tr(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitPrice*e.Quantity))}}function er(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Discount))}}function nr(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Total))}}const or=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},ar=function(n){return{ID:n}};function ir(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td")(5,"a",20),t._uU(6),t.qZA()(),t.TgZ(7,"td"),t._uU(8),t.ALo(9,"number"),t.qZA(),t.YNc(10,tr,3,3,"td",15),t.YNc(11,er,3,3,"td",15),t.YNc(12,nr,3,3,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,8,e.Date,"dd/MM/yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(13,or))("queryParams",t.VKq(14,ar,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.lcZ(9,11,e.Quantity)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost&&(null==o.purchaseHistory?null:o.purchaseHistory.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost&&(null==o.purchaseHistory?null:o.purchaseHistory.DiscountCount)>0)}}function rr(n,i){if(1&n&&(t.TgZ(0,"div",12)(1,"table",13)(2,"thead")(3,"tr",14)(4,"th"),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Invoice"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Qty"),t.qZA(),t.YNc(10,Wi,2,0,"th",15),t.YNc(11,zi,2,0,"th",16),t.YNc(12,Xi,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,ir,13,16,"tr",17),t.qZA()()()),2&n){const e=t.oxw();t.xp6(10),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Cost&&(null==e.purchaseHistory?null:e.purchaseHistory.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Cost&&(null==e.purchaseHistory?null:e.purchaseHistory.DiscountCount)>0),t.xp6(2),t.Q6J("ngForOf",null==e.purchaseHistory?null:e.purchaseHistory.Data)}}let lr=(()=>{class n{constructor(e,o){this.httpService=e,this.roleService=o}ngOnInit(){}getPurchaseHistory(){this.httpService.post("/api/catalog/product/GetPurchaseHistory",this.variant).subscribe(e=>{this.purchaseHistory=e,this.purchaseHistoryRequested=!this.purchaseHistoryRequested})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-purchase-history"]],inputs:{variant:"variant"},decls:13,vars:3,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["target","_blank","class","btn btn-outline-secondary btn-sm",3,"routerLink","queryParams",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"content"],[1,"table","mt-5"],[1,"table-light"],["class","text-end",4,"ngIf"],["style","width: 45px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end",2,"width","45px"],["target","_blank",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),t._uU(4,"Purchase History"),t.qZA()(),t.TgZ(5,"div",2),t.YNc(6,Ri,2,0,"a",3),t.YNc(7,ji,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,rr,15,4,"div",9),t.qZA()()()()()),2&e&&(t.xp6(6),t.Q6J("ngIf",!o.purchaseHistoryRequested),t.xp6(1),t.Q6J("ngIf",(null==o.purchaseHistory?null:o.purchaseHistory.Data.length)>0&&o.purchaseHistoryRequested),t.xp6(5),t.Q6J("ngIf",(null==o.purchaseHistory?null:o.purchaseHistory.Data.length)>0))},dependencies:[l.yS,c.sg,c.O5,c.JJ,c.uU]}),n})();function cr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getParkedHistory())}),t._uU(1,"View"),t.qZA()}}const sr=function(){return["/menu/Orders/Order/Parked_Order"]},Ut=function(n){return{ID:n}};function pr(n,i){if(1&n&&(t.TgZ(0,"a",11),t._uU(1,"more"),t.qZA()),2&n){const e=t.oxw();t.Q6J("queryParams",t.DdM(2,sr))("queryParams",t.VKq(3,Ut,null==e.variant?null:e.variant.ID))}}function dr(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function ur(n,i){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function _r(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net "),t.qZA())}function mr(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Total))}}function gr(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Discount),"")}}function fr(n,i){if(1&n&&(t.TgZ(0,"td",18),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.TotalAfterDiscount),"")}}const hr=function(){return["/menu/Orders/Order/Sales_Order/Info"]};function vr(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td")(5,"a",20),t._uU(6),t.qZA()(),t.TgZ(7,"td"),t._uU(8),t.ALo(9,"number"),t.qZA(),t.YNc(10,mr,3,3,"td",15),t.YNc(11,gr,3,3,"td",15),t.YNc(12,fr,3,3,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,8,e.Date,"dd/MM/yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(13,hr))("queryParams",t.VKq(14,Ut,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.lcZ(9,11,e.Quantity)),t.xp6(2),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction&&(null==o.parkedHistory?null:o.parkedHistory.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",!o.roleService.sell.PriceVisibleRestriction&&(null==o.parkedHistory?null:o.parkedHistory.DiscountCount)>0)}}function xr(n,i){if(1&n&&(t.TgZ(0,"div",12)(1,"table",13)(2,"thead")(3,"tr",14)(4,"th"),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Sales order"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Qty"),t.qZA(),t.YNc(10,dr,2,0,"th",15),t.YNc(11,ur,2,0,"th",16),t.YNc(12,_r,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,vr,13,16,"tr",17),t.qZA()()()),2&n){const e=t.oxw();t.xp6(10),t.Q6J("ngIf",!e.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",!e.roleService.sell.PriceVisibleRestriction&&(null==e.parkedHistory?null:e.parkedHistory.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",!e.roleService.sell.PriceVisibleRestriction&&(null==e.parkedHistory?null:e.parkedHistory.DiscountCount)>0),t.xp6(2),t.Q6J("ngForOf",null==e.parkedHistory?null:e.parkedHistory.Data)}}let Cr=(()=>{class n{constructor(e,o){this.httpService=e,this.roleService=o}ngOnInit(){}getParkedHistory(){this.httpService.post("/api/catalog/product/GetParkOrder",this.variant).subscribe(e=>{this.parkedHistory=e,this.parkHistoryRequested=!this.parkHistoryRequested})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-parked-history"]],inputs:{variant:"variant"},decls:13,vars:3,consts:[[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm","target","_blank",3,"queryParams",4,"ngIf"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["class","content",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",3,"click"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"queryParams"],[1,"content"],[1,"table","mt-5"],[1,"table-light"],["class","text-end",4,"ngIf"],["style","width: 45px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end",2,"width","45px"],["target","_blank",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),t._uU(4,"Parked Order History"),t.qZA()(),t.TgZ(5,"div",2),t.YNc(6,cr,2,0,"a",3),t.YNc(7,pr,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,xr,15,4,"div",9),t.qZA()()()()()),2&e&&(t.xp6(6),t.Q6J("ngIf",!o.parkHistoryRequested),t.xp6(1),t.Q6J("ngIf",(null==o.parkedHistory?null:o.parkedHistory.Data.length)>0&&o.parkHistoryRequested),t.xp6(5),t.Q6J("ngIf",(null==o.parkedHistory?null:o.parkedHistory.Data.length)>0))},dependencies:[l.yS,c.sg,c.O5,c.JJ,c.uU]}),n})();function Tr(n,i){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4),t._UZ(2,"input",12),t.TgZ(3,"label",13),t._uU(4,"UOM Sub Quantity"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",null==e.categoryMeasurement?null:e.categoryMeasurement.UOMQ)}}function Zr(n,i){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4),t._UZ(2,"input",14),t.TgZ(3,"label",15),t._uU(4,"Measurements"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",null==e.categoryMeasurement?null:e.categoryMeasurement.Measurement)}}function br(n,i){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4),t._UZ(2,"input",16),t.TgZ(3,"label",17),t._uU(4,"Sell Price Type"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.variant.SellPriceTypeString)}}let yr=(()=>{class n{constructor(){}ngOnChanges(){this.variantInfoModel&&(this.variant=this.variantInfoModel.Data.Variant,this.categoryMeasurement=this.variantInfoModel.Data.CategoryMeasurement)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-advanced"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:22,vars:6,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-4"],[1,"form-floating-outline"],["type","text","id","unitQty","placeholder","Content","name","Content","readonly","",1,"bg-white","form-control",3,"ngModel"],["for","unitQty"],["type","text","id","index","placeholder","Index","name","Index","readonly","",1,"bg-white","form-control",3,"ngModel"],["for","index"],["type","text","id","size","placeholder","Pack Size","name","Pack Size","readonly","",1,"bg-white","form-control",3,"ngModel"],["for","size"],["class","col-sm-4",4,"ngIf"],["type","text","id","uomSub","placeholder","UOM Sub Quantity","name","UOM Sub Quantity","readonly","",1,"bg-white","form-control",3,"ngModel"],["for","uomSub"],["type","text","id","measurement","placeholder","Measurements","name","Measurements","readonly","",1,"bg-white","form-control",3,"ngModel"],["for","measurement"],["type","text","id","sellPrice","placeholder","Sell Price Type","name","Sell Price Type","readonly","",1,"bg-white","form-control",3,"ngModel"],["for","sellPrice"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"input",5),t.TgZ(6,"label",6),t._uU(7,"Content"),t.qZA()()(),t.TgZ(8,"div",3)(9,"div",4),t._UZ(10,"input",7),t.TgZ(11,"label",8),t._uU(12,"Index"),t.qZA()()(),t.TgZ(13,"div",3)(14,"div",4),t._UZ(15,"input",9),t.TgZ(16,"label",10),t._uU(17,"Pack Size"),t.qZA()()()(),t.TgZ(18,"div",2),t.YNc(19,Tr,5,1,"div",11),t.YNc(20,Zr,5,1,"div",11),t.YNc(21,br,5,1,"div",11),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("ngModel",o.variant.UnitQuantity),t.xp6(5),t.Q6J("ngModel",o.variant.ProductIndex),t.xp6(5),t.Q6J("ngModel",o.variant.PackSize),t.xp6(4),t.Q6J("ngIf",null==o.categoryMeasurement?null:o.categoryMeasurement.UOMQ),t.xp6(1),t.Q6J("ngIf",null==o.categoryMeasurement?null:o.categoryMeasurement.Measurement),t.xp6(1),t.Q6J("ngIf",2==o.variant.TypeID))},dependencies:[c.O5,s.Fj,s.JJ,s.On]}),n})();function Ir(n,i){if(1&n&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"input",7),t.ALo(3,"number"),t.TgZ(4,"label",8),t._uU(5,"Commission"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",t.lcZ(3,1,null==e.variant?null:e.variant.SalesCommission))}}function Pr(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",15),t._uU(4),t.ALo(5,"number"),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(5,2,e.Amount))}}function Mr(n,i){if(1&n&&(t.TgZ(0,"div",9)(1,"table",10)(2,"thead")(3,"tr",11)(4,"th",12),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",13),t._uU(7,"Comission"),t.qZA()()(),t.TgZ(8,"tbody"),t.YNc(9,Pr,6,4,"tr",14),t.qZA()()()),2&n){const e=t.oxw();t.xp6(9),t.Q6J("ngForOf",e.commisions)}}let Ar=(()=>{class n{constructor(){}ngOnChanges(){this.variantInfoModel&&(this.commisions=this.variantInfoModel.Data.Commission,this.variant=this.variantInfoModel.Data.Variant)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-commision"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:7,vars:2,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],["class","col-sm-4",4,"ngIf"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-4"],[1,"form-floating-outline"],["type","text","id","commision","placeholder","Commission","name","Commission","readonly","",1,"form-control",3,"ngModel"],["for","commision"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"text-end"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",0)(2,"div",1)(3,"div",2),t.YNc(4,Ir,6,3,"div",3),t.qZA(),t.TgZ(5,"div",2),t.YNc(6,Mr,10,1,"div",4),t.qZA()()()()),2&e&&(t.xp6(4),t.Q6J("ngIf",0!==(null==o.variant?null:o.variant.SalesCommission)),t.xp6(2),t.Q6J("ngIf",0!==(null==o.commisions?null:o.commisions.length)))},dependencies:[c.sg,c.O5,s.Fj,s.JJ,s.On,c.JJ]}),n})();function Dr(n,i){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Unit Cost"),t.qZA())}function Sr(n,i){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Total Cost"),t.qZA())}function Nr(n,i){1&n&&t._UZ(0,"i",16)}function qr(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.hij(" ",o.findCurrencySymbolById(null==e?null:e.PriceCurrencyID)+" "+t.lcZ(2,1,null==e?null:e.TotalCost)," ")}}function wr(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.hij(" ",o.findCurrencySymbolById(null==e?null:e.PriceCurrencyID)+" "+t.lcZ(2,1,null==e?null:e.TotalCost)," ")}}const Ur=function(){return["/menu/Products/Catalog/Variants/Info"]},Or=function(n){return{ID:n}};function Jr(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"div",12)(3,"a",13),t._uU(4),t.qZA(),t.YNc(5,Nr,1,0,"i",14),t.qZA()(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td"),t._uU(11),t.qZA(),t.YNc(12,qr,3,3,"td",15),t.YNc(13,wr,3,3,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(3),t.Q6J("routerLink",t.DdM(9,Ur))("queryParams",t.VKq(10,Or,e.ID)),t.xp6(1),t.Oqu(null==e?null:e.Name),t.xp6(1),t.Q6J("ngIf",null==e?null:e.HasComponent),t.xp6(2),t.Oqu(null==e?null:e.Code),t.xp6(2),t.Oqu(null==e?null:e.Quantity),t.xp6(2),t.Oqu(null==e?null:e.UomName),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost)}}let Vr=(()=>{class n{constructor(e){this.roleService=e}findCurrencySymbolById(e){let o;return this.currencies.forEach(a=>{a.ID===e&&(o=a.Symbol)}),o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-component"]],inputs:{composites:"composites",role:"role",currencies:"currencies"},decls:19,vars:3,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end",2,"width","120px"],[1,"border-end",2,"width","70px"],["class","border-end number cost","style","width:120px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"border-end","number","cost",2,"width","120px"],[1,"d-flex","justify-content-between"],["target","_blank",3,"routerLink","queryParams"],["class","fa-solid fa-code-branch","matTooltipPosition","above","matTooltip","This component has a component",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","This component has a component",1,"fa-solid","fa-code-branch"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),t._uU(8,"Variant"),t.qZA(),t.TgZ(9,"th",7),t._uU(10,"Code"),t.qZA(),t.TgZ(11,"th",8),t._uU(12,"Qty"),t.qZA(),t.TgZ(13,"th",8),t._uU(14,"Uom"),t.qZA(),t.YNc(15,Dr,2,0,"th",9),t.YNc(16,Sr,2,0,"th",9),t.qZA()(),t.TgZ(17,"tbody"),t.YNc(18,Jr,14,12,"tr",10),t.qZA()()()()()()),2&e&&(t.xp6(15),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Q6J("ngForOf",o.composites))},dependencies:[l.yS,b.gM,c.sg,c.O5,c.JJ]}),n})();const kr=function(n){return{ID:n}};function Fr(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"a",9),t._uU(3),t.qZA()(),t.TgZ(4,"td",10),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("queryParams",t.VKq(5,kr,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(6,3,e.Quantity))}}let Qr=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-dependency-of"]],inputs:{dependencyOf:"dependencyOf"},decls:13,vars:1,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],[1,"border-end","text-end",2,"width","80px"],[4,"ngFor","ngForOf"],["routerLink","/menu/Products/Catalog/Variants/Info",1,"link",2,"cursor","pointer",3,"queryParams"],[1,"text-end"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),t._uU(8,"Variant"),t.qZA(),t.TgZ(9,"th",7),t._uU(10,"Quantity"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,Fr,7,7,"tr",8),t.qZA()()()()()()),2&e&&(t.xp6(12),t.Q6J("ngForOf",o.dependencyOf))},dependencies:[l.yS,c.sg,c.JJ],styles:["a[_ngcontent-%COMP%]{color:#0976b4;text-decoration:none;background-color:transparent}"]}),n})(),Lr=(()=>{class n{constructor(){}ngOnInit(){}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-description"]],inputs:{variant:"variant"},decls:8,vars:1,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"form-control",2,"height","max-content",3,"innerHTML"],["for","desc"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"span",5),t.TgZ(6,"label",6),t._uU(7,"Descriptions"),t.qZA()()()()()()),2&e&&(t.xp6(5),t.Q6J("innerHTML",o.variant.Description,t.oJD))},styles:["span[_ngcontent-%COMP%]{color:#333;cursor:pointer;font-size:300px;background-color:#fff;opacity:1;height:3.625rem;padding:1rem .75rem!important;color:#343434;font-size:.875rem;border-radius:.25rem!important}label[_ngcontent-%COMP%]{top:-10px!important;background-color:#fff!important}"]}),n})();function Er(n,i){1&n&&(t.TgZ(0,"div",1)(1,"div",2)(2,"p"),t._uU(3," This variant type does not have an inventory "),t.qZA()()())}const Ot=function(){return["/menu/Products/Catalog/Variants/Log"]},Yr=function(n){return{ID:n}};function Hr(n,i){if(1&n&&(t.TgZ(0,"a",25),t._uU(1,"Log"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("routerLink",t.DdM(2,Ot))("queryParams",t.VKq(3,Yr,e.variant.ID))}}function Kr(n,i){if(1&n&&(t.TgZ(0,"div",23),t.YNc(1,Hr,2,5,"a",24),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.variantParent&&e.variantParent.Ratio>0||e.variant.TypeID==e.variantType.MultipleUOM||e.variant.TypeID==e.variantType.Serialized||1==e.variant.TypeID||6==e.variant.TypeID||5==e.variant.TypeID)}}function Gr(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function Rr(n,i){1&n&&(t.TgZ(0,"th",26),t._uU(1,"Indirect Allocated"),t.qZA())}function Br(n,i){1&n&&(t.TgZ(0,"th",27),t._uU(1,"ROP"),t.qZA())}function $r(n,i){1&n&&(t.TgZ(0,"th",28),t._uU(1,"Max"),t.qZA())}function jr(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Serial"),t.qZA())}function Wr(n,i){1&n&&t._UZ(0,"th")}function zr(n,i){if(1&n&&(t.TgZ(0,"td",32),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.IndirectAllocated)," ")}}function Xr(n,i){if(1&n&&(t.TgZ(0,"td",36),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",e.MinStock>=e.OnHand&&0!=e.MinStock?"bg-gradient-warning":""),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.MinStock),"")}}function tl(n,i){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",e.MaxStock>=e.OnHand&&0!=e.MaxStock?"bg-gradient-warning":""),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.MaxStock),"")}}function el(n,i){if(1&n&&(t.TgZ(0,"li",40),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e," ")}}function nl(n,i){if(1&n&&(t.TgZ(0,"td")(1,"ul",38),t.YNc(2,el,2,1,"li",39),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.Q6J("ngForOf",e.SerialNumber)}}const ol=function(){return["/menu/Products/Catalog/Variants/Serial_Form"]},al=function(n,i){return{VariantID:n,EntityID:i}};function il(n,i){if(1&n&&(t.TgZ(0,"td")(1,"a",31),t._UZ(2,"i",41),t.qZA()()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(2,ol))("queryParams",t.WLB(3,al,o.variant.ID,e.EntityID))}}const rl=function(n,i){return{ID:n,EntityID:i}},Jt=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},ll=function(n,i){return{VariantID:n,OutletID:i}};function cl(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td",29),t._uU(2),t.qZA(),t.TgZ(3,"td",30)(4,"a",31),t._uU(5),t.ALo(6,"number"),t.qZA()(),t.TgZ(7,"td",32)(8,"a",21),t._uU(9),t.ALo(10,"number"),t.qZA()(),t.YNc(11,zr,3,3,"td",33),t.TgZ(12,"td",32),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,Xr,3,4,"td",34),t.ALo(16,"sum"),t.YNc(17,tl,3,4,"td",35),t.ALo(18,"sum"),t.YNc(19,nl,3,1,"td",13),t.YNc(20,il,3,6,"td",13),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngClass",e.MinStock>=e.OnHand&&0!=e.MinStock?"bg-gradient-warning":""),t.xp6(1),t.Q6J("routerLink",t.DdM(26,Ot))("queryParams",t.WLB(27,rl,o.variant.ID,e.EntityID)),t.xp6(1),t.Oqu(t.lcZ(6,14,e.OnHand)),t.xp6(3),t.Q6J("routerLink",t.DdM(30,Jt))("queryParams",t.WLB(31,ll,o.variant.ID,e.EntityID)),t.xp6(1),t.hij(" ",t.lcZ(10,16,e.Allocated),""),t.xp6(2),t.Q6J("ngIf",o.totalAllocatedIndrection>0),t.xp6(2),t.hij(" ",t.lcZ(14,18,e.Available)," "),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(16,20,o.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(18,23,o.entityStock,"MaxStock")),t.xp6(2),t.Q6J("ngIf",o.variant.TypeID==o.variantType.Serialized),t.xp6(1),t.Q6J("ngIf",o.variant.TypeID==o.variantType.Serialized)}}function sl(n,i){if(1&n&&(t.TgZ(0,"td",20),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"IndirectAllocated"))," ")}}function pl(n,i){if(1&n&&(t.TgZ(0,"td",20),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"MinStock"))," ")}}function dl(n,i){if(1&n&&(t.TgZ(0,"td",20),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"MaxStock"))," ")}}const ul=function(n){return{VariantID:n}};function _l(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"table",7),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(a))}),t.TgZ(7,"thead",8)(8,"tr",9)(9,"th"),t._uU(10," Outlet "),t.YNc(11,Kr,2,1,"div",10),t.qZA(),t.TgZ(12,"th",11),t._uU(13," On Hand "),t.qZA(),t.TgZ(14,"th",12),t.YNc(15,Gr,2,0,"span",13),t._uU(16," Allocated"),t.qZA(),t.YNc(17,Rr,2,0,"th",14),t.TgZ(18,"th",15),t._uU(19,"Available "),t.qZA(),t.YNc(20,Br,2,0,"th",16),t.ALo(21,"sum"),t.YNc(22,$r,2,0,"th",17),t.ALo(23,"sum"),t.YNc(24,jr,2,0,"th",13),t.YNc(25,Wr,1,0,"th",13),t.qZA()(),t.TgZ(26,"tbody"),t.YNc(27,cl,21,34,"tr",18),t.qZA(),t.TgZ(28,"tfoot")(29,"tr"),t._UZ(30,"td",19),t.TgZ(31,"td",20),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",20)(36,"a",21),t._uU(37),t.ALo(38,"number"),t.ALo(39,"sum"),t.qZA()(),t.YNc(40,sl,4,6,"td",22),t.TgZ(41,"td",20),t._uU(42),t.ALo(43,"number"),t.ALo(44,"sum"),t.qZA(),t.YNc(45,pl,4,6,"td",22),t.ALo(46,"sum"),t.YNc(47,dl,4,6,"td",22),t.ALo(48,"sum"),t.qZA()()()()()()()()()}if(2&n){const e=t.oxw();t.xp6(11),t.Q6J("ngIf",e.roleService.inventory.View&&!e.roleService.users.LogRestriction),t.xp6(4),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(2),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(3),t.Q6J("ngIf",0!=t.xi3(21,16,e.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(23,19,e.entityStock,"MaxStock")),t.xp6(2),t.Q6J("ngIf",e.variant.TypeID==e.variantType.Serialized),t.xp6(1),t.Q6J("ngIf",e.variant.TypeID==e.variantType.Serialized),t.xp6(2),t.Q6J("ngForOf",e.entityStock),t.xp6(5),t.hij(" ",t.lcZ(33,22,t.xi3(34,24,e.entityStock,"OnHand"))," "),t.xp6(4),t.Q6J("routerLink",t.DdM(43,Jt))("queryParams",t.VKq(44,ul,e.variant.ID)),t.xp6(1),t.hij(" ",t.lcZ(38,27,t.xi3(39,29,e.entityStock,"Allocated")),""),t.xp6(3),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(2),t.hij(" ",t.lcZ(43,32,t.xi3(44,34,e.entityStock,"Available"))," "),t.xp6(3),t.Q6J("ngIf",0!==t.xi3(46,37,e.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!==t.xi3(48,40,e.entityStock,"MaxStock"))}}let ml=(()=>{class n{constructor(e){this.roleService=e,this.totalAllocatedIndrection=0,this.variantType=V.J}ngOnInit(){for(let e of this.entityStock)this.totalAllocatedIndrection+=e.IndirectAllocated}ngOnChanges(){this.variantInfoModel&&(this.variantParent=this.variantInfoModel.Data.VariantParent,this.variant=this.variantInfoModel.Data.Variant,this.entityStock=this.variantInfoModel.Data.EntityStockOutlet,this.originalStock=this.entityStock)}sortData(e){const o=this.entityStock.slice();this.entityStock=e.active&&""!==e.direction?o.sort((a,r)=>this.compare(a[e.active],r[e.active],"asc"===e.direction)):this.originalStock}compare(e,o,a){return(e<o?-1:1)*(a?1:-1)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-inventory"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:2,vars:2,consts:[["class","card border-top-0",4,"ngIf"],[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],["class","btn-group bg-white ml-5",4,"ngIf"],["mat-sort-header","OnHand","matTooltipPosition","above","matTooltip","the number of Physical Inventory at your Outlet",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Inventory which is already reserved for customer's order",1,"text-end",2,"width","100px"],[4,"ngIf"],["class","text-end","matTooltipPosition","above","matTooltip","Reserved because this product is a dependancy of other Product","style","width:100px",4,"ngIf"],["matTooltipPosition","above","matTooltip","Do not sell above this to avoid OverSelling",1,"text-end",2,"width","100px"],["class","text-end","matTooltipPosition","above","matTooltip","Reorder Point Threshold - calculate by multiplying [Lead Time] with [Average Daily Sales]","style","width:70px",4,"ngIf"],["class","text-end","matTooltipPosition","above","matTooltip","Maximum Inventory you should have after PurchaseOrder or TransferOrder operation","style","width:70px",4,"ngIf"],[4,"ngFor","ngForOf"],["colspan","1"],[1,"text-end","border-end"],["target","_blank",3,"routerLink","queryParams"],["class","text-end border-end",4,"ngIf"],[1,"btn-group","bg-white","ml-5"],["class","btn btn-outline-secondary btn-sm ","style","font-size: 10px !important;",3,"routerLink","queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",2,"font-size","10px !important",3,"routerLink","queryParams"],["matTooltipPosition","above","matTooltip","Reserved because this product is a dependancy of other Product",1,"text-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","Reorder Point Threshold - calculate by multiplying [Lead Time] with [Average Daily Sales]",1,"text-end",2,"width","70px"],["matTooltipPosition","above","matTooltip","Maximum Inventory you should have after PurchaseOrder or TransferOrder operation",1,"text-end",2,"width","70px"],[2,"vertical-align","middle"],[1,"text-end","border-end",2,"vertical-align","middle",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end","border-bottom"],["class","text-end border-bottom",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["class","text-end bg-gradient-warning",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","bg-gradient-warning",3,"ngClass"],[1,"list-inline"],["class","float-left mr-7",4,"ngFor","ngForOf"],[1,"float-left","mr-7"],["aria-hidden","true",1,"fa","fa-barcode","fa-lg"]],template:function(e,o){1&e&&(t.YNc(0,Er,4,0,"div",0),t.YNc(1,_l,49,46,"div",0)),2&e&&(t.Q6J("ngIf",!(o.variantParent&&o.variantParent.Ratio>0||o.variant.TypeID==o.variantType.MultipleUOM||o.variant.TypeID==o.variantType.Serialized||1==o.variant.TypeID||6==o.variant.TypeID||5==o.variant.TypeID)),t.xp6(1),t.Q6J("ngIf",o.variantParent&&o.variantParent.Ratio>0||o.variant.TypeID==o.variantType.MultipleUOM||o.variant.TypeID==o.variantType.Serialized||1==o.variant.TypeID||6==o.variant.TypeID||5==o.variant.TypeID))},dependencies:[l.yS,b.gM,c.mk,c.sg,c.O5,S.YE,S.nU,c.JJ,D.qU]}),n})(),gl=(()=>{class n{constructor(){}ngOnInit(){}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-multiuom"]],inputs:{variantParent:"variantParent",variant:"variant"},decls:26,vars:3,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"col-sm-12"],[1,"row"],[1,"float-none","col-sm-2"],[1,"col-sm-4","ps-1"],[1,"form-floating-outline"],["type","text","id","parent","placeholder","Parent","name","Parent","readonly","",1,"form-control",3,"ngModel"],["for","parent"],[1,"col-sm-auto","ms-0",2,"width","40px"],[1,"text-start"],[1,"col-sm-3"],["type","text","id","ratio","placeholder","Ratio","name","Ratio","readonly","",1,"form-control",3,"ngModel"],["for","ratio"],[1,"col-sm-auto"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"br"),t.TgZ(6,"h3"),t._uU(7,"1 (one)"),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6),t._UZ(10,"input",7),t.TgZ(11,"label",8),t._uU(12,"Parent"),t.qZA()()(),t.TgZ(13,"div",9),t._UZ(14,"br"),t.TgZ(15,"h3",10),t._uU(16," = "),t.qZA()(),t.TgZ(17,"div",11)(18,"div",6),t._UZ(19,"input",12),t.TgZ(20,"label",13),t._uU(21,"Ratio"),t.qZA()()(),t.TgZ(22,"div",14),t._UZ(23,"br"),t.TgZ(24,"h3",10),t._uU(25),t.qZA()()()()()()),2&e&&(t.xp6(10),t.Q6J("ngModel",null==o.variantParent?null:o.variantParent.ParentName),t.xp6(9),t.Q6J("ngModel",null==o.variantParent?null:o.variantParent.Ratio),t.xp6(6),t.Oqu(null==o.variant?null:o.variant.Model))},dependencies:[s.Fj,s.JJ,s.On]}),n})();function fl(n,i){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Extra Cost"),t.qZA())}function hl(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Disc."),t.qZA())}function vl(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",(null==e?null:e.PriceCurrency)+" "+t.lcZ(2,1,e.ExtraCost)," ")}}function xl(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PriceDiscount+"%")}}function Cl(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.YNc(3,vl,3,3,"td",13),t.TgZ(4,"td"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.YNc(7,xl,2,1,"td",13),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(2),t.Oqu(null==e?null:e.EntityName),t.xp6(1),t.Q6J("ngIf",o.outletPriceVisible),t.xp6(2),t.hij(" ",(null==e?null:e.PriceCurrency)+" "+t.lcZ(6,4,e.UnitPrice)," "),t.xp6(2),t.Q6J("ngIf",o.outletPriceVisible)}}let Tl=(()=>{class n{constructor(e){this.roleService=e}ngOnChanges(){this.variantInfoModel&&(this.outletPrices=this.variantInfoModel.Data.OutletPrice,this.currencies=this.variantInfoModel.Data.Currencies,this.outletPriceVisible=this.roleService.product.Cost&&!this.roleService.sell.PriceVisibleRestriction)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-outlet-price"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:16,vars:3,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],["class","border-end","width","100px",4,"ngIf"],["width","100px",1,"border-end"],["class","border-end","width","50px",4,"ngIf"],[4,"ngFor","ngForOf"],["width","50px",1,"border-end"],[4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"table",5)(6,"thead")(7,"tr",6)(8,"th",7),t._uU(9,"Outlet"),t.qZA(),t.YNc(10,fl,2,0,"th",8),t.TgZ(11,"th",9),t._uU(12,"Price"),t.qZA(),t.YNc(13,hl,2,0,"th",10),t.qZA()(),t.TgZ(14,"tbody"),t.YNc(15,Cl,8,6,"tr",11),t.qZA()()()()()()()),2&e&&(t.xp6(10),t.Q6J("ngIf",o.outletPriceVisible),t.xp6(3),t.Q6J("ngIf",o.outletPriceVisible),t.xp6(2),t.Q6J("ngForOf",o.outletPrices))},dependencies:[c.sg,c.O5,c.JJ]}),n})();function Zl(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"number"),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.MinimumQuantity),t.xp6(2),t.Oqu("Rp "+t.lcZ(7,4,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(10,6,e.PriceDiscount)+"%")}}let bl=(()=>{class n{constructor(){}ngOnInit(){}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-pricebook"]],inputs:{pricebooks:"pricebooks"},decls:18,vars:1,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end"],["width","120px",1,"border-end"],["width","100px",1,"border-end"],["width","50px",1,"border-end"],[4,"ngFor","ngForOf"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"table",5)(6,"thead")(7,"tr",6)(8,"th",7),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th",8),t._uU(11,"Minimum Quantity"),t.qZA(),t.TgZ(12,"th",9),t._uU(13,"Unit Price"),t.qZA(),t.TgZ(14,"th",10),t._uU(15,"Unit Disc."),t.qZA()()(),t.TgZ(16,"tbody"),t.YNc(17,Zl,11,8,"tr",11),t.qZA()()()()()()()),2&e&&(t.xp6(17),t.Q6J("ngForOf",o.pricebooks))},dependencies:[c.sg,c.JJ]}),n})();function yl(n,i){1&n&&(t.TgZ(0,"th",13),t._uU(1,"Minimum Quantity"),t.qZA())}function Il(n,i){1&n&&(t.TgZ(0,"th",13),t._uU(1,"Minimum Amount"),t.qZA())}function Pl(n,i){1&n&&(t.TgZ(0,"th",10),t._uU(1,"Extra Cost"),t.qZA())}function Ml(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.MinimumQty>0?t.lcZ(2,1,e.MinimumQty):"-")}}function Al(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu("Rp "+t.lcZ(2,1,e.MinimumAmount))}}function Dl(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu("Rp "+t.lcZ(2,1,e.ExtraCost))}}const Sl=function(){return["/menu/Promotion/Main/Event/Form"]},Nl=function(n){return{ID:n}};function ql(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"a",14),t._uU(3),t.qZA(),t.TgZ(4,"div",15),t._uU(5),t.ALo(6,"date"),t.ALo(7,"date"),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.YNc(10,Ml,3,3,"td",16),t.YNc(11,Al,3,3,"td",16),t.TgZ(12,"td"),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td"),t._uU(16),t.ALo(17,"number"),t.qZA(),t.YNc(18,Dl,3,3,"td",16),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(2),t.Q6J("routerLink",t.DdM(21,Sl))("queryParams",t.VKq(22,Nl,null==e?null:e.ID)),t.xp6(1),t.hij(" ",e.PromotionName," "),t.xp6(2),t.AsE(" Active date (",t.xi3(6,11,e.StartDate,"dd MMM yyyy HH:mm")," - ",t.xi3(7,14,e.EndDate,"dd MMM yyyy HH:mm"),") "),t.xp6(4),t.hij(" ",e.PromotionTypeName," "),t.xp6(1),t.Q6J("ngIf",o.hasMinimumQuantity),t.xp6(1),t.Q6J("ngIf",o.hasMinimumAmount),t.xp6(2),t.Oqu("Rp "+t.lcZ(14,17,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(17,19,e.Discount)+"%"),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost&&o.hasExtraCost)}}let wl=(()=>{class n{constructor(e){this.roleService=e,this.promotions=[]}ngOnInit(){}ngOnChanges(e){e.promotions.currentValue&&(this.checkHasMinimumQty(),this.checkHasMinimumAmount(),this.checkHasExtraCost())}checkHasMinimumQty(){this.hasMinimumQuantity=!1,this.promotions.filter(o=>o.MinimumQty>0).length>0&&(this.hasMinimumQuantity=!0)}checkHasMinimumAmount(){this.hasMinimumAmount=!1,this.promotions.filter(o=>o.MinimumAmount>0).length>0&&(this.hasMinimumAmount=!0)}checkHasExtraCost(){this.hasExtraCost=!1,this.promotions.filter(o=>o.ExtraCost>0).length>0&&(this.hasExtraCost=!0)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-promotion"]],inputs:{promotions:"promotions"},features:[t.TTD],decls:21,vars:4,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"table","table-bordered","custom-table"],[1,"table-light"],[1,"border-end",2,"width","10rem"],[1,"border-end",2,"width","4rem"],["class","border-end","style","width: 8rem;",4,"ngIf"],[1,"border-end",2,"width","5rem"],["class","border-end","style","width: 5rem;",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","8rem"],[3,"routerLink","queryParams"],[1,"fst-italic","fw-bold","text-small"],[4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"table",5)(6,"thead")(7,"tr",6)(8,"th",7),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th",8),t._uU(11,"Type"),t.qZA(),t.YNc(12,yl,2,0,"th",9),t.YNc(13,Il,2,0,"th",9),t.TgZ(14,"th",10),t._uU(15,"Promotion Price"),t.qZA(),t.TgZ(16,"th",10),t._uU(17,"Discount"),t.qZA(),t.YNc(18,Pl,2,0,"th",11),t.qZA()(),t.TgZ(19,"tbody"),t.YNc(20,ql,19,24,"tr",12),t.qZA()()()()()()()),2&e&&(t.xp6(12),t.Q6J("ngIf",o.hasMinimumQuantity),t.xp6(1),t.Q6J("ngIf",o.hasMinimumAmount),t.xp6(5),t.Q6J("ngIf",o.roleService.product.Cost&&o.hasExtraCost),t.xp6(2),t.Q6J("ngForOf",o.promotions))},dependencies:[l.yS,c.sg,c.O5,c.JJ,c.uU]}),n})(),Ul=(()=>{class n{constructor(){}ngOnInit(){}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-purchase"]],inputs:{variant:"variant"},decls:8,vars:1,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-4"],[1,"form-floating-outline"],["type","text","id","expense","placeholder","Unit Expense","name","Unit Expense","readonly","",1,"form-control",3,"ngModel"],["for","expense"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"input",5),t.TgZ(6,"label",6),t._uU(7,"Unit Expense"),t.qZA()()()()()()),2&e&&(t.xp6(5),t.Q6J("ngModel",null==o.variant?null:o.variant.UnitExpense))},dependencies:[s.Fj,s.JJ,s.On]}),n})();var Ol=d(19835);function Jl(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function Vl(n,i){1&n&&(t.TgZ(0,"th",19)(1,"span",20),t._uU(2,"Indirect Allocated"),t.qZA()())}function kl(n,i){if(1&n&&(t.TgZ(0,"td",17),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.IndirectAllocated)}}const Fl=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},Ql=function(n){return{VariantID:n}};function Ll(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",17),t._uU(4),t.qZA(),t.TgZ(5,"td",21)(6,"a",22),t._uU(7),t.ALo(8,"number"),t.qZA()(),t.YNc(9,kl,2,1,"td",18),t.TgZ(10,"td",17),t._uU(11),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(e.OnHand),t.xp6(2),t.Q6J("routerLink",t.DdM(9,Fl))("queryParams",t.VKq(10,Ql,o.variantID)),t.xp6(1),t.hij(" ",t.lcZ(8,7,e.Allocated),""),t.xp6(2),t.Q6J("ngIf",o.TotalIndirect>0),t.xp6(2),t.Oqu(e.Available)}}function El(n,i){if(1&n&&(t.TgZ(0,"td",17),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.totalCompositeInventory.IndirectAllocated)}}let Yl=(()=>{class n{constructor(){this.TotalIndirect=0}ngOnInit(){for(let e of this.compositeInventories)this.TotalIndirect+=e.IndirectAllocated}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-composite-inventory"]],inputs:{compositeInventories:"compositeInventories",variantID:"variantID",totalCompositeInventory:"totalCompositeInventory"},decls:33,vars:11,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-end"],["ng-click","compositeSortDirec = !compositeSortDirec",1,"border-end","text-end",2,"width","100px"],[1,"pointer"],[1,"fa-solid","fa-sort"],["matTooltipPosition","above","matTooltip","Allocated that associate directly with the product",1,"border-end","pointer","text-end",2,"width","100px"],["customTooltip","Allocated that associate directly with the product","position","top"],[4,"ngIf"],["class","border-end text-end pointer","style","width:100px",4,"ngIf"],[1,"border-end","text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["colspan","1"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"border-end","text-end","pointer",2,"width","100px"],["customTooltip","Allocated that associate indirectly with the product (either its parent, or its component)","position","top"],[1,"text-end","border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"th",7),t._uU(10," On Hand "),t.TgZ(11,"span",8),t._UZ(12,"i",9),t.qZA()(),t.TgZ(13,"th",10)(14,"div",11),t.YNc(15,Jl,2,0,"span",12),t._uU(16," Allocated "),t.qZA()(),t.YNc(17,Vl,3,0,"th",13),t.TgZ(18,"th",14),t._uU(19," Available "),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,Ll,12,12,"tr",15),t.ALo(22,"sortBy"),t.qZA(),t.TgZ(23,"tfoot")(24,"tr"),t._UZ(25,"td",16),t.TgZ(26,"td",17),t._uU(27),t.qZA(),t.TgZ(28,"td",17),t._uU(29),t.qZA(),t.YNc(30,El,2,1,"td",18),t.TgZ(31,"td",17),t._uU(32),t.qZA()()()()()()()()),2&e&&(t.xp6(15),t.Q6J("ngIf",o.TotalIndirect>0),t.xp6(2),t.Q6J("ngIf",o.TotalIndirect>0),t.xp6(4),t.Q6J("ngForOf",t.Dn7(22,7,o.compositeInventories,"desc","OnHand")),t.xp6(6),t.hij(" ",o.totalCompositeInventory.OnHand," "),t.xp6(2),t.hij(" ",o.totalCompositeInventory.Allocated," "),t.xp6(1),t.Q6J("ngIf",o.TotalIndirect>0),t.xp6(2),t.hij(" ",o.totalCompositeInventory.Available," "))},dependencies:[l.yS,b.gM,c.sg,c.O5,Ol.i,c.JJ,D.W7]}),n})();var Hl=d(34782);let Kl=(()=>{class n{constructor(e,o,a){this.dialogRef=e,this.data=o,this.toastr=a,this.modalConfig=new I.O,this.modalConfig.title="Daily Sales",this.modalConfig.customWidth="250px",this.lastDays=o}ngOnInit(){}onOk(){u.gT.IsEmpty(this.lastDays)?this.toastr.warning("This field Can't be blank","Warning"):this.dialogRef.close(this.lastDays)}onCancel(){this.dialogRef.close()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.so),t.Y36(C.WI),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-modal-update-days"]],decls:6,vars:2,consts:[[3,"config","onOk","onCancel","onClose"],[1,"form-floating-outline"],["type","text","data-cy","lastDays","id","lastDays","name","lastDays","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","lastDays"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.onCancel()})("onClose",function(){return o.onCancel()}),t.TgZ(1,"content")(2,"div",1)(3,"input",2),t.NdJ("ngModelChange",function(r){return o.lastDays=r}),t.qZA(),t.TgZ(4,"label",3),t._uU(5,"Number Of Days"),t.qZA()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(3),t.Q6J("ngModel",o.lastDays))},dependencies:[M.M,s.Fj,s.JJ,s.On,w.b]}),n})();function Gl(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",9),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",9),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",9),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",9),t._uU(13),t.ALo(14,"number"),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.outlet),t.xp6(2),t.Oqu(t.xi3(5,5,e.available,"1.0-3")),t.xp6(3),t.Oqu(t.xi3(8,8,e.sales,"1.0-3")),t.xp6(3),t.Oqu(t.xi3(11,11,e.QtyPerDay,"1.0-4")),t.xp6(3),t.Oqu(t.xi3(14,14,e.daysToZero,"1.0-0"))}}let Rl=(()=>{class n{constructor(e,o){this.httpService=e,this.dialog=o,this.lastDays=30}ngOnChanges(e){e.variantInfoModel&&(this.lastDays=this.variantInfoModel.Config.ToZeroDays,this.initListData())}initListData(){let a,o=this.variantInfoModel.Data.EntityStockOutlet;this.listData$=this.getForecastData(this.variantInfoModel.Data.Variant.ID,this.lastDays).pipe((0,at.U)(r=>r.Data),(0,at.U)(r=>o.filter(p=>-1!=r.findIndex(g=>g.EntityID==p.EntityID)).map(p=>{if(a=r.findIndex(g=>p.EntityID==g.EntityID),-1!=a)return{outlet:p.Name,available:p.Available,sales:r[a].Quantity,QtyPerDay:r[a].Quantity/this.lastDays,daysToZero:p.Available>0?p.Available/(r[a].Quantity/this.lastDays):0}}))),this.originalData$=this.listData$}onUpdateLastDays(){this.dialog.open(Kl,{data:this.lastDays}).afterClosed().pipe((0,z.h)(e=>u.gT.IsNotEmpty(e))).subscribe(e=>{this.lastDays=e,this.initListData()})}getForecastData(e,o){return this.httpService.post("api/catalog/variant/ProductsSoldGroupByOutlet",{VariantID:e,NumberOfDays:o}).pipe((0,Hl.d)(1))}onSort(e){this.listData$=e.active&&""!==e.direction?this.listData$.pipe((0,at.U)(o=>o.sort((a,r)=>u.gT.compare(a[e.active],r[e.active],"asc"===e.direction)))):this.originalData$}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(C.uw))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-info-variant-mav-forecast"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:24,vars:6,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],[2,"width","200px"],[1,"text-end"],[1,"pointer",3,"click"],["arrowPosition","before","mat-sort-header","QtyPerDay",1,"text-end"],["matTooltipPosition","above","matTooltip","How many days left until you run out of inventory",1,"fa-solid","fa-circle-info","ms-2","cursor"],[4,"ngFor","ngForOf"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"table",5),t.NdJ("matSortChange",function(r){return o.onSort(r)}),t.TgZ(6,"thead",6)(7,"tr",7)(8,"th",8),t._uU(9,"Outlet"),t.qZA(),t.TgZ(10,"th",9),t._uU(11,"Available Inventory"),t.qZA(),t.TgZ(12,"th",9)(13,"a",10),t.NdJ("click",function(){return o.onUpdateLastDays()}),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"th",11),t._uU(17,"Daily Sales"),t.qZA(),t.TgZ(18,"th",9),t._UZ(19,"i",12),t._uU(20," Days to Zero "),t.qZA()()(),t.TgZ(21,"tbody"),t.YNc(22,Gl,15,17,"tr",13),t.ALo(23,"async"),t.qZA()()()()()()()),2&e&&(t.xp6(14),t.hij(" (",t.lcZ(15,2,o.lastDays)," Days Sales) "),t.xp6(8),t.Q6J("ngForOf",t.lcZ(23,4,o.listData$)))},dependencies:[b.gM,c.sg,S.YE,S.nU,c.Ov,c.JJ]}),n})();function Bl(n,i){1&n&&(t.TgZ(0,"div",1)(1,"div",2)(2,"p"),t._uU(3," This variant type does not have an inventory "),t.qZA()()())}function $l(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function jl(n,i){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Indirect Allocated"),t.qZA())}function Wl(n,i){1&n&&(t.TgZ(0,"th",22),t._uU(1,"ROP"),t.qZA())}function zl(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Max"),t.qZA())}function Xl(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Serial"),t.qZA())}function tc(n,i){1&n&&t._UZ(0,"th")}function ec(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.IndirectAllocated)," ")}}function nc(n,i){if(1&n&&(t.TgZ(0,"td",31),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",e.MinStock>=e.OnHand&&0!=e.MinStock?"bg-gradient-warning":""),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.MinStock),"")}}function oc(n,i){if(1&n&&(t.TgZ(0,"td",32),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",e.MaxStock>=e.OnHand&&0!=e.MaxStock?"bg-gradient-warning":""),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.MaxStock),"")}}function ac(n,i){if(1&n&&(t.TgZ(0,"li",35),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e," ")}}function ic(n,i){if(1&n&&(t.TgZ(0,"td")(1,"ul",33),t.YNc(2,ac,2,1,"li",34),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.Q6J("ngForOf",e.SerialNumber)}}const rc=function(){return["/menu/Products/Catalog/Variants/Serial_Form"]},lc=function(n,i){return{VariantID:n,EntityID:i}};function cc(n,i){if(1&n&&(t.TgZ(0,"td")(1,"a",26),t._UZ(2,"i",36),t.qZA()()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(2,rc))("queryParams",t.WLB(3,lc,o.variant.ID,e.EntityID))}}const sc=function(){return["/menu/Products/Catalog/Variants/Log"]},pc=function(n,i){return{ID:n,EntityID:i}},Vt=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},dc=function(n,i){return{VariantID:n,OutletID:i}};function uc(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td",24),t._uU(2),t.qZA(),t.TgZ(3,"td",25)(4,"a",26),t._uU(5),t.ALo(6,"number"),t.qZA()(),t.TgZ(7,"td",27)(8,"a",20),t._uU(9),t.ALo(10,"number"),t.qZA()(),t.YNc(11,ec,3,3,"td",28),t.TgZ(12,"td",27),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,nc,3,4,"td",29),t.ALo(16,"sum"),t.YNc(17,oc,3,4,"td",30),t.ALo(18,"sum"),t.YNc(19,ic,3,1,"td",12),t.YNc(20,cc,3,6,"td",12),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityGroupName),t.xp6(1),t.Q6J("ngClass",e.MinStock>=e.OnHand&&0!=e.MinStock?"bg-gradient-warning":""),t.xp6(1),t.Q6J("routerLink",t.DdM(26,sc))("queryParams",t.WLB(27,pc,o.variant.ID,e.EntityID)),t.xp6(1),t.hij(" ",t.lcZ(6,14,e.OnHand),""),t.xp6(3),t.Q6J("routerLink",t.DdM(30,Vt))("queryParams",t.WLB(31,dc,o.variant.ID,e.EntityID)),t.xp6(1),t.hij(" ",t.lcZ(10,16,e.Allocated),""),t.xp6(2),t.Q6J("ngIf",o.totalAllocatedIndrection>0),t.xp6(2),t.hij(" ",t.lcZ(14,18,e.Available)," "),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(16,20,o.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(18,23,o.entityStock,"MaxStock")),t.xp6(2),t.Q6J("ngIf",(null==o.variant?null:o.variant.TypeID)==o.variantType.Serialized),t.xp6(1),t.Q6J("ngIf",(null==o.variant?null:o.variant.TypeID)==o.variantType.Serialized)}}function _c(n,i){if(1&n&&(t.TgZ(0,"td",19),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"IndirectAllocated"))," ")}}function mc(n,i){if(1&n&&(t.TgZ(0,"td",19),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"Available"))," ")}}function gc(n,i){if(1&n&&(t.TgZ(0,"td",19),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"MinStock"))," ")}}function fc(n,i){if(1&n&&(t.TgZ(0,"td",19),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.entityStock,"MaxStock"))," ")}}const hc=function(n){return{VariantID:n}};function vc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"table",7),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(a))}),t.TgZ(7,"thead",8)(8,"tr",9)(9,"th"),t._uU(10," Group "),t.qZA(),t.TgZ(11,"th",10),t._uU(12," On Hand "),t.qZA(),t.TgZ(13,"th",11),t.YNc(14,$l,2,0,"span",12),t._uU(15," Allocated"),t.qZA(),t.YNc(16,jl,2,0,"th",13),t.TgZ(17,"th",14),t._uU(18,"Available "),t.qZA(),t.YNc(19,Wl,2,0,"th",15),t.ALo(20,"sum"),t.YNc(21,zl,2,0,"th",16),t.ALo(22,"sum"),t.YNc(23,Xl,2,0,"th",12),t.YNc(24,tc,1,0,"th",12),t.qZA()(),t.TgZ(25,"tbody"),t.YNc(26,uc,21,34,"tr",17),t.qZA(),t.TgZ(27,"tfoot")(28,"tr"),t._UZ(29,"td",18),t.TgZ(30,"td",19),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",19)(35,"a",20),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA()(),t.YNc(39,_c,4,6,"td",21),t.YNc(40,mc,4,6,"td",21),t.ALo(41,"sum"),t.YNc(42,gc,4,6,"td",21),t.ALo(43,"sum"),t.YNc(44,fc,4,6,"td",21),t.ALo(45,"sum"),t.qZA()()()()()()()()()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(2),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(3),t.Q6J("ngIf",0!=t.xi3(20,15,e.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(22,18,e.entityStock,"MaxStock")),t.xp6(2),t.Q6J("ngIf",(null==e.variant?null:e.variant.TypeID)==e.variantType.Serialized),t.xp6(1),t.Q6J("ngIf",(null==e.variant?null:e.variant.TypeID)==e.variantType.Serialized),t.xp6(2),t.Q6J("ngForOf",e.entityStock),t.xp6(5),t.hij(" ",t.lcZ(32,21,t.xi3(33,23,e.entityStock,"OnHand"))," "),t.xp6(4),t.Q6J("routerLink",t.DdM(40,Vt))("queryParams",t.VKq(41,hc,e.variant.ID)),t.xp6(1),t.hij(" ",t.lcZ(37,26,t.xi3(38,28,e.entityStock,"Allocated")),""),t.xp6(3),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(1),t.Q6J("ngIf",0!==t.xi3(41,31,e.entityStock,"Available")),t.xp6(2),t.Q6J("ngIf",0!==t.xi3(43,34,e.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!==t.xi3(45,37,e.entityStock,"MaxStock"))}}let xc=(()=>{class n{constructor(e){this.roleService=e,this.totalAllocatedIndrection=0,this.variantType=V.J}ngOnInit(){for(let e of this.entityStock)this.totalAllocatedIndrection+=e.IndirectAllocated}ngOnChanges(){this.variantInfoModel&&(this.variantParent=this.variantInfoModel.Data.VariantParent,this.variant=this.variantInfoModel.Data.Variant,this.entityStock=this.variantInfoModel.Data.EntityStockGroup,this.originalStock=this.entityStock)}sortData(e){const o=this.entityStock.slice();this.entityStock=e.active&&""!==e.direction?o.sort((a,r)=>this.compare(a[e.active],r[e.active],"asc"===e.direction)):this.originalStock}compare(e,o,a){return(e<o?-1:1)*(a?1:-1)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav-group-inventory"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:2,vars:2,consts:[["class","card border-top-0",4,"ngIf"],[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],["mat-sort-header","OnHand","matTooltipPosition","above","matTooltip","How many you have in your warehouse right now",1,"text-end","border-end",2,"width","100px"],["matTooltipPosition","above","matTooltip","How many have been Allocated, but not shipped out yet",1,"text-end",2,"width","100px"],[4,"ngIf"],["class","text-end","matTooltipPosition","above","matTooltip","How many have been Allocated, but not shipped out yet","style","width:100px",4,"ngIf"],["matTooltipPosition","above","matTooltip","How many can be purchased by customers",1,"text-end",2,"width","100px"],["class","text-end","matTooltipPosition","above","matTooltip","ROP Inventory for this outlet before it gets re-alerted","style","width:70px",4,"ngIf"],["class","text-end","matTooltipPosition","above","matTooltip","Max Inventory that this outlet should have","style","width:70px",4,"ngIf"],[4,"ngFor","ngForOf"],["colspan","1"],[1,"text-end","border-end"],["target","_blank",3,"routerLink","queryParams"],["class","text-end border-end",4,"ngIf"],["matTooltipPosition","above","matTooltip","ROP Inventory for this outlet before it gets re-alerted",1,"text-end",2,"width","70px"],["matTooltipPosition","above","matTooltip","Max Inventory that this outlet should have",1,"text-end",2,"width","70px"],[2,"vertical-align","middle"],[1,"text-end","border-end",2,"vertical-align","middle",3,"ngClass"],[3,"routerLink","queryParams"],[1,"text-end","border-bottom"],["class","text-end border-bottom",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["class","text-end bg-warning",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","bg-warning",3,"ngClass"],[1,"list-inline"],["class","float-left mr-7",4,"ngFor","ngForOf"],[1,"float-left","mr-7"],["aria-hidden","true",1,"fa","fa-barcode","fa-lg"]],template:function(e,o){1&e&&(t.YNc(0,Bl,4,0,"div",0),t.YNc(1,vc,46,43,"div",0)),2&e&&(t.Q6J("ngIf",!(o.variantParent&&o.variantParent.Ratio>0||(null==o.variant?null:o.variant.TypeID)==o.variantType.MultipleUOM||(null==o.variant?null:o.variant.TypeID)==o.variantType.Serialized||1==o.variant.TypeID||6==o.variant.TypeID||5==o.variant.TypeID)),t.xp6(1),t.Q6J("ngIf",o.variantParent&&o.variantParent.Ratio>0||(null==o.variant?null:o.variant.TypeID)==o.variantType.MultipleUOM||(null==o.variant?null:o.variant.TypeID)==o.variantType.Serialized||1==o.variant.TypeID||6==o.variant.TypeID||5==o.variant.TypeID))},dependencies:[l.yS,b.gM,c.mk,c.sg,c.O5,S.YE,S.nU,c.JJ,D.qU]}),n})();function Cc(n,i){1&n&&(t.TgZ(0,"div",1)(1,"div",2)(2,"p"),t._uU(3," This variant type does not have an inventory "),t.qZA()()())}const Tc=function(){return["/menu/Products/Catalog/Variants/Log"]},Zc=function(n){return{ID:n}};function bc(n,i){if(1&n&&(t.TgZ(0,"a",20),t._uU(1,"Log"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("routerLink",t.DdM(2,Tc))("queryParams",t.VKq(3,Zc,e.variant.ID))}}function yc(n,i){if(1&n&&(t.TgZ(0,"div",18),t.YNc(1,bc,2,5,"a",19),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.variantParent&&e.variantParent.Ratio>0||e.variant.TypeID==e.variantType.MultipleUOM||e.variantType.Serialized||1==e.variant.TypeID||6==e.variant.TypeID||5==e.variant.TypeID)}}function Ic(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td",21),t._uU(2),t.qZA(),t.TgZ(3,"td",22),t._uU(4),t.qZA(),t.TgZ(5,"td",22),t._uU(6),t.qZA(),t.TgZ(7,"td",22),t._uU(8),t.qZA(),t.TgZ(9,"td",22),t._uU(10),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Available),t.xp6(2),t.Oqu(e.PickPack),t.xp6(2),t.Oqu(e.PickPackDelegated),t.xp6(2),t.Oqu(e.AvailableAdjustPickPack)}}function Pc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"table",7),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(a))}),t.TgZ(7,"thead",8)(8,"tr",9)(9,"th"),t._uU(10," Outlet "),t.YNc(11,yc,2,1,"div",10),t.qZA(),t.TgZ(12,"th",11),t._uU(13,"Available"),t.qZA(),t.TgZ(14,"th",12),t._uU(15,"Pick Pack"),t.qZA(),t.TgZ(16,"th",13),t._uU(17,"Inventory Delegated"),t.qZA(),t.TgZ(18,"th",14),t._uU(19,"Nett Available"),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,Ic,11,5,"tr",15),t.qZA(),t.TgZ(22,"tfoot")(23,"tr"),t._UZ(24,"td",16),t.TgZ(25,"td",17),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",17),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.qZA(),t.TgZ(33,"td",17),t._uU(34),t.ALo(35,"number"),t.ALo(36,"sum"),t.qZA(),t.TgZ(37,"td",17),t._uU(38),t.ALo(39,"number"),t.ALo(40,"sum"),t.qZA()()()()()()()()()()}if(2&n){const e=t.oxw();t.xp6(11),t.Q6J("ngIf",e.roleService.inventory.View&&!e.roleService.users.LogRestriction),t.xp6(10),t.Q6J("ngForOf",e.entityStock),t.xp6(5),t.hij(" ",t.lcZ(27,6,t.xi3(28,8,e.entityStock,"Available"))," "),t.xp6(4),t.hij(" ",t.lcZ(31,11,t.xi3(32,13,e.entityStock,"PickPack"))," "),t.xp6(4),t.hij(" ",t.lcZ(35,16,t.xi3(36,18,e.entityStock,"PickPackDelegated"))," "),t.xp6(4),t.hij(" ",t.lcZ(39,21,t.xi3(40,23,e.entityStock,"AvailableAdjustPickPack"))," ")}}let Mc=(()=>{class n{constructor(e){this.roleService=e,this.totalAllocatedIndrection=0,this.variantType=V.J}ngOnInit(){for(let e of this.entityStock)this.totalAllocatedIndrection+=e.IndirectAllocated}ngOnChanges(){this.variantInfoModel&&(this.variantParent=this.variantInfoModel.Data.VariantParent,this.variant=this.variantInfoModel.Data.Variant,this.entityStock=this.variantInfoModel.Data.EntityStockOutlet,this.originalStock=this.entityStock)}sortData(e){const o=this.entityStock.slice();this.entityStock=e.active&&""!==e.direction?o.sort((a,r)=>this.compare(a[e.active],r[e.active],"asc"===e.direction)):this.originalStock}compare(e,o,a){return(e<o?-1:1)*(a?1:-1)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-pickpack"]],inputs:{variantInfoModel:"variantInfoModel"},features:[t.TTD],decls:2,vars:2,consts:[["class","card border-top-0",4,"ngIf"],[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"content"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],["class","btn-group bg-white ml-5",4,"ngIf"],["matTooltipPosition","above","matTooltip","Inventory present in your warehouse which are available for sale",1,"text-end"],["matTooltipPosition","above","matTooltip","Inventory assigned from another outlets and needs to be packed",1,"text-end"],["matTooltipPosition","above","matTooltip","Total inventory assigned to another outlets",1,"text-end"],["matTooltipPosition","above","matTooltip","Total Nett Inventory (Available - PickPack + Inventory Delegated)",1,"text-end"],[4,"ngFor","ngForOf"],["colspan","1"],[1,"text-end","border-end"],[1,"btn-group","bg-white","ml-5"],["class","btn btn-outline-secondary btn-sm ","style","font-size: 10px !important;",3,"routerLink","queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","btn-sm",2,"font-size","10px !important",3,"routerLink","queryParams"],[2,"vertical-align","middle"],[1,"text-end"]],template:function(e,o){1&e&&(t.YNc(0,Cc,4,0,"div",0),t.YNc(1,Pc,41,26,"div",0)),2&e&&(t.Q6J("ngIf",!(o.variantParent&&o.variantParent.Ratio>0||o.variant.TypeID==o.variantType.MultipleUOM||o.variantType.Serialized||1==o.variant.TypeID||6==o.variant.TypeID||5==o.variant.TypeID)),t.xp6(1),t.Q6J("ngIf",o.variantParent&&o.variantParent.Ratio>0||o.variant.TypeID==o.variantType.MultipleUOM||o.variantType.Serialized||1==o.variant.TypeID||6==o.variant.TypeID||5==o.variant.TypeID))},dependencies:[l.yS,b.gM,c.sg,c.O5,S.YE,c.JJ,D.qU]}),n})();function Ac(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",25),t._uU(2,"Inventory"),t.qZA()())}function Dc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",26),t._uU(2,"Component"),t.qZA()())}function Sc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",27),t._uU(2,"Outlet Price"),t.qZA()())}function Nc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",28),t._uU(2,"Pricebook"),t.qZA()())}function qc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",29),t._uU(2,"Promotion"),t.qZA()())}function wc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",30),t._uU(2,"Purchase"),t.qZA()())}function Uc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",31),t._uU(2,"Description"),t.qZA()())}function Oc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",32),t._uU(2,"Commission"),t.qZA()())}function Jc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",33),t._uU(2,"MultiUOM"),t.qZA()())}function Vc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",34),t._uU(2,"Composite Inventory"),t.qZA()())}function kc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",35),t._uU(2,"Dependency Of"),t.qZA()())}function Fc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",36),t._uU(2,"Group"),t.qZA()())}function Qc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",37),t._uU(2,"Pick Pack"),t.qZA()())}function Lc(n,i){if(1&n&&(t.TgZ(0,"div",38),t._UZ(1,"POS-info-variant-nav-inventory",13),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function Ec(n,i){if(1&n&&(t.TgZ(0,"div",39),t._UZ(1,"POS-info-variant-nav-component",40),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("composites",e.composites)("currencies",e.currencies)}}function Yc(n,i){if(1&n&&(t.TgZ(0,"div",41),t._UZ(1,"POS-info-variant-nav-outlet-price",13),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function Hc(n,i){if(1&n&&(t.TgZ(0,"div",42),t._UZ(1,"POS-info-variant-nav-pricebook",43),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("pricebooks",e.pricebooks)}}function Kc(n,i){if(1&n&&(t.TgZ(0,"div",44),t._UZ(1,"POS-info-variant-nav-promotion",45),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("costRole",e.roleService.product.Cost)("promotions",e.promotions)}}function Gc(n,i){1&n&&(t.TgZ(0,"div",46),t._UZ(1,"POS-info-variant-nav-purchase"),t.qZA())}function Rc(n,i){if(1&n&&t._UZ(0,"POS-info-variant-nav-multiuom",50),2&n){const e=t.oxw(2);t.Q6J("variant",e.variant)("variantParent",e.variantParent)}}function Bc(n,i){1&n&&(t.TgZ(0,"div",51)(1,"div",52)(2,"div",53)(3,"div",54),t._uU(4," Parent has not been set "),t.qZA()()()())}function $c(n,i){if(1&n&&(t.TgZ(0,"div",47),t.YNc(1,Rc,1,2,"POS-info-variant-nav-multiuom",48),t.YNc(2,Bc,5,0,"ng-template",null,49,t.W1O),t.qZA()),2&n){const e=t.MAs(3),o=t.oxw();t.xp6(1),t.Q6J("ngIf",(null==o.variantParent?null:o.variantParent.ParentName)&&(null==o.variantParent?null:o.variantParent.Ratio)>0)("ngIfElse",e)}}function jc(n,i){if(1&n&&(t.TgZ(0,"div",55),t._UZ(1,"POS-info-variant-nav-composite-inventory",56),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("totalCompositeInventory",e.totalCompositeInventory)("compositeInventories",e.compositeInventories)("variantID",null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID)}}function Wc(n,i){if(1&n&&(t.TgZ(0,"div",57),t._UZ(1,"POS-info-variant-nav-group-inventory",13),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function zc(n,i){if(1&n&&(t.ynx(0),t._UZ(1,"app-info-variant-mav-forecast",13),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}let Xc=(()=>{class n{constructor(e){this.roleService=e,this.initForecast=!1,this.promotions=[],this.dependencyOf=[],this.composites=[],this.variantType=V.J,this.isPickPacked=0,this.outletPrices=[],this.pricebooks=[],this.commisions=[],this.compositeInventories=[]}ngAfterViewInit(){document.querySelector(".inventory-nav-tab .nav-link").classList.add("active");const o=document.querySelector(".inventory-content.tab-content .tab-pane");o.classList.add("show"),o.classList.add("active")}ngOnChanges(){if(this.data.Data){this.outletPrices=this.data.Data.OutletPrice,this.commisions=this.data.Data.Commission,this.pricebooks=this.data.Data.Pricebook,this.promotions=this.data.Data.Promotion,this.compositeInventories=this.data.Data.CompositeInventory,this.dependencyOf=this.data.Data.DependencyOf,this.composites=this.data.Data.Composites,this.variant=this.data.Data.Variant,this.variantParent=this.data.Data.VariantParent,this.role=this.data.Roles,this.currencies=this.data.Data.Currencies,this.totalCompositeInventory=this.data.Data.TotalCompositeInventory;const e=this.data.Data.EntityStockOutlet.map(o=>o.PickPack);this.isPickPacked=0==e.length?0:e.reduce((o,a)=>o+a)}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant-nav"]],inputs:{data:"data"},features:[t.TTD],decls:42,vars:28,consts:[["id","myTab","role","tablist",1,"nav","nav-tabs","inventory-nav-tab"],["class","nav-item",4,"ngIf"],[1,"nav-item"],["id","advance-tab","data-bs-toggle","tab","data-bs-target","#advance","role","tab","aria-controls","advance","aria-selected","false",1,"nav-link"],["id","group-inventory-tab","data-bs-toggle","tab","data-bs-target","#ToZero","role","tab","aria-controls","ToZero","aria-selected","false",1,"nav-link",3,"click"],["id","myTabContent",1,"inventory-content","tab-content"],["class","tab-pane fade show active mt-0 pt-0","id","inventory","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","component","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","price","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","pricebook","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","promotion","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","purchase","role","tabpanel",4,"ngIf"],["id","commission","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"variantInfoModel"],["id","advance","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","description","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"variant"],["class","tab-pane fade mt-0 pt-0","id","multiuom","role","tabpanel",4,"ngIf"],["class","tab-pane fade mt-0 pt-0","id","composite-inventory","role","tabpanel",4,"ngIf"],["id","dependency-of","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"dependencyOf"],["class","tab-pane fade mt-0 pt-0","id","group-inventory","role","tabpanel",4,"ngIf"],["id","pickpack-inventory","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","ToZero","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[4,"ngIf"],["id","inventory-tab","data-bs-toggle","tab","data-bs-target","#inventory","role","tab","aria-controls","inventory","aria-selected","false",1,"nav-link","active"],["id","component-tab","data-bs-toggle","tab","data-bs-target","#component","role","tab","aria-controls","component","aria-selected","false",1,"nav-link"],["id","price-tab","data-bs-toggle","tab","data-bs-target","#price","role","tab","aria-controls","price","aria-selected","false",1,"nav-link"],["id","pricebook-tab","data-bs-toggle","tab","data-bs-target","#pricebook","role","tab","aria-controls","pricebook","aria-selected","false",1,"nav-link"],["id","promotion-tab","data-bs-toggle","tab","data-bs-target","#promotion","role","tab","aria-controls","promotion","aria-selected","false",1,"nav-link"],["id","purchase-tab","data-bs-toggle","tab","data-bs-target","#purchase","role","tab","aria-controls","purchase","aria-selected","false",1,"nav-link"],["id","description-tab","data-bs-toggle","tab","data-bs-target","#description","role","tab","aria-controls","description","aria-selected","true",1,"nav-link"],["id","commission-tab","data-bs-toggle","tab","data-bs-target","#commission","role","tab","aria-controls","commission","aria-selected","false",1,"nav-link"],["id","multiuom-tab","data-bs-toggle","tab","data-bs-target","#multiuom","role","tab","aria-controls","multiuom","aria-selected","false",1,"nav-link"],["id","composite-inventory-tab","data-bs-toggle","tab","data-bs-target","#composite-inventory","role","tab","aria-controls","composite-inventory","aria-selected","false",1,"nav-link"],["id","dependency-of-tab","data-bs-toggle","tab","data-bs-target","#dependency-of","role","tab","aria-controls","dependency-of","aria-selected","false",1,"nav-link"],["id","group-inventory-tab","data-bs-toggle","tab","data-bs-target","#group-inventory","role","tab","aria-controls","group-inventory","aria-selected","false",1,"nav-link"],["id","group-inventory-tab","data-bs-toggle","tab","data-bs-target","#pickpack-inventory","role","tab","aria-controls","pickpack-inventory","aria-selected","false",1,"nav-link"],["id","inventory","role","tabpanel",1,"tab-pane","fade","show","active","mt-0","pt-0"],["id","component","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"composites","currencies"],["id","price","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","pricebook","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"pricebooks"],["id","promotion","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"costRole","promotions"],["id","purchase","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["id","multiuom","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"variant","variantParent",4,"ngIf","ngIfElse"],["notAssigned",""],[3,"variant","variantParent"],[1,"card","border-top-0"],[1,"card-body"],[1,"col-sm-12"],[1,"row","ms-3"],["id","composite-inventory","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],[3,"totalCompositeInventory","compositeInventories","variantID"],["id","group-inventory","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"]],template:function(e,o){1&e&&(t.TgZ(0,"ul",0),t.YNc(1,Ac,3,0,"li",1),t.YNc(2,Dc,3,0,"li",1),t.YNc(3,Sc,3,0,"li",1),t.YNc(4,Nc,3,0,"li",1),t.YNc(5,qc,3,0,"li",1),t.YNc(6,wc,3,0,"li",1),t.TgZ(7,"li",2)(8,"button",3),t._uU(9,"Advanced"),t.qZA()(),t.YNc(10,Uc,3,0,"li",1),t.YNc(11,Oc,3,0,"li",1),t.YNc(12,Jc,3,0,"li",1),t.YNc(13,Vc,3,0,"li",1),t.YNc(14,kc,3,0,"li",1),t.YNc(15,Fc,3,0,"li",1),t.YNc(16,Qc,3,0,"li",1),t.TgZ(17,"li",2)(18,"button",4),t.NdJ("click",function(){return o.initForecast=!0}),t._uU(19,"To Zero"),t.qZA()()(),t.TgZ(20,"div",5),t.YNc(21,Lc,2,1,"div",6),t.YNc(22,Ec,2,2,"div",7),t.YNc(23,Yc,2,1,"div",8),t.YNc(24,Hc,2,1,"div",9),t.YNc(25,Kc,2,2,"div",10),t.YNc(26,Gc,2,0,"div",11),t.TgZ(27,"div",12),t._UZ(28,"POS-info-variant-nav-commision",13),t.qZA(),t.TgZ(29,"div",14),t._UZ(30,"POS-info-variant-nav-advanced",13),t.qZA(),t.TgZ(31,"div",15),t._UZ(32,"POS-info-variant-nav-description",16),t.qZA(),t.YNc(33,$c,4,2,"div",17),t.YNc(34,jc,2,3,"div",18),t.TgZ(35,"div",19),t._UZ(36,"POS-info-variant-nav-dependency-of",20),t.qZA(),t.YNc(37,Wc,2,1,"div",21),t.TgZ(38,"div",22),t._UZ(39,"POS-info-variant-pickpack",13),t.qZA(),t.TgZ(40,"div",23),t.YNc(41,zc,2,1,"ng-container",24),t.qZA()()),2&e&&(t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(1),t.Q6J("ngIf",(null==o.composites?null:o.composites.length)>0),t.xp6(1),t.Q6J("ngIf",o.outletPrices.length>0),t.xp6(1),t.Q6J("ngIf",0!==o.pricebooks.length),t.xp6(1),t.Q6J("ngIf",0!==o.promotions.length),t.xp6(1),t.Q6J("ngIf",0!==(null==o.variant?null:o.variant.UnitExpense)),t.xp6(4),t.Q6J("ngIf",null==o.variant?null:o.variant.Description),t.xp6(1),t.Q6J("ngIf",0!=(null==o.variant?null:o.variant.SalesCommission)||0!==(null==o.commisions?null:o.commisions.length)),t.xp6(1),t.Q6J("ngIf",(null==o.variant?null:o.variant.TypeID)==o.variantType.MultipleUOM),t.xp6(1),t.Q6J("ngIf",(null==o.variant?null:o.variant.TypeID)===o.variantType.Composite),t.xp6(1),t.Q6J("ngIf",0!==o.dependencyOf.length),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(1),t.Q6J("ngIf",0!=o.isPickPacked),t.xp6(5),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(1),t.Q6J("ngIf",o.composites.length>0),t.xp6(1),t.Q6J("ngIf",o.outletPrices.length>0),t.xp6(1),t.Q6J("ngIf",0!==o.pricebooks.length),t.xp6(1),t.Q6J("ngIf",0!==o.promotions.length),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Expense&&0!==(null==o.variant?null:o.variant.UnitExpense)),t.xp6(2),t.Q6J("variantInfoModel",o.data),t.xp6(2),t.Q6J("variantInfoModel",o.data),t.xp6(2),t.Q6J("variant",o.variant),t.xp6(1),t.Q6J("ngIf",(null==o.variant?null:o.variant.TypeID)==o.variantType.MultipleUOM),t.xp6(1),t.Q6J("ngIf",(null==o.variant?null:o.variant.TypeID)===o.variantType.Composite),t.xp6(2),t.Q6J("dependencyOf",o.dependencyOf),t.xp6(1),t.Q6J("ngIf",o.roleService.inventory.View),t.xp6(2),t.Q6J("variantInfoModel",o.data),t.xp6(2),t.Q6J("ngIf",o.initForecast))},dependencies:[c.O5,yr,Ar,Vr,Qr,Lr,ml,gl,Tl,bl,wl,Ul,Yl,Rl,xc,Mc]}),n})();const es=function(){return["/menu/Products/Catalog/Variants/Inventory_Cost_History"]},mt=function(n){return{VariantID:n}};function ns(n,i){if(1&n&&(t.TgZ(0,"a",44),t._UZ(1,"i",45),t._uU(2,"\xa0\xa0Inventory Cost"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("routerLink",t.DdM(2,es))("queryParams",t.VKq(3,mt,null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID))}}function os(n,i){if(1&n&&(t.TgZ(0,"div",43),t.YNc(1,ns,3,5,"a",6),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Edit)}}const kt=function(){return["/menu/Products/Add-Ons/Variant_History"]};function as(n,i){if(1&n&&(t.TgZ(0,"a",46),t._UZ(1,"i",47),t._uU(2,"\xa0\xa0Update History "),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,kt))("queryParams",t.VKq(3,mt,null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID))}}function is(n,i){if(1&n&&(t.TgZ(0,"a",48),t._UZ(1,"i",49),t._uU(2,"\xa0\xa0Print Barcode"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("href","https://barcode.dealpos.app/pages?ID="+e.data.Data.Variant.ID,t.LSH)}}const rs=function(){return["/menu/Products/Catalog/Variants/Form"]},Ft=function(n){return{ID:n}};function ls(n,i){if(1&n&&(t.TgZ(0,"a",44),t._UZ(1,"i",50),t._uU(2,"\xa0\xa0Edit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,rs))("queryParams",t.VKq(3,Ft,e.data.Data.Variant.ID))}}function cs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",51),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.deleteVariantInfo())}),t._UZ(1,"i",52),t._uU(2,"\xa0\xa0Delete"),t.qZA()}}function ss(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"img",53),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.openBigPicture(r.data.Data.Variant,a))}),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("src",e.data.Data.Variant.Image,t.LSH)}}function ps(n,i){1&n&&(t.TgZ(0,"div",54),t._UZ(1,"i",55),t.qZA())}function ds(n,i){if(1&n&&(t.TgZ(0,"p",56),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.data.Data.UOM.Name," ")}}function us(n,i){1&n&&(t.TgZ(0,"p",57),t._uU(1,"Point(s)"),t.qZA())}function _s(n,i){1&n&&(t.TgZ(0,"p",58),t._uU(1," Expiration "),t.qZA())}function ms(n,i){if(1&n&&(t.TgZ(0,"p",59),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" ",null==e.data.Data.VariantPoint?null:e.data.Data.VariantPoint.ExpiredDay," Days + ",null==e.data.Data.VariantPoint?null:e.data.Data.VariantPoint.ExpiredMonth," Month(s) ")}}function gs(n,i){if(1&n&&(t.TgZ(0,"div",60)(1,"div",61)(2,"a",62),t._uU(3),t.ALo(4,"number"),t.qZA(),t.TgZ(5,"label"),t._uU(6,"Buying Cost"),t.qZA()()()),2&n){const e=t.oxw(2);t.Q6J("ngClass",e.data.Data.Variant.OrderPriceDiscount>0?"col-sm-3":""),t.xp6(2),t.Q6J("routerLink",t.DdM(6,kt))("queryParams",t.VKq(7,mt,e.data.Data.Variant.ID)),t.xp6(1),t.Oqu(t.lcZ(4,4,e.data.Data.Variant.UnitCost))}}function fs(n,i){if(1&n&&(t.TgZ(0,"div",63)(1,"div",32),t._UZ(2,"POS-info-page-input",64),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("inputValue",e.data.Data.Variant.OrderPriceDiscount+"%")}}function hs(n,i){if(1&n&&(t.TgZ(0,"div",60)(1,"div",32),t._UZ(2,"POS-info-page-input",65),t.ALo(3,"number"),t.qZA()()),2&n){const e=t.oxw(2);t.Q6J("ngClass",e.data.Data.Variant.OrderPriceDiscount>0?"col-sm-3":"")("ngClass",null!=e.roleService&&e.roleService.product.Cost?"ps-0":""),t.xp6(2),t.Q6J("inputValue",t.lcZ(3,3,e.data.Data.Variant.UnitPrice))}}function vs(n,i){if(1&n&&(t.TgZ(0,"div",63)(1,"div",32),t._UZ(2,"POS-info-page-input",64),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("inputValue",e.data.Data.Variant.PriceDiscount+"%")}}function xs(n,i){if(1&n&&(t.TgZ(0,"div",31)(1,"div",32),t._UZ(2,"POS-info-page-input",66),t.ALo(3,"number"),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("inputValue",t.lcZ(3,1,e.data.Data.Variant.OrderPrice))}}function Cs(n,i){if(1&n&&(t.TgZ(0,"div",35),t._UZ(1,"POS-info-variant-sales-history",67),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("variant",e.data.Data.Variant)}}function Ts(n,i){if(1&n&&(t.TgZ(0,"div",9)(1,"div",68),t._UZ(2,"POS-info-variant-purchase-history",67),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("variant",e.data.Data.Variant)}}function Zs(n,i){if(1&n&&(t.TgZ(0,"div",9)(1,"div",68),t._UZ(2,"POS-info-variant-transfer-order",67),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("variant",e.data.Data.Variant)}}function bs(n,i){if(1&n&&(t.TgZ(0,"div",9)(1,"div",68),t._UZ(2,"POS-info-variant-parked-history",67),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("variant",e.data.Data.Variant)}}const ys=function(){return["/menu/Products/Catalog/Products/Info"]};function Is(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,os,2,1,"div",2),t.YNc(3,as,3,5,"a",3),t.TgZ(4,"div",4),t.YNc(5,is,3,1,"a",5),t.qZA(),t.TgZ(6,"div",4),t.YNc(7,ls,3,5,"a",6),t.YNc(8,cs,3,0,"a",7),t.qZA()(),t.TgZ(9,"content")(10,"div",8)(11,"div",9)(12,"div",10)(13,"div",9)(14,"div",11)(15,"div",12)(16,"div",13),t.YNc(17,ss,2,1,"div",14),t.YNc(18,ps,2,0,"div",15),t.TgZ(19,"p",16)(20,"a",17),t._uU(21),t.qZA()(),t.TgZ(22,"p",18),t._uU(23),t.qZA(),t.TgZ(24,"p",19),t._uU(25),t.qZA(),t.YNc(26,ds,2,1,"p",20),t.YNc(27,us,2,0,"p",21),t.TgZ(28,"p",22),t._uU(29),t.qZA(),t.YNc(30,_s,2,0,"p",23),t.YNc(31,ms,2,2,"p",24),t.qZA()()(),t.TgZ(32,"div",25)(33,"div",26)(34,"div",27)(35,"h3"),t._uU(36,"Pricing"),t.qZA()(),t.TgZ(37,"div",13)(38,"div",9),t.YNc(39,gs,7,9,"div",28),t.YNc(40,fs,3,1,"div",29),t.YNc(41,hs,4,5,"div",28),t.YNc(42,vs,3,1,"div",29),t.qZA(),t.TgZ(43,"div",9),t.YNc(44,xs,4,3,"div",30),t.TgZ(45,"div",31)(46,"div",32),t._UZ(47,"POS-info-page-input",33),t.ALo(48,"number"),t.qZA()(),t.TgZ(49,"div",31)(50,"div",32),t._UZ(51,"POS-info-page-input",34),t.qZA()()()()()()(),t.TgZ(52,"div",9)(53,"div",35),t._UZ(54,"POS-info-variant-nav",36),t.qZA()()(),t.TgZ(55,"div",31)(56,"div",9)(57,"div",35)(58,"div",26)(59,"div",27)(60,"h3"),t._uU(61,"Properties"),t.qZA()(),t.TgZ(62,"div",13)(63,"div",9)(64,"div",35)(65,"div",32),t._UZ(66,"POS-info-page-input",37),t.qZA()(),t.TgZ(67,"div",35)(68,"div",32),t._UZ(69,"POS-info-page-input",38),t.qZA()(),t.TgZ(70,"div",35)(71,"div",32),t._UZ(72,"POS-info-page-input",39),t.qZA()(),t.TgZ(73,"div",35)(74,"div",32),t._UZ(75,"POS-info-page-input",40),t.qZA()()()()()(),t.YNc(76,Cs,2,1,"div",41),t.qZA(),t.YNc(77,Ts,3,1,"div",42),t.YNc(78,Zs,3,1,"div",42),t.YNc(79,bs,3,1,"div",42),t.qZA()()()()()),2&n){const e=t.oxw();t.Q6J("hideSearchDropdown",!0)("hideSearchBox",!0)("pageData",e.menuData),t.xp6(2),t.Q6J("ngIf",null==e.data||null==e.data.Config?null:e.data.Config.IsFIFO),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Edit),t.xp6(2),t.Q6J("ngIf",0==(null==e.roleService?null:e.roleService.product.BarcodePrintingRestriction)),t.xp6(2),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Delete),t.xp6(9),t.Q6J("ngIf",e.data.Data.Variant.Image),t.xp6(1),t.Q6J("ngIf",!e.data.Data.Variant.Image),t.xp6(2),t.Q6J("routerLink",t.DdM(40,ys))("queryParams",t.VKq(41,Ft,e.data.Data.Variant.ProductID)),t.xp6(1),t.Oqu(e.data.Data.Product.Name),t.xp6(2),t.Oqu(e.data.Data.Variant.Model),t.xp6(1),t.s9C("placeholder",e.AutoGenerateCode?"Leave Blank for Auto Generate":""),t.xp6(1),t.hij(" ",e.data.Data.Variant.Code," "),t.xp6(1),t.Q6J("ngIf",e.data.Data.UOM),t.xp6(1),t.Q6J("ngIf",e.data.Data.UOM&&(null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.PaymentTypeID)!==e.paymentType.Cash),t.xp6(2),t.hij(" ",null==e.data.Data.VariantPoint?null:e.data.Data.VariantPoint.Point," "),t.xp6(1),t.Q6J("ngIf",e.isUsingPoint),t.xp6(1),t.Q6J("ngIf",e.isUsingPoint),t.xp6(8),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",(null==e.roleService?null:e.roleService.product.Cost)&&e.data.Data.Variant.OrderPriceDiscount),t.xp6(1),t.Q6J("ngIf",!(null!=e.roleService&&e.roleService.sell.PriceVisibleRestriction)),t.xp6(1),t.Q6J("ngIf",e.data.Data.Variant.PriceDiscount&&!(null!=e.roleService&&e.roleService.sell.PriceVisibleRestriction)),t.xp6(2),t.Q6J("ngIf",e.outletPriceVisible),t.xp6(3),t.Q6J("inputValue",t.lcZ(48,38,e.data.Data.Variant.Weight)),t.xp6(4),t.Q6J("inputValue",e.data.Data.Variant.PaymentTypeString),t.xp6(3),t.Q6J("data",e.data)("role",e.data),t.xp6(12),t.Q6J("inputValue",e.data.Data.Variant.VariantType),t.xp6(3),t.Q6J("inputValue",e.data.Data.Variant.Taxable?"Yes":"No"),t.xp6(3),t.Q6J("inputValue",e.data.Data.Variant.LoyaltyPoint?"Yes":"No"),t.xp6(3),t.Q6J("inputValue",e.data.Data.Variant.Discontinued?"Yes":"No"),t.xp6(1),t.Q6J("ngIf",e.roleService.report.View),t.xp6(1),t.Q6J("ngIf",e.roleService.buy.Create),t.xp6(1),t.Q6J("ngIf",e.roleService.logistic.View),t.xp6(1),t.Q6J("ngIf",e.roleService.order.View)}}const Ps=BiggerPicture({target:document.body});let Ms=(()=>{class n extends q.U{constructor(e,o,a,r,p,g){super(e,"catalog/variant/GetVariantInfoModelById",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.title=p,this.roleService=g,this.paymentType=ot,this.destroy$=new pt.x,this.router.routeReuseStrategy.shouldReuseRoute=function(){return!1}}initRoles(){this.outletPriceVisible=this.roleService.product.Cost&&!this.roleService.sell.PriceVisibleRestriction,this.IsPurchaseRoleHistory=this.roleService.buy.Create&&this.roleService.report.View,this.isUsingPoint=this.data?.Variant?.TypeID==V.J.PrepaidPoint}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}postBindForm(e){this.menuData.H=e.Data.PageTitle;const o=this.title.getTitle().split("|")[0];this.title.setTitle(`${o}| ${this.data.Data.Variant.Name}`),this.initRoles()}deleteVariantInfo(){confirm("Are you sure you want to delete this record?")&&(this.data.Form={ID:this.data.Data.Variant.ID},this.onSubmit("catalog/variant/DeleteVariantInfo"))}onSubmitSuccess(){this.router.navigate(["/menu/Products/Catalog/Variants"]),this.toaster.success("Success Delete Variant",_.n.Success)}openBigPicture(e,o){return(0,A.Z)(function*(){o.preventDefault();try{const a=yield(0,u.FI)(e.Image.replace("w_80",""));Ps.open({items:[a],intro:"fadeup"})}catch(a){alert(a)}})()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W),t.Y36(Mt.Dx),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-variant"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"hideSearchDropdown","hideSearchBox","pageData",4,"ngIf"],[3,"hideSearchDropdown","hideSearchBox","pageData"],["class","btn-group",4,"ngIf"],["class","btn btn-outline-secondary ms-5","role","button","matTooltipPosition","above","matTooltip","Variant Update History",3,"routerLink","queryParams",4,"ngIf"],[1,"btn-group","ms-5"],["target","_blank","class","btn btn-outline-secondary","role","button",3,"href",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","bg-light-gray","pt-4","m-0"],[1,"row"],[1,"col-sm-8"],[1,"col-sm-3"],[1,"card","text-center"],[1,"card-body"],[4,"ngIf"],["class","my-lg-7",4,"ngIf"],[1,"h3","text-primary","fw-bold","d-block"],["tar","_blank",3,"routerLink","queryParams"],[1,"mb-1","h5"],[1,"mb-1",3,"placeholder"],["class","mb-1",4,"ngIf"],["class","mb-0",4,"ngIf"],[1,"mb-0",2,"color","#9da2a6","font-size","14px"],["class","mb-0 h5",4,"ngIf"],["style","color: #9da2a6; font-size: 14px",4,"ngIf"],[1,"col-sm-9"],[1,"card"],[1,"card-header"],["class","col",3,"ngClass",4,"ngIf"],["class","col-2 ps-0",4,"ngIf"],["class","col-sm-4",4,"ngIf"],[1,"col-sm-4"],[1,"form-floating-outline"],["labelValue","Weight (gr)",3,"inputValue"],["labelValue","Payment Type",3,"inputValue"],[1,"col-sm-12"],[3,"data","role"],["labelValue","Type",3,"inputValue"],["labelValue","Taxable",3,"inputValue"],["labelValue","Loyalty Point Enabled",3,"inputValue"],["labelValue","Discontinued",3,"inputValue"],["class","col-sm-12",4,"ngIf"],["class","row",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-clock-rotate-left"],["role","button","matTooltipPosition","above","matTooltip","Variant Update History",1,"btn","btn-outline-secondary","ms-5",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-clock-rotate-left"],["target","_blank","role","button",1,"btn","btn-outline-secondary",3,"href"],["aria-hidden","true",1,"fa-solid","fa-barcode"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],["matTooltipPosition","above","matTooltip","Click to zoom",3,"src","click"],[1,"my-lg-7"],[1,"fa","fa-cube","fa-i-block",2,"font-size","60px"],[1,"mb-1"],[1,"mb-0"],[1,"mb-0","h5"],[2,"color","#9da2a6","font-size","14px"],[1,"col",3,"ngClass"],[1,"form-floating-outline","floating-url"],[1,"form-control",3,"routerLink","queryParams"],[1,"col-2","ps-0"],["labelValue","Disc",3,"inputValue"],["labelValue","Selling Price",3,"inputValue"],["labelValue","Last Buy Cost",3,"inputValue"],[3,"variant"],[1,"col-12"]],template:function(e,o){1&e&&t.YNc(0,Is,80,43,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data.Data)},dependencies:[l.yS,b.gM,Z.p,c.mk,c.O5,R.o,Fi,Gi,lr,Cr,Xc,c.JJ],styles:[".floating-url[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{background-color:#fff;font-size:.75rem!important;color:#9da2a6;top:-10px!important;padding:0 .25rem;left:.5rem}.floating-url[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem!important;font-size:.875rem;border-radius:.25rem!important;display:flex;align-items:center;color:#0976b4}.floating-url[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] [_ngcontent-%COMP%]:hover{color:#05466b}POS-info-variant-purchase-history[_ngcontent-%COMP%] td, POS-info-variant-transfer-order[_ngcontent-%COMP%] td, POS-info-variant-sales-history[_ngcontent-%COMP%] td, POS-info-variant-parked-history[_ngcontent-%COMP%] td{word-break:break-all}"]}),n})();var j=(()=>{return(n=j||(j={}))[n.PurchaseOrder=2]="PurchaseOrder",n[n.Archive=3]="Archive",j;var n})();function As(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Variant"),t.qZA())}function Ds(n,i){1&n&&(t.TgZ(0,"th",22),t._uU(1,"Buying Cost"),t.qZA())}function Ss(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Selling Price"),t.qZA())}const Ns=function(){return["/menu/Products/Catalog/Variants/Info"]},Qt=function(n){return{ID:n}};function qs(n,i){if(1&n&&(t.TgZ(0,"td")(1,"a",28),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,Ns))("queryParams",t.VKq(4,Qt,e.ParentID)),t.xp6(1),t.Oqu(e.VariantName)}}function ws(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.UnitCost,"1.2-2"))}}function Us(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.UnitPrice,"1.2-2"))}}const Os=function(n){return[n]};function Js(n,i){if(1&n&&(t.TgZ(0,"tr",24),t.YNc(1,qs,3,6,"td",18),t.TgZ(2,"td"),t._uU(3),t.ALo(4,"date"),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t._UZ(7,"td",25),t.ALo(8,"newlines"),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.YNc(11,ws,3,4,"td",26),t.YNc(12,Us,3,4,"td",26),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.TgZ(15,"td")(16,"a",27),t._uU(17),t.qZA()()()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(1),t.Q6J("ngIf",o.data.ShowColumnVariant),t.xp6(2),t.Oqu(t.xi3(4,11,e.Created,"dd MMM yyyy HH:mm")),t.xp6(3),t.Oqu(e.UserName),t.xp6(1),t.Q6J("innerHTML",t.lcZ(8,14,e.Note),t.oJD),t.xp6(3),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.UnitPriceEditor),t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("queryParams",t.VKq(16,Qt,e.ReferenceID))("routerLink",t.VKq(18,Os,o.linkReference(e.TypeID))),t.xp6(1),t.hij(" ",e.DisplayReference," ")}}function Vs(n,i){if(1&n&&(t.TgZ(0,"table",16)(1,"thead",17)(2,"tr"),t.YNc(3,As,2,0,"th",18),t.TgZ(4,"th"),t._uU(5,"Modified"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Modify By"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Note"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Code"),t.qZA(),t.YNc(12,Ds,2,0,"th",19),t.YNc(13,Ss,2,0,"th",20),t.TgZ(14,"th"),t._uU(15,"Outlet"),t.qZA(),t.TgZ(16,"th"),t._uU(17,"Reference"),t.qZA()()(),t.TgZ(18,"tbody"),t.YNc(19,Js,18,20,"tr",21),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngIf",e.data.ShowColumnVariant),t.xp6(9),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.UnitPriceEditor),t.xp6(6),t.Q6J("ngForOf",e.data.Data)}}function ks(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",30),t.NdJ("page",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPaginationChange(a))}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",0==e.pageData.Filter.PageNumber?0:e.pageData.Filter.PageNumber-1)}}const Fs=function(){return["/menu/Products/Catalog/Variants"]};function Qs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.UserName=a)})("onSubmit",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.searchFromPageOne())}),t.TgZ(1,"actions")(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onExportToCsv())}),t._UZ(3,"i",3),t._uU(4," Export "),t.qZA(),t.TgZ(5,"a",4),t._uU(6," Return to Variant "),t.qZA()(),t.TgZ(7,"filters")(8,"div",5)(9,"div")(10,"h6"),t._uU(11,"Outlet"),t.qZA(),t.TgZ(12,"ng-select",6),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.EntityID=a)}),t.qZA()(),t.TgZ(13,"div")(14,"h6"),t._uU(15,"Variant"),t.qZA(),t.TgZ(16,"autocompleteV2",7),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.VariantID=a)}),t.qZA()(),t.TgZ(17,"div")(18,"h6"),t._uU(19,"From - To"),t.qZA(),t.TgZ(20,"datepicker",8),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.From=a)}),t.qZA(),t.TgZ(21,"datepicker",9),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.To=a)}),t.qZA()(),t.TgZ(22,"div")(23,"h6"),t._uU(24,"Note"),t.qZA(),t.TgZ(25,"input",10),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Note=a)}),t.qZA()(),t.TgZ(26,"div")(27,"h6"),t._uU(28,"Page Size"),t.qZA(),t.TgZ(29,"input",10),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.RowCount=a)}),t.qZA()()()(),t.TgZ(30,"content")(31,"div",11)(32,"div",12),t.YNc(33,Vs,20,4,"table",13),t.qZA(),t.TgZ(34,"div",14),t.YNc(35,ks,1,3,"mat-paginator",15),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("text",e.pageData.Filter.UserName),t.xp6(5),t.Q6J("routerLink",t.DdM(15,Fs)),t.xp6(7),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.VariantID)("inputTextValue",e.variantName)("displayText",e.variantName),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Note),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(4),t.Q6J("ngIf",e.pageData),t.xp6(2),t.Q6J("ngIf",e.pagination.listTotal>0)}}let Ls=(()=>{class n extends P.n{constructor(e,o,a,r,p){super(a,"catalog/variant/VariantHistoryList","catalog/VariantLoader/VariantHistoryLoader",r,o),this.csvConverter=e,this.activatedRoute=o,this.httpService=a,this.roleService=p,this.urlParams=this.activatedRoute.snapshot.queryParams}onExportToCsv(){this.convertToCSV(this.csvConverter,this.data.Data,"Variant_Update_History")}postInit(e){this.menuData.H=e.PageTitle,Object.entries(this.urlParams).length>0&&(this.variantName=this.pageData.VariantName);const o=this.data.Data.map(a=>{let r=a.Note.replace(/"/g,'""');return{...a,Note:r}});this.data.Data=o}preInitList(){Object.entries(this.urlParams).length>0&&(this.pageData.Filter=Object.assign(this.pageData.Filter,this.urlParams))}linkReference(e){let o="";switch(e){case j.PurchaseOrder:o="/menu/Orders/Order/Purchase_Order/Info";break;case j.Archive:o="/menu/Manufacture/Job_Order/Archive/Info"}return o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.O),t.Y36(l.gz),t.Y36(m.O),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-history-variant"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","text","textChange","onSubmit"],[1,"btn","btn-outline-secondary","me-6",3,"click"],[1,"fa","fa-upload"],["role","button","matTooltipPosition","above","matTooltip","Return to Variant",1,"btn","btn-success",3,"routerLink"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",1,"w-100",3,"items","ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","inputTextValue","displayText","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["type","text",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom",4,"ngIf"],[1,"d-sm-block","mt-2"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","text-end","style","width: 78px;",4,"ngIf"],["class","text-end","style","width: 80px;",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"text-end",2,"width","78px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"innerHTML"],["class","text-end",4,"ngIf"],[3,"queryParams","routerLink"],[3,"routerLink","queryParams"],[1,"text-end"],[3,"length","pageSize","pageIndex","page"]],template:function(e,o){1&e&&t.YNc(0,Qs,36,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[l.yS,b.gM,Z.p,c.sg,c.O5,s.Fj,s.JJ,s.On,et.NW,T.w9,H.QB,E.J,c.JJ,c.uU,D.sH]}),n})();function Es(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",26),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(3);return t.KtG(a.deleteRowCustomOutlet())}),t._UZ(1,"i",27),t._uU(2,"Delete "),t.qZA()}}function Ys(n,i){1&n&&(t.TgZ(0,"button",28)(1,"span",29),t._uU(2,"Toggle Dropdown"),t.qZA()())}function Hs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",20),t.YNc(1,Es,3,0,"a",21),t.YNc(2,Ys,3,0,"button",22),t.TgZ(3,"ul",23)(4,"li",24),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.deleteAll(a.pageData.Filter.EntityID,a.pageData.Filter.CategoryID))}),t.TgZ(5,"a",25),t._uU(6,"Delete All"),t.qZA()()()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(1),t.Q6J("ngIf",e.roleService.product.DeleteAllOutletPrice&&e.getSelectedData().length==e.data.Data.length)}}function Ks(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",30)(1,"input",31),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(a.target.checked))}),t.qZA()()}}function Gs(n,i){1&n&&(t.TgZ(0,"th",16),t._uU(1,"Unit Cost"),t.qZA())}function Rs(n,i){1&n&&(t.TgZ(0,"th",16),t._uU(1,"Extra Cost"),t.qZA())}function Bs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",34),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)}}function $s(n,i){if(1&n&&(t.TgZ(0,"td",16),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function js(n,i){if(1&n&&(t.TgZ(0,"td",16),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.ExtraCost))}}function Ws(n,i){if(1&n&&(t.TgZ(0,"tr",32),t.YNc(1,Bs,2,1,"td",33),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.YNc(10,$s,3,3,"td",15),t.TgZ(11,"td",16),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,js,3,3,"td",15),t.TgZ(15,"td",16),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",16),t._uU(19),t.ALo(20,"number"),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.CategoryName),t.xp6(2),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(e.VariantCode),t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Oqu(t.lcZ(13,10,e.UnitPrice)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(2),t.Oqu(t.lcZ(17,12,e.OutletPrice)),t.xp6(3),t.Oqu(t.lcZ(20,14,e.PriceDiscount))}}function zs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",35),t.NdJ("page",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPaginationChange(a))}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",0==e.pageData.Filter.PageNumber?0:e.pageData.Filter.PageNumber-1)}}function Xs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,Hs,7,2,"div",2),t.TgZ(3,"a",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.exportCSV(a.csvConverter,"ProductExport/OutletPrice","Outlet Price"))}),t._UZ(4,"i",4),t._uU(5," Export "),t.qZA()(),t.TgZ(6,"filters")(7,"div",5)(8,"div",6)(9,"div")(10,"h6"),t._uU(11,"Outlet"),t.qZA(),t.TgZ(12,"ng-select",7),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.EntityID=a)}),t.qZA()(),t.TgZ(13,"div")(14,"h6"),t._uU(15,"Category"),t.qZA(),t.TgZ(16,"ng-select",8),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.CategoryID=a)}),t.qZA()()()()(),t.TgZ(17,"content")(18,"div",9)(19,"div",10)(20,"table",11)(21,"thead",12)(22,"tr",13),t.YNc(23,Ks,2,0,"th",14),t.TgZ(24,"th"),t._uU(25,"Name"),t.qZA(),t.TgZ(26,"th"),t._uU(27,"Category"),t.qZA(),t.TgZ(28,"th"),t._uU(29,"Variant"),t.qZA(),t.TgZ(30,"th"),t._uU(31,"Code"),t.qZA(),t.YNc(32,Gs,2,0,"th",15),t.TgZ(33,"th",16),t._uU(34,"Unit Price"),t.qZA(),t.YNc(35,Rs,2,0,"th",15),t.TgZ(36,"th",16),t._uU(37,"Outlet Price"),t.qZA(),t.TgZ(38,"th",16),t._uU(39,"%"),t.qZA()()(),t.TgZ(40,"tbody"),t.YNc(41,Ws,21,16,"tr",17),t.qZA()()(),t.TgZ(42,"div",18),t.YNc(43,zs,1,3,"mat-paginator",19),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.getSelectedData().length>0),t.xp6(10),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(4),t.Q6J("items",e.pageData.Options.Categories)("ngModel",e.pageData.Filter.CategoryID),t.xp6(7),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(9),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(3),t.Q6J("ngIf",e.roleService.product.Cost),t.xp6(6),t.Q6J("ngForOf",e.data.Data),t.xp6(2),t.Q6J("ngIf",e.pagination.listTotal>0)}}let tp=(()=>{class n extends P.n{constructor(e,o,a,r,p){super(o,"catalog/product/OutletPrice","catalog/ProductLoader/OutletPrice",a),this.csvConverter=e,this.httpService=o,this.toasterClient=r,this.roleService=p}deleteRowCustomOutlet(){const o=this.getSelectedData().map(a=>({key1:a.VariantID,key2:a.EntityID}));this.httpService.post("/api/catalog/product/DeleteOutletPrice",JSON.stringify({Data:o})).subscribe(()=>{this.toasterClient.success("Success Custom Outlet Price",_.n.Success),this.getListData()})}deleteAll(e,o){this.httpService.post("/api/catalog/product/DeleteAllOutletPrice ",JSON.stringify({EntityID:e,CategoryID:o})).subscribe(r=>{this.toasterClient.success(r.Message,_.n.Success),this.getListData()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.O),t.Y36(m.O),t.Y36(v._W),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-custom-outlet-price"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn-group",4,"ngIf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],[1,"fa","fa-upload"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",1,"w-100",3,"items","ngModel","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose an outlet",1,"w-100",3,"items","ngModel","ngModelChange"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 24px;",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-sm-block","mt-2"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"btn-group"],["value","Delete","matTooltipPosition","above","matTooltip","Delete","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["type","button","class","btn btn-outline-secondary dropdown-toggle dropdown-toggle-split","data-bs-toggle","dropdown","aria-expanded","false",4,"ngIf"],[1,"dropdown-menu"],[1,"cursor",3,"click"],[1,"dropdown-item"],["value","Delete","matTooltipPosition","above","matTooltip","Delete",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle","dropdown-toggle-split"],[1,"visually-hidden"],[2,"width","24px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"length","pageSize","pageIndex","page"]],template:function(e,o){1&e&&t.YNc(0,Xs,44,12,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[b.gM,Z.p,c.sg,c.O5,s.Wl,s.JJ,s.On,et.NW,T.w9,c.JJ]}),n})();function ep(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.httpPostListID("ProductSetup/RemoveBrands"))}),t._UZ(1,"i",11),t._uU(2," Delete"),t.qZA()}}const Lt=function(){return["/menu/Products/Setup/Brand/Brand_Form"]};function np(n,i){1&n&&(t.TgZ(0,"a",12),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Lt))}function op(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",13)(1,"input",14),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(a.target.checked))}),t.qZA()()}}function ap(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",17),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const ip=function(n){return{ID:n}};function rp(n,i){if(1&n&&(t.TgZ(0,"span")(1,"a",18),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,Lt))("queryParams",t.VKq(4,ip,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function lp(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Name)}}function cp(n,i){if(1&n&&(t.TgZ(0,"tr",15),t.YNc(1,ap,2,2,"td",16),t.TgZ(2,"td"),t.YNc(3,rp,3,6,"span",16),t.YNc(4,lp,2,1,"span",16),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",!o.roleService.product.Edit),t.xp6(2),t.Oqu(e.Code)}}function sp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,ep,3,0,"a",2),t.YNc(3,np,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,op,2,0,"th",7),t.TgZ(10,"th",8),t._uU(11,"Name"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Code"),t.qZA()()(),t.TgZ(14,"tbody"),t.YNc(15,cp,7,4,"tr",9),t.qZA()()()()()),2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Delete&&e.getSelectedData().length>0),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(6),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(6),t.Q6J("ngForOf",e.data.Data)}}let pp=(()=>{class n extends P.n{constructor(e,o,a){super(e,"ProductSetup/GetBrandsList",null,o),this.httpService=e,this.roleService=a}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-brands"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button","class","btn btn-outline-secondary ms-2 me-4",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","200px"],["class","border-bottom ng-scope",4,"ngFor","ngForOf"],["role","button",1,"btn","btn-outline-secondary","ms-2","me-4",3,"click"],[1,"fa-solid","fa-trash"],[1,"button","btn","btn-success",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom","ng-scope"],[4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&t.YNc(0,sp,16,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,Z.p,c.sg,c.O5,s.Wl,s.JJ,s.On]}),n})();function dp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.httpPostListID("ProductSetup/RemoveMeasurements"))}),t._UZ(1,"i",12),t._uU(2," Delete"),t.qZA()}}const Et=function(){return["/menu/Products/Setup/Measurement/Form"]};function up(n,i){1&n&&(t.TgZ(0,"a",13),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Et))}function _p(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",14)(1,"input",15),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(a.target.checked))}),t.qZA()()}}function mp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",18),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const gp=function(n){return{ID:n}};function fp(n,i){if(1&n&&(t.TgZ(0,"span")(1,"a",19),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,Et))("queryParams",t.VKq(4,gp,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function hp(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Name)}}function vp(n,i){if(1&n&&(t.TgZ(0,"tr",16),t.YNc(1,mp,2,2,"td",17),t.TgZ(2,"td"),t.YNc(3,fp,3,6,"span",17),t.YNc(4,hp,2,1,"span",17),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",!o.roleService.product.Edit),t.xp6(2),t.Oqu(e.Description)}}function xp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,dp,3,0,"a",2),t.YNc(3,up,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr",7),t.YNc(9,_p,2,0,"th",8),t.TgZ(10,"th",9),t._uU(11,"Name"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Description"),t.qZA()()(),t.TgZ(14,"tbody"),t.YNc(15,vp,7,4,"tr",10),t.qZA()()()()()),2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Delete&&e.getSelectedData().length>0),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(6),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(6),t.Q6J("ngForOf",e.data.Data)}}let Cp=(()=>{class n extends P.n{constructor(e,o,a){super(e,"ProductSetup/GetMeasurementList",null,o),this.httpService=e,this.roleService=a}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-measurement"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button","class","btn btn-outline-secondary ms-2 me-4",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],["class","border-bottom ng-scope",4,"ngFor","ngForOf"],["role","button",1,"btn","btn-outline-secondary","ms-2","me-4",3,"click"],[1,"fa-solid","fa-trash"],[1,"button","btn","btn-success",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom","ng-scope"],[4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&t.YNc(0,xp,16,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,Z.p,c.sg,c.O5,s.Wl,s.JJ,s.On]}),n})();function Tp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",9),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.httpPostListID("ProductSetup/RemoveTags"))}),t._UZ(1,"i",10),t._uU(2," Delete"),t.qZA()}}const Yt=function(){return["/menu/Products/Setup/Tags/Tags_Form"]};function Zp(n,i){1&n&&(t.TgZ(0,"a",11),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Yt))}function bp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",12)(1,"input",13),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(a.target.checked))}),t.qZA()()}}function yp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",16),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const Ip=function(n){return{ID:n}};function Pp(n,i){if(1&n&&(t.TgZ(0,"span")(1,"a",17),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,Yt))("queryParams",t.VKq(4,Ip,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function Mp(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Name)}}function Ap(n,i){if(1&n&&(t.TgZ(0,"tr",14),t.YNc(1,yp,2,2,"td",15),t.TgZ(2,"td"),t.YNc(3,Pp,3,6,"span",15),t.YNc(4,Mp,2,1,"span",15),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",!e.roleService.product.Edit)}}function Dp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Tp,3,0,"a",2),t.YNc(3,Zp,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,bp,2,0,"th",7),t.TgZ(10,"th"),t._uU(11,"Name"),t.qZA()()(),t.TgZ(12,"tbody"),t.YNc(13,Ap,5,3,"tr",8),t.qZA()()()()()),2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Delete&&e.getSelectedData().length>0),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(6),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(4),t.Q6J("ngForOf",e.data.Data)}}let Sp=(()=>{class n extends P.n{constructor(e,o,a){super(e,"ProductSetup/GetTagsList",null,o),this.httpService=e,this.roleService=a}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-tags"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button","class","btn btn-outline-secondary ms-2 me-4",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],["class","border-bottom ng-scope",4,"ngFor","ngForOf"],["role","button",1,"btn","btn-outline-secondary","ms-2","me-4",3,"click"],[1,"fa-solid","fa-trash"],[1,"button","btn","btn-success",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom","ng-scope"],[4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&t.YNc(0,Dp,14,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[l.yS,Z.p,c.sg,c.O5,s.Wl,s.JJ,s.On]}),n})();function Np(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.httpPostListID("ProductSetup/RemoveUOMs"))}),t._UZ(1,"i",11),t._uU(2," Delete"),t.qZA()}}const Ht=function(){return["/menu/Products/Setup/UOM/Form"]};function qp(n,i){1&n&&(t.TgZ(0,"a",12),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Ht))}function wp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"th",13)(1,"input",14),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(a.target.checked))}),t.qZA()()}}function Up(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",18),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)})("ngModelChange",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const Op=function(n){return{ID:n}};function Jp(n,i){if(1&n&&(t.TgZ(0,"span")(1,"a",19),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,Ht))("queryParams",t.VKq(4,Op,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function Vp(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Name)}}function kp(n,i){if(1&n&&(t.TgZ(0,"tr",15),t.YNc(1,Up,2,2,"td",16),t.TgZ(2,"td"),t.YNc(3,Jp,3,6,"span",16),t.YNc(4,Vp,2,1,"span",16),t.qZA(),t._UZ(5,"td",17),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.roleService.product.Delete),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",!o.roleService.product.Edit),t.xp6(1),t.Q6J("innerText",e.Description)}}function Fp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Np,3,0,"a",2),t.YNc(3,qp,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,wp,2,0,"th",7),t.TgZ(10,"th",8),t._uU(11,"Name"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Description"),t.qZA()()(),t.TgZ(14,"tbody"),t.YNc(15,kp,6,4,"tr",9),t.qZA()()()()()),2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Delete&&e.getSelectedData().length>0),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Create),t.xp6(6),t.Q6J("ngIf",e.roleService.product.Delete),t.xp6(6),t.Q6J("ngForOf",e.data.Data)}}let Qp=(()=>{class n extends P.n{constructor(e,o,a){super(e,"ProductSetup/GetUOMList",null,o),this.httpService=e,this.roleService=a}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-uom"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button","class","btn btn-outline-secondary ms-2 me-4",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],["class","border-bottom ng-scope",4,"ngFor","ngForOf"],["role","button",1,"btn","btn-outline-secondary","ms-2","me-4",3,"click"],[1,"fa-solid","fa-trash"],[1,"button","btn","btn-success",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom","ng-scope"],[4,"ngIf"],[1,"ng-binding",3,"innerText"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&t.YNc(0,Fp,16,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,Z.p,c.sg,c.O5,s.Wl,s.JJ,s.On]}),n})();var gt=d(59286);const Lp=["inputRename"],Ep=["inputAdd"],Yp=function(){return["/menu/Products/Setup/Storages/Form"]};function Hp(n,i){1&n&&(t.TgZ(0,"a",18),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Yp))}function Kp(n,i){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e.label)}}function Gp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,20),t.NdJ("keyup",function(a){t.CHM(e);const r=t.MAs(1),p=t.oxw(2);return t.KtG(p.onKeydownEvent(a,"/API/catalog/product/RenameProductStorage",r.dirty))})("focusout",function(){t.CHM(e);const a=t.MAs(1),r=t.oxw(2);return t.KtG(r.saveRename("/API/catalog/product/RenameProductStorage",a.dirty))})("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.label=a)}),t.qZA()}2&n&&t.Q6J("ngModel",i.$implicit.label)}function Rp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,21),t.NdJ("keyup",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onKeydownEvent(a,"/API/catalog/product/CreateProductStorage"))})("focusout",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.saveAdd("/API/catalog/product/CreateProductStorage"))})("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.label=a)}),t.qZA()}2&n&&t.Q6J("ngModel",i.$implicit.label)}function Bp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Hp,2,2,"a",2),t.qZA(),t.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"p-contextMenu",5,6),t.NdJ("onShow",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.changeContextMenu())}),t.qZA(),t.TgZ(8,"p-tree",7),t.NdJ("onNodeDrop",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onDrop(a))})("selectionChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.selectedNode=a)}),t.YNc(9,Kp,2,1,"ng-template",8),t.YNc(10,Gp,3,1,"ng-template",9),t.YNc(11,Rp,2,1,"ng-template",10),t.qZA()(),t.TgZ(12,"div",11)(13,"div",12)(14,"div",13)(15,"h2",14),t._uU(16,"Tips"),t.qZA()(),t.TgZ(17,"div",15)(18,"ol",16)(19,"li"),t._uU(20,"Right click on any node to activate Context Menu and Create new storages"),t.qZA(),t.TgZ(21,"li",17),t._uU(22,"Drag & Drop is supported to move node to different locations"),t.qZA()()()()()()()()}if(2&n){const e=t.MAs(7),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Create),t.xp6(4),t.Q6J("model",o.items),t.xp6(2),t.Q6J("value",o.data.Data)("selection",o.selectedNode)("contextMenu",e)}}let $p=(()=>{class n extends P.n{constructor(e,o,a,r){super(e,"catalog/product/GetProductStorageTreeNew"),this.router=o,this.toastr=a,this.roleService=r}postInit(){this.data.Data[0].children&&(this.data.Data[0].expanded=!0)}checkedHome(){return"Home"==this.selectedNode.label&&"disabled"}changeContextMenu(){this.items=[],this.items.push({label:"Add",icon:"fas fa-plus fa-fw",command:()=>this.add(this.selectedNode)}),this.items.push({label:"Rename",icon:`fas fa-edit fa-fw ${this.checkedHome()}`,command:()=>{this.checkedHome()||this.rename(this.selectedNode)}}),this.items.push({label:"Delete",icon:`fas fa-trash fa-fw ${this.checkedHome()}`,command:()=>this.checkedHome()?"":this.delete(this.selectedNode)}),this.items.push({label:"Properties",icon:`fas fa-screwdriver-wrench fa-fw ${this.checkedHome()}`,command:()=>this.checkedHome()?"":this.properties(this.selectedNode)})}properties(e){u.gT.IsEmpty(e.id)||this.router.navigate(["/menu/Products/Setup/Storages/Info"],{queryParams:{ID:e.id}})}onDrop(e){this.httpService.post("/API/catalog/product/UpdateParentStorage",JSON.stringify({guidID:e.dragNode.id,parentID:e.dropNode.id})).subscribe(p=>{p.Success?e.dropNode.icon="fas fa-folder":this.toastr.error(p.Message,_.n.Success)})}delete(e){if(!e.parent)return this.toastr.error("Can not delete Home",_.n.Error),void(this.selectedNode=null);this.httpService.post("/API/catalog/product/DeleteProductStorage",JSON.stringify(e.id)).subscribe(a=>{if(a.Success){let r=e.parent.children.indexOf(e);e.parent.children.splice(r,1),this.toastr.success(a.Message,_.n.Success)}else this.toastr.error(a.Message,_.n.Error)})}rename(e){e.type="rename",this.oldLabel=e.label,setTimeout(()=>{this.inputNodeRename.nativeElement.focus()},100)}add(e){let o={label:"",type:"add",icon:"far fa-folder",children:[]};u.gT.IsEmpty(e.children)&&(e.children=[]),u.gT.IsNotEmpty(e.icon)&&delete e.icon,e.children.push(o),e.expandedIcon="fas fa-folder-open",e.collapsedIcon="fas fa-folder",e.expanded=!0,this.oldParent=e,this.selectedNode=o,setTimeout(()=>{this.inputNodeAdd.nativeElement.focus()},100)}saveAdd(e){this.selectedNode.type="default";let o={name:this.selectedNode.label,ID:this.selectedNode.id,parentID:this.selectedNode.parent.id};if(""==o.name)return this.toastr.error("Name is required",_.n.Error),this.selectedNode.parent.children.pop(),this.selectedNode=null,void(0==this.selectedNode.parent.children.length&&(this.oldParent.icon="far fa-folder"));this.httpService.post(e,JSON.stringify(o)).subscribe({next:a=>{this.selectedNode.id=a.ObjectID,this.selectedNode=null},error:a=>{this.toastr.error(a.error,_.n.Error),this.selectedNode.parent.children.pop(),this.selectedNode=null}})}saveRename(e,o){this.selectedNode.type="default";let a={name:this.selectedNode.label,parentID:this.selectedNode?.parent?.id,guidID:this.selectedNode.id};""==a.name?(this.toastr.error("Name is required",_.n.Error),this.selectedNode.label=this.oldLabel,this.selectedNode=null):o?this.httpService.post(e,JSON.stringify(a)).subscribe(r=>{this.selectedNode=null},r=>{this.toastr.error(r.error,_.n.Error),this.selectedNode.label=this.oldLabel,this.selectedNode=null}):this.selectedNode=null}onKeydownEvent(e,o,a){"Enter"===e.key&&("rename"==this.selectedNode.type?this.saveRename(o,a):this.saveAdd(o))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.F0),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-storage"]],viewQuery:function(e,o){if(1&e&&(t.Gf(Lp,5),t.Gf(Ep,5)),2&e){let a;t.iGM(a=t.CRH())&&(o.inputNodeRename=a.first),t.iGM(a=t.CRH())&&(o.inputNodeAdd=a.first)}},features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5","d-flex"],[2,"width","70%"],["appendTo","body",3,"model","onShow"],["cm",""],["draggableNodes","true","droppableNodes","true","selectionMode","single",3,"value","selection","contextMenu","onNodeDrop","selectionChange"],["pTemplate","default"],["pTemplate","rename"],["pTemplate","add"],[2,"width","30%"],[1,"card"],[1,"card-header","py-5"],[1,"text-info"],[1,"card-body",2,"padding-left","18px"],[1,"mb-0",2,"padding-left","15px"],[1,"mt-3"],[1,"button","btn","btn-success",3,"routerLink"],["type","text",3,"ngModel","keyup","focusout","ngModelChange"],["dirtyRename","ngModel","inputRename",""],["inputAdd",""]],template:function(e,o){1&e&&t.YNc(0,Bp,23,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[Y.mp,O.jx,gt.xV,l.yS,Z.p,c.O5,s.Fj,s.JJ,s.On],styles:["p-tree[_ngcontent-%COMP%] div.p-tree{padding-top:0!important;padding-left:0!important;border:none!important}p-tree[_ngcontent-%COMP%] span.far.fa-folder{color:#d2d2cf!important}.card-header[_ngcontent-%COMP%]{background-color:#00000008}"]}),n})();function jp(n,i){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const Wp=function(){return["/menu/Products/Setup/Brand"]};function zp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onSubmit("ProductSetup/UpdateBrandsList"))}),t._uU(5,"Save"),t.qZA()(),t.TgZ(6,"content")(7,"div",4),t._UZ(8,"alert",5),t.TgZ(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",7)(14,"h3"),t._uU(15,"General"),t.qZA()()(),t.TgZ(16,"div",10)(17,"div",7)(18,"div",11)(19,"input",12,13),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=a)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,jp,2,0,"span",15),t.qZA(),t.TgZ(24,"div",11)(25,"input",16),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Code=a)}),t.qZA(),t.TgZ(26,"label",17),t._uU(27,"Code"),t.qZA()()()()()()()()()()}if(2&n){const e=t.MAs(20),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(8,Wp)),t.xp6(2),t.Q6J("disabled",!(null!=o.formData&&o.formData.Name)),t.xp6(15),t.Q6J("ngModel",o.formData.Name),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngModel",o.formData.Code)}}let Xp=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"ProductSetup/BrandFormInitial",o),this.activatedRoute=o,this.router=a,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit Brand",_.n.Success),this.router.navigate(["/menu/Products/Setup/Brand"])}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-brands"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-4",3,"routerLink"],["matTooltipPosition","above","matTooltip","Save",1,"button","btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","form-horizontal"],["data","ctrl.Alert"],[1,"row"],[1,"col-sm-12"],[1,"card","mt-10"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","autofocus","","required","","name","Name",1,"form-control",3,"ngModel","ngModelChange"],["Name","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],["type","text","id","inputCode","placeholder","Code","maxlength","100",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCode"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,zp,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.nD,s.On]}),n})();function td(n,i){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const ed=function(){return["/menu/Products/Setup/Measurement"]};function nd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onSubmit("ProductSetup/UpdateMeasurementList"))}),t._uU(5,"Save"),t.qZA()(),t.TgZ(6,"content")(7,"div",4),t._UZ(8,"alert",5),t.TgZ(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",7)(14,"h3"),t._uU(15,"General"),t.qZA()()(),t.TgZ(16,"div",10)(17,"div",7)(18,"div",11)(19,"input",12,13),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=a)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,td,2,0,"span",15),t.qZA(),t.TgZ(24,"div",11)(25,"textarea",16),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Description=a)}),t.qZA(),t.TgZ(26,"label",17),t._uU(27,"Description"),t.qZA()()()()()()()()()()}if(2&n){const e=t.MAs(20),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(8,ed)),t.xp6(2),t.Q6J("disabled",!(null!=o.formData&&o.formData.Name)),t.xp6(15),t.Q6J("ngModel",o.formData.Name),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngModel",o.formData.Description)}}let od=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"ProductSetup/MeasurementFormInitial",o),this.activatedRoute=o,this.router=a,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit Measurement",_.n.Success),this.router.navigate(["/menu/Products/Setup/Measurement"])}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-measurement"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-4",3,"routerLink"],["matTooltipPosition","above","matTooltip","Save",1,"button","btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","form-horizontal"],["data","ctrl.Alert"],[1,"row"],[1,"col-sm-12"],[1,"card","mt-10"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","autofocus","","required","","name","Name",1,"form-control",3,"ngModel","ngModelChange"],["Name","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],["id","inputDescription","placeholder","Description",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDescription"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,nd,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]}),n})();function ad(n,i){1&n&&(t.TgZ(0,"span",16),t._uU(1," Name required!"),t.qZA())}const id=function(){return["/menu/Products/Setup/Tags"]};function rd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onSubmit("ProductSetup/UpdateTagsList"))}),t._uU(5,"Save"),t.qZA()(),t.TgZ(6,"content")(7,"div",4),t._UZ(8,"alert",5),t.TgZ(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",7)(14,"h3"),t._uU(15,"General"),t.qZA()()(),t.TgZ(16,"div",10)(17,"div",7)(18,"div",11)(19,"input",12,13),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=a)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,ad,2,0,"span",15),t.qZA()()()()()()()()()}if(2&n){const e=t.MAs(20),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(7,id)),t.xp6(2),t.Q6J("disabled",!(null!=o.formData&&o.formData.Name)),t.xp6(15),t.Q6J("ngModel",o.formData.Name),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid)}}let ld=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"ProductSetup/TagFormInitials",o),this.activatedRoute=o,this.router=a,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit Tags",_.n.Success),this.router.navigate(["/menu/Products/Setup/Tags"])}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-tags"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-4",3,"routerLink"],["matTooltipPosition","above","matTooltip","Save",1,"button","btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","form-horizontal"],["data","ctrl.Alert"],[1,"row"],[1,"col-sm-12"],[1,"card","mt-10"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","autofocus","","required","","name","Name",1,"form-control",3,"ngModel","ngModelChange"],["Name","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,rd,24,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]}),n})();function cd(n,i){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const sd=function(){return["/menu/Products/Setup/UOM"]};function pd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onSubmit("ProductSetup/PostUOM"))}),t._uU(5,"Save"),t.qZA()(),t.TgZ(6,"content")(7,"div",4),t._UZ(8,"alert",5),t.TgZ(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",7)(14,"h3"),t._uU(15,"General"),t.qZA()()(),t.TgZ(16,"div",10)(17,"div",7)(18,"div",11)(19,"input",12,13),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=a)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,cd,2,0,"span",15),t.qZA(),t.TgZ(24,"div",11)(25,"textarea",16),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Description=a)}),t.qZA(),t.TgZ(26,"label",17),t._uU(27,"Description"),t.qZA()()()()()()()()()()}if(2&n){const e=t.MAs(20),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(8,sd)),t.xp6(2),t.Q6J("disabled",!(null!=o.formData&&o.formData.Name)),t.xp6(15),t.Q6J("ngModel",o.formData.Name),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngModel",o.formData.Description)}}let dd=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"ProductSetup/UOMFormInitial",o),this.activatedRoute=o,this.router=a,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit UOM",_.n.Success),this.router.navigate(["/menu/Products/Setup/UOM"])}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-uom"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-4",3,"routerLink"],["matTooltipPosition","above","matTooltip","Save",1,"button","btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","form-horizontal"],["data","ctrl.Alert"],[1,"row"],[1,"col-sm-12"],[1,"card","mt-10"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","autofocus","","required","","name","Name",1,"form-control",3,"ngModel","ngModelChange"],["Name","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],["id","inputDescription","placeholder","Description",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDescription"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,pd,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]}),n})();function ud(n,i){1&n&&(t.TgZ(0,"span",21),t._uU(1," Name required."),t.qZA())}const _d=function(){return["/menu/Products/Setup/Storages"]},md=function(n){return{invalid:n}},gd=function(n){return{selected:n}};function fd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onSubmit("catalog/product/ProductStorageSubmit"))}),t._uU(5,"Save"),t.qZA()(),t.TgZ(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h3"),t._uU(13,"General"),t.qZA()(),t.TgZ(14,"div",9)(15,"div",10)(16,"input",11,12),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Model=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.changeName())}),t.qZA(),t.TgZ(18,"label",13),t._uU(19,"Name"),t.qZA(),t.YNc(20,ud,2,0,"span",14),t.qZA(),t.TgZ(21,"div",15)(22,"div",16)(23,"ng-select",17),t.NdJ("change",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.changeName())})("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.ParentID=a)}),t.qZA(),t.TgZ(24,"label",18),t._uU(25,"Parent"),t.qZA()()(),t.TgZ(26,"div",10),t._UZ(27,"input",19),t.TgZ(28,"label",20),t._uU(29,"Display"),t.qZA()()()()()()()()()}if(2&n){const e=t.MAs(17),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(12,_d)),t.xp6(2),t.Q6J("disabled",!(null!=o.formData&&o.formData.Name)),t.xp6(12),t.Q6J("ngModel",o.formData.Model)("ngClass",t.VKq(13,md,o.ValidNameCode)),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngClass",t.VKq(15,gd,o.IsNotEmpty(o.formData.ParentID))),t.xp6(1),t.Q6J("items",o.options.Storages)("ngModel",o.formData.ParentID),t.xp6(4),t.Q6J("ngModel",o.formData.Name)}}let hd=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"catalog/ProductLoader/ProductStorageForm",o),this.activatedRoute=o,this.router=a,this.toaster=r}postBindForm(e){this.activatedRoute.queryParams?this.menuData.H=e.PageTitle:this.formData.ParentID=null}onSubmitSuccess(e){this.toaster.success("Success Submit Storages",_.n.Success),this.router.navigate(["/menu/Products/Setup/Storages"])}changeName(){const e=this.options.Storages,o=this.formData.Model?this.formData.Model:"";let a;this.IsNotEmpty(this.formData.ParentID)&&e.forEach(r=>{r.Key==this.formData.ParentID&&(a=r.Value)}),this.formData.Name=a?`${a}/${o}`:o}IsNotEmpty(e){return u.gT.IsNotEmpty(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-storage"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-4",3,"routerLink"],["matTooltipPosition","above","matTooltip","Save",1,"button","btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","form-horizontal","pt-4"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","name","productName","ng-model-options","{ debounce: 400 }","autofocus","","required","",1,"form-control",3,"ngModel","ngClass","ngModelChange"],["productName","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],[1,"row","g-0"],[1,"form-floating-outline","col",3,"ngClass"],["bindLabel","Value","bindValue","Key",1,"productform",3,"items","ngModel","change","ngModelChange"],["for","inputParent",1,"ng-select"],["type","text","id","inputDisplay","placeholder","Display","name","categoryDisplay","disabled","",1,"form-control",3,"ngModel"],["for","inputDisplay"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,fd,30,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,b.gM,Z.p,c.mk,c.O5,s.Fj,s.JJ,s.Q7,s.On,T.w9]}),n})();const vd=function(){return["/menu/Products/Setup/Storages/Form"]},Kt=function(n){return{ID:n}},xd=function(){return["/menu/Products/Setup/Storages/Info"]};function Cd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"a",3),t._UZ(4,"i",4),t._uU(5," Edit"),t.qZA(),t.TgZ(6,"a",5),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onSubmit("catalog/product/ProductStorageDelete"))}),t._UZ(7,"i",6),t._uU(8," Delete"),t.qZA()()(),t.TgZ(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"div",11)(15,"h3"),t._uU(16,"General"),t.qZA()(),t.TgZ(17,"div",12)(18,"div",13),t._UZ(19,"POS-info-page-input",14),t.qZA(),t.TgZ(20,"div",15)(21,"div",16)(22,"a",17),t._uU(23),t.qZA(),t.TgZ(24,"label"),t._uU(25,"Parent"),t.qZA()()(),t.TgZ(26,"div",13),t._UZ(27,"POS-info-page-input",18),t.qZA()()()()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("routerLink",t.DdM(10,vd))("queryParams",t.VKq(11,Kt,e.formData.ID)),t.xp6(16),t.Q6J("inputValue",e.formData.Model),t.xp6(3),t.Q6J("routerLink",t.DdM(13,xd))("queryParams",t.VKq(14,Kt,e.formData.ParentID)),t.xp6(1),t.Oqu(e.parentName),t.xp6(4),t.Q6J("inputValue",e.formData.Name)}}let Td=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"catalog/ProductLoader/ProductStorageForm",o),this.httpService=e,this.activatedRoute=o,this.toaster=a,this.router=r}postBindForm(){this.options.Storages.forEach(e=>{e.Key==this.formData.ParentID&&(this.parentName=e.Value)})}onSubmitSuccess(e){this.toaster.success("Success Delete Storages",_.n.Success),this.router.navigate(["/menu/Products/Setup/Storages"])}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(v._W),t.Y36(l.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-storage"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-trash"],[1,"container-fluid","bg-light-gray","form-horizontal","pt-4"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["labelValue","Name",3,"inputValue"],[1,"row","g-0"],[1,"form-floating-outline","floating-url","w-100"],["target","_blank",1,"form-control",3,"routerLink","queryParams"],["labelValue","Display",3,"inputValue"]],template:function(e,o){1&e&&t.YNc(0,Cd,28,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,Z.p,c.O5,R.o],styles:[".floating-url[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{background-color:#fff;font-size:.75rem!important;color:#9da2a6;top:-10px!important;padding:0 .25rem;left:.5rem}.floating-url[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem!important;font-size:.875rem;border-radius:.25rem!important;display:flex;align-items:center;color:#0976b4}.floating-url[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] [_ngcontent-%COMP%]:hover{color:#05466b}"]}),n})();var Zd=d(22863),bd=d(24351);const yd=["inputRename"],Id=["inputAdd"],Pd=function(){return["/menu/Products/Catalog/Categories/Form"]};function Md(n,i){1&n&&(t.TgZ(0,"a",18),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Pd))}function Ad(n,i){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e.label)}}function Dd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,20),t.NdJ("keyup",function(a){t.CHM(e);const r=t.MAs(1),p=t.oxw(2);return t.KtG(p.onKeydownEvent(a,"/API/catalog/category/RenameProductCategory",r.dirty))})("focusout",function(){t.CHM(e);const a=t.MAs(1),r=t.oxw(2);return t.KtG(r.saveRename("/API/catalog/category/RenameProductCategory",a.dirty))})("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.label=a)}),t.qZA()}2&n&&t.Q6J("ngModel",i.$implicit.label)}function Sd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,22),t.NdJ("keyup",function(a){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onKeydownEvent(a,"/API/catalog/category/CreateProductCategory"))})("focusout",function(){t.CHM(e);const a=t.oxw(3);return t.KtG(a.saveAdd("/API/catalog/category/CreateProductCategory"))})("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.label=a)}),t.qZA()}2&n&&t.Q6J("ngModel",i.$implicit.label)}function Nd(n,i){1&n&&t.YNc(0,Sd,2,1,"ng-template",21)}function qd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Md,2,2,"a",2),t.qZA(),t.TgZ(3,"content")(4,"div",3)(5,"div",4),t._UZ(6,"p-contextMenu",5,6),t.TgZ(8,"p-tree",7),t.NdJ("onNodeDrop",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.onDrop(a))})("selectionChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.selectedNode=a)}),t.YNc(9,Ad,2,1,"ng-template",8),t.YNc(10,Dd,3,1,"ng-template",9),t.YNc(11,Nd,1,0,null,10),t.qZA()(),t.TgZ(12,"div",11)(13,"div",12)(14,"div",13)(15,"h2"),t._uU(16,"Tips"),t.qZA()(),t.TgZ(17,"div",14)(18,"ol",15)(19,"li"),t._uU(20,"Context menu is available to ADD or Delete a Category (Activate by using right click on your Mouse)"),t.qZA(),t.TgZ(21,"li",16),t._uU(22,"You can Drag and Drop folder to a new Location (Example: move a folder to be inside another folder)"),t.qZA(),t.TgZ(23,"li",16),t._uU(24,"Read Product Category in this "),t.TgZ(25,"a",17),t._uU(26,"article"),t.qZA()()()()()()()()()}if(2&n){const e=t.MAs(7),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Create),t.xp6(4),t.Q6J("model",o.items),t.xp6(2),t.Q6J("value",o.data.Data)("draggableNodes",o.roleService.product.Edit)("droppableNodes",o.roleService.product.Edit)("selection",o.selectedNode)("contextMenu",e),t.xp6(3),t.Q6J("ngIf",o.roleService.product.Create)}}let wd=(()=>{class n extends Zd.M{constructor(e,o,a,r){super(e),this.Router=o,this.toastr=a,this.roleService=r,this.menuData$.pipe((0,bd.b)(()=>this.httpService.post("/API/catalog/category/GetProductCategoryTreeNew"))).subscribe(p=>{this.data=p,this.data.Data[0].children&&(this.data.Data[0].expanded=!0),this.items=[],this.roleService.product.Create&&this.items.push({label:"Add",icon:"fas fa-plus fa-fw",command:g=>this.add(this.selectedNode)}),this.roleService.product.Delete&&this.items.push({label:"Delete",icon:"fas fa-trash fa-fw",command:g=>this.delete(this.selectedNode)}),this.roleService.product.Edit&&this.items.push({label:"Rename",icon:"fas fa-edit fa-fw",command:g=>this.rename(this.selectedNode)}),this.items.push({label:"Properties",icon:"fas fa-screwdriver-wrench fa-fw",command:g=>this.properties(this.selectedNode)})})}ngOnInit(){}properties(e){u.gT.IsEmpty(e.id)||this.Router.navigate(["/menu/Products/Catalog/Categories/Info"],{queryParams:{ID:e.id}})}onDrop(e){this.httpService.post("/API/catalog/category/UpdateParentCategory",JSON.stringify({guidID:e.dragNode.id,parentID:e.dropNode.id})).subscribe(p=>{p.Message?(e.dropNode.icon="fas fa-folder",this.toastr.success(p.Message,_.n.Success)):this.toastr.error(p.Message,_.n.Error)})}delete(e){if(!e.parent)return this.toastr.error("Can not delete Home",_.n.Error),void(this.selectedNode=null);this.httpService.post("/API/catalog/category/DeleteProductCategory",JSON.stringify({ID:e.id})).subscribe(a=>{let r=e.parent.children.indexOf(e);e.parent.children.splice(r,1),this.toastr.success(a.Message,_.n.Success)})}rename(e){e.type="rename",this.oldLabel=e.label,setTimeout(()=>{this.inputNodeRename.nativeElement.focus()},100)}add(e){let o={label:"",type:"add",icon:"far fa-folder",children:[]};u.gT.IsEmpty(e.children)&&(e.children=[]),u.gT.IsNotEmpty(e.icon)&&delete e.icon,e.children.push(o),e.expandedIcon="fas fa-folder-open",e.collapsedIcon="fas fa-folder",e.expanded=!0,this.oldParent=e,this.selectedNode=o,setTimeout(()=>{this.inputNodeAdd.nativeElement.focus()},100)}saveAdd(e){this.selectedNode.type="default";let o={name:this.selectedNode.label,ID:this.selectedNode.id,parentID:this.selectedNode.parent.id};if(""==o.name)return this.toastr.error("Name is required",_.n.Error),this.selectedNode.parent.children.pop(),0==this.selectedNode.parent.children.length&&(this.oldParent.icon="far fa-folder"),void(this.selectedNode=null);this.httpService.post(e,JSON.stringify(o)).subscribe({next:a=>{this.selectedNode.id=a.ID,this.selectedNode=null},error:a=>{this.selectedNode.parent.children.pop(),this.selectedNode=null}})}saveRename(e,o){this.selectedNode.type="default";let a={name:this.selectedNode.label,parentID:this.selectedNode?.parent?.id,guidID:this.selectedNode.id};""==a.name?(this.toastr.error("Name is required",_.n.Error),this.selectedNode.label=this.oldLabel,this.selectedNode=null):o?this.httpService.post(e,JSON.stringify(a)).subscribe({next:r=>{this.selectedNode=null,this.toastr.success("Successfully rename category",_.n.Success)},error:r=>{this.selectedNode.label=this.oldLabel,this.selectedNode=null}}):this.selectedNode=null}onKeydownEvent(e,o,a){"Enter"===e.key&&("rename"==this.selectedNode.type?this.saveRename(o,a):this.saveAdd(o))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.F0),t.Y36(v._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-category"]],viewQuery:function(e,o){if(1&e&&(t.Gf(yd,5),t.Gf(Id,5)),2&e){let a;t.iGM(a=t.CRH())&&(o.inputNodeRename=a.first),t.iGM(a=t.CRH())&&(o.inputNodeAdd=a.first)}},features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5","d-flex"],[2,"width","70%"],["appendTo","body",3,"model"],["cm",""],["selectionMode","single",3,"value","draggableNodes","droppableNodes","selection","contextMenu","onNodeDrop","selectionChange"],["pTemplate","default"],["pTemplate","rename"],[4,"ngIf"],[2,"width","30%"],[1,"card"],[1,"card-header","py-5"],[1,"card-body","ps-6"],[1,"mb-0","ps-5"],[1,"mt-3"],["href","https://support.dealpos.com/en/articles/4773748-product-introduction","target","blank"],[1,"button","btn","btn-success",3,"routerLink"],["type","text",3,"ngModel","keyup","focusout","ngModelChange"],["dirtyRename","ngModel","inputRename",""],["pTemplate","add"],["inputAdd",""]],template:function(e,o){1&e&&t.YNc(0,qd,27,11,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[Y.mp,O.jx,gt.xV,l.yS,Z.p,c.O5,s.Fj,s.JJ,s.On],styles:["p-tree[_ngcontent-%COMP%] div.p-tree{padding-top:0!important;padding-left:0!important;border:none!important}p-tree[_ngcontent-%COMP%] span.far.fa-folder{color:#d2d2cf!important}.card-header[_ngcontent-%COMP%]{background-color:#00000008}.card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#2596be}"]}),n})();function Ud(n,i){1&n&&(t.TgZ(0,"span",39),t._uU(1," Name required."),t.qZA())}const Od=function(){return["/menu/Products/Catalog/Categories"]},it=function(n){return{selected:n}};function Jd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Cancel"),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.validateSubmit())}),t._uU(5,"Submit"),t.qZA()(),t.TgZ(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h3"),t._uU(13,"General"),t.qZA()(),t.TgZ(14,"div",9)(15,"div",10)(16,"input",11,12),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Model=a)})("ngModelChange",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.changeCategory())}),t.qZA(),t.TgZ(18,"label",13),t._uU(19,"Name"),t.qZA(),t.YNc(20,Ud,2,0,"span",14),t.qZA(),t.TgZ(21,"div",15)(22,"div",16)(23,"ng-select",17),t.NdJ("change",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.changeCategory())})("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.ParentID=a)}),t.qZA(),t.TgZ(24,"label",18),t._uU(25,"Parent"),t.qZA()()(),t.TgZ(26,"div",10)(27,"input",19),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=a)}),t.qZA(),t.TgZ(28,"label",20),t._uU(29,"Display"),t.qZA()(),t.TgZ(30,"div",5)(31,"div",21)(32,"div",10)(33,"input",22),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Code=a)}),t.qZA(),t.TgZ(34,"label",23),t._uU(35,"SKU Prefix"),t.qZA()()(),t.TgZ(36,"div",21)(37,"div",10)(38,"input",24),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.SKUSeed=a)}),t.qZA(),t.TgZ(39,"label",25),t._uU(40,"SKU Seed"),t.qZA()()()()()()(),t.TgZ(41,"div",26)(42,"div",7)(43,"div",8)(44,"h3"),t._uU(45,"Advanced"),t.qZA()(),t.TgZ(46,"div",9)(47,"div",5)(48,"div",27)(49,"div",28)(50,"ng-select",29),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.UOM=a)}),t.qZA(),t.TgZ(51,"label",30),t._uU(52,"UOM"),t.qZA()()(),t.TgZ(53,"div",27)(54,"div",28)(55,"ng-select",29),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.UOMQ=a)}),t.qZA(),t.TgZ(56,"label",31),t._uU(57,"UOMQ"),t.qZA()()()(),t.TgZ(58,"div",5)(59,"div",32)(60,"div",28)(61,"ng-select",29),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.MeasurementID=a)}),t.qZA(),t.TgZ(62,"label",33),t._uU(63,"Measurement"),t.qZA()()()(),t.TgZ(64,"div",5)(65,"div",32)(66,"div",34)(67,"ng-select",35),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.TypeID=a)}),t.qZA(),t.TgZ(68,"label",36),t._uU(69,"Type"),t.qZA()()()(),t.TgZ(70,"div",5)(71,"div",32)(72,"div",10)(73,"textarea",37),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Description=a)}),t.qZA(),t.TgZ(74,"label",38),t._uU(75,"Description"),t.qZA()()()()()()()()()()()}if(2&n){const e=t.MAs(17),o=t.oxw();t.Q6J("pageData",o.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(26,Od)),t.xp6(2),t.Q6J("disabled",!(null!=o.formData&&o.formData.Name)),t.xp6(12),t.Q6J("ngModel",o.formData.Model),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngClass",t.VKq(27,it,o.IsNotEmpty(o.formData.ParentID))),t.xp6(1),t.Q6J("items",o.options.Categories)("ngModel",o.formData.ParentID),t.xp6(4),t.Q6J("ngModel",o.formData.Name),t.xp6(6),t.Q6J("ngModel",o.formData.Code),t.xp6(5),t.Q6J("ngModel",o.formData.SKUSeed),t.xp6(11),t.Q6J("ngClass",t.VKq(29,it,o.IsNotEmpty(o.formData.UOM))),t.xp6(1),t.Q6J("items",o.options.UOMs)("ngModel",o.formData.UOM),t.xp6(4),t.Q6J("ngClass",t.VKq(31,it,o.IsNotEmpty(o.formData.UOMQ))),t.xp6(1),t.Q6J("items",o.options.UOMQ)("ngModel",o.formData.UOMQ),t.xp6(5),t.Q6J("ngClass",t.VKq(33,it,o.IsNotEmpty(o.formData.MeasurementID))),t.xp6(1),t.Q6J("items",o.options.Measurements)("ngModel",o.formData.MeasurementID),t.xp6(6),t.Q6J("clearable",!1)("items",o.options.CategoryTypes)("ngModel",o.formData.TypeID),t.xp6(6),t.Q6J("ngModel",o.formData.Description)}}let Vd=(()=>{class n extends q.U{constructor(e,o,a,r){super(e,"catalog/ProductCategoryLoader/ProductCategoryForm",o),this.activatedRoute=o,this.router=a,this.toaster=r}postBindForm(e){this.menuData.H=e.PageTitle}IsNotEmpty(e){return u.gT.IsNotEmpty(e)}changeCategory(){const e=this.options.Categories,o=this.formData.Model?this.formData.Model:"";let a;this.IsNotEmpty(this.formData.ParentID)&&e.forEach(r=>{r.Key==this.formData.ParentID&&(a=r.Value)}),this.formData.Name=a?`${a}/${o}`:o}onSubmitSuccess(e){this.toaster.success("Success Submit Category",_.n.Success),this.router.navigate(["/menu/Products/Catalog/Categories"])}validateSubmit(){u.gT.IsEmpty(this.formData.Model.trim())?this.toaster.info("Model name for variant is required",_.n.Info):this.onSubmit("catalog/category/ProductCategorySubmit")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(l.F0),t.Y36(v._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-form-category"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-outline-secondary","btn-lg","ms-2","me-5",3,"routerLink"],["type","button",1,"btn","btn-success","btn-lg",3,"disabled","click"],[1,"container-fluid","bg-light-gray","pt-5"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","name","productName","autofocus","","required","",1,"form-control",3,"ngModel","ngModelChange"],["productName","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],[1,"row","g-0"],[1,"form-floating-outline","col",3,"ngClass"],["bindLabel","Value","bindValue","Key",1,"productform",3,"items","ngModel","change","ngModelChange"],["for","inputParent",1,"ng-select"],["type","text","id","inputDisplay","placeholder","Display","name","categoryDisplay","disabled","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDisplay"],[1,"col-sm-6"],["type","text","id","inputSKUPrefix","placeholder","SKU Prefix","name","SKUPrefix",1,"form-control",3,"ngModel","ngModelChange"],["for","inputSKUPrefix"],["type","text","id","inputSKUSeed","placeholder","SKU Seed","name","SKUSeed","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputSKUSeed"],[1,"col-md-4"],[1,"col-md-6"],[1,"form-floating-outline",3,"ngClass"],["bindLabel","Name","bindValue","ID",1,"productform",3,"items","ngModel","ngModelChange"],["for","inputUOM",1,"ng-select"],["for","inputUOMQ",1,"ng-select"],[1,"col-sm-12"],["for","inputMeasurement",1,"ng-select"],[1,"form-floating-outline","flexRow","selected"],["bindLabel","Value","bindValue","Key",1,"productform",3,"clearable","items","ngModel","ngModelChange"],["for","inputType",1,"ng-select"],["id","inputDescription","placeholder","Description","ng-keyup","ctrl.setHeightTextarea('inputDescription')",1,"form-control",3,"ngModel","ngModelChange"],["for","inputDescription"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,Jd,76,35,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,Z.p,c.mk,c.O5,s.Fj,s.JJ,s.Q7,s.On,T.w9,w.b]}),n})();const kd=function(){return["/menu/Products/Catalog/Categories/Form"]},ft=function(n){return{ID:n}};function Fd(n,i){if(1&n&&(t.TgZ(0,"a",24),t._UZ(1,"i",25),t._uU(2," Edit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,kd))("queryParams",t.VKq(3,ft,e.formData.ID))}}function Qd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",26),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.removeCategory())}),t._UZ(1,"i",27),t._uU(2," Delete"),t.qZA()}}const Ld=function(){return["/menu/Inventory/Quantity/Valuation"]},Ed=function(){return["/menu/Products/Catalog/Categories/Info"]};function Yd(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"View Inventory"),t.qZA(),t.TgZ(4,"div",3),t.YNc(5,Fd,3,5,"a",4),t.YNc(6,Qd,3,0,"a",5),t.qZA()(),t.TgZ(7,"content")(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h3"),t._uU(14,"General"),t.qZA()(),t.TgZ(15,"div",11)(16,"div",7)(17,"div",12)(18,"div",13),t._UZ(19,"POS-info-page-input",14),t.qZA()()(),t.TgZ(20,"div",7)(21,"div",12)(22,"div",15)(23,"a",16),t._uU(24),t.qZA(),t.TgZ(25,"label"),t._uU(26,"Parent"),t.qZA()()()(),t.TgZ(27,"div",7)(28,"div",12)(29,"div",13),t._UZ(30,"POS-info-page-input",17),t.qZA()()(),t.TgZ(31,"div",7)(32,"div",18)(33,"div",13),t._UZ(34,"POS-info-page-input",19),t.qZA()(),t.TgZ(35,"div",18)(36,"div",13),t._UZ(37,"POS-info-page-input",20),t.qZA()()()()()(),t.TgZ(38,"div",21)(39,"div",9)(40,"div",10)(41,"h3"),t._uU(42,"Advanced"),t.qZA()(),t.TgZ(43,"div",11)(44,"div",7)(45,"div",12)(46,"div",13),t._UZ(47,"POS-info-page-input",22),t.qZA()()(),t.TgZ(48,"div",7)(49,"div",12)(50,"div",13),t._UZ(51,"POS-info-page-input",23),t.qZA()()()()()()()()()()),2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(16,Ld))("queryParams",t.VKq(17,ft,e.formData.ID)),t.xp6(3),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Delete),t.xp6(13),t.Q6J("inputValue",e.formData.Model),t.xp6(4),t.Q6J("routerLink",t.DdM(19,Ed))("queryParams",t.VKq(20,ft,e.formData.ParentID)),t.xp6(1),t.Oqu(e.data.ParentName),t.xp6(6),t.Q6J("inputValue",e.formData.Name),t.xp6(4),t.Q6J("inputValue",e.formData.Code),t.xp6(3),t.Q6J("inputValue",e.formData.SKUSeed),t.xp6(10),t.Q6J("inputValue",e.formData.TypeName),t.xp6(4),t.Q6J("inputValue",e.formData.Description)}}let Hd=(()=>{class n extends q.U{constructor(e,o,a,r,p){super(e,"catalog/ProductCategoryLoader/ProductCategoryInfoLoader",o),this.httpService=e,this.activatedRoute=o,this.toaster=a,this.router=r,this.roleService=p}postBindForm(){this.options.Categories&&this.options.Categories.forEach(e=>{e.Key==this.formData.ParentID&&(this.parentName=e.Value)})}removeCategory(){confirm("Are you sure you want to delete this record?")&&this.onSubmit("catalog/category/ProductCategoryDelete")}onSubmitSuccess(e){this.toaster.success("Success Delete Category",_.n.Success),this.router.navigate(["/menu/Products/Catalog/Categories"])}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(v._W),t.Y36(l.F0),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-info-category"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-success","me-5",3,"routerLink","queryParams"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","bg-light-gray","form-horizontal","pt-4"],[1,"row"],[1,"col-sm-8"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-floating-outline"],["labelValue","Name",3,"inputValue"],[1,"form-floating-outline","floating-url","w-100"],["target","_blank",1,"form-control",3,"routerLink","queryParams"],["labelValue","Display",3,"inputValue"],[1,"col-sm-6"],["labelValue","SKU Prefix",3,"inputValue"],["labelValue","SKU Seed",3,"inputValue"],[1,"col-sm-4"],["labelValue","Category Type",3,"inputValue"],["labelValue","Description",3,"inputValue"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square"],["role","button",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-trash"]],template:function(e,o){1&e&&t.YNc(0,Yd,52,22,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,Z.p,c.O5,R.o],styles:[".floating-url[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{background-color:#fff;font-size:.75rem!important;color:#9da2a6;top:-10px!important;padding:0 .25rem;left:.5rem}.floating-url[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem!important;font-size:.875rem;border-radius:.25rem!important;display:flex;align-items:center;color:#0976b4}.floating-url[_ngcontent-%COMP%] > a[_ngcontent-%COMP%] [_ngcontent-%COMP%]:hover{color:#05466b}"]}),n})();const Kd=["fileInput"];function Gd(n,i){if(1&n&&(t.TgZ(0,"div",38),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",e.ctrl.Alert?"alert-success":"alert-danger"),t.xp6(1),t.hij(" ",e.ctrl.Message," ")}}function Rd(n,i){if(1&n&&(t.TgZ(0,"h4",48),t._UZ(1,"i",49),t._uU(2),t.qZA()),2&n){const e=t.oxw(4);t.xp6(2),t.hij(" There is ",e.ctrl.Issues.length," things you could improve your csv ")}}function Bd(n,i){if(1&n&&(t.TgZ(0,"tr",50)(1,"td",51),t._uU(2),t.qZA(),t.TgZ(3,"td",51),t._uU(4),t.qZA(),t.TgZ(5,"td",51),t._uU(6),t.qZA()()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Issue),t.xp6(2),t.hij(" ",e.FirstRow==e.LastRow?e.FirstRow:e.FirstRow+" - "+e.LastRow," "),t.xp6(2),t.Oqu(e.Solution)}}function $d(n,i){if(1&n&&(t.TgZ(0,"div",41),t.YNc(1,Rd,3,1,"h4",42),t.TgZ(2,"table",43)(3,"thead",44)(4,"tr")(5,"th",45),t._uU(6,"Issue"),t.qZA(),t.TgZ(7,"th",46),t._uU(8," Row Number "),t.qZA(),t.TgZ(9,"th"),t._uU(10,"Solution"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,Bd,7,3,"tr",47),t.qZA()()()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",1==e.ctrl.Issues[0].Level),t.xp6(11),t.Q6J("ngForOf",e.ctrl.Issues)}}function jd(n,i){if(1&n&&(t.TgZ(0,"div",39),t.YNc(1,$d,13,2,"div",40),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.ctrl.Issues.length>0)}}const Wd=function(n){return{show:n}};function zd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"a",3),t._UZ(4,"i",4),t._uU(5," Download Sample"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6)(8,"li",7)(9,"a",8),t._uU(10,"Download Sample Serial"),t.qZA()(),t.TgZ(11,"li",7)(12,"a",9),t._uU(13,"Download Sample Composite"),t.qZA()(),t.TgZ(14,"li",7)(15,"a",10),t._uU(16,"Google Sheet"),t.qZA()(),t.TgZ(17,"li",7)(18,"a",11),t._uU(19,"Online Sheet"),t.qZA()()()(),t.TgZ(20,"button",12),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.UploadFileCSV("catalog/product/Upload"))}),t._uU(21),t.qZA()(),t.TgZ(22,"content")(23,"div",13),t.YNc(24,Gd,2,2,"div",14),t.TgZ(25,"div",15)(26,"div",16)(27,"div",17)(28,"h5",18),t._uU(29,"File"),t.qZA(),t.TgZ(30,"i"),t._uU(31,".csv format"),t.qZA()(),t.TgZ(32,"div",19)(33,"input",20,21),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.ctrl.FileToBeUploaded=a)}),t.qZA(),t.TgZ(35,"a",22),t._uU(36,"Learn More"),t.qZA()()()(),t.TgZ(37,"div",23)(38,"div",24)(39,"div",25)(40,"div",26)(41,"h5",18),t._uU(42,"Inventory"),t.qZA(),t.TgZ(43,"i"),t._uU(44,"import options"),t.qZA()(),t.TgZ(45,"div",27)(46,"div",28)(47,"div",29)(48,"label",18),t._uU(49,"Update"),t.qZA(),t.TgZ(50,"i",30),t._uU(51," replace existing inventory count"),t.qZA(),t.TgZ(52,"div",31)(53,"radio-options",32),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.InventoryUpdate=a)}),t.qZA()()()()()(),t.TgZ(54,"div",25)(55,"div",26)(56,"h5",18),t._uU(57,"Advanced"),t.qZA(),t.TgZ(58,"i"),t._uU(59,"more options"),t.qZA()(),t.TgZ(60,"div",27)(61,"div",28)(62,"div",29)(63,"label",18),t._uU(64,"Category"),t.qZA(),t.TgZ(65,"i",30),t._uU(66," import destination"),t.qZA(),t.TgZ(67,"ng-select",33),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.CategoryID=a)}),t.qZA()(),t.TgZ(68,"div",29)(69,"label",18),t._uU(70,"Import Row Range"),t.qZA(),t.TgZ(71,"i",30),t._uU(72," import subset rows for huge dataset"),t.qZA(),t.TgZ(73,"div")(74,"input",34),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.StartRow=a)}),t.qZA(),t._uU(75," - "),t.TgZ(76,"input",34),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.EndRow=a)}),t.qZA()()()(),t.TgZ(77,"div",35)(78,"div",29)(79,"label",18),t._uU(80,"Allow Duplicate SKU "),t.qZA(),t.TgZ(81,"i",30),t._uU(82," file may contain duplicate SKU"),t.qZA(),t.TgZ(83,"div",31)(84,"radio-options",32),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.SKU=a)}),t.qZA()()(),t.TgZ(85,"div",29)(86,"label",18),t._uU(87,"Apply 0 Cost"),t.qZA(),t.TgZ(88,"i",30),t._uU(89," file may contain duplicate SKU"),t.qZA(),t.TgZ(90,"div",31)(91,"radio-options",32),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.CostZeroSupport=a)}),t.qZA()()()()()()()(),t.TgZ(92,"a",36),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.toogle())}),t._uU(93,"More Options"),t.qZA(),t.TgZ(94,"div",28),t.YNc(95,jd,2,1,"div",37),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(21),t.hij(" ",e.ctrl.IgnoreWarning?"Proceed":"Upload"," "),t.xp6(3),t.Q6J("ngIf",null!=e.ctrl.Alert),t.xp6(9),t.Q6J("ngModel",e.ctrl.FileToBeUploaded),t.xp6(4),t.Q6J("ngClass",t.VKq(16,Wd,e.extraOption)),t.xp6(16),t.Q6J("model",e.formData.InventoryUpdate),t.xp6(14),t.Q6J("ngModel",e.formData.CategoryID)("items",e.options.Categories)("clearable",!1),t.xp6(7),t.Q6J("ngModel",e.formData.StartRow),t.xp6(2),t.Q6J("ngModel",e.formData.EndRow),t.xp6(8),t.Q6J("model",e.formData.SKU),t.xp6(7),t.Q6J("model",e.formData.CostZeroSupport),t.xp6(4),t.Q6J("ngIf",e.ctrl.Issues)}}let Xd=(()=>{class n extends q.U{constructor(e,o){super(e,"catalog/ProductLoader/ProductImportLoader",o),this.activatedRoute=o,this.ctrl={IgnoreWarning:!1,Alert:null}}UploadFileCSV(e){if(!confirm(this.formData.InventoryUpdate?"Update Inventory is YES. This is will replace current inventory. Do you want to proceed?":"Update inventory is NO. Do you want to proceed?"))return!1;const a=new FormData,p=JSON.stringify(Object.assign(this.formData,{IgnoreWarning:this.ctrl.IgnoreWarning}));a.append("Data",p),a.append("Info","Customer"),a.append("File",this.fileInput.nativeElement.files[0]),this.httpService.postFormData(`/api/${e}`,a).subscribe({next:g=>{this.ctrl.Alert=g.Success,this.ctrl.Message=g.Message,this.ctrl.Issues=null,this.ctrl.IgnoreWarning=!1},error:g=>{this.ctrl.Alert=g.error.Success,this.ctrl.Message=g.error.Message,this.ctrl.Issues=g.error.Issues,this.ctrl.IgnoreWarning=!0}})}ShowProceed(){return!1}toogle(){this.extraOption=!this.extraOption}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-import-product"]],viewQuery:function(e,o){if(1&e&&t.Gf(Kd,5),2&e){let a;t.iGM(a=t.CRH())&&(o.fileInput=a.first)}},features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn-group","me-4"],["href","https://res.cloudinary.com/pos/raw/upload/v1672116235/POS/xlsx/Products_DealPOS_xlsx.xlsx","matTooltipPosition","above","matTooltip","Download csv sample and edit it with installed Spreadsheet Application",1,"btn","btn-outline-secondary"],["aria-hidden","true",1,"fa-solid","fa-download"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],[1,"dropdown-item"],["href","https://res.cloudinary.com/pos/raw/upload/POS/CSV/Products_Serial_DealPOS.csv","matTooltipPosition","above","matTooltip","Download Sample Serial"],["href","https://res.cloudinary.com/pos/raw/upload/POS/CSV/Products_Composite_DealPOS.csv","matTooltipPosition","above","matTooltip","Download Sample Composite"],["target","_blank","href","http://bit.ly/dealpos-products-template","matTooltipPosition","above","matTooltip","Create & Edit your products database online with Google Sheet"],["href","https://tools.dealpos.app/menu/product/new","target","_blank","matTooltipPosition","above","matTooltip","Create & Edit your products database online with Google Sheet"],[1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-5"],["class","alert ng-binding ng-scope","role","alert",3,"ngClass",4,"ngIf"],[1,"form-horizontal"],[1,"row","border-bottom","mt-10","ms-2",2,"height","60px"],[1,"col-md-2"],[1,"fw-bold","mb-5"],[1,"col-md-6","mb-5"],["type","file","accept",".csv,.xlsx",1,"form-control","form-control-md","bg-light-gray","d-inline",2,"width","305px",3,"ngModel","ngModelChange"],["fileInput",""],["role","button","target","_blank","href","//support.dealpos.com/en/articles/4773747-import-product-list-using-excel-csv-file","matTooltipPosition","above","matTooltip","Import products using CSV file","target","_blank",1,"btn","btn-outline-secondary","ms-4","d-inline","align-items-center"],[1,"row","extra-options","collapse",3,"ngClass"],[1,"container-fluid","form-horizontal"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-sm-6"],[1,"text-secondary"],[1,"form-floating-outline","border","rounded","pt-4","px-5",2,"padding-bottom","10px"],["name","Date Filter",3,"model","modelChange"],["placeholder","Select an Option","id","labelCity","bindLabel","Value","bindValue","Key","appendTo","body",1,"category-select",3,"ngModel","items","clearable","ngModelChange"],["autoNum","",2,"width","20%","padding","7px !important","border","1px solid #C8D3DF",3,"ngModel","ngModelChange"],[1,"row",2,"margin-top","10px"],["data-bs-toggle","collapse",1,"more","float-end",3,"click"],["class","col-md-12",4,"ngIf"],["role","alert",1,"alert","ng-binding","ng-scope",3,"ngClass"],[1,"col-md-12"],["class","mt-5 ng-scope",4,"ngIf"],[1,"mt-5","ng-scope"],["class","ng-binding ng-scope",4,"ngIf"],[1,"table","table-bordered","mt-3"],[1,"text-dark","fw-bold","p-3",2,"background-color","#FCECA3 !important"],[2,"width","200px"],[2,"width","100px"],["class","ng-scope",4,"ngFor","ngForOf"],[1,"ng-binding","ng-scope"],[1,"fa-solid","fa-triangle-exclamation","text-warning"],[1,"ng-scope"],[1,"ng-binding"]],template:function(e,o){1&e&&t.YNc(0,zd,96,18,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[b.gM,Z.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.On,T.w9,F.P,w.b]}),n})();const eu=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Gt=function(n){return{VariantID:n}},nu=function(){return["/menu/Reports/Purchases_Report/History"]};function ou(n,i){if(1&n&&(t.TgZ(0,"div",29)(1,"a",30),t._UZ(2,"i",31),t._uU(3,"\xa0Sales History "),t.qZA(),t._UZ(4,"button",32),t.TgZ(5,"ul",33)(6,"li",34)(7,"a",35),t._uU(8,"Purchase History"),t.qZA()()()()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(4,eu))("queryParams",t.VKq(5,Gt,e.pageData.Filter.ID)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,nu))("queryParams",t.VKq(8,Gt,e.pageData.Filter.ID))}}function au(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",29)(1,"a",36),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"Inventory/GetStockLog",a.data.PageTitle))}),t._UZ(2,"i",37),t._uU(3,"\xa0Export "),t.qZA(),t._UZ(4,"button",32),t.TgZ(5,"ul",33)(6,"li",34)(7,"a",38),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.exportCSV(a.csvConverter,"ReportExport/GetExport","Transaction History All"))}),t._uU(8,"Transaction History"),t.qZA()()()()}}function iu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div")(2,"h6"),t._uU(3,"Order"),t.qZA(),t.TgZ(4,"ng-select",39),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.OrderBy=a)}),t.qZA()(),t.TgZ(5,"div")(6,"h6"),t._uU(7,"Hide Canceled Transaction"),t.qZA(),t.TgZ(8,"radio-options",40),t.NdJ("modelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.HideCancelled=a)}),t.qZA()(),t.TgZ(9,"div")(10,"h6"),t._uU(11,"Variant Log"),t.qZA(),t.TgZ(12,"ng-select",41),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.LogSourceType=a)}),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("clearable",!1)("items",e.sort)("ngModel",e.pageData.Filter.OrderBy),t.xp6(4),t.Q6J("model",e.pageData.Filter.HideCancelled),t.xp6(4),t.Q6J("items",e.pageData.Options.LogSource)("ngModel",e.pageData.Filter.LogSourceType)}}function ru(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Outlet"),t.qZA())}function lu(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1," Price"),t.qZA())}const cu=function(){return["/menu/Outlets/Master/Outlets/Info"]},ht=function(n){return{ID:n}};function su(n,i){if(1&n&&(t.TgZ(0,"td")(1,"a",35),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,cu))("queryParams",t.VKq(4,ht,e.EntityID)),t.xp6(1),t.Oqu(e.Outlet)}}function pu(n,i){if(1&n&&(t.TgZ(0,"small",49),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function du(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3).$implicit;t.xp6(1),t.hij("- ",t.lcZ(2,1,e.PriceDiscount),"%")}}function uu(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"small",53),t._uU(2),t.ALo(3,"number"),t.YNc(4,du,3,3,"span",45),t.qZA(),t.BQk()),2&n){const e=t.oxw(2).$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,2,e.UnitPrice)," "),t.xp6(2),t.Q6J("ngIf",0!=e.PriceDiscount)}}function _u(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3).$implicit;t.xp6(1),t.hij(" - ",t.lcZ(2,1,e.PriceDiscount),"%")}}function mu(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"small",54)(2,"span"),t._uU(3),t.ALo(4,"number"),t.qZA(),t.YNc(5,_u,3,3,"span",45),t.qZA(),t.BQk()),2&n){const e=t.oxw(2).$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,e.UnitCost)),t.xp6(2),t.Q6J("ngIf",0!=e.PriceDiscount)}}function gu(n,i){if(1&n&&(t.TgZ(0,"td",50),t.YNc(1,pu,3,3,"small",52),t.YNc(2,uu,5,4,"ng-container",45),t.YNc(3,mu,6,4,"ng-container",45),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.roleService.product.Cost&&2!=e.SourceTypeID),t.xp6(1),t.Q6J("ngIf",1==e.SourceTypeID&&!o.roleService.sell.PriceVisibleRestriction),t.xp6(1),t.Q6J("ngIf",2==e.SourceTypeID&&o.roleService.product.Cost)}}const fu=function(n){return[n]};function hu(n,i){if(1&n&&(t.TgZ(0,"tr",44),t.YNc(1,su,3,6,"td",45),t.TgZ(2,"td",46),t._uU(3),t.ALo(4,"IsMinDate"),t.qZA(),t.TgZ(5,"td")(6,"a",47),t._uU(7),t.qZA()(),t.TgZ(8,"td"),t._uU(9),t._UZ(10,"br"),t._uU(11),t.qZA(),t.TgZ(12,"td"),t._uU(13),t._UZ(14,"br"),t.TgZ(15,"i"),t._uU(16),t.qZA()(),t.TgZ(17,"td",48),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"td",49),t._uU(21),t.ALo(22,"number"),t.qZA(),t.TgZ(23,"td",50),t._uU(24),t.ALo(25,"number"),t.qZA(),t.YNc(26,gu,4,3,"td",51),t.TgZ(27,"td"),t._uU(28),t.ALo(29,"date"),t._UZ(30,"br"),t._uU(31),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.data.EntityColumnVisible),t.xp6(2),t.Oqu(t.xi3(4,17,e.LogDate,"dd MMM yyyy")),t.xp6(3),t.Q6J("routerLink",t.VKq(29,fu,e.NavUrl))("queryParams",t.VKq(31,ht,e.ReferenceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.hij(" ",e.Name,""),t.xp6(2),t.hij(" ",e.Note," "),t.xp6(2),t.hij(" ",e.SourceTypeLabel," "),t.xp6(2),t.ekj("text-warning",1===e.TypeID),t.xp6(1),t.Oqu(e.Type),t.xp6(2),t.Oqu(0==e.In?"-":t.lcZ(19,20,e.In)),t.xp6(3),t.Oqu(0==e.Out?"-":t.lcZ(22,22,e.Out)),t.xp6(3),t.Oqu(t.lcZ(25,24,e.UnitsInStock)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost||!o.roleService.sell.PriceVisibleRestriction),t.xp6(2),t.hij(" ",t.xi3(29,26,e.EntryDate,"dd MMM yyyy, HH:mm "),""),t.xp6(3),t.hij(" ",e.UserName," ")}}function vu(n,i){1&n&&(t.TgZ(0,"td",55)(1,"b"),t._uU(2,"Total"),t.qZA()())}function xu(n,i){1&n&&(t.TgZ(0,"td",56)(1,"b"),t._uU(2,"Total"),t.qZA()())}const Cu=function(){return["/menu/Products/Catalog/Variants/Info"]};function Tu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Code=a)})("onSubmit",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,ou,9,10,"div",2),t.YNc(3,au,9,0,"div",2),t.TgZ(4,"a",3),t._uU(5,"Back"),t.qZA()(),t.TgZ(6,"filters")(7,"div",4)(8,"div",5)(9,"div")(10,"h6"),t._uU(11,"Outlet"),t.qZA(),t.TgZ(12,"ng-select",6),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.EntityID=a)}),t.qZA()(),t.TgZ(13,"div")(14,"h6"),t._uU(15,"From - To"),t.qZA(),t.TgZ(16,"datepicker",7),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.From=a)}),t.qZA(),t.TgZ(17,"datepicker",8),t.NdJ("dateChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.To=a)}),t.qZA()(),t.TgZ(18,"div")(19,"h6"),t._uU(20,"Page Size"),t.qZA(),t.TgZ(21,"input",9),t.NdJ("ngModelChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.RowCount=a)}),t.qZA()()(),t.YNc(22,iu,13,6,"div",10),t.qZA(),t.TgZ(23,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.more=!a.more)}),t._uU(24,"More "),t._UZ(25,"i",12),t.qZA()(),t.TgZ(26,"content")(27,"div",13)(28,"div",14)(29,"table",15)(30,"thead",16)(31,"tr"),t.YNc(32,ru,2,0,"th",17),t.TgZ(33,"th",18),t._uU(34,"Date"),t.qZA(),t.TgZ(35,"th",19),t._uU(36,"Number"),t.qZA(),t.TgZ(37,"th",19),t._uU(38," Name"),t._UZ(39,"br"),t.TgZ(40,"i"),t._uU(41,"Note"),t.qZA()(),t.TgZ(42,"th",20),t._uU(43," Log Type"),t._UZ(44,"br"),t.TgZ(45,"i"),t._uU(46,"DB Type"),t.qZA()(),t.TgZ(47,"th",21),t._uU(48,"In"),t.qZA(),t.TgZ(49,"th",21),t._uU(50,"Out"),t.qZA(),t.TgZ(51,"th",21),t._uU(52,"Inventory"),t.qZA(),t.YNc(53,lu,2,0,"th",22),t.TgZ(54,"th",18),t._uU(55," Created"),t._UZ(56,"br"),t.TgZ(57,"i"),t._uU(58,"By"),t.qZA()()()(),t.TgZ(59,"tbody"),t.YNc(60,hu,32,33,"tr",23),t.qZA(),t.TgZ(61,"tfoot")(62,"tr"),t.YNc(63,vu,3,0,"td",24),t.YNc(64,xu,3,0,"td",25),t.TgZ(65,"td",26)(66,"b"),t._uU(67),t.ALo(68,"number"),t.ALo(69,"sum"),t.qZA()(),t.TgZ(70,"td",27)(71,"b"),t._uU(72),t.ALo(73,"number"),t.ALo(74,"sum"),t.qZA()()()()()(),t.TgZ(75,"POS-complex-pagination",28),t.NdJ("jumpToPage",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getListData())})("previousPage",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getListData())})("nextPage",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.getListData())}),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Code),t.xp6(2),t.Q6J("ngIf",e.roleService.report.View),t.xp6(1),t.Q6J("ngIf",e.roleService.global.Export),t.xp6(1),t.Q6J("routerLink",t.DdM(33,Cu))("queryParams",t.VKq(34,ht,e.pageData.Filter.ID)),t.xp6(8),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(1),t.Q6J("ngIf",e.more),t.xp6(10),t.Q6J("ngIf",e.data.EntityColumnVisible),t.xp6(21),t.Q6J("ngIf",e.roleService.product.Cost||!e.roleService.sell.PriceVisibleRestriction),t.xp6(7),t.Q6J("ngForOf",e.data.Data),t.xp6(3),t.Q6J("ngIf",e.data.EntityColumnVisible),t.xp6(1),t.Q6J("ngIf",!e.data.EntityColumnVisible),t.xp6(3),t.Oqu(t.lcZ(68,23,t.xi3(69,25,e.data.Data,"In"))),t.xp6(5),t.Oqu(t.lcZ(73,28,t.xi3(74,30,e.data.Data,"Out"))),t.xp6(3),t.Q6J("total",e.data.Data.length)("pageData",e.pageData)}}let Zu=(()=>{class n extends P.n{constructor(e,o,a,r,p){super(e,"Inventory/GetStockLog","InventoryLoader/StockLogLoader",o,r),this.csvConverter=a,this.roleService=p,this.sort=[{ID:0,Name:"Ascending"},{ID:1,Name:"Descending"}],this.pageData.Filter.OrderBy=0}postInit(){this.menuData.H=this.data.PageTitle?this.data.PageTitle:this.menuData.H}preInitList(){this.pageData.Filter.EntityID=this.route.snapshot.queryParams.EntityID}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(v._W),t.Y36(J.O),t.Y36(l.gz),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-log-variant"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["class","btn-group me-4",4,"ngIf"],["matTooltipPosition","above","matTooltip","Back to variant info",1,"btn","btn-success",3,"routerLink","queryParams"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Outlet",1,"outlet",3,"items","ngModel","ngModelChange"],["placeholder","From","appearance","outline","name","From",3,"isFloatingLabel","date","dateChange"],["placeholder","To","appearance","outline","name","To",3,"isFloatingLabel","date","dateChange"],["type","text",3,"ngModel","ngModelChange"],["container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light"],["style","width: 120px",4,"ngIf"],[2,"width","150px"],[2,"width","200px"],[2,"width","100px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 100px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","5","class","text-end",4,"ngIf"],["colspan","4","class","text-end",4,"ngIf"],[1,"text-end","empty-column","text-success",2,"background-color","lemonchiffon"],[1,"text-end","empty-column","text-danger",2,"background-color","lemonchiffon"],["api","Inventory/GetStockLogRowsCount",3,"total","pageData","jumpToPage","previousPage","nextPage"],[1,"btn-group","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-chart-area"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item"],[3,"routerLink","queryParams"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],[2,"cursor","pointer",3,"click"],["bindLabel","Name","bindValue","ID","placeholder","Outlet",1,"outlet",3,"clearable","items","ngModel","ngModelChange"],[3,"model","modelChange"],["bindLabel","Value","bindValue","Key","placeholder","Outlet",1,"outlet",3,"items","ngModel","ngModelChange"],[2,"width","120px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[4,"ngIf"],[1,"text-start"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"d-block","text-end","text-success"],[1,"d-block","text-end","text-danger"],["colspan","5",1,"text-end"],["colspan","4",1,"text-end"]],template:function(e,o){1&e&&t.YNc(0,Tu,76,36,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[l.yS,b.gM,Z.p,c.sg,c.O5,s.Fj,s.JJ,s.On,T.w9,H.QB,F.P,lt.v,c.JJ,c.uU,D.qU,D.$k]}),n})();function bu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.SubmitForm())}),t._uU(1,"Submit"),t.qZA()}}const yu=function(n,i){return{alert:!0,"alert-success":n,"alert-danger":i}},Iu=function(n,i){return{"fas ":!0,"fa-circle-check":n,"fa-circle-exclamation":i}};function Pu(n,i){if(1&n&&(t.TgZ(0,"div",18),t._UZ(1,"span",19)(2,"span",20),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(3,yu,e.alert.Success,!e.alert.Success)),t.xp6(1),t.Q6J("ngClass",t.WLB(6,Iu,e.alert.Success,!e.alert.Success)),t.xp6(1),t.Q6J("innerHtml",e.alert.Message,t.oJD)}}function Mu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"div",7)(2,"h5",8),t._uU(3,"Import"),t.qZA()(),t.TgZ(4,"div",21)(5,"div",10)(6,"div",11)(7,"input",22),t.NdJ("change",function(){t.CHM(e);const a=t.oxw(2);return t.KtG(a.UploadCSV())}),t.qZA()()()()()}}function Au(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"li",23)(1,"div",24)(2,"span",25),t._uU(3),t.qZA(),t._UZ(4,"i",26),t.qZA(),t.TgZ(5,"div",27)(6,"span",28),t._uU(7,"S/N"),t.qZA(),t.TgZ(8,"input",29),t.NdJ("ngModelChange",function(a){const p=t.CHM(e).$implicit;return t.KtG(p.Serial=a)}),t.qZA()()()}if(2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(3),t.hij("#",o+1,""),t.xp6(5),t.Q6J("ngModel",e.Serial)("disabled",!a.roleService.product.Edit)}}const Du=function(){return["/menu/Products/Catalog/Variants/Info"]},Su=function(n){return{ID:n}};function Nu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),t._uU(3,"Return to Product"),t.qZA(),t.YNc(4,bu,2,0,"a",3),t.qZA(),t.TgZ(5,"content")(6,"div",4),t.YNc(7,Pu,3,9,"div",5),t.TgZ(8,"div",6)(9,"div",7)(10,"h5",8),t._uU(11,"Outlet"),t.qZA()(),t.TgZ(12,"div",9)(13,"div",10)(14,"div",11)(15,"ng-select",12),t.NdJ("change",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.changeOutlet(a))}),t.qZA()()()()(),t.YNc(16,Mu,8,0,"div",13),t.TgZ(17,"div",14)(18,"ul",15),t.YNc(19,Au,9,3,"li",16),t.qZA()()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(10,Du))("queryParams",t.VKq(11,Su,e.data.VariantID)),t.xp6(2),t.Q6J("ngIf",e.roleService.product.Edit),t.xp6(3),t.Q6J("ngIf",e.alert.Visible),t.xp6(8),t.Q6J("items",e.options.Entities),t.xp6(1),t.Q6J("ngIf",e.roleService.product.Edit),t.xp6(3),t.Q6J("ngForOf",e.formData.Data)}}let qu=(()=>{class n extends q.U{constructor(e,o,a){super(e,"catalog/VariantLoader/VariantSerialFormLoader",o),this.httpService=e,this.activeRoute=o,this.roleService=a,this.alert={Error:!1,Success:!1,Visible:!1,Message:null}}UploadCSV(){}preSubmitForm(){let e=Object.assign({},this.formData);e.VariantID=this.data.VariantID,this.data.Form=e}changeOutlet(e){this.httpService.post("/API/catalog/VariantLoader/GetVariantSerialForm",{VariantID:this.data.VariantID,EntityID:e.ID}).subscribe(a=>{this.data.Form.Data=a})}SubmitForm(){this.onSubmit("catalog/variant/SubmitSerialVariant")}onSubmitSuccess(e){this.alert.Error=!1,this.alert.Success=!0,this.alert.Visible=!0,this.alert.Message=e.Message}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(l.gz),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-serial-form-variant"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-outline-secondary","me-4",3,"routerLink","queryParams"],["matTooltipPosition","above","matTooltip","Submit","role","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","form-horizontal","pt-4"],["class","alert alert-success",3,"ngClass",4,"ngIf"],[1,"row","border-bottom","mt-10","ms-2",2,"height","50px"],[1,"col-sm-2"],[1,"fw-bold"],[1,"col-sm-6"],[1,"row"],[1,"col-sm-12"],["placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"items","change"],["class","row border-bottom mt-10 ms-2","style","height: 50px;",4,"ngIf"],[1,"ms-5"],[1,"serial","p-0"],["class","mt-8 rounded ms-6 border border-secondary",4,"ngFor","ngForOf"],["matTooltipPosition","above","matTooltip","Submit","role","button",1,"btn","btn-success",3,"click"],[1,"alert","alert-success",3,"ngClass"],["aria-hidden","true",1,"fa-solid","fa-circle-check","me-2",3,"ngClass"],[3,"innerHtml"],[1,"col-sm-10"],["type","file","accept",".csv","ng-file-model","ctrl.FileToBeUploaded",1,"form-control","bg-light-gray",2,"width","400px",3,"change"],[1,"mt-8","rounded","ms-6","border","border-secondary"],[1,"title","clearfix"],[1,"text-center","fw-bold","pt-3"],["aria-hidden","true",1,"fa","fa-barcode","fa-2x","ps-6",2,"transform","scale(2.5,1)"],[1,"txtbox","mt-1"],[1,"pt-4","fw-bold","text-center"],["type","text",1,"mt-4","px-3","py-4","border","border-secondary",3,"ngModel","disabled","ngModelChange"]],template:function(e,o){1&e&&t.YNc(0,Nu,20,13,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData)},dependencies:[l.yS,b.gM,Z.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.On,T.w9],styles:["ul.serial[_ngcontent-%COMP%]{list-style:none}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{float:left;width:195px;height:63px;background:rgb(238,238,238)}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:nth-child(5n+2), ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:nth-child(5n+4){background:rgb(240,225,184)}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > div.title[_ngcontent-%COMP%]{height:25px}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > div.title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{width:43px;height:14px;float:left;background:rgb(71,156,207);font-size:12px;color:#fff;border-top-left-radius:3px}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:nth-child(5n+2) > div.title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:nth-child(5n+4) > div.title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{background:rgb(51,51,51)}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > div.txtbox[_ngcontent-%COMP%]{height:28px}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > div.txtbox[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{float:left;font-size:12px;width:43px;height:14px;color:#666}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > div.txtbox[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{float:left;width:110px;height:18px}ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%] > div.title[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{width:43px;height:24px;float:left;background:rgb(71,156,207);font-size:12px;border-top-left-radius:3px}ng-select[_ngcontent-%COMP%] div.ng-select-container{width:200px}"]}),n})();function wu(n,i){1&n&&t._UZ(0,"th",11),2&n&&t.Q6J("innerHtml",i.$implicit.Name,t.oJD)}function Uu(n,i){if(1&n&&(t.TgZ(0,"thead",7)(1,"tr")(2,"th",8),t._uU(3,"Model"),t.qZA(),t.YNc(4,wu,1,1,"th",9),t.TgZ(5,"th",10),t._uU(6,"Total"),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.Entity)}}function Ou(n,i){if(1&n&&(t.TgZ(0,"td",10),t._uU(1),t.ALo(2,"find"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit;let a;t.xp6(1),t.Oqu(null==(a=t.Dn7(2,1,o.Outlet,"EntityID",e.ID))?null:a.Stock)}}function Ju(n,i){if(1&n&&(t.TgZ(0,"tr",12)(1,"td"),t._uU(2),t.qZA(),t.YNc(3,Ou,3,5,"td",13),t.TgZ(4,"td",10),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Model),t.xp6(1),t.Q6J("ngForOf",o.data.Entity),t.xp6(2),t.Oqu(t.lcZ(6,3,e.Total))}}function Vu(n,i){if(1&n&&(t.TgZ(0,"td",10),t._uU(1),t.ALo(2,"sum"),t.ALo(3,"GetChildrenArray"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(1),t.Oqu(t.gM2(2,1,t.xi3(3,6,o.data.Data,"Outlet"),"Stock","EntityID",e.ID))}}function ku(n,i){if(1&n&&(t.TgZ(0,"tfoot",14)(1,"tr")(2,"td",15),t._uU(3,"Total"),t.qZA(),t.YNc(4,Vu,4,9,"td",13),t.TgZ(5,"td",10),t._uU(6),t.ALo(7,"number"),t.ALo(8,"sum"),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.Entity),t.xp6(2),t.Oqu(t.lcZ(7,2,t.xi3(8,4,e.data.Data,"Total")))}}function Fu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSelect",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.selectItem(a))})("onSubmit",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.searchFromPageOne())}),t.TgZ(1,"content")(2,"div",2)(3,"table",3),t.NdJ("matSortChange",function(a){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(a))}),t.YNc(4,Uu,7,1,"thead",4),t.TgZ(5,"tbody"),t.YNc(6,Ju,7,5,"tr",5),t.qZA(),t.YNc(7,ku,9,7,"tfoot",6),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.ProductName)("filterAutoComplete",!0)("requestUrl","/API/AC/GetProductSuggestionByCodeNName")("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(4),t.Q6J("ngIf",e.data.Data),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data)}}const Qu=[{path:"Catalog/Categories",component:wd},{path:"Catalog/Categories/Form",component:Vd},{path:"Catalog/Categories/Info",component:Hd},{path:"Catalog/Products",component:Fe},{path:"Catalog/Products/Form",component:po},{path:"Catalog/Products/Info",component:Eo},{path:"Catalog/Products/Import",component:Xd},{path:"Catalog/Products/Inventory",component:(()=>{class n extends P.n{constructor(e,o,a,r){super(o,"catalog/product/GetEntityStock","catalog/ProductLoader/EntityStockLoader",null,e),this.activeRoute=e,this.httpService=o,this.location=a,this.router=r}selectItem(e){const o=JSON.parse(e);this.pageData.Filter.ProductName=o.Value,this.pageData.Filter.ProductID=o.Key;const a=this.router.createUrlTree([],{relativeTo:this.activeRoute,queryParams:{ID:this.pageData.Filter.ProductID}}).toString();this.location.go(a),this.searchFromPageOne()}postInit(){this.menuData.H=`${this.pageData.Filter.ProductName} Inventory`,this.originalStock=this.data.Data}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const p="asc"===e.direction;return this.compare(a[e.active].toLocaleLowerCase(),r[e.active].toLocaleLowerCase(),p)}):this.originalStock}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(l.gz),t.Y36(m.O),t.Y36(c.Ye),t.Y36(l.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-inventory-product"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","filterAutoComplete","requestUrl","hideSearchBox","hideSearchDropdown","onSelect","onSubmit",4,"ngIf"],[3,"pageData","text","filterAutoComplete","requestUrl","hideSearchBox","hideSearchDropdown","onSelect","onSubmit"],[1,"container-fluid","pt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],["class","thead-light",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["class","table-footer",4,"ngIf"],[1,"thead-light"],["mat-sort-header","Model",2,"width","90px"],["style","width: 90px","class","text-end",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end",2,"width","90px",3,"innerHtml"],[1,"border-bottom"],["class","text-end",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-start"]],template:function(e,o){1&e&&t.YNc(0,Fu,8,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[Z.p,c.sg,c.O5,S.YE,S.nU,c.JJ,D.qU,D.Z0,D.J1]}),n})()},{path:"Catalog/Variants",component:ma},{path:"Catalog/Variants/Form",component:bi},{path:"Catalog/Variants/Info",component:Ms},{path:"Catalog/Variants/Log",component:Zu},{path:"Catalog/Variants/Serial_Form",component:qu},{path:"Add-Ons/Variant_History",component:Ls},{path:"Price_Editor/Custom_Outlet_Price",component:tp},{path:"Setup/Brand",component:pp},{path:"Setup/Brand/Brand_Form",component:Xp},{path:"Setup/Measurement",component:Cp},{path:"Setup/Measurement/Form",component:od},{path:"Setup/Tags",component:Sp},{path:"Setup/Tags/Tags_Form",component:ld},{path:"Setup/UOM",component:Qp},{path:"Setup/UOM/Form",component:dd},{path:"Setup/Storages",component:$p},{path:"Setup/Storages/Form",component:hd},{path:"Setup/Storages/Info",component:Td},{path:"",redirectTo:"Catalog/Products",pathMatch:"full"}];let Lu=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[l.Bz.forChild(Qu),l.Bz]}),n})();var Eu=d(46510),Yu=d(7155),Hu=d(99602),Rt=d(3238),Ku=d(44144),Gu=d(3848),Ru=d(90811),Bu=d(65131),$u=d(35355),ju=d(94673);let Wu=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[O.Y],imports:[Y.xc,gt.vI,$u.V,U._t,b.AV,Z.R,c.ez,D.dr,Lu,M.d,Eu.Z,s.u5,s.UX,Hu.FA,Rt.XK,$.Fk,Ku.c,Rt.Ng,Gu.Nh,et.TU,Ru.vV,T.A0,S.JX,Yu.p0,H.ZU,F.K,Bu.X,G.Hi,E.Q,lt.T,R.F,S.JX,ju.z,ut.O,Zn]}),n})()},3077:(rt,k,d)=>{d.d(k,{T:()=>u,v:()=>y});var c=d(36895),l=d(94650),A=d(24006),P=d(89156);function C(h,_){if(1&h&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&h){const f=l.oxw();l.xp6(1),l.AsE(" Showing ",f.pageData.Filter.PageNumber*f.total-f.total+1," - ",f.pageData.Filter.PageNumber*f.total," ")}}function I(h,_){if(1&h&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&h){const f=l.oxw();l.xp6(1),l.AsE(" Showing ",f.pageData.Filter.RowCount*f.pageData.Filter.PageNumber-f.pageData.Filter.RowCount+1," - ",f.pageData.Filter.RowCount*f.pageData.Filter.PageNumber-f.pageData.Filter.RowCount+f.total," ")}}function t(h,_){if(1&h){const f=l.EpF();l.TgZ(0,"span",8),l.NdJ("click",function(){l.CHM(f);const v=l.oxw();return l.KtG(v.StoreRowsCountAPIResult())}),l.TgZ(1,"i",9),l._uU(2,"?"),l.qZA()()}}function M(h,_){if(1&h&&(l.TgZ(0,"span"),l._uU(1),l.ALo(2,"number"),l.qZA()),2&h){const f=l.oxw();l.xp6(1),l.hij(" of ",l.lcZ(2,1,f.listTotal),"")}}function s(h,_){if(1&h){const f=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(f);const v=l.oxw();return l.KtG(v.onPreviousPage())}),l._UZ(1,"i",11),l._uU(2," Previous"),l.qZA()}}function T(h,_){if(1&h){const f=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(f);const v=l.oxw();return l.KtG(v.onNextPage())}),l._UZ(1,"i",12),l._uU(2," Next"),l.qZA()}}let y=(()=>{class h{constructor(f){this.httpService=f,this.jumpToPage=new l.vpe,this.previousPage=new l.vpe,this.nextPage=new l.vpe,this.pageNumber=1,this.showingNumber=this.pageNumber,this.listTotal=-1}onJumpToPage(f){"Enter"===f.key&&(this.pageData.Filter.PageNumber=this.pageNumber,this.showingNumber=this.pageNumber,this.jumpToPage.emit())}onPreviousPage(){this.pageData.Filter.PageNumber-=1,this.pageNumber=this.pageData.Filter.PageNumber,this.showingNumber=this.pageNumber,this.previousPage.emit()}onNextPage(){this.pageData.Filter.PageNumber+=1,this.pageNumber=this.pageData.Filter.PageNumber,this.showingNumber=this.pageNumber,this.nextPage.emit()}StoreRowsCountAPIResult(){this.httpService.post("/api/"+this.api,JSON.stringify(this.pageData.Filter)).subscribe(f=>{this.listTotal=f.Count?f.Count:f,this.pageData.HideStoreApiCount=!0})}}return h.\u0275fac=function(f){return new(f||h)(l.Y36(P.O))},h.\u0275cmp=l.Xpm({type:h,selectors:[["POS-complex-pagination"]],inputs:{pageData:"pageData",total:"total",api:"api"},outputs:{jumpToPage:"jumpToPage",previousPage:"previousPage",nextPage:"nextPage"},decls:12,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[4,"ngIf"],["style","cursor: pointer",3,"click",4,"ngIf"],["type","text","autoNum","","autoNum","",1,"text-end",2,"width","45px",3,"ngModel","keyup","ngModelChange"],[1,"btn-group"],["class","btn btn-outline-secondary btn-sm text-primary",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],[1,"border","p-3"],[1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-left"],[1,"fa-solid","fa-arrow-right"]],template:function(f,m){1&f&&(l.TgZ(0,"div",0)(1,"div",1)(2,"div",2),l.YNc(3,C,2,2,"span",3),l.YNc(4,I,2,2,"span",3),l.YNc(5,t,3,0,"span",4),l.YNc(6,M,3,3,"span",3),l._uU(7," records ~ Page "),l.TgZ(8,"input",5),l.NdJ("keyup",function(J){return m.onJumpToPage(J)})("ngModelChange",function(J){return m.pageNumber=J}),l.qZA()()(),l.TgZ(9,"div",6),l.YNc(10,s,3,0,"a",7),l.YNc(11,T,3,0,"a",7),l.qZA()()),2&f&&(l.xp6(3),l.Q6J("ngIf",m.pageData.Filter.RowCount==m.total),l.xp6(1),l.Q6J("ngIf",m.pageData.Filter.RowCount!=m.total),l.xp6(1),l.Q6J("ngIf",!m.pageData.HideStoreApiCount),l.xp6(1),l.Q6J("ngIf",m.pageData.HideStoreApiCount),l.xp6(2),l.Q6J("ngModel",m.pageNumber),l.xp6(2),l.Q6J("ngIf",1!=m.pageData.Filter.PageNumber),l.xp6(1),l.Q6J("ngIf",m.total>=m.pageData.Filter.RowCount))},dependencies:[c.O5,A.Fj,A.JJ,A.On,c.JJ]}),h})(),u=(()=>{class h{}return h.\u0275fac=function(f){return new(f||h)},h.\u0275mod=l.oAB({type:h}),h.\u0275inj=l.cJS({imports:[c.ez,A.u5,A.UX]}),h})()},19835:(rt,k,d)=>{d.d(k,{i:()=>M});var c=d(84080),l=d(94650),A=d(36895);function P(s,T){1&s&&l.GkF(0)}const C=function(s,T){return{"tooltip-container-bottom":s,"tooltip-container-top":T}};let I=(()=>{class s{}return s.\u0275fac=function(y){return new(y||s)},s.\u0275cmp=l.Xpm({type:s,selectors:[["POS-tooltip"]],inputs:{text:"text",position:"position",content:"content"},decls:3,vars:6,consts:[[3,"ngClass"],[4,"ngTemplateOutlet"]],template:function(y,u){1&y&&(l.TgZ(0,"div",0),l._uU(1),l.YNc(2,P,1,0,"ng-container",1),l.qZA()),2&y&&(l.Q6J("ngClass",l.WLB(3,C,"top"==u.position||!u.position,"bottom"==u.position)),l.xp6(1),l.hij(" ",u.text," "),l.xp6(1),l.Q6J("ngTemplateOutlet",u.content))},dependencies:[A.mk,A.tP],styles:['.tooltip-container-top[_ngcontent-%COMP%]{box-shadow:0 0 5px #0003;margin:.7rem 1rem 1rem;min-width:50px;max-width:400px;background:#fff;border:1px solid #ccc;pointer-events:none;position:relative;min-height:1rem;padding:.5rem;border-radius:4px}.tooltip-container-top[_ngcontent-%COMP%]:after, .tooltip-container-top[_ngcontent-%COMP%]:before{content:"";display:block;position:absolute;bottom:100%;width:0;height:0;border-style:solid}.tooltip-container-top[_ngcontent-%COMP%]:after{left:calc(49% + 2px);border-color:transparent transparent #fff transparent;border-width:6px}.tooltip-container-top[_ngcontent-%COMP%]:before{left:49%;border-color:transparent transparent #ccc transparent;border-width:8px}.tooltip-container-bottom[_ngcontent-%COMP%]{box-shadow:0 0 5px #0003;margin:.7rem 1rem 1rem;min-width:50px;max-width:400px;background:#fff;border:1px solid #ccc;pointer-events:none;position:relative;min-height:1rem;padding:.5rem;border-radius:4px}.tooltip-container-bottom[_ngcontent-%COMP%]:after, .tooltip-container-bottom[_ngcontent-%COMP%]:before{content:"";display:block;position:absolute;bottom:100%;width:0;height:0;border-style:solid}.tooltip-container-bottom[_ngcontent-%COMP%]:after{left:calc(40% + 2px);border-color:#fff transparent transparent transparent;border-width:6px;top:100%}.tooltip-container-bottom[_ngcontent-%COMP%]:before{left:40%;border-color:#ccc transparent transparent transparent;border-width:8px;top:100%}']}),s})();var t=d(98184);let M=(()=>{class s{constructor(y,u,h){this.overlayPositionBuilder=y,this.elementRef=u,this.overlay=h}ngOnInit(){let y=this.initPosition();const u=this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([y]);this.overlayRef=this.overlay.create({positionStrategy:u})}initPosition(){let y={originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"};return"top"===this.position&&(y={originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"}),y}show(){if(this.content){this.overlayRef.detach();const y=new c.C5(I),u=this.overlayRef.attach(y);"string"==typeof this.content?u.instance.text=this.content:u.instance.content=this.content,u.instance.position=this.position}}hide(){this.overlayRef.detach()}}return s.\u0275fac=function(y){return new(y||s)(l.Y36(t.wJ),l.Y36(l.SBq),l.Y36(t.aV))},s.\u0275dir=l.lG2({type:s,selectors:[["","customTooltip",""]],hostBindings:function(y,u){1&y&&l.NdJ("mouseenter",function(){return u.show()})("mouseleave",function(){return u.hide()})},inputs:{content:["customTooltip","content"],position:"position"}}),s})()},94673:(rt,k,d)=>{d.d(k,{z:()=>C});var c=d(24006),l=d(98184),A=d(36895),P=d(94650);let C=(()=>{class I{}return I.\u0275fac=function(M){return new(M||I)},I.\u0275mod=P.oAB({type:I}),I.\u0275inj=P.cJS({imports:[A.ez,c.u5,l.U8]}),I})()}}]);
|