dealpos 12.0.4 → 12.0.5
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.ef400ef628eb99d7.js +1 -0
- package/POS/{2668.9b58d3e1fa4ffc3c.js → 2668.b58d9c43b6c352e2.js} +1 -1
- package/POS/3894.87776d3a2efc08de.js +1 -0
- package/POS/{4205.76e7666742064185.js → 4205.e8691a888fd9174c.js} +1 -1
- package/POS/{4694.5c625b5425af945c.js → 4694.21f79e1673580b65.js} +1 -1
- package/POS/4941.1fffd34d750d9e6c.js +1 -0
- package/POS/{5471.4b5bea86a7259686.js → 5471.a8f59fd4e4e69b96.js} +1 -1
- package/POS/6972.d3f6e56adcff8ace.js +1 -0
- package/POS/7298.08f826d1b775db8a.js +1 -0
- package/POS/7767.020060094126f448.js +1 -0
- package/POS/8094.c2a28367527c607a.js +1 -0
- package/POS/8105.52be4684ec569b64.js +1 -0
- package/POS/index.html +2 -2
- package/POS/{main.aeb8a61c70968822.js → main.3ea008bcdc1f8c18.js} +1 -1
- package/POS/{runtime.059a88194041ec90.js → runtime.efb75aba8aa83695.js} +1 -1
- package/package.json +1 -1
- package/POS/2312.945cbaad72d2f8d8.js +0 -1
- package/POS/3894.5eddee623597ca86.js +0 -1
- package/POS/4941.644a1c4024c49471.js +0 -1
- package/POS/6972.1215ce1afa633a1e.js +0 -1
- package/POS/7298.2ba647fa096d8149.js +0 -1
- package/POS/7767.d46c10206e3461c1.js +0 -1
- package/POS/8094.425eede93123c5b2.js +0 -1
- package/POS/8105.6b04a0e7820b0dd4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[2312],{62312:(it,k,d)=>{d.r(k),d.d(k,{ProductModule:()=>Xu});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),g=d(54004),m=d(89156),v=d(10266),U=d(71948),N=d(83902);function Rt(n,i){if(1&n&&(t.TgZ(0,"ng-conntainer")(1,"span",11),t._uU(2),t.ALo(3,"number"),t.ALo(4,"async"),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(t.lcZ(3,1,t.lcZ(4,3,e.totalRowCount$)))}}function Bt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"span",21)(1,"i",22),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.onShowTotal())}),t._uU(2,"?"),t.qZA()()}}let $t=(()=>{class n{constructor(e,o,a){this.data=e,this.dialogRef=o,this.httpService=a,this.pageNumber=1,this.pageSize=1e4,this.startExport=1,this.isShowTotal=!1,this.totalCount=1e4,this.isExportCsv=!0,this.modalConfig=new I.O,this.modalConfig.title=e.title,this.modalConfig.headerType=_.n.Success}ngOnInit(){this.countExportRowCount()}onPageNumberChange(e){this.pageNumber=e,this.countExportRowCount()}exportCSV(){this.dialogRef.close(1)}ExportXlsx(){this.dialogRef.close(2)}countExportRowCount(){let e=1e4;this.pageNumber>1?(this.endExport=this.totalCount-this.pageNumber*e>0?this.pageNumber*e:this.totalCount,this.startExport=this.pageNumber-1==1?e+1:(this.pageNumber-1)*e+1,this.startExport>this.totalCount&&(this.startExport=this.totalCount)):(this.startExport=this.pageNumber,this.endExport=this.totalCount>e?e:this.totalCount)}onShowTotal(){this.isShowTotal=!0,this.totalRowCount$=this.httpService.post("/api/catalog/product/ProductRowsCount",{}).pipe((0,g.U)(e=>(this.totalCount=e.Count,this.countExportRowCount(),e.Count)))}onSave(){this.dialogRef.close({pageSize:this.pageSize,pageNumber:this.pageNumber,isExportCsv:this.isExportCsv})}onCancel(){this.dialogRef.close("CANCEL")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(C.WI),t.Y36(C.so),t.Y36(m.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-modal-export-product"]],decls:37,vars:16,consts:[[3,"config","onCancel","onOk"],[1,"container-fluid"],[1,"row","border","p-4","border-secondary"],[1,"col-12","ps-0","d-flex","justify-content-center"],["aria-label","Select an option",3,"ngModel","ngModelChange"],[1,"me-4",3,"value"],[1,"fa-solid","fa-file-csv","me-1","fs-4"],[3,"value"],[1,"fa-solid","fa-file-excel","me-1","fs-4"],[1,"row","mt-8"],[1,"col-6","ps-0","pe-3"],[1,"fw-bold"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","pe-0","ps-3"],[1,"border","border-2","border-secondary","ps-3","pt-3","bg-light",2,"height","32px"],[1,"row","mt-4"],[1,"col-12","p-0"],[1,"border","border-1","ps-3","pt-3","alert-warning",2,"height","32px"],[1,"fa-solid","fa-circle-info","me-1"],[4,"ngIf","ngIfElse"],["MARK_QUESTION",""],[2,"cursor","pointer"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","py-1","px-3",3,"click"]],template:function(e,o){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return o.dialogRef.close()})("onOk",function(){return o.onSave()}),t.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"mat-radio-group",4),t.NdJ("ngModelChange",function(r){return o.isExportCsv=r}),t.TgZ(6,"mat-radio-button",5),t._UZ(7,"i",6),t._uU(8," Export CSV "),t.qZA(),t.TgZ(9,"mat-radio-button",7),t._UZ(10,"i",8),t._uU(11," Export XLSX "),t.qZA()()()(),t.TgZ(12,"div",9)(13,"div",10)(14,"label",11),t._uU(15,"Page Number"),t.qZA(),t.TgZ(16,"input",12),t.NdJ("ngModelChange",function(r){return o.pageNumber=r})("ngModelChange",function(r){return o.onPageNumberChange(r)}),t.qZA()(),t.TgZ(17,"div",13)(18,"label",11),t._uU(19,"Page Size"),t.qZA(),t.TgZ(20,"div",14),t._uU(21),t.ALo(22,"number"),t.qZA()()(),t.TgZ(23,"div",15)(24,"div",16)(25,"div",17),t._UZ(26,"i",18),t._uU(27," Exporting ["),t.TgZ(28,"span",11),t._uU(29),t.ALo(30,"number"),t.ALo(31,"number"),t.qZA(),t._uU(32,"] record of "),t.YNc(33,Rt,5,5,"ng-conntainer",19),t.YNc(34,Bt,3,0,"ng-template",null,20,t.W1O),t._uU(36," transactions "),t.qZA()()()()()()),2&e){const a=t.MAs(35);t.Q6J("config",o.modalConfig),t.xp6(5),t.Q6J("ngModel",o.isExportCsv),t.xp6(1),t.Q6J("value",!0),t.xp6(3),t.Q6J("value",!1),t.xp6(7),t.Q6J("ngModel",o.pageNumber),t.xp6(5),t.hij(" ",t.lcZ(22,10,o.pageSize),""),t.xp6(8),t.AsE("",t.lcZ(30,12,o.startExport)," - ",t.lcZ(31,14,o.endExport),""),t.xp6(4),t.Q6J("ngIf",o.isShowTotal)("ngIfElse",a)}},dependencies:[v.gM,c.O5,M.M,s.Fj,s.JJ,s.On,U.VQ,U.U0,N.b,c.Ov,c.JJ]}),n})();var H=d(39300),b=d(97185),K=d(24424),x=d(51161),Z=d(30273),G=d(24537),F=d(11594),rt=d(3077),D=d(93669);function jt(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 Wt(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Price"),t.qZA())}function zt(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 ht=function(n){return{width:n}};function Xt(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,ht,o.data.ThumbnailWidth+"px")),t.Q6J("src",e.ThumbnailUrl,t.LSH)}}const vt=function(){return["/menu/Products/Catalog/Products/Info"]},lt=function(n){return{ID:n}};function te(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,vt))("queryParams",t.VKq(6,lt,e.ID)),t.xp6(1),t.Akn(t.VKq(8,ht,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 ee(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 ne(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 oe(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"i",26),t._uU(2),t.qZA(),t.YNc(3,ne,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 ae=function(){return["/menu/Products/Catalog/Variants/Info"]},xt=function(n){return{"text-decoration-line-through":n}};function ie(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,oe,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,ae))("queryParams",t.VKq(9,lt,e.ID)),t.xp6(1),t.Tol(t.VKq(11,xt,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 re(n,i){if(1&n&&(t.TgZ(0,"ul",27),t.YNc(1,ie,7,13,"li",28),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",e.Variants)}}function le(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 ce(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,zt,2,1,"td",3),t.TgZ(2,"td")(3,"div",13)(4,"div",14),t.YNc(5,Xt,2,5,"ng-container",15),t.ynx(6),t.YNc(7,te,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,ee,5,6,"i",19),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.qZA(),t.TgZ(16,"td"),t.YNc(17,re,2,1,"ul",20),t.qZA(),t.YNc(18,le,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,xt,e.Discontinued)),t.Q6J("routerLink",t.DdM(20,vt))("queryParams",t.VKq(21,lt,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 se=(()=>{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,jt,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,Wt,2,0,"th",7),t.TgZ(13,"th",8),t._uU(14,"Released"),t.qZA()()(),t.TgZ(15,"tbody"),t.YNc(16,ce,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,v.gM,c.sg,c.O5,s.Wl,s.JJ,s.On,c.JJ,c.uU,D.qU,D.Mj],changeDetection:0}),n})();function pe(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 de(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 ue(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 _e=function(){return["/menu/Products/Catalog/Products/Import"]};function me(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,_e))}function ge(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 fe(n,i){1&n&&t._UZ(0,"button",31)}function he(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 ve=function(){return["/menu/Products/Catalog/Products/Form"]};function xe(n,i){1&n&&(t.TgZ(0,"a",35),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,ve))}function Ce(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 Te(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,Ce,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 Ze(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 be=function(n){return{show:n}};function ye(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,Ze,4,2,"div",47),t.qZA()}if(2&n){const e=t.oxw(2);t.Tol(t.VKq(7,be,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 Ie=function(n){return{width:n}};function Pe(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,Ie,o.data.ThumbnailWidth+"px")),t.s9C("src",e.ThumbnailUrl,t.LSH)}}const Ct=function(){return["/menu/Products/Catalog/Products/Info"]},ct=function(n){return{ID:n}};function Me(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,Ct))("queryParams",t.VKq(5,ct,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 Ae(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 De(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 Se(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 Ne(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 qe(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"i",64),t._uU(2),t.qZA(),t.YNc(3,Ne,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 we=function(){return["/menu/Products/Catalog/Variants/Info"]};function Ue(n,i){if(1&n&&(t.TgZ(0,"li",61)(1,"a",62),t.YNc(2,De,3,1,"span",47),t.YNc(3,Se,2,1,"span",47),t.qZA(),t.TgZ(4,"small",63),t._uU(5),t.qZA(),t.YNc(6,qe,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,we))("queryParams",t.VKq(8,ct,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 Oe(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 Je=function(n){return{"text-decoration-line-through":n}};function Ve(n,i){if(1&n&&(t.TgZ(0,"div",50),t.YNc(1,Pe,2,7,"a",51),t.YNc(2,Me,2,7,"a",52),t.TgZ(3,"div",53)(4,"a",54),t._uU(5),t.qZA(),t.YNc(6,Ae,2,1,"small",47),t.TgZ(7,"ul",55),t.YNc(8,Ue,7,10,"li",56),t.qZA()(),t.YNc(9,Oe,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,Je,e.Discontinued)),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(13,Ct))("queryParams",t.VKq(14,ct,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 ke(n,i){if(1&n&&(t.TgZ(0,"div",48),t.YNc(1,Ve,10,16,"div",49),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function Fe(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,pe,3,0,"a",2),t.YNc(3,de,3,0,"a",3),t.YNc(4,ue,3,0,"a",4),t.TgZ(5,"div",5),t.YNc(6,me,3,2,"a",6),t.YNc(7,ge,3,0,"a",7),t.YNc(8,fe,1,0,"button",8),t.YNc(9,he,37,0,"ul",9),t.qZA(),t.YNc(10,xe,2,2,"a",10),t.qZA(),t.TgZ(11,"filters")(12,"div",11),t.YNc(13,Te,18,8,"div",12),t.YNc(14,ye,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,ke,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 Qe=BiggerPicture({target:document.body});let Le=(()=>{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($t,{data:{title:"Export Products"},width:"400px"}).afterClosed().pipe((0,H.h)(o=>"CANCEL"!==o)).subscribe(o=>{this.pageData.Filter.ExportPageNumber=o.pageNumber,this.pageData.Filter.ExportRowCount=o.pageSize,o.isExportCsv?this.exportCSV(this.csvConverter,"ProductExport/ExportProductList","Product.csv"):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,f=o.map(q=>q.ID);this.postData(e,{ID:p,List:f})}})}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);Qe.open({items:[o],intro:"fadeup"})}catch(o){alert(o)}})()}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(m.O),t.Y36(b._W),t.Y36(K.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,Fe,24,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,v.gM,Z.p,c.sg,c.O5,s.JJ,s.On,T.w9,T.ir,G.QB,F.P,rt.v,se,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 O=d(41206),Tt=d(29521),w=d(88651),V=d(16571),st=d(77579),Ee=d(54968),Ye=d(78372),pt=d(82722);let He=(()=>{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})(),Zt=(()=>{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})();function Ke(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 Ge(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,Ke,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 Re(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 R=function(n){return{selected:n}},Be=function(n){return{"Choose UOM":n}};function $e(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,Re,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,R,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,R,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,Be,e.IsEmpty(e.item.UOM))),t.xp6(4),t.Tol(t.VKq(27,R,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 je=(()=>{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,Ge,35,7,"ng-container",6),t.YNc(10,$e,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,R,"GENERAL"==o.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(7,R,"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,N.b]}),n})();var bt=d(22414),J=d(10805),We=d(59549),S=d(96308),B=d(77331),E=d(58393),dt=d(54825),ze=d(91795),Q=d(37340),L=d(19592),Y=d(74369),X=d(60982);const Xe=["container"],tn=["focusInput"],en=["filter"],nn=["tree"];function on(n,i){1&n&&t.GkF(0)}const an=function(n,i){return{$implicit:n,placeholder:i}};function rn(n,i){if(1&n&&(t.ynx(0),t.YNc(1,on,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,an,e.value,e.placeholder))}}function ln(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 cn(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 sn(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 pn(n,i){if(1&n&&(t.YNc(0,cn,3,1,"div",15),t.YNc(1,sn,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 dn(n,i){if(1&n&&(t.YNc(0,ln,2,1,"ng-container",7),t.YNc(1,pn,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 un(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 _n(n,i){1&n&&t.GkF(0)}function mn(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 gn(n,i){1&n&&t.GkF(0)}function fn(n,i){if(1&n&&t.YNc(0,gn,1,0,"ng-container",34),2&n){const e=t.oxw(3);t.Q6J("ngTemplateOutlet",e.emptyTemplate)}}function hn(n,i){1&n&&(t.ynx(0),t.YNc(1,fn,1,1,"ng-template",33),t.BQk())}function vn(n,i){1&n&&t.GkF(0)}const xn=function(n,i){return{showTransitionParams:n,hideTransitionParams:i}},Cn=function(n){return{value:"visible",params:n}},yt=function(n,i){return{$implicit:n,options:i}},Tn=function(n){return{"max-height":n}};function Zn(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,_n,1,0,"ng-container",13),t.YNc(3,mn,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,hn,2,0,"ng-container",16),t.qZA()(),t.YNc(8,vn,1,0,"ng-container",13),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("@overlayAnimation",t.VKq(24,Cn,t.WLB(21,xn,e.showTransitionOptions,e.hideTransitionOptions))),t.xp6(2),t.Q6J("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",t.WLB(26,yt,e.value,e.options)),t.xp6(1),t.Q6J("ngIf",e.filter),t.xp6(1),t.Q6J("ngStyle",t.VKq(29,Tn,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,yt,e.value,e.options))}}const bn={provide:s.JU,useExisting:(0,t.Gpc)(()=>It),multi:!0};let It=(()=>{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(J.b4),t.Y36(t.sBO),t.Y36(t.SBq),t.Y36(J.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["p-treeSelect"]],contentQueries:function(e,o,a){if(1&e&&t.Suo(a,J.jx,4),2&e){let r;t.iGM(r=t.CRH())&&(o.templates=r)}},viewQuery:function(e,o){if(1&e&&(t.Gf(Xe,5),t.Gf(tn,5),t.Gf(en,5),t.Gf(nn,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([bn])],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,rn,2,5,"ng-container",7),t.YNc(8,dn,3,2,"ng-template",null,8,t.W1O),t.qZA(),t.YNc(10,un,1,0,"i",9),t.qZA(),t.TgZ(11,"div",10),t._UZ(12,"span",11),t.qZA(),t.YNc(13,Zn,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,J.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})(),yn=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[c.ez,ze.T,J.m8,Y.xc,J.m8,Y.xc]}),n})();function In(n,i){1&n&&(t.TgZ(0,"span",51),t._uU(1," Name required."),t.qZA())}function Pn(n,i){1&n&&(t.TgZ(0,"span",51),t._uU(1," Product name + code combination already exists"),t.qZA())}function Mn(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 An(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 Dn(n,i){1&n&&(t.TgZ(0,"div",72),t._uU(1,"Main Image"),t.qZA())}function Sn(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,f=t.oxw(3);return t.KtG(f.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,Dn,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 Nn(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,Sn,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 qn(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 wn(n,i){1&n&&(t.TgZ(0,"span",88),t._uU(1,"[override all variants price]"),t.qZA())}const Un=function(n){return{"mb-4":n}};function On(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,qn,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,wn,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,Un,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 Jn(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 Vn(n,i){1&n&&(t.TgZ(0,"th",122),t._uU(1,"UnitCost "),t.qZA())}function kn(n,i){1&n&&(t.TgZ(0,"th",123),t._uU(1,"Ratio"),t.qZA())}function Fn(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 Qn(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 Ln(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 En(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 Yn=function(n){return{"text-decoration":n}};function Hn(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,f=t.oxw(4);return t.KtG(f.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,Fn,2,1,"span",118),t.qZA(),t.YNc(7,Qn,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,Ln,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,En,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,Yn,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 Kn(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 Gn(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,Vn,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,kn,2,0,"th",115),t.qZA()(),t.TgZ(19,"tbody"),t.YNc(20,Hn,21,22,"tr",116),t.qZA(),t.TgZ(21,"tfoot")(22,"tr"),t._UZ(23,"td",117),t.YNc(24,Kn,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 Rn=function(n,i){return{"mb-6":n,"mb-3":i}},Bn=function(n){return{"text-danger":n}};function $n(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,Jn,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,Gn,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,Rn,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,Bn,o.statVariantAdd.length>0))("matChipInputSeparatorKeyCodes",o.separatorKeysCodes)("matChipInputAddOnBlur",!0),t.xp6(7),t.Q6J("ngIf",o.EditMode||o.data.Product.Variants.length>0)}}const jn=function(n){return{"bg-light":n}};function Wn(n,i){if(1&n&&t._UZ(0,"span",148),2&n){const e=t.oxw(4);t.Q6J("ngClass",t.VKq(1,jn,!e.roleService.inventory.Edit))}}function zn(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 Xn(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,Wn,1,3,"span",145),t.YNc(7,zn,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 to(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 eo(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,to,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 no(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,Xn,12,5,"tr",143),t.qZA(),t.YNc(21,eo,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 oo(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 ao(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 io(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 ro(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,f=t.oxw(3);return t.KtG(f.selectedStorages[p].Key=a)})("change",function(a){const p=t.CHM(e).$implicit,f=t.oxw(3);return t.KtG(f.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 lo(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,ro,5,3,"tr",143),t.qZA()()()()),2&n){const e=t.oxw(2);t.xp6(10),t.Q6J("ngForOf",e.options.Entities)}}const co=function(){return["/menu/Products/Catalog/Products"]},so=function(n){return{"border border-danger":n}};function po(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,In,2,0,"span",15),t.YNc(23,Pn,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,Mn,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,An,4,0,"div",27),t.YNc(39,Nn,14,3,"div",28),t.qZA()()()(),t.YNc(40,On,27,8,"div",29),t.YNc(41,$n,19,13,"div",30),t.YNc(42,no,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,oo,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,ao,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,io,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,lo,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,co)),t.xp6(2),t.Q6J("disabled",!(null!=o.data.Product&&o.data.Product.Name)),t.xp6(14),t.Q6J("ngClass",t.VKq(41,so,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 uo=BiggerPicture({target:document.body});let _o=(()=>{class n extends w.U{constructor(e,o,a,r,p,f,q){super(e,"catalog/ProductLoader/ProductForm",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.cloudinaryService=p,this.matDialog=f,this.roleService=q,this.separatorKeysCodes=[Tt.K5,Tt.OC],this.statVariantAdd=[],this.NewVariantInputs=[],this.selectedStorages=[],this.smallBreakpoints=576,this.selectedCategoryLabel=null,this.isCloudinaryErrored=!1,this.destroy$=new st.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,Ee.R)(window,"resize").pipe((0,Ye.b)(500),(0,pt.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,pt.R)(this.destroy$)).subscribe(e=>{this.productImages=[...this.productImages,{URL:e.ImageURL}]})}catch{this.isCloudinaryErrored=!0}}onRemoveImage(e){this.matDialog.open(Zt,{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,O.bA)(this.productImages,e.previousContainer.data,e.container.data)}dropVariant(e){(0,O.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(He,{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(q=>{switch(r.Status){case"Category":let z={children:[],collapsedIcon:"fas fa-folder",expandedIcon:"fas fa-folder-open",id:q.ID,label:r.Name};this.data.Options.Categories=[...this.data.Options.Categories,z],this.data.Product.CategoryID=q.ID,this.selectedCategory=z,this.generateLabelSelectedCategory(z);break;case"Brand":this.data.Options.Brands=[...this.data.Options.Brands,{ID:q.ObjectID,Name:r.Name}],this.data.Product.BrandID=q.ObjectID;break;case"Tag":this.data.Options.Tags=[...this.data.Options.Tags,{ID:q.ObjectID,Name:r.Name}],this.data.Product.TagIDs=[...this.data.Product.TagIDs,q.ObjectID];break;case"UOM":this.data.Options.UOMs=[...this.data.Options.UOMs,{ID:q.ObjectID,Name:r.Name}],this.data.Product.VariantUOM=q.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(je,{data:{form:e,Options:this.data.Options,Role:this.data.Role,parentDiscontinued:this.data.Product.Discontinued,productName:this.data.Product.Name}}).afterClosed().pipe((0,H.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/",""));uo.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(b._W),t.Y36(bt.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,po,102,47,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data.Options)},dependencies:[J.jx,l.yS,O.Wj,O.Fd,O.Zt,v.gM,Z.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.Q7,s.On,We.KE,T.w9,S.YE,S.nU,G.QB,F.P,N.b,B.qn,B.HS,B.oH,B.qH,E.J,dt.V,It,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 mo=d(29881),Pt=d(11481),$=d(1591);const fo=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Mt=function(n){return{ProductID:n}},ho=function(){return["/menu/Reports/Purchases_Report/History"]};function vo(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,fo))("queryParams",t.VKq(5,Mt,e.data.Product.ID)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,ho))("queryParams",t.VKq(8,Mt,e.data.Product.ID))}}const xo=function(){return["/menu/Products/Catalog/Products/Form"]},j=function(n){return{ID:n}};function Co(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,xo))("queryParams",t.VKq(3,j,e.data.Product.ID))}}function To(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 Zo(n,i){1&n&&(t.TgZ(0,"div",68),t._uU(1,"Main Image"),t.qZA())}function bo(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,f=t.oxw(3);return t.KtG(f.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,Zo,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 yo(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,bo,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 Io=function(){return["/menu/Products/Catalog/Products/Inventory"]};function Po(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,Io))("queryParams",t.VKq(3,j,e.data.Product.ID))}}function Mo(n,i){1&n&&(t.TgZ(0,"th",70),t._uU(1,"UnitCost"),t.qZA())}function Ao(n,i){1&n&&(t.TgZ(0,"th",70),t._uU(1," UnitPrice"),t.qZA())}function Do(n,i){1&n&&(t.TgZ(0,"th",26),t._uU(1,"Ratio"),t.qZA())}function So(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 No(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 qo(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 wo=function(n){return{"text-decoration":n}},Uo=function(){return["/menu/Products/Catalog/Variants/Info"]};function Oo(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,So,3,3,"td",73),t.YNc(10,No,3,3,"td",73),t.TgZ(11,"td",72),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,qo,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,wo,e.Discontinued?"line-through":"none")),t.ekj("bg-gradient-warning",e.Discontinued),t.xp6(1),t.Q6J("routerLink",t.DdM(22,Uo))("queryParams",t.VKq(23,j,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 Jo(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 Vo(n,i){if(1&n&&(t.TgZ(0,"div",74)(1,"div",75),t.YNc(2,Jo,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 ko(n,i){1&n&&t._UZ(0,"POS-info-page-input",79)}function Fo(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 Qo(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 Lo=function(){return["/menu/Contacts/Contact/Suppliers/Info"]};function Eo(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,vo,9,10,"div",2),t.TgZ(3,"div",3),t.YNc(4,Co,3,5,"a",4),t.YNc(5,To,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,yo,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,Po,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,Mo,2,0,"th",25),t.YNc(40,Ao,2,0,"th",25),t.TgZ(41,"th",26),t._uU(42,"%"),t.qZA(),t.YNc(43,Do,2,0,"th",27),t.TgZ(44,"th",28),t._uU(45,"Inventory"),t.qZA()()(),t.TgZ(46,"tbody"),t.YNc(47,Oo,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,Vo,5,1,"div",34),t.YNc(63,ko,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,Fo,5,2,"tr",29),t.qZA()()()()()()(),t.YNc(90,Qo,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,j,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,Lo))("queryParams",t.VKq(36,j,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 Yo=BiggerPicture({target:document.body});let Ho=(()=>{class n extends mo.O{constructor(e,o,a,r,p,f,q,z){super(e,"catalog/ProductLoader/ProductInfoInitial",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.cloudinaryService=p,this.matDialog=f,this.title=q,this.roleService=z,this.productImages=[],this.destroy$=new st.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,pt.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(Zt,{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/",""));Yo.open({items:[a],intro:"fadeup"})}catch(a){alert(a)}})()}drop(e){(0,O.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(b._W),t.Y36(bt.q),t.Y36(C.uw),t.Y36(Pt.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,Eo,91,38,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",null==o.data?null:o.data.Product)},dependencies:[l.rH,l.yS,O.Wj,O.Fd,O.Zt,v.gM,Z.p,c.sg,c.O5,$.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 Ko(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 Go=function(){return["/menu/Products/Add-Ons/Variant_History"]};function Ro(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,Go))}function Bo(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 $o=function(){return["Form"]};function jo(n,i){1&n&&(t.TgZ(0,"a",23),t._uU(1," Add Variant "),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,$o))}function Wo(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 zo(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Description"),t.qZA())}function Xo(n,i){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Buying Cost "),t.qZA())}function ta(n,i){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Last Buy Cost "),t.qZA())}function ea(n,i){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Selling Price"),t.qZA())}function na(n,i){1&n&&(t.TgZ(0,"th",36),t._uU(1,"%"),t.qZA())}function oa(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 aa(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 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.UnitCost))}}function ra(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 la(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 ca(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 sa=function(n){return{ID:n}},pa=function(n){return{"text-decoration-line-through":n}};function da(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,oa,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,aa,1,1,"td",41),t.YNc(11,ia,3,3,"td",42),t.YNc(12,ra,3,3,"td",42),t.YNc(13,la,3,3,"td",42),t.YNc(14,ca,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,sa,e.ID)),t.xp6(1),t.Q6J("ngClass",t.VKq(17,pa,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 ua(n,i){if(1&n&&(t.TgZ(0,"table",24)(1,"thead",25)(2,"tr",26),t.YNc(3,Wo,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,zo,2,0,"th",29),t.YNc(11,Xo,2,0,"th",30),t.YNc(12,ta,2,0,"th",31),t.YNc(13,ea,2,0,"th",30),t.YNc(14,na,2,0,"th",30),t.TgZ(15,"th",32),t._uU(16,"Inventory"),t.qZA()()(),t.TgZ(17,"tbody"),t.YNc(18,da,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 _a(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 ma(n,i){if(1&n&&(t.TgZ(0,"div",48),t.YNc(1,_a,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 ga(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,Ko,3,0,"a",2),t.YNc(3,Ro,3,2,"a",3),t.YNc(4,Bo,3,0,"a",4),t.YNc(5,jo,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,ua,19,7,"table",15),t.qZA(),t.YNc(33,ma,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 fa=(()=>{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(b._W),t.Y36(K.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,ga,34,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[l.yS,v.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 At{}class Dt{}class ha{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 va=d(50494);function xa(n,i){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Minimum Quantity"),t.qZA())}function Ca(n,i){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Minimum Amount"),t.qZA())}function Ta(n,i){1&n&&(t.TgZ(0,"th",6),t._uU(1,"Extra Cost"),t.qZA())}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;t.xp6(1),t.Oqu(e.MinimumQty>0?t.lcZ(2,1,e.MinimumQty):"-")}}function ba(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 ya(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 Ia(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,Za,3,3,"td",10),t.YNc(6,ba,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,ya,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 Pa=(()=>{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,xa,2,0,"th",5),t.YNc(10,Ca,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,Ta,2,0,"th",7),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,Ia,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})();class St{}let Ma=(()=>{class n{constructor(e,o,a,r){this._httpService=o,this.dialogRef=a,this.toastr=r,this.composite=Object.assign(new St,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,H.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 St,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(b._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,N.b,E.J]}),n})();function Aa(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Unit Cost"),t.qZA())}function Da(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Total"),t.qZA())}function Sa(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 Na(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 qa(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,f=t.oxw();return t.KtG(f.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,Sa,3,3,"td",17),t.YNc(12,Na,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 wa(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 Ua=(()=>{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(Ma,{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,Aa,2,0,"th",9),t.YNc(15,Da,2,0,"th",9),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,qa,13,6,"tr",10),t.qZA(),t.YNc(18,wa,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:[v.gM,c.sg,c.O5,c.JJ]}),n})();const ut=function(n){return{"bg-light":n}};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,ut,!o.roleService.inventory.Edit)),t.xp6(1),t.Oqu(e.OnHand)}}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.OnHand=a)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.OnHand)}}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,ut,!o.roleService.product.Create&&!o.roleService.product.Edit)),t.xp6(1),t.hij(" ",e.MinStock," ")}}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.MinStock=a)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.MinStock)}}function Fa(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,ut,!o.roleService.product.Create&&!o.roleService.product.Edit)),t.xp6(1),t.hij(" ",e.MaxStock," ")}}function Qa(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 La(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,Oa,2,5,"span",11),t.YNc(7,Ja,1,1,"input",12),t.qZA(),t.TgZ(8,"td"),t.YNc(9,Va,2,5,"span",11),t.YNc(10,ka,1,1,"input",12),t.qZA(),t.TgZ(11,"td"),t.YNc(12,Fa,2,5,"span",11),t.YNc(13,Qa,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 Ea(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 Ya(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 Ha(n,i){if(1&n&&(t.TgZ(0,"tfoot")(1,"tr"),t._UZ(2,"td",15),t.TgZ(3,"td"),t.YNc(4,Ea,1,0,"input",16),t.qZA(),t.TgZ(5,"td"),t.YNc(6,Ya,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 Ka(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,La,14,7,"tr",8),t.qZA(),t.YNc(14,Ha,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 Ga=(()=>{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,Ka,15,2,"table",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[v.gM,c.sg,c.O5,s.Fj,s.JJ,s.On,S.YE,S.nU,N.b]}),n})();class Ra{}function Ba(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 $a=function(n){return{selected:n}};let ja=(()=>{class n{constructor(e,o,a){this.dialogRef=o,this.roleService=a,this.outletPrice=Object.assign(new Ra,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,Ba,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,$a,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,N.b]}),n})();function Wa(n,i){1&n&&(t.TgZ(0,"th",7),t._uU(1,"Extra Cost"),t.qZA())}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(null==e.ExtraCost?"":o.getCurrencySymbolByID(e.CostCurrencyID)+" "+t.lcZ(2,1,e.ExtraCost))}}function Xa(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,f=t.oxw();return t.KtG(f.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,za,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 ti=(()=>{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(ja,{data:a}).afterClosed().pipe((0,H.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,Wa,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,Xa,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:[v.gM,c.sg,c.O5,c.JJ]}),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",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 ni=(()=>{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,ei,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,N.b]}),n})();function oi(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 ai=(()=>{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,oi,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,N.b]}),n})(),ii=(()=>{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:[dt.V]}),n})();var ri=d(77890);const nt=function(n){return{selected:n}};let li=(()=>{class n{constructor(){this.paymentType=ri._,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,U.VQ,U.U0,T.w9,F.P,N.b]}),n})();function ci(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 si=(()=>{class n{constructor(){this.formChange=new t.vpe}set _form(e){e?(this.form=e,console.log(this.form)):this.form=new Dt}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,ci,20,5,"div",0),2&e&&t.Q6J("ngIf",o.form)},dependencies:[c.O5,s.Fj,s.JJ,s.On,T.w9,N.b]}),n})();function pi(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 di(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 ui(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 _i(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 mi(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 gi(n,i){1&n&&(t.TgZ(0,"li",39)(1,"a",81),t._uU(2,"Inventory"),t.qZA()())}function fi(n,i){1&n&&(t.TgZ(0,"li",39)(1,"a",82),t._uU(2,"Component"),t.qZA()())}function hi(n,i){1&n&&(t.TgZ(0,"a",83),t._uU(1,"MultiUOM"),t.qZA())}function vi(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 xi(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 Ci(n,i){if(1&n&&(t.TgZ(0,"div",52),t.YNc(1,vi,5,0,"ng-container",86),t.YNc(2,xi,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 Ti(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,Ci,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 Zi(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 bi=function(){return["/menu/Products/Catalog/Products"]},Nt=function(n){return{selected:n}};function yi(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,pi,2,1,"small",26),t.qZA(),t.TgZ(50,"div",9)(51,"div",5),t.YNc(52,di,12,2,"div",27),t.YNc(53,ui,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,_i,6,1,"div",32),t.YNc(69,mi,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,gi,3,0,"li",38),t.YNc(104,fi,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,hi,2,0,"a",45),t.qZA()(),t.TgZ(122,"div",46),t.YNc(123,Ti,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,Zi,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,bi)),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,Nt,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,Nt,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 Ii=(()=>{class n extends w.U{constructor(e,o,a,r,p,f){super(e,"catalog/variant/GetVariantFormInitialData",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.matDialog=p,this.roleService=f,this.variantTypeID=V.J,this.getQueryParams=null,this.variantParentList=[],this.isEdit=!1,this.variant=new ha,this.composites=[],this.outletPrices=[],this.pricebooks=[],this.salesGroups=[],this.entities=[],this.VariantPoint={ExpiredDay:0,Point:0,ExpiredMonth:0},this.variantParent=new Dt,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 At,u.gT.IsEmpty(r.EntityID)&&(r.EntityID=r.ID),o=(0,va.d8)(At,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(Pa,{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(b._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,yi,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,U.VQ,U.U0,T.w9,N.b,E.J,Ua,Ga,ti,ni,ai,ii,li,si]}),n})();var ot=(()=>{return(n=ot||(ot={}))[n.CashAndPoint=0]="CashAndPoint",n[n.Cash=1]="Cash",n[n.Point=2]="Point",ot;var n})();function Pi(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 Ai=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Di=function(n){return{VariantID:n}};function Si(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,Ai))("queryParams",t.VKq(3,Di,null==e.variant?null:e.variant.ID))}}function Ni(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function qi(n,i){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function wi(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net "),t.qZA())}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.Total),"")}}function Oi(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 Ji(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 Vi=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},ki=function(n){return{ID:n}};function Fi(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,Ui,3,3,"td",15),t.YNc(11,Oi,3,3,"td",15),t.YNc(12,Ji,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,Vi))("queryParams",t.VKq(14,ki,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 Qi(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,Ni,2,0,"th",15),t.YNc(11,qi,2,0,"th",16),t.YNc(12,wi,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,Fi,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 Li=(()=>{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,g.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,Pi,2,0,"a",3),t.YNc(7,Si,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,Qi,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 Ei(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 Yi=function(){return["/menu/Logistics/Report/Transfer/Product"]},qt=function(n){return{ID:n}};function Hi(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,Yi))("queryParams",t.VKq(3,qt,null==e.variant?null:e.variant.ID))}}const Ki=function(){return["/menu/Logistics/Archive/Transfer_Order/Info"]};function Gi(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,Ki))("queryParams",t.VKq(13,qt,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 Ri(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,Gi,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 Bi=(()=>{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,Ei,2,0,"a",3),t.YNc(7,Hi,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,Ri,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 $i(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 ji=function(){return["/menu/Reports/Purchases_Report/History"]},Wi=function(n){return{VariantID:n}};function zi(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,ji))("queryParams",t.VKq(3,Wi,e.variant.ID))}}function Xi(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function tr(n,i){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function er(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net"),t.qZA())}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.UnitPrice*e.Quantity))}}function or(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 ar(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 ir=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},rr=function(n){return{ID:n}};function lr(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,nr,3,3,"td",15),t.YNc(11,or,3,3,"td",15),t.YNc(12,ar,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,ir))("queryParams",t.VKq(14,rr,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 cr(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,Xi,2,0,"th",15),t.YNc(11,tr,2,0,"th",16),t.YNc(12,er,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,lr,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 sr=(()=>{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,$i,2,0,"a",3),t.YNc(7,zi,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,cr,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 pr(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 dr=function(){return["/menu/Orders/Order/Parked_Order"]},wt=function(n){return{ID:n}};function ur(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,dr))("queryParams",t.VKq(3,wt,null==e.variant?null:e.variant.ID))}}function _r(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function mr(n,i){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function gr(n,i){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net "),t.qZA())}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.Oqu(t.lcZ(2,1,e.Total))}}function hr(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 vr(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 xr=function(){return["/menu/Orders/Order/Sales_Order/Info"]};function Cr(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,fr,3,3,"td",15),t.YNc(11,hr,3,3,"td",15),t.YNc(12,vr,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,xr))("queryParams",t.VKq(14,wt,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 Tr(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,_r,2,0,"th",15),t.YNc(11,mr,2,0,"th",16),t.YNc(12,gr,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,Cr,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 Zr=(()=>{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,pr,2,0,"a",3),t.YNc(7,ur,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,Tr,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 br(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 yr(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 Ir(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 Pr=(()=>{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,br,5,1,"div",11),t.YNc(20,yr,5,1,"div",11),t.YNc(21,Ir,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 Mr(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 Ar(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 Dr(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,Ar,6,4,"tr",14),t.qZA()()()),2&n){const e=t.oxw();t.xp6(9),t.Q6J("ngForOf",e.commisions)}}let Sr=(()=>{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,Mr,6,3,"div",3),t.qZA(),t.TgZ(5,"div",2),t.YNc(6,Dr,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 Nr(n,i){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Unit Cost"),t.qZA())}function qr(n,i){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Total Cost"),t.qZA())}function wr(n,i){1&n&&t._UZ(0,"i",16)}function Ur(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 Or(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 Jr=function(){return["/menu/Products/Catalog/Variants/Info"]},Vr=function(n){return{ID:n}};function kr(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,wr,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,Ur,3,3,"td",15),t.YNc(13,Or,3,3,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(3),t.Q6J("routerLink",t.DdM(9,Jr))("queryParams",t.VKq(10,Vr,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 Fr=(()=>{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,Nr,2,0,"th",9),t.YNc(16,qr,2,0,"th",9),t.qZA()(),t.TgZ(17,"tbody"),t.YNc(18,kr,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,v.gM,c.sg,c.O5,c.JJ]}),n})();const Qr=function(n){return{ID:n}};function Lr(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,Qr,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(6,3,e.Quantity))}}let Er=(()=>{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,Lr,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})(),Yr=(()=>{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 Hr(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 Ut=function(){return["/menu/Products/Catalog/Variants/Log"]},Kr=function(n){return{ID:n}};function Gr(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,Ut))("queryParams",t.VKq(3,Kr,e.variant.ID))}}function Rr(n,i){if(1&n&&(t.TgZ(0,"div",23),t.YNc(1,Gr,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 Br(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function $r(n,i){1&n&&(t.TgZ(0,"th",26),t._uU(1,"Indirect Allocated"),t.qZA())}function jr(n,i){1&n&&(t.TgZ(0,"th",27),t._uU(1,"ROP"),t.qZA())}function Wr(n,i){1&n&&(t.TgZ(0,"th",28),t._uU(1,"Max"),t.qZA())}function zr(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Serial"),t.qZA())}function Xr(n,i){1&n&&t._UZ(0,"th")}function tl(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 el(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 nl(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 ol(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 al(n,i){if(1&n&&(t.TgZ(0,"td")(1,"ul",38),t.YNc(2,ol,2,1,"li",39),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.Q6J("ngForOf",e.SerialNumber)}}const il=function(){return["/menu/Products/Catalog/Variants/Serial_Form"]},rl=function(n,i){return{VariantID:n,EntityID:i}};function ll(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,il))("queryParams",t.WLB(3,rl,o.variant.ID,e.EntityID))}}const cl=function(n,i){return{ID:n,EntityID:i}},Ot=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},sl=function(n,i){return{VariantID:n,OutletID:i}};function pl(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,tl,3,3,"td",33),t.TgZ(12,"td",32),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,el,3,4,"td",34),t.ALo(16,"sum"),t.YNc(17,nl,3,4,"td",35),t.ALo(18,"sum"),t.YNc(19,al,3,1,"td",13),t.YNc(20,ll,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,Ut))("queryParams",t.WLB(27,cl,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,Ot))("queryParams",t.WLB(31,sl,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 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,"IndirectAllocated"))," ")}}function ul(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 _l(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 ml=function(n){return{VariantID:n}};function gl(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,Rr,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,Br,2,0,"span",13),t._uU(16," Allocated"),t.qZA(),t.YNc(17,$r,2,0,"th",14),t.TgZ(18,"th",15),t._uU(19,"Available "),t.qZA(),t.YNc(20,jr,2,0,"th",16),t.ALo(21,"sum"),t.YNc(22,Wr,2,0,"th",17),t.ALo(23,"sum"),t.YNc(24,zr,2,0,"th",13),t.YNc(25,Xr,1,0,"th",13),t.qZA()(),t.TgZ(26,"tbody"),t.YNc(27,pl,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,dl,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,ul,4,6,"td",22),t.ALo(46,"sum"),t.YNc(47,_l,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,Ot))("queryParams",t.VKq(44,ml,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 fl=(()=>{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,Hr,4,0,"div",0),t.YNc(1,gl,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,v.gM,c.mk,c.sg,c.O5,S.YE,S.nU,c.JJ,D.qU]}),n})(),hl=(()=>{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 vl(n,i){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Extra Cost"),t.qZA())}function xl(n,i){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Disc."),t.qZA())}function Cl(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 Tl(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 Zl(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.YNc(3,Cl,3,3,"td",13),t.TgZ(4,"td"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.YNc(7,Tl,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 bl=(()=>{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,vl,2,0,"th",8),t.TgZ(11,"th",9),t._uU(12,"Price"),t.qZA(),t.YNc(13,xl,2,0,"th",10),t.qZA()(),t.TgZ(14,"tbody"),t.YNc(15,Zl,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 yl(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 Il=(()=>{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,yl,11,8,"tr",11),t.qZA()()()()()()()),2&e&&(t.xp6(17),t.Q6J("ngForOf",o.pricebooks))},dependencies:[c.sg,c.JJ]}),n})();function Pl(n,i){1&n&&(t.TgZ(0,"th",13),t._uU(1,"Minimum Quantity"),t.qZA())}function Ml(n,i){1&n&&(t.TgZ(0,"th",13),t._uU(1,"Minimum Amount"),t.qZA())}function Al(n,i){1&n&&(t.TgZ(0,"th",10),t._uU(1,"Extra Cost"),t.qZA())}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(e.MinimumQty>0?t.lcZ(2,1,e.MinimumQty):"-")}}function Sl(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 Nl(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 ql=function(){return["/menu/Promotion/Main/Event/Form"]},wl=function(n){return{ID:n}};function Ul(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,Dl,3,3,"td",16),t.YNc(11,Sl,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,Nl,3,3,"td",16),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(2),t.Q6J("routerLink",t.DdM(21,ql))("queryParams",t.VKq(22,wl,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 Ol=(()=>{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,Pl,2,0,"th",9),t.YNc(13,Ml,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,Al,2,0,"th",11),t.qZA()(),t.TgZ(19,"tbody"),t.YNc(20,Ul,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})(),Jl=(()=>{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 Vl=d(19835);function kl(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function Fl(n,i){1&n&&(t.TgZ(0,"th",19)(1,"span",20),t._uU(2,"Indirect Allocated"),t.qZA()())}function Ql(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 Ll=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},El=function(n){return{VariantID:n}};function Yl(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,Ql,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,Ll))("queryParams",t.VKq(10,El,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 Hl(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 Kl=(()=>{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,kl,2,0,"span",12),t._uU(16," Allocated "),t.qZA()(),t.YNc(17,Fl,3,0,"th",13),t.TgZ(18,"th",14),t._uU(19," Available "),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,Yl,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,Hl,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,v.gM,c.sg,c.O5,Vl.i,c.JJ,D.W7]}),n})();var Gl=d(34782);let Rl=(()=>{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(b._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,N.b]}),n})();function Bl(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 $l=(()=>{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,g.U)(r=>r.Data),(0,g.U)(r=>o.filter(p=>-1!=r.findIndex(f=>f.EntityID==p.EntityID)).map(p=>{if(a=r.findIndex(f=>p.EntityID==f.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(Rl,{data:this.lastDays}).afterClosed().pipe((0,H.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,Gl.d)(1))}onSort(e){this.listData$=e.active&&""!==e.direction?this.listData$.pipe((0,g.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,Bl,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:[v.gM,c.sg,S.YE,S.nU,c.Ov,c.JJ]}),n})();function jl(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 Wl(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function zl(n,i){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Indirect Allocated"),t.qZA())}function Xl(n,i){1&n&&(t.TgZ(0,"th",22),t._uU(1,"ROP"),t.qZA())}function tc(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Max"),t.qZA())}function ec(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Serial"),t.qZA())}function nc(n,i){1&n&&t._UZ(0,"th")}function oc(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 ac(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 ic(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 rc(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 lc(n,i){if(1&n&&(t.TgZ(0,"td")(1,"ul",33),t.YNc(2,rc,2,1,"li",34),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.Q6J("ngForOf",e.SerialNumber)}}const cc=function(){return["/menu/Products/Catalog/Variants/Serial_Form"]},sc=function(n,i){return{VariantID:n,EntityID:i}};function pc(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,cc))("queryParams",t.WLB(3,sc,o.variant.ID,e.EntityID))}}const dc=function(){return["/menu/Products/Catalog/Variants/Log"]},uc=function(n,i){return{ID:n,EntityID:i}},Jt=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},_c=function(n,i){return{VariantID:n,OutletID:i}};function mc(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,oc,3,3,"td",28),t.TgZ(12,"td",27),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,ac,3,4,"td",29),t.ALo(16,"sum"),t.YNc(17,ic,3,4,"td",30),t.ALo(18,"sum"),t.YNc(19,lc,3,1,"td",12),t.YNc(20,pc,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,dc))("queryParams",t.WLB(27,uc,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,Jt))("queryParams",t.WLB(31,_c,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 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,"IndirectAllocated"))," ")}}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,"Available"))," ")}}function hc(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 vc(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 xc=function(n){return{VariantID:n}};function Cc(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,Wl,2,0,"span",12),t._uU(15," Allocated"),t.qZA(),t.YNc(16,zl,2,0,"th",13),t.TgZ(17,"th",14),t._uU(18,"Available "),t.qZA(),t.YNc(19,Xl,2,0,"th",15),t.ALo(20,"sum"),t.YNc(21,tc,2,0,"th",16),t.ALo(22,"sum"),t.YNc(23,ec,2,0,"th",12),t.YNc(24,nc,1,0,"th",12),t.qZA()(),t.TgZ(25,"tbody"),t.YNc(26,mc,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,gc,4,6,"td",21),t.YNc(40,fc,4,6,"td",21),t.ALo(41,"sum"),t.YNc(42,hc,4,6,"td",21),t.ALo(43,"sum"),t.YNc(44,vc,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,Jt))("queryParams",t.VKq(41,xc,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 Tc=(()=>{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,jl,4,0,"div",0),t.YNc(1,Cc,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,v.gM,c.mk,c.sg,c.O5,S.YE,S.nU,c.JJ,D.qU]}),n})();function Zc(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 bc=function(){return["/menu/Products/Catalog/Variants/Log"]},yc=function(n){return{ID:n}};function Ic(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,bc))("queryParams",t.VKq(3,yc,e.variant.ID))}}function Pc(n,i){if(1&n&&(t.TgZ(0,"div",18),t.YNc(1,Ic,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 Mc(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 Ac(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,Pc,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,Mc,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 Dc=(()=>{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,Zc,4,0,"div",0),t.YNc(1,Ac,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,v.gM,c.sg,c.O5,S.YE,c.JJ,D.qU]}),n})();function Sc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",25),t._uU(2,"Inventory"),t.qZA()())}function Nc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",26),t._uU(2,"Component"),t.qZA()())}function qc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",27),t._uU(2,"Outlet Price"),t.qZA()())}function wc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",28),t._uU(2,"Pricebook"),t.qZA()())}function Uc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",29),t._uU(2,"Promotion"),t.qZA()())}function Oc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",30),t._uU(2,"Purchase"),t.qZA()())}function Jc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",31),t._uU(2,"Description"),t.qZA()())}function Vc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",32),t._uU(2,"Commission"),t.qZA()())}function kc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",33),t._uU(2,"MultiUOM"),t.qZA()())}function Fc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",34),t._uU(2,"Composite Inventory"),t.qZA()())}function Qc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",35),t._uU(2,"Dependency Of"),t.qZA()())}function Lc(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",36),t._uU(2,"Group"),t.qZA()())}function Ec(n,i){1&n&&(t.TgZ(0,"li",2)(1,"button",37),t._uU(2,"Pick Pack"),t.qZA()())}function Yc(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 Hc(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 Kc(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 Gc(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 Rc(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 Bc(n,i){1&n&&(t.TgZ(0,"div",46),t._UZ(1,"POS-info-variant-nav-purchase"),t.qZA())}function $c(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 jc(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 Wc(n,i){if(1&n&&(t.TgZ(0,"div",47),t.YNc(1,$c,1,2,"POS-info-variant-nav-multiuom",48),t.YNc(2,jc,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 zc(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 Xc(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 ts(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 es=(()=>{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,Sc,3,0,"li",1),t.YNc(2,Nc,3,0,"li",1),t.YNc(3,qc,3,0,"li",1),t.YNc(4,wc,3,0,"li",1),t.YNc(5,Uc,3,0,"li",1),t.YNc(6,Oc,3,0,"li",1),t.TgZ(7,"li",2)(8,"button",3),t._uU(9,"Advanced"),t.qZA()(),t.YNc(10,Jc,3,0,"li",1),t.YNc(11,Vc,3,0,"li",1),t.YNc(12,kc,3,0,"li",1),t.YNc(13,Fc,3,0,"li",1),t.YNc(14,Qc,3,0,"li",1),t.YNc(15,Lc,3,0,"li",1),t.YNc(16,Ec,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,Yc,2,1,"div",6),t.YNc(22,Hc,2,2,"div",7),t.YNc(23,Kc,2,1,"div",8),t.YNc(24,Gc,2,1,"div",9),t.YNc(25,Rc,2,2,"div",10),t.YNc(26,Bc,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,Wc,4,2,"div",17),t.YNc(34,zc,2,3,"div",18),t.TgZ(35,"div",19),t._UZ(36,"POS-info-variant-nav-dependency-of",20),t.qZA(),t.YNc(37,Xc,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,ts,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,Pr,Sr,Fr,Er,Yr,fl,hl,bl,Il,Ol,Jl,Kl,$l,Tc,Dc]}),n})();const os=function(){return["/menu/Products/Catalog/Variants/Inventory_Cost_History"]},_t=function(n){return{VariantID:n}};function as(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,os))("queryParams",t.VKq(3,_t,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,"div",43),t.YNc(1,as,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 Vt=function(){return["/menu/Products/Add-Ons/Variant_History"]};function rs(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,Vt))("queryParams",t.VKq(3,_t,null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID))}}function ls(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 cs=function(){return["/menu/Products/Catalog/Variants/Form"]},kt=function(n){return{ID:n}};function ss(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,cs))("queryParams",t.VKq(3,kt,e.data.Data.Variant.ID))}}function ps(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 ds(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 us(n,i){1&n&&(t.TgZ(0,"div",54),t._UZ(1,"i",55),t.qZA())}function _s(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 ms(n,i){1&n&&(t.TgZ(0,"p",57),t._uU(1,"Point(s)"),t.qZA())}function gs(n,i){1&n&&(t.TgZ(0,"p",58),t._uU(1," Expiration "),t.qZA())}function fs(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 hs(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,Vt))("queryParams",t.VKq(7,_t,e.data.Data.Variant.ID)),t.xp6(1),t.Oqu(t.lcZ(4,4,e.data.Data.Variant.UnitCost))}}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.OrderPriceDiscount+"%")}}function xs(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 Cs(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 Ts(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 Zs(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 bs(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 ys(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 Is(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 Ps=function(){return["/menu/Products/Catalog/Products/Info"]};function Ms(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,is,2,1,"div",2),t.YNc(3,rs,3,5,"a",3),t.TgZ(4,"div",4),t.YNc(5,ls,3,1,"a",5),t.qZA(),t.TgZ(6,"div",4),t.YNc(7,ss,3,5,"a",6),t.YNc(8,ps,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,ds,2,1,"div",14),t.YNc(18,us,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,_s,2,1,"p",20),t.YNc(27,ms,2,0,"p",21),t.TgZ(28,"p",22),t._uU(29),t.qZA(),t.YNc(30,gs,2,0,"p",23),t.YNc(31,fs,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,hs,7,9,"div",28),t.YNc(40,vs,3,1,"div",29),t.YNc(41,xs,4,5,"div",28),t.YNc(42,Cs,3,1,"div",29),t.qZA(),t.TgZ(43,"div",9),t.YNc(44,Ts,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,Zs,2,1,"div",41),t.qZA(),t.YNc(77,bs,3,1,"div",42),t.YNc(78,ys,3,1,"div",42),t.YNc(79,Is,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,Ps))("queryParams",t.VKq(41,kt,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 As=BiggerPicture({target:document.body});let Ds=(()=>{class n extends w.U{constructor(e,o,a,r,p,f){super(e,"catalog/variant/GetVariantInfoModelById",o),this.httpService=e,this.activatedRoute=o,this.router=a,this.toaster=r,this.title=p,this.roleService=f,this.paymentType=ot,this.destroy$=new st.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",""));As.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(b._W),t.Y36(Pt.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,Ms,80,43,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data.Data)},dependencies:[l.yS,v.gM,Z.p,c.mk,c.O5,$.o,Li,Bi,sr,Zr,es,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 W=(()=>{return(n=W||(W={}))[n.PurchaseOrder=2]="PurchaseOrder",n[n.Archive=3]="Archive",W;var n})();function Ss(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Variant"),t.qZA())}function Ns(n,i){1&n&&(t.TgZ(0,"th",22),t._uU(1,"Buying Cost"),t.qZA())}function qs(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Selling Price"),t.qZA())}const ws=function(){return["/menu/Products/Catalog/Variants/Info"]},Ft=function(n){return{ID:n}};function Us(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,ws))("queryParams",t.VKq(4,Ft,e.ParentID)),t.xp6(1),t.Oqu(e.VariantName)}}function Os(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 Js(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 Vs=function(n){return[n]};function ks(n,i){if(1&n&&(t.TgZ(0,"tr",24),t.YNc(1,Us,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,Os,3,4,"td",26),t.YNc(12,Js,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,Ft,e.ReferenceID))("routerLink",t.VKq(18,Vs,o.linkReference(e.TypeID))),t.xp6(1),t.hij(" ",e.DisplayReference," ")}}function Fs(n,i){if(1&n&&(t.TgZ(0,"table",16)(1,"thead",17)(2,"tr"),t.YNc(3,Ss,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,Ns,2,0,"th",19),t.YNc(13,qs,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,ks,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 Qs(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 Ls=function(){return["/menu/Products/Catalog/Variants"]};function Es(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,Fs,20,4,"table",13),t.qZA(),t.TgZ(34,"div",14),t.YNc(35,Qs,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,Ls)),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 Ys=(()=>{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 W.PurchaseOrder:o="/menu/Orders/Order/Purchase_Order/Info";break;case W.Archive:o="/menu/Manufacture/Job_Order/Archive/Info"}return o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(K.O),t.Y36(l.gz),t.Y36(m.O),t.Y36(b._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,Es,36,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[l.yS,v.gM,Z.p,c.sg,c.O5,s.Fj,s.JJ,s.On,et.NW,T.w9,G.QB,E.J,c.JJ,c.uU,D.sH]}),n})();function Hs(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 Ks(n,i){1&n&&(t.TgZ(0,"button",28)(1,"span",29),t._uU(2,"Toggle Dropdown"),t.qZA()())}function Gs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",20),t.YNc(1,Hs,3,0,"a",21),t.YNc(2,Ks,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 Rs(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 Bs(n,i){1&n&&(t.TgZ(0,"th",16),t._uU(1,"Unit Cost"),t.qZA())}function $s(n,i){1&n&&(t.TgZ(0,"th",16),t._uU(1,"Extra Cost"),t.qZA())}function js(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 Ws(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 zs(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 Xs(n,i){if(1&n&&(t.TgZ(0,"tr",32),t.YNc(1,js,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,Ws,3,3,"td",15),t.TgZ(11,"td",16),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,zs,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 tp(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 ep(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,Gs,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,Rs,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,Bs,2,0,"th",15),t.TgZ(33,"th",16),t._uU(34,"Unit Price"),t.qZA(),t.YNc(35,$s,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,Xs,21,16,"tr",17),t.qZA()()(),t.TgZ(42,"div",18),t.YNc(43,tp,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 np=(()=>{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(K.O),t.Y36(m.O),t.Y36(b._W),t.Y36(b._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,ep,44,12,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[v.gM,Z.p,c.sg,c.O5,s.Wl,s.JJ,s.On,et.NW,T.w9,c.JJ]}),n})();function op(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 Qt=function(){return["/menu/Products/Setup/Brand/Brand_Form"]};function ap(n,i){1&n&&(t.TgZ(0,"a",12),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Qt))}function ip(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 rp(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 lp=function(n){return{ID:n}};function cp(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,Qt))("queryParams",t.VKq(4,lp,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function sp(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 pp(n,i){if(1&n&&(t.TgZ(0,"tr",15),t.YNc(1,rp,2,2,"td",16),t.TgZ(2,"td"),t.YNc(3,cp,3,6,"span",16),t.YNc(4,sp,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 dp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,op,3,0,"a",2),t.YNc(3,ap,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,ip,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,pp,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 up=(()=>{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(b._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,dp,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 _p(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 Lt=function(){return["/menu/Products/Setup/Measurement/Form"]};function mp(n,i){1&n&&(t.TgZ(0,"a",13),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Lt))}function gp(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 fp(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 hp=function(n){return{ID:n}};function vp(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,Lt))("queryParams",t.VKq(4,hp,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function xp(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",16),t.YNc(1,fp,2,2,"td",17),t.TgZ(2,"td"),t.YNc(3,vp,3,6,"span",17),t.YNc(4,xp,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 Tp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,_p,3,0,"a",2),t.YNc(3,mp,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,gp,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,Cp,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 Zp=(()=>{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(b._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,Tp,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 bp(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 Et=function(){return["/menu/Products/Setup/Tags/Tags_Form"]};function yp(n,i){1&n&&(t.TgZ(0,"a",11),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Et))}function Ip(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 Pp(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 Mp=function(n){return{ID:n}};function Ap(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,Et))("queryParams",t.VKq(4,Mp,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function Dp(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 Sp(n,i){if(1&n&&(t.TgZ(0,"tr",14),t.YNc(1,Pp,2,2,"td",15),t.TgZ(2,"td"),t.YNc(3,Ap,3,6,"span",15),t.YNc(4,Dp,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 Np(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,bp,3,0,"a",2),t.YNc(3,yp,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,Ip,2,0,"th",7),t.TgZ(10,"th"),t._uU(11,"Name"),t.qZA()()(),t.TgZ(12,"tbody"),t.YNc(13,Sp,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 qp=(()=>{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(b._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,Np,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 wp(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 Yt=function(){return["/menu/Products/Setup/UOM/Form"]};function Up(n,i){1&n&&(t.TgZ(0,"a",12),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Yt))}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 Jp(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 Vp=function(n){return{ID:n}};function kp(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,Yt))("queryParams",t.VKq(4,Vp,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function Fp(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 Qp(n,i){if(1&n&&(t.TgZ(0,"tr",15),t.YNc(1,Jp,2,2,"td",16),t.TgZ(2,"td"),t.YNc(3,kp,3,6,"span",16),t.YNc(4,Fp,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 Lp(n,i){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,wp,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"),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,"Description"),t.qZA()()(),t.TgZ(14,"tbody"),t.YNc(15,Qp,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 Ep=(()=>{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(b._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,Lp,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 mt=d(59286);const Yp=["inputRename"],Hp=["inputAdd"],Kp=function(){return["/menu/Products/Setup/Storages/Form"]};function Gp(n,i){1&n&&(t.TgZ(0,"a",18),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Kp))}function Rp(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 Bp(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 $p(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 jp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Gp,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,Rp,2,1,"ng-template",8),t.YNc(10,Bp,3,1,"ng-template",9),t.YNc(11,$p,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 Wp=(()=>{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(b._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-storage"]],viewQuery:function(e,o){if(1&e&&(t.Gf(Yp,5),t.Gf(Hp,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,jp,23,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[Y.mp,J.jx,mt.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 zp(n,i){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const Xp=function(){return["/menu/Products/Setup/Brand"]};function td(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,zp,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,Xp)),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 ed=(()=>{class n extends w.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(b._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,td,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,v.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.nD,s.On]}),n})();function nd(n,i){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const od=function(){return["/menu/Products/Setup/Measurement"]};function ad(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,nd,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,od)),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 id=(()=>{class n extends w.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(b._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,ad,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,v.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]}),n})();function rd(n,i){1&n&&(t.TgZ(0,"span",16),t._uU(1," Name required!"),t.qZA())}const ld=function(){return["/menu/Products/Setup/Tags"]};function cd(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,rd,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,ld)),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 sd=(()=>{class n extends w.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(b._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,cd,24,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,v.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]}),n})();function pd(n,i){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const dd=function(){return["/menu/Products/Setup/UOM"]};function ud(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,pd,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,dd)),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 _d=(()=>{class n extends w.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(b._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,ud,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,v.gM,Z.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]}),n})();function md(n,i){1&n&&(t.TgZ(0,"span",21),t._uU(1," Name required."),t.qZA())}const gd=function(){return["/menu/Products/Setup/Storages"]},fd=function(n){return{invalid:n}},hd=function(n){return{selected:n}};function vd(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,md,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,gd)),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,fd,o.ValidNameCode)),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngClass",t.VKq(15,hd,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 xd=(()=>{class n extends w.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(b._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,vd,30,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,v.gM,Z.p,c.mk,c.O5,s.Fj,s.JJ,s.Q7,s.On,T.w9]}),n})();const Cd=function(){return["/menu/Products/Setup/Storages/Form"]},Ht=function(n){return{ID:n}},Td=function(){return["/menu/Products/Setup/Storages/Info"]};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," 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,Cd))("queryParams",t.VKq(11,Ht,e.formData.ID)),t.xp6(16),t.Q6J("inputValue",e.formData.Model),t.xp6(3),t.Q6J("routerLink",t.DdM(13,Td))("queryParams",t.VKq(14,Ht,e.formData.ParentID)),t.xp6(1),t.Oqu(e.parentName),t.xp6(4),t.Q6J("inputValue",e.formData.Name)}}let bd=(()=>{class n extends w.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(b._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,Zd,28,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,Z.p,c.O5,$.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 yd=d(22863),Id=d(24351);const Pd=["inputRename"],Md=["inputAdd"],Ad=function(){return["/menu/Products/Catalog/Categories/Form"]};function Dd(n,i){1&n&&(t.TgZ(0,"a",18),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Ad))}function Sd(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 Nd(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 qd(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 wd(n,i){1&n&&t.YNc(0,qd,2,1,"ng-template",21)}function Ud(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Dd,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,Sd,2,1,"ng-template",8),t.YNc(10,Nd,3,1,"ng-template",9),t.YNc(11,wd,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 Od=(()=>{class n extends yd.M{constructor(e,o,a,r){super(e),this.Router=o,this.toastr=a,this.roleService=r,this.menuData$.pipe((0,Id.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:f=>this.add(this.selectedNode)}),this.roleService.product.Delete&&this.items.push({label:"Delete",icon:"fas fa-trash fa-fw",command:f=>this.delete(this.selectedNode)}),this.roleService.product.Edit&&this.items.push({label:"Rename",icon:"fas fa-edit fa-fw",command:f=>this.rename(this.selectedNode)}),this.items.push({label:"Properties",icon:"fas fa-screwdriver-wrench fa-fw",command:f=>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(b._W),t.Y36(x.N))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-category"]],viewQuery:function(e,o){if(1&e&&(t.Gf(Pd,5),t.Gf(Md,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,Ud,27,11,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[Y.mp,J.jx,mt.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 Jd(n,i){1&n&&(t.TgZ(0,"span",39),t._uU(1," Name required."),t.qZA())}const Vd=function(){return["/menu/Products/Catalog/Categories"]},at=function(n){return{selected:n}};function kd(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,Jd,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,Vd)),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,at,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,at,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,at,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,at,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 Fd=(()=>{class n extends w.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(b._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,kd,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,N.b]}),n})();const Qd=function(){return["/menu/Products/Catalog/Categories/Form"]},gt=function(n){return{ID:n}};function Ld(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,Qd))("queryParams",t.VKq(3,gt,e.formData.ID))}}function Ed(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 Yd=function(){return["/menu/Inventory/Quantity/Valuation"]},Hd=function(){return["/menu/Products/Catalog/Categories/Info"]};function Kd(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,Ld,3,5,"a",4),t.YNc(6,Ed,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,Yd))("queryParams",t.VKq(17,gt,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,Hd))("queryParams",t.VKq(20,gt,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 Gd=(()=>{class n extends w.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(b._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,Kd,52,22,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[l.yS,Z.p,c.O5,$.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 Rd=["fileInput"];function Bd(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 $d(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 jd(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 Wd(n,i){if(1&n&&(t.TgZ(0,"div",41),t.YNc(1,$d,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,jd,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 zd(n,i){if(1&n&&(t.TgZ(0,"div",39),t.YNc(1,Wd,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 Xd=function(n){return{show:n}};function tu(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,Bd,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,zd,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,Xd,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 eu=(()=>{class n extends w.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:f=>{this.ctrl.Alert=f.Success,this.ctrl.Message=f.Message,this.ctrl.Issues=null,this.ctrl.IgnoreWarning=!1},error:f=>{this.ctrl.Alert=f.error.Success,this.ctrl.Message=f.error.Message,this.ctrl.Issues=f.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(Rd,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/v1676258568/POS/CSV/Products_DealPOS3.csv","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,tu,96,18,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[v.gM,Z.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.On,T.w9,F.P,N.b]}),n})();const ou=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Kt=function(n){return{VariantID:n}},au=function(){return["/menu/Reports/Purchases_Report/History"]};function iu(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,ou))("queryParams",t.VKq(5,Kt,e.pageData.Filter.ID)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,au))("queryParams",t.VKq(8,Kt,e.pageData.Filter.ID))}}function ru(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 lu(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 cu(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Outlet"),t.qZA())}function su(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1," Price"),t.qZA())}const pu=function(){return["/menu/Outlets/Master/Outlets/Info"]},ft=function(n){return{ID:n}};function du(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,pu))("queryParams",t.VKq(4,ft,e.EntityID)),t.xp6(1),t.Oqu(e.Outlet)}}function uu(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 _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",53),t._uU(2),t.ALo(3,"number"),t.YNc(4,_u,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 gu(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 fu(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,gu,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 hu(n,i){if(1&n&&(t.TgZ(0,"td",50),t.YNc(1,uu,3,3,"small",52),t.YNc(2,mu,5,4,"ng-container",45),t.YNc(3,fu,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 vu=function(n){return[n]};function xu(n,i){if(1&n&&(t.TgZ(0,"tr",44),t.YNc(1,du,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,hu,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,vu,e.NavUrl))("queryParams",t.VKq(31,ft,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 Cu(n,i){1&n&&(t.TgZ(0,"td",55)(1,"b"),t._uU(2,"Total"),t.qZA()())}function Tu(n,i){1&n&&(t.TgZ(0,"td",56)(1,"b"),t._uU(2,"Total"),t.qZA()())}const Zu=function(){return["/menu/Products/Catalog/Variants/Info"]};function bu(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,iu,9,10,"div",2),t.YNc(3,ru,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,lu,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,cu,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,su,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,xu,32,33,"tr",23),t.qZA(),t.TgZ(61,"tfoot")(62,"tr"),t.YNc(63,Cu,3,0,"td",24),t.YNc(64,Tu,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,Zu))("queryParams",t.VKq(34,ft,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 yu=(()=>{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(b._W),t.Y36(K.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,bu,76,36,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[l.yS,v.gM,Z.p,c.sg,c.O5,s.Fj,s.JJ,s.On,T.w9,G.QB,F.P,rt.v,c.JJ,c.uU,D.qU,D.$k]}),n})();function Iu(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 Pu=function(n,i){return{alert:!0,"alert-success":n,"alert-danger":i}},Mu=function(n,i){return{"fas ":!0,"fa-circle-check":n,"fa-circle-exclamation":i}};function Au(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,Pu,e.alert.Success,!e.alert.Success)),t.xp6(1),t.Q6J("ngClass",t.WLB(6,Mu,e.alert.Success,!e.alert.Success)),t.xp6(1),t.Q6J("innerHtml",e.alert.Message,t.oJD)}}function Du(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 Su(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 Nu=function(){return["/menu/Products/Catalog/Variants/Info"]},qu=function(n){return{ID:n}};function wu(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,Iu,2,0,"a",3),t.qZA(),t.TgZ(5,"content")(6,"div",4),t.YNc(7,Au,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,Du,8,0,"div",13),t.TgZ(17,"div",14)(18,"ul",15),t.YNc(19,Su,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,Nu))("queryParams",t.VKq(11,qu,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 Uu=(()=>{class n extends w.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,wu,20,13,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData)},dependencies:[l.yS,v.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 Ou(n,i){1&n&&t._UZ(0,"th",11),2&n&&t.Q6J("innerHtml",i.$implicit.Name,t.oJD)}function Ju(n,i){if(1&n&&(t.TgZ(0,"thead",7)(1,"tr")(2,"th",8),t._uU(3,"Model"),t.qZA(),t.YNc(4,Ou,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 Vu(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 ku(n,i){if(1&n&&(t.TgZ(0,"tr",12)(1,"td"),t._uU(2),t.qZA(),t.YNc(3,Vu,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 Fu(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 Qu(n,i){if(1&n&&(t.TgZ(0,"tfoot",14)(1,"tr")(2,"td",15),t._uU(3,"Total"),t.qZA(),t.YNc(4,Fu,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 Lu(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,Ju,7,1,"thead",4),t.TgZ(5,"tbody"),t.YNc(6,ku,7,5,"tr",5),t.qZA(),t.YNc(7,Qu,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 Eu=[{path:"Catalog/Categories",component:Od},{path:"Catalog/Categories/Form",component:Fd},{path:"Catalog/Categories/Info",component:Gd},{path:"Catalog/Products",component:Le},{path:"Catalog/Products/Form",component:_o},{path:"Catalog/Products/Info",component:Ho},{path:"Catalog/Products/Import",component:eu},{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,Lu,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:fa},{path:"Catalog/Variants/Form",component:Ii},{path:"Catalog/Variants/Info",component:Ds},{path:"Catalog/Variants/Log",component:yu},{path:"Catalog/Variants/Serial_Form",component:Uu},{path:"Add-Ons/Variant_History",component:Ys},{path:"Price_Editor/Custom_Outlet_Price",component:np},{path:"Setup/Brand",component:up},{path:"Setup/Brand/Brand_Form",component:ed},{path:"Setup/Measurement",component:Zp},{path:"Setup/Measurement/Form",component:id},{path:"Setup/Tags",component:qp},{path:"Setup/Tags/Tags_Form",component:sd},{path:"Setup/UOM",component:Ep},{path:"Setup/UOM/Form",component:_d},{path:"Setup/Storages",component:Wp},{path:"Setup/Storages/Form",component:xd},{path:"Setup/Storages/Info",component:bd},{path:"",redirectTo:"Catalog/Products",pathMatch:"full"}];let Yu=(()=>{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(Eu),l.Bz]}),n})();var Hu=d(46510),Ku=d(7155),Gu=d(99602),Gt=d(3238),Ru=d(44144),Bu=d(3848),$u=d(90811),ju=d(65131),Wu=d(35355),zu=d(94673);let Xu=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[J.Y],imports:[Y.xc,mt.vI,Wu.V,O._t,v.AV,Z.R,c.ez,D.dr,Yu,M.d,Hu.Z,s.u5,s.UX,Gu.FA,Gt.XK,U.Fk,Ru.c,Gt.Ng,Bu.Nh,et.TU,$u.vV,T.A0,S.JX,Ku.p0,G.ZU,F.K,ju.X,B.Hi,E.Q,rt.T,$.F,S.JX,zu.z,dt.O,yn]}),n})()},3077:(it,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 g=l.oxw();l.xp6(1),l.AsE(" Showing ",g.pageData.Filter.PageNumber*g.total-g.total+1," - ",g.pageData.Filter.PageNumber*g.total," ")}}function I(h,_){if(1&h&&(l.TgZ(0,"span"),l._uU(1),l.qZA()),2&h){const g=l.oxw();l.xp6(1),l.AsE(" Showing ",g.pageData.Filter.RowCount*g.pageData.Filter.PageNumber-g.pageData.Filter.RowCount+1," - ",g.pageData.Filter.RowCount*g.pageData.Filter.PageNumber-g.pageData.Filter.RowCount+g.total," ")}}function t(h,_){if(1&h){const g=l.EpF();l.TgZ(0,"span",8),l.NdJ("click",function(){l.CHM(g);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 g=l.oxw();l.xp6(1),l.hij(" of ",l.lcZ(2,1,g.listTotal),"")}}function s(h,_){if(1&h){const g=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(g);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 g=l.EpF();l.TgZ(0,"a",10),l.NdJ("click",function(){l.CHM(g);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(g){this.httpService=g,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(g){"Enter"===g.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(g=>{this.listTotal=g.Count?g.Count:g,this.pageData.HideStoreApiCount=!0})}}return h.\u0275fac=function(g){return new(g||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(g,m){1&g&&(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(U){return m.onJumpToPage(U)})("ngModelChange",function(U){return m.pageNumber=U}),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&g&&(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(g){return new(g||h)},h.\u0275mod=l.oAB({type:h}),h.\u0275inj=l.cJS({imports:[c.ez,A.u5,A.UX]}),h})()},19835:(it,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:(it,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})()}}]);
|