dealpos 12.2.2 → 12.2.3
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/2527.c8c1472e2583d15c.js +1 -0
- package/POS/{4970.4b720eacff390388.js → 4970.4fd0b65a33ec215d.js} +1 -1
- package/POS/500.8a2dabd11040f420.js +1 -0
- package/POS/5453.70fcfbaa7bfcd55b.js +1 -0
- package/POS/5586.6557e4bd206a28bd.js +1 -0
- package/POS/6303.bfcba36635158bb0.js +1 -0
- package/POS/6664.5a6d92ea4c288821.js +1 -0
- package/POS/6840.d0036ec626577639.js +1 -0
- package/POS/{8126.a38cad86f4c81065.js → 8126.2a3f67a7639fa6c8.js} +1 -1
- package/POS/8317.5eadaac9d81f9a5f.js +1 -0
- package/POS/8425.8d3419e0fb226dda.js +1 -0
- package/POS/9042.5c52e1b1c2f26f40.js +1 -0
- package/POS/9612.6a332f69514c0983.js +1 -0
- package/POS/{9757.7255467eb7a81e5f.js → 9757.197c3204c36bdd73.js} +1 -1
- package/POS/{2527.7e671ae42215b675.js → 9841.5c1c03ebf5b7893e.js} +1 -1
- package/POS/index.html +2 -2
- package/POS/{main.5719023b63890082.js → main.434c24ea7d5f6011.js} +1 -1
- package/POS/runtime.7c28f5c91adf7583.js +1 -0
- package/package.json +1 -1
- package/POS/2526.b4ad12c60a108246.js +0 -1
- package/POS/500.0c17a4a814815447.js +0 -1
- package/POS/6303.5724083b307f1ed5.js +0 -1
- package/POS/6551.7ed8f31c22230139.js +0 -1
- package/POS/6664.567ef29551e80239.js +0 -1
- package/POS/6840.123d77eead78424d.js +0 -1
- package/POS/6911.3b1b89c2d61a261c.js +0 -1
- package/POS/8317.f9654b9e65973243.js +0 -1
- package/POS/9498.2b6e42b23bdba39a.js +0 -1
- package/POS/9612.0ffe44a08279c42b.js +0 -1
- package/POS/runtime.f4e420d04496da7f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[9042],{19042:(Ct,E,p)=>{p.r(E),p.d(E,{ProductModule:()=>Pm});var l=p(81180),c=p(36895),u=p(9116),O=p(15861),M=p(4077),h=p(65412),y=p(42046),t=p(94650),D=p(63165),s=p(24006),x=p(88796);let I=(()=>{class n{constructor(e,o){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"Model",void 0),(0,l.Z)(this,"configModal",void 0),this.dialogRef=e,this.data=o,this.Model=o,this.configModal=new y.O,this.configModal.title="Move to Category"}onOk(){this.dialogRef.close({Model:this.Model})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.so),t.Y36(h.WI))}),(0,l.Z)(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:[D.M,s.JJ,s.On,x.w9]})),n})();var m=p(67327),J=(()=>{return(n=J||(J={}))[n.NEVER=0]="NEVER",n[n.QUERY=1]="QUERY",n[n.ALWAYS=2]="ALWAYS",J;var n})(),g=p(96700),F=p(54004),f=p(89156),Z=p(10266),Q=p(71948),A=p(83902);function ee(n,a){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 ne(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"span",21)(1,"i",22),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onShowTotal())}),t._uU(2,"?"),t.qZA()()}}let oe=(()=>{class n{constructor(e,o,i){(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"modalConfig",void 0),(0,l.Z)(this,"pageNumber",1),(0,l.Z)(this,"pageSize",1e4),(0,l.Z)(this,"startExport",1),(0,l.Z)(this,"endExport",void 0),(0,l.Z)(this,"isShowTotal",!1),(0,l.Z)(this,"totalCount",1e4),(0,l.Z)(this,"isExportCsv",!0),(0,l.Z)(this,"totalRowCount$",void 0),this.data=e,this.dialogRef=o,this.httpService=i,this.modalConfig=new y.O,this.modalConfig.title=e.title,this.modalConfig.headerType=g.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,F.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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.WI),t.Y36(h.so),t.Y36(f.O))}),(0,l.Z)(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,ee,5,5,"ng-conntainer",19),t.YNc(34,ne,3,0,"ng-template",null,20,t.W1O),t._uU(36," transactions "),t.qZA()()()()()()),2&e){const i=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",i)}},dependencies:[Z.gM,c.O5,D.M,s.Fj,s.JJ,s.On,Q.VQ,Q.U0,A.b,c.Ov,c.JJ]})),n})();var H=p(39300),K=p(17554),C=p(97185),G=p(24424),v=p(51161),T=p(30273),R=p(98085),V=p(11594),rt=p(3077),S=p(93669);function ie(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",10)(1,"input",11),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectAllProducts(i.target.checked))}),t.qZA()()}}function ae(n,a){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Price"),t.qZA())}function re(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",10)(1,"input",22),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)}}const Zt=function(n){return{width:n}};function le(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"img",23),t.NdJ("click",function(i){t.CHM(e);const r=t.oxw().$implicit,d=t.oxw();return t.KtG(d.onOpenBigPicture(r,i))}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Akn(t.VKq(3,Zt,o.data.ThumbnailWidth+"px")),t.Q6J("src",e.ThumbnailUrl,t.LSH)}}const Tt=function(){return["/menu/Products/Catalog/Products/Info"]},lt=function(n){return{ID:n}};function ce(n,a){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,Tt))("queryParams",t.VKq(6,lt,e.ID)),t.xp6(1),t.Akn(t.VKq(8,Zt,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 se(n,a){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 de(n,a){if(1&n&&(t.TgZ(0,"i",33),t._uU(1),t.qZA()),2&n){const e=t.oxw(3).$implicit;t.xp6(1),t.Oqu(" - "+e.Allocated+" Allocated ")}}function pe(n,a){if(1&n&&(t.ynx(0),t.YNc(1,de,2,1,"i",32),t.BQk()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("ngIf",e.Allocated)}}function ue(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"i",26),t._uU(2),t.qZA(),t.YNc(3,pe,2,1,"ng-container",15),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.hij("( ",null==e.Inventory?0:e.Inventory," On Hand )"),t.xp6(1),t.Q6J("ngIf",2!=e.TypeID)}}const me=function(){return["/menu/Products/Catalog/Variants/Info"]},bt=function(n){return{"text-decoration-line-through":n}};function _e(n,a){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,ue,4,2,"ng-container",15),t.qZA()),2&n){const e=a.$implicit,o=t.oxw(3);t.xp6(1),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(8,me))("queryParams",t.VKq(9,lt,e.ID)),t.xp6(1),t.Tol(t.VKq(11,bt,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 ge(n,a){if(1&n&&(t.TgZ(0,"ul",27),t.YNc(1,_e,7,13,"li",28),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",e.Variants)}}function fe(n,a){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 he(n,a){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,re,2,1,"td",3),t.TgZ(2,"td")(3,"div",13)(4,"div",14),t.YNc(5,le,2,5,"ng-container",15),t.ynx(6),t.YNc(7,ce,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,se,5,6,"i",19),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.qZA(),t.TgZ(16,"td"),t.YNc(17,ge,2,1,"ul",20),t.qZA(),t.YNc(18,fe,3,4,"td",21),t.TgZ(19,"td"),t._uU(20),t.ALo(21,"date"),t.qZA()()),2&n){const e=a.$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,bt,e.Discontinued)),t.Q6J("routerLink",t.DdM(20,Tt))("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.PriceVisible),t.xp6(2),t.Oqu(t.xi3(21,15,e.Released,"dd MMM yy"))}}let ve=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"pageData",void 0),(0,l.Z)(this,"selectAllProducts",new t.vpe),(0,l.Z)(this,"openBigPicture",new t.vpe),(0,l.Z)(this,"renderScenario",J),this.roleService=e}onSelectAllProducts(e){this.selectAllProducts.emit(e)}onOpenBigPicture(e,o){this.openBigPicture.emit({product:e,pEvent:o})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,ie,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,ae,2,0,"th",7),t.TgZ(13,"th",8),t._uU(14,"Released"),t.qZA()()(),t.TgZ(15,"tbody"),t.YNc(16,he,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.PriceVisible),t.xp6(4),t.Q6J("ngForOf",o.data.Data))},dependencies:[u.rH,Z.gM,c.sg,c.O5,s.Wl,s.JJ,s.On,c.JJ,c.uU,S.qU,S.Mj],changeDetection:0})),n})();function xe(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",22),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.httpPostListID("catalog/product/BulkDiscontinue"))}),t._uU(1," Discontinue "),t.qZA()}}function Ce(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",22),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.httpPostListID("catalog/product/BulkReactivate"))}),t._uU(1," Continue "),t.qZA()}}function Ze(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"li",23)(1,"a",24),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.httpPostListID("catalog/product/DeleteProductList"))}),t._UZ(2,"i",25),t._uU(3," Delete "),t.qZA()()}}function Te(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"li",23)(1,"a",26),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.mergeData())}),t._UZ(2,"i",27),t._uU(3," Merge "),t.qZA()()}}function be(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"li",23)(1,"a",28),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.moveProduct("catalog/product/MoveProduct"))}),t._UZ(2,"i",29),t._uU(3," Move "),t.qZA()()}}function ye(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"div",17),t.YNc(2,xe,2,0,"a",18),t.YNc(3,Ce,2,0,"a",18),t._UZ(4,"button",19),t.TgZ(5,"ul",20),t.YNc(6,Ze,4,0,"li",21),t.YNc(7,Te,4,0,"li",21),t.YNc(8,be,4,0,"li",21),t.qZA()(),t.BQk()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngIf",!e.pageData.Filter.ProductDiscontinued),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.ProductDiscontinued),t.xp6(3),t.Q6J("ngIf",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.roleService.product.Edit)}}const Ie=function(){return["/menu/Products/Catalog/Products/Import"]};function Me(n,a){1&n&&(t.TgZ(0,"a",30),t._UZ(1,"i",31),t._uU(2," Import"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Ie))}function Pe(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",32),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openExportModal())}),t._UZ(1,"i",33),t._uU(2," Export "),t.qZA()}}const De=function(){return["/menu/Products/Catalog/Products/Form"]};function Ae(n,a){1&n&&(t.TgZ(0,"a",34),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,De))}function Se(n,a){if(1&n&&(t.TgZ(0,"div",41),t._uU(1),t.qZA()),2&n){const e=a.item;t.s9C("matTooltip",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ne(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",35)(1,"div",36)(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",37),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.CategoryID=i)}),t.YNc(5,Se,2,2,"ng-template",38),t.qZA()(),t.TgZ(6,"div")(7,"h6"),t._uU(8,"Brand"),t.qZA(),t.TgZ(9,"ng-select",37),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.BrandID=i)}),t.qZA()(),t.TgZ(10,"div")(11,"h6"),t._uU(12,"Product Discontinued"),t.qZA(),t.TgZ(13,"radio-options",39),t.NdJ("modelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.ProductDiscontinued=i)}),t.qZA()(),t.TgZ(14,"div")(15,"h6"),t._uU(16,"Variant Discontinued"),t.qZA(),t.TgZ(17,"radio-options",40),t.NdJ("modelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.VariantDiscontinued=i)}),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 qe(n,a){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",37),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.pageData.Filter.EntityGroupID=i)}),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 we=function(n){return{show:n}};function Ue(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",42)(1,"div")(2,"h6"),t._uU(3,"Tags"),t.qZA(),t.TgZ(4,"ng-select",43),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.TagsID=i)}),t.qZA()(),t.TgZ(5,"div")(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"div")(9,"datepicker",44),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.From=i)}),t.qZA()(),t.TgZ(10,"div",45)(11,"datepicker",46),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.To=i)}),t.qZA()()(),t.YNc(12,qe,4,2,"div",2),t.qZA()}if(2&n){const e=t.oxw(2);t.Tol(t.VKq(7,we,e.more)),t.xp6(4),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Tags)("ngModel",e.pageData.Filter.TagsID),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(2),t.Q6J("date",e.pageData.Filter.To),t.xp6(1),t.Q6J("ngIf",e.pageData.Options.EntityGroups.length>0)}}const Oe=function(n){return{width:n}};function Je(n,a){if(1&n&&(t.TgZ(0,"a",56),t._UZ(1,"img",57),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,Oe,o.data.ThumbnailWidth+"px")),t.s9C("src",e.ThumbnailUrl,t.LSH)}}const yt=function(){return["/menu/Products/Catalog/Products/Info"]},ct=function(n){return{ID:n}};function Ve(n,a){if(1&n&&(t.TgZ(0,"a",58),t._UZ(1,"img",59),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,yt))("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 ke(n,a){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 Fe(n,a){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 Qe(n,a){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 Ee(n,a){if(1&n&&(t.TgZ(0,"i",65),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.Oqu(" - "+e.Allocated+" Allocated ")}}function Le(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"i",63),t._uU(2),t.qZA(),t.YNc(3,Ee,2,1,"i",64),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.hij("( ",null==e.Inventory?0:e.Inventory," On Hand )"),t.xp6(1),t.Q6J("ngIf",e.Allocated)}}const Ye=function(){return["/menu/Products/Catalog/Variants/Info"]};function He(n,a){if(1&n&&(t.TgZ(0,"li",60)(1,"a",61),t.YNc(2,Fe,3,1,"span",2),t.YNc(3,Qe,2,1,"span",2),t.qZA(),t.TgZ(4,"small",62),t._uU(5),t.qZA(),t.YNc(6,Le,4,2,"ng-container",2),t.qZA()),2&n){const e=a.$implicit,o=t.oxw(4);t.xp6(1),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(7,Ye))("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 Ke(n,a){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 Ge=function(n){return{"text-decoration-line-through":n}};function Re(n,a){if(1&n&&(t.TgZ(0,"div",49),t.YNc(1,Je,2,7,"a",50),t.YNc(2,Ve,2,7,"a",51),t.TgZ(3,"div",52)(4,"a",53),t._uU(5),t.qZA(),t.YNc(6,ke,2,1,"small",2),t.TgZ(7,"ul",54),t.YNc(8,He,7,10,"li",55),t.qZA()(),t.YNc(9,Ke,3,4,"div",2),t.qZA()),2&n){const e=a.$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,Ge,e.Discontinued)),t.s9C("target",o.pageData.LinkTarget),t.Q6J("routerLink",t.DdM(13,yt))("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.PriceVisible)}}function Be(n,a){if(1&n&&(t.TgZ(0,"div",47),t.YNc(1,Re,10,16,"div",48),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function $e(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Text=i)})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,ye,9,5,"ng-container",2),t.TgZ(3,"div",3),t.YNc(4,Me,3,2,"a",4),t.YNc(5,Pe,3,0,"a",5),t.qZA(),t.YNc(6,Ae,2,2,"a",6),t.qZA(),t.TgZ(7,"filters")(8,"div",7),t.YNc(9,Ne,18,8,"div",8),t.YNc(10,Ue,13,9,"div",9),t.TgZ(11,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.more=!i.more)}),t._uU(12),t._UZ(13,"i",11),t.qZA()()(),t.TgZ(14,"content")(15,"div",12)(16,"div",13)(17,"POS-product-list-desktop",14),t.NdJ("selectAllProducts",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectAllData(i))})("openBigPicture",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.openBiggerPicture(i))}),t.qZA()(),t.YNc(18,Be,2,1,"div",15),t.TgZ(19,"POS-complex-pagination",16),t.NdJ("jumpToPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("previousPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("nextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.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.Edit||e.roleService.product.Delete)),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",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(2),t.hij("",e.more?"Less":"More"," "),t.xp6(5),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 je=BiggerPicture({target:document.body});let We=(()=>{class n extends M.n{constructor(e,o,i,r,d){super(e,"catalog/product/GetProductList","catalog/ProductLoader/ProductList",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"more",void 0),(0,l.Z)(this,"radioOption",void 0),(0,l.Z)(this,"renderScenario",J),this.httpService=e,this.csvConverter=i,this.matDialog=r,this.roleService=d,this.radioOption=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"},{Key:null,Value:"All"}]}Select_Export(){this.matDialog.open(oe,{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(I,{data:{Form:{CategoryID:null},Options:this.pageData.Options}}).afterClosed().subscribe(r=>{if(r){const d=r.Model.Form.CategoryID,_=o.map(b=>b.ID);this.postData(e,{ID:d,List:_})}})}s2ab(e){for(var o=new ArrayBuffer(e.length),i=new Uint8Array(o),r=0;r!=e.length;++r)i[r]=255&e.charCodeAt(r);return o}exportXlsx(e){this.pageData.Filter.FormatType=M.s.XLSX,this.httpService.post(`/api/${e}`,JSON.stringify(this.pageData.Filter)).subscribe(o=>{let i="Product.xlsx";i=decodeURI(i);const r=window.URL.createObjectURL(new Blob([this.s2ab(atob(o))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),d=document.createElement("a");d.href=r,d.setAttribute("download",i),document.body.appendChild(d),d.click(),window.URL.revokeObjectURL(r),d.remove()})}mergeData(){this.httpPostListID("catalog/product/MergeProduct","Are you sure you want to merge these records?")}openBiggerPicture(e){return(0,O.Z)(function*(){e.pEvent.preventDefault();try{const o=yield(0,m.FI)(e.product.ImageUrl);je.open({items:[o],intro:"fadeup"})}catch(o){alert(o)}})()}openExportModal(){this.matDialog.open(K.H,{data:{title:"Product",exportTypes:[{ID:"ProductExport/ExportProductList",Value:"Default",FileName:"Product"},{ID:"ProductExport/ExportProductListWithOutletPrice",Value:"Outlet Price",FileName:"Export with Outlet Price"},{ID:"ProductExport/ExportProductListWithPricebook",Value:"Pricebook",FileName:"Export with Pricebook"},{ID:"ProductExport/ExportProductListWithComponents",Value:"Components",FileName:"Export with Components"},{ID:"ProductExport/ExportProductListWithParent",Value:"Parent",FileName:"Export with Parent"},{ID:"ProductExport/ExportProductListWithSerial",Value:"Serial",FileName:"Export with Serial"},{ID:"ProductExport/ExportProductListWithSerialAndRow",Value:"Serial and Row",FileName:"Export with Serial and Row"},{ID:"ProductExport/ExportProductListWithTags",Value:"Tags",FileName:"Export with Tags"},{ID:"ProductExport/ExportProductListWithSalesGroupCommission",Value:"Commission",FileName:"Export with Commission"},{ID:"ProductExport/ExportProductListWithInventory",Value:"Inventory",FileName:"Export with Inventory"},{ID:"ProductExport/ExportProductListMinMaxWithInventory",Value:"ROP & Max Inventory",FileName:"Export with ROP & Max Inventory"},{ID:"ProductExport/ExportProductListWithPreapaid",Value:"Prepaid",FileName:"Export with Prepaid"},{ID:"ProductExport/ExportProductListWithStorageLocation",Value:"Storage Location",FileName:"Export with Storage Location"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"catalog/product/ProductRowsCount",pagination:!0}})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(G.O),t.Y36(h.uw),t.Y36(v.N))}),(0,l.Z)(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"],[4,"ngIf"],[1,"btn-group","ms-5","me-4"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",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"],[1,"btn-group","ms-5"],["data-cy","DiscountinueProduct","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],["class","dropdown-item",4,"ngIf"],["data-cy","DiscountinueProduct",1,"btn","btn-outline-secondary",3,"click"],[1,"dropdown-item"],["data-cy","DeleteProduct",3,"click"],[1,"fa-solid","fa-trash"],[3,"click"],[1,"fa-solid","fa-merge"],["matTooltipPosition","above","matTooltip","Move",3,"click"],[1,"fa-solid","fa-arrows-up-down-left-right"],[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-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"],[1,"mt-4"],["name","To",3,"date","dateChange"],[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,$e,20,14,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.sg,c.O5,s.JJ,s.On,x.w9,x.ir,R.QB,V.P,rt.v,ve,S.Mj],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})),n})();var w=p(41206),It=p(29521),q=p(88651),k=p(16571),tt=p(77579),ze=p(54968),Xe=p(78372),st=p(82722);let tn=(()=>{class n{constructor(e,o){switch((0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"Model",void 0),(0,l.Z)(this,"configModal",void 0),(0,l.Z)(this,"Title",void 0),this.dialogRef=e,this.data=o,this.Title="",this.Model=o,this.configModal=new y.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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.so),t.Y36(h.WI))}),(0,l.Z)(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:[D.M,s.Fj,s.JJ,s.On]})),n})(),Mt=(()=>{class n{constructor(e,o){(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"modalConfig",void 0),this.data=e,this.dialogRef=o,this.modalConfig=new y.O,this.modalConfig.title=e.title,this.modalConfig.headerType=g.n.Error}onOk(){this.dialogRef.close("REMOVE")}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.WI),t.Y36(h.so))}),(0,l.Z)(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:[D.M]})),n})();function en(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",11)(2,"input",30),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.item.UnitCost=i)}),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 nn(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Model=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Code=i)}),t.qZA(),t.TgZ(11,"label",16),t._uU(12,"Variant Code"),t.qZA()()()(),t.TgZ(13,"div",9),t.YNc(14,en,5,1,"div",17),t.TgZ(15,"div",18)(16,"div",11)(17,"input",19),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UnitPrice=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Discount=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Weight=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Description=i)}),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 on(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",37)(1,"div",11)(2,"input",51),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.item.Ratio=i)}),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 B=function(n){return{selected:n}},an=function(n){return{"Choose UOM":n}};function rn(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.TypeID=i)}),t.qZA()()(),t.YNc(6,on,5,1,"div",36),t.TgZ(7,"div",37)(8,"div",11)(9,"input",38),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UnitQuantity=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UOM=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.UOMQ=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Name=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.item.Discontinued=i)}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(2),t.Tol(t.VKq(21,B,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,B,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,an,e.IsEmpty(e.item.UOM))),t.xp6(4),t.Tol(t.VKq(27,B,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 ln=(()=>{class n{constructor(e,o,i){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"configModal",void 0),(0,l.Z)(this,"item",void 0),(0,l.Z)(this,"currentTabState","GENERAL"),this.dialogRef=e,this.data=o,this.roleService=i,this.item=Object.assign({},o.form),this.configModal=new y.O,this.configModal.title="Add New Variant?",m.gT.IsNotEmpty(this.item)&&(this.configModal.title="Edit Variant"),this.configModal.headerType=g.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 m.gT.IsEmpty(e)}IsNotEmpty(e){return m.gT.IsNotEmpty(e)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.so),t.Y36(h.WI),t.Y36(v.N))}),(0,l.Z)(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,nn,35,7,"ng-container",6),t.YNc(10,rn,36,29,"ng-template",null,7,t.W1O),t.qZA()()()),2&e){const i=t.MAs(11);t.Q6J("config",o.configModal),t.xp6(5),t.Q6J("ngClass",t.VKq(5,B,"GENERAL"==o.currentTabState)),t.xp6(2),t.Q6J("ngClass",t.VKq(7,B,"ADVANCED"==o.currentTabState)),t.xp6(2),t.Q6J("ngIf","GENERAL"==o.currentTabState)("ngIfElse",i)}},dependencies:[c.mk,c.O5,D.M,s.Fj,s.JJ,s.nD,s.On,x.w9,V.P,A.b]})),n})();var Pt=p(22414),U=p(10805),cn=p(59549),P=p(96308),$=p(77331),L=p(58393),dt=p(54825),Dt=p(19592),pt=p(72526),sn=p(91795),Y=p(14323),At=p(60982);const dn=["container"],pn=["focusInput"],un=["filter"],mn=["tree"],_n=["panel"],gn=["overlay"];function fn(n,a){1&n&&t.GkF(0)}const hn=function(n,a){return{$implicit:n,placeholder:a}};function vn(n,a){if(1&n&&(t.ynx(0),t.YNc(1,fn,1,0,"ng-container",15),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngTemplateOutlet",e.valueTemplate)("ngTemplateOutletContext",t.WLB(2,hn,e.value,e.placeholder))}}function xn(n,a){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,a){if(1&n&&(t.TgZ(0,"div",19)(1,"span",20),t._uU(2),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(e.label)}}function Zn(n,a){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 Tn(n,a){if(1&n&&(t.YNc(0,Cn,3,1,"div",17),t.YNc(1,Zn,2,1,"ng-container",18)),2&n){const e=t.oxw(2);t.Q6J("ngForOf",e.value),t.xp6(1),t.Q6J("ngIf",e.emptyValue)}}function bn(n,a){if(1&n&&(t.YNc(0,xn,2,1,"ng-container",7),t.YNc(1,Tn,2,2,"ng-template",null,16,t.W1O)),2&n){const e=t.MAs(2),o=t.oxw();t.Q6J("ngIf","comma"===o.display)("ngIfElse",e)}}function yn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"i",21),t.NdJ("click",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.clear(i))}),t.qZA()}}function In(n,a){1&n&&t.GkF(0)}function Mn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",28)(1,"div",29)(2,"input",30,31),t.NdJ("keydown.enter",function(i){return i.preventDefault()})("input",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onFilterInput(i))}),t.qZA(),t._UZ(4,"span",32),t.qZA(),t.TgZ(5,"button",33),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.hide())}),t._UZ(6,"span",34),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("value",e.filterValue),t.uIk("placeholder",e.filterPlaceholder)}}function Pn(n,a){1&n&&t.GkF(0)}function Dn(n,a){if(1&n&&t.YNc(0,Pn,1,0,"ng-container",36),2&n){const e=t.oxw(3);t.Q6J("ngTemplateOutlet",e.emptyTemplate)}}function An(n,a){1&n&&(t.ynx(0),t.YNc(1,Dn,1,1,"ng-template",35),t.BQk())}function Sn(n,a){1&n&&t.GkF(0)}const St=function(n,a){return{$implicit:n,options:a}},Nn=function(n){return{"max-height":n}};function qn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",22,23),t.YNc(2,In,1,0,"ng-container",15),t.YNc(3,Mn,7,2,"div",24),t.TgZ(4,"div",25)(5,"p-tree",26,27),t.NdJ("selectionChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectionChange(i))})("onNodeExpand",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.nodeExpand(i))})("onNodeCollapse",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.nodeCollapse(i))})("onNodeSelect",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelect(i))})("onNodeUnselect",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onUnselect(i))}),t.YNc(7,An,2,0,"ng-container",18),t.qZA()(),t.YNc(8,Sn,1,0,"ng-container",15),t.qZA()}if(2&n){const e=t.oxw();t.Tol(e.panelStyleClass),t.Q6J("ngStyle",e.panelStyle)("ngClass",e.panelClass),t.xp6(2),t.Q6J("ngTemplateOutlet",e.headerTemplate)("ngTemplateOutletContext",t.WLB(24,St,e.value,e.options)),t.xp6(1),t.Q6J("ngIf",e.filter),t.xp6(1),t.Q6J("ngStyle",t.VKq(27,Nn,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)("filteredNodes",e.filteredNodes)("_templateMap",e.templateMap),t.xp6(2),t.Q6J("ngIf",e.emptyTemplate),t.xp6(1),t.Q6J("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",t.WLB(29,St,e.value,e.options))}}const wn={provide:s.JU,useExisting:(0,t.Gpc)(()=>Nt),multi:!0};let Nt=(()=>{class n{constructor(e,o,i,r){this.config=e,this.cd=o,this.el=i,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.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()}get showTransitionOptions(){return this._showTransitionOptions}set showTransitionOptions(e){this._showTransitionOptions=e,console.warn("The showTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}get hideTransitionOptions(){return this._hideTransitionOptions}set hideTransitionOptions(e){this._hideTransitionOptions=e,console.warn("The hideTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}ngOnInit(){this.updateTreeState()}ngAfterContentInit(){this.templates.length&&(this.templateMap={}),this.templates.forEach(e=>{switch(e.getType()){case"value":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;break;default:e.name?this.templateMap[e.name]=e.template:this.valueTemplate=e.template}})}onOverlayAnimationStart(e){"visible"===e.toState&&this.filter&&(At.gb.isNotEmpty(this.filterValue)&&this.treeViewChild?._filter(this.filterValue),this.filterInputAutoFocus&&this.filterViewChild.nativeElement.focus())}onSelectionChange(e){this.value=e,this.onModelChange(this.value),this.cd.markForCheck()}onClick(e){this.disabled||!this.overlayViewChild?.el?.nativeElement?.contains(e.target)&&!Dt.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.panelEl?.nativeElement){let o=Dt.p.getFocusableElements(this.panelEl.nativeElement);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(e){this.overlayVisible=!1,this.resetFilter(),this.onHide.emit(e),this.cd.markForCheck()}clear(e){this.value=null,this.resetExpandedNodes(),this.resetPartialSelected(),this.onModelChange(this.value),this.onClear.emit(),e.stopPropagation()}checkValue(){return null!==this.value&&At.gb.isNotEmpty(this.value)}resetFilter(){this.filter&&!this.resetFilterOnHide?(this.filteredNodes=this.treeViewChild?.filteredNodes,this.treeViewChild?.resetFilter()):this.filterValue=null}updateTreeState(){if(this.value){let e="single"===this.selectionMode?[this.value]:[...this.value];this.resetExpandedNodes(),this.resetPartialSelected(),e&&this.options&&this.updateTreeBranchState(null,null,e)}}updateTreeBranchState(e,o,i){if(e){if(this.isSelected(e)&&(this.expandPath(o),i.splice(i.indexOf(e),1)),i.length>0&&e.children)for(let r of e.children)this.updateTreeBranchState(r,[...o,e],i)}else for(let r of this.options)this.updateTreeBranchState(r,[],i)}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=[]}resetPartialSelected(e=this.options){if(e)for(let o of e)o.partialSelected=!1,o.children&&o.children?.length>0&&this.resetPartialSelected(o.children)}findSelectedNodes(e,o,i){if(e){if(this.isSelected(e)&&(i.push(e),delete o[e.key]),Object.keys(o).length&&e.children)for(let r of e.children)this.findSelectedNodes(r,o,i)}else for(let r of this.options)this.findSelectedNodes(r,o,i)}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 i=0;i<this.value.length;i++){let r=this.value[i];if(r.key&&r.key===e.key||r==e){o=i;break}}return o}onSelect(e){this.onNodeSelect.emit(e),"single"===this.selectionMode&&this.hide()}onUnselect(e){this.onNodeUnselect.emit(e)}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()}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(U.b4),t.Y36(t.sBO),t.Y36(t.SBq),t.Y36(U.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["p-treeSelect"]],contentQueries:function(e,o,i){if(1&e&&t.Suo(i,U.jx,4),2&e){let r;t.iGM(r=t.CRH())&&(o.templates=r)}},viewQuery:function(e,o){if(1&e&&(t.Gf(dn,5),t.Gf(pn,5),t.Gf(un,5),t.Gf(mn,5),t.Gf(_n,5),t.Gf(gn,5)),2&e){let i;t.iGM(i=t.CRH())&&(o.containerEl=i.first),t.iGM(i=t.CRH())&&(o.focusInput=i.first),t.iGM(i=t.CRH())&&(o.filterViewChild=i.first),t.iGM(i=t.CRH())&&(o.treeViewChild=i.first),t.iGM(i=t.CRH())&&(o.panelEl=i.first),t.iGM(i=t.CRH())&&(o.overlayViewChild=i.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",panelStyle:"panelStyle",panelStyleClass:"panelStyleClass",containerStyle:"containerStyle",containerStyleClass:"containerStyleClass",labelStyle:"labelStyle",labelStyleClass:"labelStyleClass",overlayOptions:"overlayOptions",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([wn])],decls:16,vars:22,consts:[[3,"ngClass","ngStyle","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","ngStyle"],[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"],[3,"visible","options","target","appendTo","showTransitionOptions","hideTransitionOptions","visibleChange","onAnimationStart","onShow","onHide"],["overlay",""],["pTemplate","content"],[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,"ngStyle","ngClass"],["panel",""],["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","filteredNodes","_templateMap","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,vn,2,5,"ng-container",7),t.YNc(8,bn,3,2,"ng-template",null,8,t.W1O),t.qZA(),t.YNc(10,yn,1,0,"i",9),t.qZA(),t.TgZ(11,"div",10),t._UZ(12,"span",11),t.qZA(),t.TgZ(13,"p-overlay",12,13),t.NdJ("visibleChange",function(r){return o.overlayVisible=r})("onAnimationStart",function(r){return o.onOverlayAnimationStart(r)})("onShow",function(r){return o.onShow.emit(r)})("onHide",function(r){return o.hide(r)}),t.YNc(15,qn,9,32,"ng-template",14),t.qZA()()),2&e){const i=t.MAs(9);t.Tol(o.containerStyleClass),t.Q6J("ngClass",o.containerClass())("ngStyle",o.containerStyle),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.Tol(o.labelStyleClass),t.Q6J("ngClass",o.labelClass())("ngStyle",o.labelStyle),t.xp6(1),t.Q6J("ngIf",o.valueTemplate)("ngIfElse",i),t.xp6(3),t.Q6J("ngIf",o.checkValue()&&!o.disabled&&o.showClear),t.xp6(3),t.Q6J("visible",o.overlayVisible)("options",o.overlayOptions)("target","@parent")("appendTo",o.appendTo)("showTransitionOptions",o.showTransitionOptions)("hideTransitionOptions",o.hideTransitionOptions)}},dependencies:[c.mk,c.sg,c.O5,c.tP,c.PC,pt.aV,U.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-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,changeDetection:0}),n})(),Un=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[c.ez,pt.U8,sn.T,U.m8,Y.xc,pt.U8,U.m8,Y.xc]}),n})();var qt=p(97392);function On(n,a){1&n&&(t.TgZ(0,"span",51),t._uU(1," Name required."),t.qZA())}function Jn(n,a){1&n&&(t.TgZ(0,"span",51),t._uU(1," Product name + code combination already exists"),t.qZA())}function Vn(n,a){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 kn(n,a){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 Fn(n,a){1&n&&(t.TgZ(0,"div",74),t._uU(1,"Main Image"),t.qZA())}function Qn(n,a){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(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.drop(i))}),t.TgZ(1,"div",64),t._UZ(2,"img",65),t.TgZ(3,"div",66)(4,"a",67),t.NdJ("click",function(i){const d=t.CHM(e).$implicit,_=t.oxw(3);return t.KtG(_.onZoomImage(d.URL,i))}),t._UZ(5,"i",68),t.qZA(),t.TgZ(6,"a",69),t.NdJ("click",function(){const r=t.CHM(e).index,d=t.oxw(3);return t.KtG(d.onRemoveImage(r))}),t._UZ(7,"i",70),t.qZA(),t.TgZ(8,"a",71),t.NdJ("click",function(){const i=t.CHM(e),r=i.$implicit,d=i.index,_=t.oxw(3);return t.KtG(_.onEditImage(r.URL,d))}),t._UZ(9,"i",72),t.qZA()(),t.YNc(10,Fn,2,0,"div",73),t.qZA()()}if(2&n){const e=a.$implicit,o=a.index;t.Q6J("cdkDropListData",o),t.xp6(2),t.Q6J("src",e.URL,t.LSH),t.xp6(8),t.Q6J("ngIf",0==o)}}function En(n,a){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,Qn,11,3,"div",60),t.TgZ(11,"button",61),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.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 Ln(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",87)(1,"div",11)(2,"input",88),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.data.Product.VariantUnitCost=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.ChangeVariant(i.data.Product.VariantUnitCost,"UnitCost"))}),t.qZA(),t.TgZ(3,"label",89),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 Yn(n,a){1&n&&(t.TgZ(0,"span",90),t._uU(1,"[override all variants price]"),t.qZA())}const Hn=function(n){return{"mb-4":n}};function Kn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",75)(1,"div",8)(2,"h3"),t._uU(3,"Pricing and Variants"),t.qZA()(),t.TgZ(4,"div",9)(5,"div",5),t.YNc(6,Ln,5,1,"div",76),t.TgZ(7,"div",77)(8,"div",11)(9,"input",78),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantUnitPrice=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.ChangeVariant(i.data.Product.VariantUnitPrice,"UnitPrice"))}),t.qZA(),t.TgZ(10,"label",79),t._uU(11,"Selling Price"),t.qZA(),t.YNc(12,Yn,2,0,"span",80),t.qZA()(),t.TgZ(13,"div",32)(14,"div",16)(15,"div",81)(16,"div",82),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.FocusOnTagsInput(!1))}),t.TgZ(17,"div"),t._UZ(18,"i",83),t.qZA(),t.TgZ(19,"div",84),t._uU(20," Single "),t.qZA()()(),t.TgZ(21,"div",81)(22,"div",85),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.FocusOnTagsInput(!0))}),t.TgZ(23,"div"),t._UZ(24,"i",86),t.qZA(),t.TgZ(25,"div",84),t._uU(26," Multiple "),t.qZA()()()()()()()()}if(2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(6,Hn,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 Gn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-chip-row",105),t.NdJ("removed",function(){const r=t.CHM(e).$implicit,d=t.oxw(3);return t.KtG(d.removeVariant(r))}),t._uU(1),t.TgZ(2,"mat-icon",106),t._uU(3,"x"),t.qZA()()}if(2&n){const e=a.$implicit;t.Q6J("selectable",!0)("removable",!0),t.xp6(1),t.hij(" ",e," ")}}function Rn(n,a){1&n&&(t.TgZ(0,"th",124),t._uU(1,"UnitCost "),t.qZA())}function Bn(n,a){1&n&&(t.TgZ(0,"th",125),t._uU(1,"Ratio"),t.qZA())}function $n(n,a){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 jn(n,a){if(1&n&&(t.TgZ(0,"small",134),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 Wn(n,a){if(1&n&&(t.TgZ(0,"td",130),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 zn(n,a){if(1&n&&(t.TgZ(0,"td",121),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 Xn=function(n){return{"text-decoration":n}};function to(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"tr",126),t.NdJ("click",function(){const i=t.CHM(e),r=i.$implicit,d=i.index,_=t.oxw(4);return t.KtG(_.openDialogVariant(r,d))}),t.TgZ(1,"td")(2,"i",127),t.NdJ("click",function(){const r=t.CHM(e).index,d=t.oxw(4);return t.KtG(d.data.Product.Variants.splice(r,1))}),t.qZA()(),t.TgZ(3,"td")(4,"div",128),t._uU(5),t.YNc(6,$n,2,1,"span",120),t.qZA(),t.YNc(7,jn,2,1,"small",129),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.qZA(),t.TgZ(10,"td",130),t._uU(11),t.ALo(12,"number"),t.qZA(),t.YNc(13,Wn,3,3,"td",131),t.TgZ(14,"td",130),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",132),t._uU(18),t.ALo(19,"number"),t.qZA(),t.YNc(20,zn,3,3,"td",133),t.qZA()}if(2&n){const e=a.$implicit,o=t.oxw(4);t.Q6J("cdkDragDisabled","small"==o.screenSize),t.xp6(3),t.Akn(t.VKq(20,Xn,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 eo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",135),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(4);return t.KtG(r.data.Product.VariantWeight=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(4);return t.KtG(i.ChangeVariant(i.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 no(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",107)(1,"div",58)(2,"div",108)(3,"table",109),t.NdJ("matSortChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.sortData(i))})("cdkDropListDropped",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.dropVariant(i))}),t.TgZ(4,"thead",110)(5,"tr"),t._UZ(6,"th",111),t.TgZ(7,"th",112),t._uU(8,"Variant"),t.qZA(),t.TgZ(9,"th",113),t._uU(10,"Code"),t.qZA(),t.TgZ(11,"th",114),t._uU(12,"Weight (GR)"),t.qZA(),t.YNc(13,Rn,2,0,"th",115),t.TgZ(14,"th",116),t._uU(15,"UnitPrice"),t.qZA(),t.TgZ(16,"th",116),t._uU(17,"%"),t.qZA(),t.YNc(18,Bn,2,0,"th",117),t.qZA()(),t.TgZ(19,"tbody"),t.YNc(20,to,21,22,"tr",118),t.qZA(),t.TgZ(21,"tfoot")(22,"tr"),t._UZ(23,"td",119),t.YNc(24,eo,2,1,"td",120),t.TgZ(25,"td",121)(26,"input",122),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.data.Product.VariantUnitCost=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.ChangeVariant(i.data.Product.VariantUnitCost,"UnitCost"))}),t.qZA()(),t.TgZ(27,"td",121)(28,"input",122),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.data.Product.VariantUnitPrice=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.ChangeVariant(i.data.Product.VariantUnitPrice,"UnitPrice"))}),t.qZA()(),t.TgZ(29,"td")(30,"input",123),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.VariantDiscount=i)})("keyup",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.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 oo=function(n,a){return{"mb-6":n,"mb-3":a}},io=function(n){return{"text-danger":n}};function ao(n,a){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",91)(5,"div",92)(6,"div",93)(7,"mat-form-field",94)(8,"mat-chip-grid",95,96),t.YNc(10,Gn,4,3,"mat-chip-row",97),t.TgZ(11,"input",98),t.NdJ("matChipInputTokenEnd",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.addVariant(i))}),t.qZA()()()(),t.TgZ(12,"div",99)(13,"div",100),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.addMultipleVariants())}),t.TgZ(14,"span",101),t._UZ(15,"i",102),t.TgZ(16,"strong",103),t._uU(17,"ADD"),t.qZA()()()()(),t.YNc(18,no,31,7,"div",104),t.qZA()()}if(2&n){const e=t.MAs(9),o=t.oxw(2);t.xp6(5),t.Q6J("ngClass",t.WLB(8,oo,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,io,o.statVariantAdd.length>0))("matChipInputSeparatorKeyCodes",o.separatorKeysCodes)("matChipInputAddOnBlur",!0),t.xp6(7),t.Q6J("ngIf",o.EditMode||o.data.Product.Variants.length>0)}}const ro=function(n){return{"bg-light":n}};function lo(n,a){if(1&n&&t._UZ(0,"span",149),2&n){const e=t.oxw(4);t.Q6J("ngClass",t.VKq(1,ro,!e.roleService.inventory.Edit))}}function co(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",148),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.UnitsInStock=i)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.UnitsInStock)}}function so(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td",145),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4,":"),t.qZA(),t.TgZ(5,"td"),t.YNc(6,lo,1,3,"span",146),t.YNc(7,co,1,1,"input",147),t.qZA(),t.TgZ(8,"td")(9,"input",148),t.NdJ("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.MinStock=i)}),t.qZA()(),t.TgZ(10,"td")(11,"input",148),t.NdJ("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.MaxStock=i)}),t.qZA()()()}if(2&n){const e=a.$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 po(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",154),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(4);return t.KtG(r.Stock=i)})("keyup",function(i){t.CHM(e);const r=t.oxw(4);return t.KtG(r.UpdateStock(i))}),t.qZA()}if(2&n){const e=t.oxw(4);t.Q6J("ngModel",e.Stock)}}function uo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"tfoot")(1,"tr"),t._UZ(2,"td",150),t.TgZ(3,"td"),t.YNc(4,po,1,1,"input",151),t.qZA(),t.TgZ(5,"td")(6,"input",152),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.MinStock=i)})("keyup",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.UpdateMinStock(i))}),t.qZA()(),t.TgZ(7,"td")(8,"input",153),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.MaxStock=i)})("keyup",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.UpdateMaxStock(i))}),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 mo(n,a){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",108)(6,"table",136),t.NdJ("matSortChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.sortDataInventrory(i))}),t.TgZ(7,"thead",137)(8,"tr")(9,"th",138),t._uU(10,"Outlet "),t._UZ(11,"i",139),t.qZA(),t._UZ(12,"th",140),t.TgZ(13,"th",141),t._uU(14,"On Hand"),t.qZA(),t.TgZ(15,"th",142),t._uU(16," ROP "),t.qZA(),t.TgZ(17,"th",143),t._uU(18," Max "),t.qZA()()(),t.TgZ(19,"tbody"),t.YNc(20,so,12,5,"tr",144),t.qZA(),t.YNc(21,uo,9,3,"tfoot",120),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 et=function(n){return{selected:n}};function _o(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",36)(1,"ng-select",155),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantTypeID=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectVariantType(i))}),t.qZA(),t.TgZ(2,"label",156),t._uU(3,"Type"),t.qZA()()}if(2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(4,et,e.IsNotEmpty(e.data.Product.VariantTypeID))),t.xp6(1),t.Q6J("ngModel",e.data.Product.VariantTypeID)("clearable",!1)("items",e.data.Options.Types)}}function go(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",33)(2,"div",11)(3,"input",157),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantWeight=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.ChangeVariant(i.data.Product.VariantWeight,"Weight"))}),t.qZA(),t.TgZ(4,"label",158),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 fo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",16)(1,"div",33)(2,"div",36)(3,"ng-select",159),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.data.Product.VariantUOM=i)}),t.qZA(),t.TgZ(4,"label",160),t._uU(5,"Units of Measurement"),t.qZA()()(),t.TgZ(6,"div",39)(7,"h2",161),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openDialog("UOM"))}),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,et,e.IsNotEmpty(e.data.Product.VariantUOM))),t.xp6(1),t.Q6J("clearable",!1)("ngModel",e.data.Product.VariantUOM)("items",e.data.Options.UOMs)}}function ho(n,a){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",164),t.NdJ("ngModelChange",function(i){const d=t.CHM(e).index,_=t.oxw(3);return t.KtG(_.selectedStorages[d].Key=i)})("change",function(i){const d=t.CHM(e).$implicit,_=t.oxw(3);return t.KtG(_.onSelectStorage(d.ID,i))}),t.qZA()()()}if(2&n){const e=a.$implicit,o=a.index,i=t.oxw(3);t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Q6J("items",i.options.Storages)("ngModel",i.selectedStorages[o].Key)}}function vo(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"div",108)(2,"table",162)(3,"thead",110)(4,"tr")(5,"th",163),t._uU(6,"Outlet"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"Storage"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,ho,5,3,"tr",144),t.qZA()()()()),2&n){const e=t.oxw(2);t.xp6(10),t.Q6J("ngForOf",e.options.Entities)}}const xo=function(){return["/menu/Products/Catalog/Products"]},Co=function(n){return{"border border-danger":n}};function Zo(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Name=i)})("change",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.ValidateNameCode())}),t.qZA(),t.TgZ(20,"label",14),t._uU(21,"Name"),t.qZA(),t.YNc(22,On,2,0,"span",15),t.YNc(23,Jn,2,0,"span",15),t.qZA(),t.TgZ(24,"div",16)(25,"div",17)(26,"div",11)(27,"input",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Code=i)})("change",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.selectedCategory=i)})("onNodeSelect",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectCategory(i.node))}),t.YNc(33,Vn,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 i=t.oxw();return t.KtG(i.openDialog("Category"))}),t.qZA()()(),t.YNc(38,kn,4,0,"div",27),t.YNc(39,En,14,3,"div",28),t.qZA()()()(),t.YNc(40,Kn,27,8,"div",29),t.YNc(41,ao,19,13,"div",30),t.YNc(42,mo,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Description=i)}),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,_o,4,6,"div",34),t.qZA()(),t.TgZ(59,"div",5)(60,"div",33)(61,"div",11)(62,"autocompleteV2",35),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.SupplierID=i)}),t.qZA()()()(),t.TgZ(63,"div",16)(64,"div",33)(65,"div",36)(66,"ng-select",37),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.BrandID=i)}),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 i=t.oxw();return t.KtG(i.openDialog("Brand"))}),t.qZA()()(),t.TgZ(71,"div",16)(72,"div",33)(73,"div",36)(74,"ng-select",41),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.TagIDs=i)}),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 i=t.oxw();return t.KtG(i.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,go,6,1,"div",28),t.TgZ(85,"div",5)(86,"div",33)(87,"datepicker",44),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Released=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.Discontinued=i)})("modelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.toggleDiscontinue())}),t.qZA()(),t.YNc(92,fo,8,6,"div",47),t.TgZ(93,"div",11)(94,"input",48),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.NextProductName=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.data.Product.NextProductID=i)}),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,vo,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,xo)),t.xp6(2),t.Q6J("disabled",!(null!=o.data.Product&&o.data.Product.Name)),t.xp6(14),t.Q6J("ngClass",t.VKq(41,Co,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,et,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,et,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 To=BiggerPicture({target:document.body});let bo=(()=>{class n extends q.U{constructor(e,o,i,r,d,_,b){super(e,"catalog/ProductLoader/ProductForm",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"cloudinaryService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"destroy$",void 0),(0,l.Z)(this,"separatorKeysCodes",[It.K5,It.OC]),(0,l.Z)(this,"isNameAndCodeExist",void 0),(0,l.Z)(this,"multipleVariants",void 0),(0,l.Z)(this,"EditMode",void 0),(0,l.Z)(this,"ProductName",void 0),(0,l.Z)(this,"statVariantAdd",[]),(0,l.Z)(this,"NewVariantInputs",[]),(0,l.Z)(this,"hasMultipleUOM",void 0),(0,l.Z)(this,"VariantDiscount",void 0),(0,l.Z)(this,"Stock",void 0),(0,l.Z)(this,"MinStock",void 0),(0,l.Z)(this,"MaxStock",void 0),(0,l.Z)(this,"productImages",[]),(0,l.Z)(this,"isRemoveImg",void 0),(0,l.Z)(this,"selectedStorages",[]),(0,l.Z)(this,"screenSize",void 0),(0,l.Z)(this,"smallBreakpoints",576),(0,l.Z)(this,"selectedCategoryLabel",null),(0,l.Z)(this,"selectedCategory",void 0),(0,l.Z)(this,"isCloudinaryErrored",!1),this.httpService=e,this.activatedRoute=o,this.router=i,this.toaster=r,this.cloudinaryService=d,this.matDialog=_,this.roleService=b,this.destroy$=new tt.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,ze.R)(window,"resize").pipe((0,Xe.b)(500),(0,st.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=m.gT.IsNotEmpty(this.data.Product.CategoryID),e.Options.Entities.forEach(o=>{const i=e.ProductLocations.find(r=>r.OutletID==o.ID);o.Key=m.gT.IsEmpty(i)?null:i.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(){try{this.cloudinaryService.initUploadMultipleImagesWidget(cloudinary,this.data.CloudinaryFolder,5-this.data.Product.ProductImages.length).pipe((0,st.R)(this.destroy$)).subscribe({next:e=>{this.productImages=[...this.productImages,{URL:e.ImageURL}]},complete:()=>this.cloudinaryService.updateUploadWidgetMaxFiles(5-this.productImages.length)})}catch{this.isCloudinaryErrored=!0}}onEditImage(e,o){const i=e.split(`/${this.data.CloudinaryConfig}`)[1],r=this.data.CloudinaryConfig+i.split(".")[0],d=`.${i.split(".")[1]}`;this.cloudinaryService.initMediaEditorWidget(cloudinary,r).pipe((0,F.U)(_=>_.assets[0].url.split("http:")[1])).subscribe({next:_=>{this.productImages=[...this.productImages].map((b,N)=>N==o?{...b,URL:`${_+d}`}:b)},complete:()=>{this.cloudinaryService.destroyImageEditor()}}),this.cloudinaryService.openMediaEditorWidget()}onRemoveImage(e){this.matDialog.open(Mt,{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((i,r)=>r!=e),this.cloudinaryService.updateUploadWidgetMaxFiles(5-this.productImages.length))})}drop(e){(0,w.bA)(this.productImages,e.previousContainer.data,e.container.data)}dropVariant(e){(0,w.bA)(this.data.Product.Variants,e.previousIndex,e.currentIndex)}uploadPicture(){this.productImages.length<5&&(this.cloudinaryService.openUploadWidget(),this.initCloudinary())}IsNotEmpty(e){return m.gT.IsNotEmpty(e)}validate(){this.isNameAndCodeExist?this.toaster.error("Product with the same name is already exist",g.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(tn,{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(b=>{switch(r.Status){case"Category":let N={children:[],collapsedIcon:"fas fa-folder",expandedIcon:"fas fa-folder-open",id:b.ID,label:r.Name};this.data.Options.Categories=[...this.data.Options.Categories,N],this.data.Product.CategoryID=b.ID,this.selectedCategory=N,this.generateLabelSelectedCategory(N);break;case"Brand":this.data.Options.Brands=[...this.data.Options.Brands,{ID:b.ObjectID,Name:r.Name}],this.data.Product.BrandID=b.ObjectID;break;case"Tag":this.data.Options.Tags=[...this.data.Options.Tags,{ID:b.ObjectID,Name:r.Name}],this.data.Product.TagIDs=[...this.data.Product.TagIDs,b.ObjectID];break;case"UOM":this.data.Options.UOMs=[...this.data.Options.UOMs,{ID:b.ObjectID,Name:r.Name}],this.data.Product.VariantUOM=b.ObjectID}})})}onSelectVariantType(e){e==k.J.MultipleUOM&&this.handlingVariantTypeUOM()}handlingVariantTypeUOM(){const e=this.data.Product.Variants;this.data.Product.Variants=e.map((o,i)=>(o.TypeID=this.data.Product.VariantTypeID,i===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(i=>(i[o]=e,i)))}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,i=e.value;i&&(this.statVariantAdd=this.NewVariantInputs.filter(function(r){return r==i}),0==this.statVariantAdd.length&&(this.NewVariantInputs.push(i),o.value=""))}openDialogVariant(e,o){this.matDialog.open(ln,{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)(i=>m.gT.IsNotEmpty(i))).subscribe(i=>{this.data.Product.Variants[o]=i})}AddOrUpdateVariant(e){!e.Model||!e.Name||(void 0===e.index?(e.ID=m.gT.GuidEmpty,this.data.Product.ID!==m.gT.GuidEmpty?(e.ProductID=this.data.Product.ID,e.TypeID=1,e.CostCurrencyID=1,e.PriceCurrencyID=1):e.ProductID=m.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 i=0;i<e;i++){const r=this.NewVariantInputs[i];o={Index:i+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&&i===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((i,r)=>"Variant"===e.active?(i.Model<r.Model?-1:1)*("asc"===e.direction?1:-1):0):o}sortDataInventrory(e){let i="desc"==e.direction?"-":"";i+="Name",this.data.Options.Entities=this.data.Options.Entities.sort(this.dynamicSort(i))}dynamicSort(e){let o=1;return"-"===e[0]&&(o=-1,e=e.substr(1)),function(i,r){return-1==o?r[e].localeCompare(i[e]):i[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={},i={},r={};e.UnitsInStock&&(r={UnitsInStock:e.UnitsInStock}),e.MinStock&&(o={MinStock:e.MinStock}),e.MaxStock&&(i={MaxStock:e.MaxStock}),this.data.Product.OutletStocks.push({EntityID:e.ID,Name:e.Name,...o,...i,...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;let o="";return e.URL&&e.URL.includes("crop")&&(o=e.URL.split("upload/")[1].split(`/${this.data.CloudinaryFolder}`)[0]+"#"),e.URL=o+e.URL.substring(e.URL.lastIndexOf("/")+1),e}),this.productImages}onZoomImage(e,o){return(0,O.Z)(function*(){o.preventDefault();try{const i=yield(0,m.FI)(e.replace("w_80/",""));To.open({items:[i],intro:"fadeup"})}catch(i){alert(i)}})()}checkVariantInput(){let e;this.NewVariantInputs.forEach((o,i)=>{e={Index:i+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!",g.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 i;m.gT.IsEmpty(this.data.Product.ProductLocations)&&(this.data.Product.ProductLocations=[]),i=m.gT.IsEmpty(o)?m.gT.GuidEmpty:o.Key,m.gT.IsEmpty(this.data.Product.ProductLocations.find(r=>r.OutletID==e))&&this.data.Product.ProductLocations.push({OutletID:e,StorageID:i})}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(!m.gT.IsNotEmpty(o))return null;for(const i of e){if(i.id===o)return i;{i.children=i.children?i.children:[],i.children=i.children.map(d=>(d.parent=i,d));const r=this.findSelectedCategory(i.children,o);if(r)return r}}}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W),t.Y36(Pt.q),t.Y36(h.uw),t.Y36(v.N))}),(0,l.Z)(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","mt-10"],[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"],["matTooltipPosition","above","matTooltip","Crop image",1,"edit-icon","image_upload_icon",3,"click"],[1,"fa","fa-file-pen"],["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",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["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,Zo,102,47,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data.Options)},dependencies:[U.jx,u.rH,w.Wj,w.Fd,w.Zt,Z.gM,T.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.Q7,s.On,cn.KE,x.w9,P.YE,P.nU,R.QB,V.P,A.b,$.RA,$.oH,$.qH,$.z3,L.J,dt.V,Nt,qt.Hw,c.JJ],styles:[".mat-chip-custom .mat-mdc-form-field-infix{padding-top:9px!important} .mat-chip-custom .mat-mdc-text-field-wrapper{margin:0!important;height:35px;border:0px} .mat-chip-custom .mat-mdc-standard-chip{min-height:auto;height:auto} .mat-chip-custom .mdc-evolution-chip-set .mdc-evolution-chip{margin-top:0!important;margin-bottom:0!important} .mat-chip-custom .mat-chip-list-wrapper input.mat-mdc-input-element, .mat-chip-custom .mat-chip-list-wrapper .mat-mdc-standard-chip{margin:1.5px!important;height:22px} .mat-chip-custom .mat-mdc-standard-chip.mat-chip-with-trailing-icon{padding-top:0!important;padding-bottom:0!important;padding-right:8px} .mat-chip-custom .mat-mdc-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-mdc-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;inset: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:0;left:0;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:18%;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:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;cursor:pointer}.edit-icon[_ngcontent-%COMP%]{color:#d4d4d4;font-size:18px;position:absolute;top:50%;left:82%;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 ut=p(54850),wt=p(39646),yo=p(63900),mt=p(18505),Io=p(29881),Ut=p(11481),j=p(1591);const Po=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Ot=function(n){return{ProductID:n}},Do=function(){return["/menu/Reports/Purchases_Report/History"]};function Ao(n,a){if(1&n&&(t.TgZ(0,"div",17)(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,Po))("queryParams",t.VKq(5,Ot,e.data.Product.ID)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,Do))("queryParams",t.VKq(8,Ot,e.data.Product.ID))}}const So=function(){return["/menu/Products/Catalog/Products/Form"]},W=function(n){return{ID:n}};function No(n,a){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,So))("queryParams",t.VKq(3,W,e.data.Product.ID))}}function qo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",49),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.removeProduct())}),t._UZ(1,"i",50),t._uU(2," Delete"),t.qZA()}}function wo(n,a){1&n&&(t.TgZ(0,"div",70),t._uU(1,"Main Image"),t.qZA())}function Uo(n,a){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(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.drop(i))}),t.TgZ(1,"div",61),t._UZ(2,"img",62),t.TgZ(3,"div",63)(4,"a",64),t.NdJ("click",function(i){const d=t.CHM(e).$implicit,_=t.oxw(3);return t.KtG(_.onZoomImage(d.URL,i))}),t._UZ(5,"i",65),t.qZA(),t.TgZ(6,"a",66),t.NdJ("click",function(){const r=t.CHM(e).index,d=t.oxw(3);return t.KtG(d.onRemoveImage(r))}),t._UZ(7,"i",50),t.qZA(),t.TgZ(8,"a",67),t.NdJ("click",function(){const i=t.CHM(e),r=i.$implicit,d=i.index,_=t.oxw(3);return t.KtG(_.onEditImage(r.URL,d))}),t._UZ(9,"i",68),t.qZA()(),t.YNc(10,wo,2,0,"div",69),t.qZA()()}if(2&n){const e=a.$implicit,o=a.index;t.Q6J("cdkDropListData",o),t.xp6(2),t.Q6J("src",e.URL,t.LSH),t.xp6(8),t.Q6J("ngIf",0==o)}}function Oo(n,a){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,Uo,11,3,"div",57),t.TgZ(11,"button",58),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.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 Jo=function(){return["/menu/Products/Catalog/Products/Inventory"]};function Vo(n,a){if(1&n&&(t.TgZ(0,"a",71),t._uU(1,"Outlet Inventory"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,Jo))("queryParams",t.VKq(3,W,e.data.Product.ID))}}function ko(n,a){1&n&&(t.TgZ(0,"th",72),t._uU(1,"UnitCost "),t.qZA())}function Fo(n,a){1&n&&(t.TgZ(0,"th",72),t._uU(1," UnitPrice"),t.qZA())}function Qo(n,a){1&n&&(t.TgZ(0,"th",25),t._uU(1,"Ratio"),t.qZA())}function Eo(n,a){if(1&n&&(t.TgZ(0,"td",74),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 Lo(n,a){if(1&n&&(t.TgZ(0,"td",74),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 Yo(n,a){if(1&n&&(t.TgZ(0,"td",74),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.RatioDisplay)}}const Ho=function(n){return{"text-decoration":n}},Ko=function(){return["/menu/Products/Catalog/Variants/Info"]};function Go(n,a){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"a",73),t._uU(3),t.qZA()(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td",74),t._uU(7),t.ALo(8,"number"),t.qZA(),t.YNc(9,Eo,3,3,"td",75),t.YNc(10,Lo,3,3,"td",75),t.TgZ(11,"td",74),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,Yo,2,1,"td",75),t.TgZ(15,"td",74),t._uU(16),t.ALo(17,"number"),t.qZA()()),2&n){const e=a.$implicit,o=t.oxw(2);t.xp6(1),t.Akn(t.VKq(20,Ho,e.Discontinued?"line-through":"none")),t.ekj("bg-gradient-warning",e.Discontinued),t.xp6(1),t.Q6J("routerLink",t.DdM(22,Ko))("queryParams",t.VKq(23,W,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.PriceVisible),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 Ro(n,a){if(1&n&&(t.TgZ(0,"span",80),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function Bo(n,a){if(1&n&&(t.TgZ(0,"div",76)(1,"div",77),t.YNc(2,Ro,2,1,"span",78),t.qZA(),t.TgZ(3,"label",79),t._uU(4,"Tags"),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("ngForOf",e.data.Form.Tags)}}function $o(n,a){1&n&&t._UZ(0,"POS-info-page-input",81)}function jo(n,a){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=a.$implicit;t.xp6(2),t.Oqu(e.OutletName),t.xp6(2),t.hij(" ",e.StorageName," ")}}function Wo(n,a){if(1&n&&(t.TgZ(0,"div",82),t._UZ(1,"i",83),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 zo=function(){return["/menu/Contacts/Contact/Suppliers/Info"]};function Xo(n,a){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Ao,9,10,"div",2),t.TgZ(3,"div",3),t.YNc(4,No,3,5,"a",4),t.YNc(5,qo,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",7)(16,"div",12),t._UZ(17,"POS-info-page-input",13),t.qZA(),t.TgZ(18,"div",12),t._UZ(19,"POS-info-page-input",14),t.qZA()(),t.YNc(20,Oo,14,3,"div",15),t.qZA()(),t.TgZ(21,"div",9)(22,"div",16)(23,"div")(24,"h2"),t._uU(25,"Pricing and Variants"),t.qZA()(),t.TgZ(26,"div",17),t.YNc(27,Vo,2,5,"a",18),t.qZA()(),t.TgZ(28,"div",11)(29,"div",19)(30,"table",20)(31,"thead",21)(32,"tr")(33,"th",22),t._uU(34,"Variant"),t.qZA(),t.TgZ(35,"th",23),t._uU(36,"Code"),t.qZA(),t.TgZ(37,"th",23),t._uU(38,"Weight (gr)"),t.qZA(),t.YNc(39,ko,2,0,"th",24),t.YNc(40,Fo,2,0,"th",24),t.TgZ(41,"th",25),t._uU(42,"%"),t.qZA(),t.YNc(43,Qo,2,0,"th",26),t.TgZ(44,"th",27),t._uU(45,"Inventory"),t.qZA()()(),t.TgZ(46,"tbody"),t.YNc(47,Go,18,25,"tr",28),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",29),t.qZA()()(),t.TgZ(54,"div",30)(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,Bo,5,1,"div",34),t.YNc(63,$o,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",19)(81,"table",20)(82,"thead",21)(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,jo,5,2,"tr",28),t.qZA()()()()()()(),t.YNc(90,Wo,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,W,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.PriceVisible),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,zo))("queryParams",t.VKq(36,W,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 ti=BiggerPicture({target:document.body});let ei=(()=>{class n extends Io.O{constructor(e,o,i,r,d,_,b,N){super(e,"catalog/ProductLoader/ProductInfoInitial",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"cloudinaryService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"title",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"destroy$",void 0),(0,l.Z)(this,"redirect",void 0),(0,l.Z)(this,"productImages",[]),(0,l.Z)(this,"ratioConfig",void 0),this.httpService=e,this.activatedRoute=o,this.router=i,this.toaster=r,this.cloudinaryService=d,this.matDialog=_,this.title=b,this.roleService=N,this.destroy$=new tt.x}initRoles(){this.ratioConfig=this.data?.Variant?.filter(e=>e.TypeID==k.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.cloudinaryService.initUploadMultipleImagesWidget(cloudinary,this.data.CloudinaryFolder,5-this.data.ProductImages.length).pipe((0,yo.w)((e,o)=>0==o?(0,wt.of)(e).pipe((0,mt.b)(()=>this.toaster.success("Image has been updated",g.n.Success))):(0,wt.of)(e)),(0,st.R)(this.destroy$)).subscribe({next:e=>{this.productImages=[...this.productImages,{URL:e.ImageURL,ProductID:this.data.Product.ID}],this.uploadEditedImage()},complete:()=>{this.cloudinaryService.updateUploadWidgetMaxFiles(5-this.productImages.length)}})}uploadEditedImage(){this.sliceImageUrl(),this.httpService.post(ut.W.UpdateProductImage,{ID:this.data.Product.ID,ImageUrl:this.productImages[0]?this.productImages[0].URL:null,ProductImages:this.productImages}).subscribe(o=>{this.productImages=o.ProductImages})}sliceImageUrl(){this.productImages=this.productImages.map(e=>{let o="";return console.log(e),e.URL.includes("crop")&&(o=e.URL.split("upload/")[1].split(`/${this.data.CloudinaryConfig}`)[0]+"#"),e.URL=o+e.URL.substring(e.URL.lastIndexOf("/")+1),e})}onRemoveImage(e){this.matDialog.open(Mt,{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((i,r)=>r!=e),this.uploadEditedImage(),this.cloudinaryService.updateUploadWidgetMaxFiles(5-this.productImages.length))})}onEditImage(e,o){const i=e.split(`/${this.data.CloudinaryConfig}`)[1],r=this.data.CloudinaryConfig+i.split(".")[0],d=`.${i.split(".")[1]}`;this.cloudinaryService.initMediaEditorWidget(cloudinary,r).pipe((0,F.U)(_=>_.assets[0].url.split("http:")[1])).subscribe({next:_=>{this.productImages=[...this.productImages].map((b,N)=>N==o?{...b,URL:`${_+d}`}:b)},complete:()=>{this.cloudinaryService.destroyImageEditor(),this.uploadEditedImage()}}),this.cloudinaryService.openMediaEditorWidget()}IsNotEmpty(e){return m.gT.IsNotEmpty(e)?e:""}uploadPicture(){this.productImages.length<5&&(this.cloudinaryService.openUploadWidget(),this.initCloudinaryService())}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,g.n.Success)}onZoomImage(e,o){return(0,O.Z)(function*(){o.preventDefault();try{const i=yield(0,m.FI)(e.replace("w_80/",""));ti.open({items:[i],intro:"fadeup"})}catch(i){alert(i)}})()}drop(e){(0,w.bA)(this.productImages,e.previousContainer.data,e.container.data),this.uploadEditedImage()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W),t.Y36(Pt.q),t.Y36(h.uw),t.Y36(Ut.Dx),t.Y36(v.N))}),(0,l.Z)(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,"col-md-6"],["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,"col-md-4"],[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"],["matTooltipPosition","above","matTooltip","Crop image",1,"edit-icon","image_upload_icon",3,"click"],[1,"fa","fa-file-pen"],["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,Xo,91,38,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",null==o.data?null:o.data.Product)},dependencies:[u.rH,w.Wj,w.Fd,w.Zt,Z.gM,T.p,c.sg,c.O5,j.o,c.JJ,c.uU,S.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;inset: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:0;left:0;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:18%;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:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;cursor:pointer}.edit-icon[_ngcontent-%COMP%]{color:#d4d4d4;font-size:18px;position:absolute;top:50%;left:82%;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 nt=p(59798);function ni(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.httpPostListID("catalog/variant/DeleteVariantList"))}),t._UZ(1,"i",18),t._uU(2," Delete "),t.qZA()}}const oi=function(){return["/menu/Products/Add-Ons/Variant_History"]};function ii(n,a){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,oi))}function ai(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openExportModal())}),t._UZ(1,"i",22),t._uU(2," Export"),t.qZA()}}const ri=function(){return["Form"]};function li(n,a){1&n&&(t.TgZ(0,"a",23),t._uU(1," Add Variant "),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,ri))}function ci(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",34)(1,"input",35),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onSelectAllData(i.target.checked))}),t.qZA()()}}function si(n,a){1&n&&(t.TgZ(0,"th"),t._uU(1,"Description"),t.qZA())}function di(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Buying Cost "),t.qZA())}function pi(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Last Buy Cost "),t.qZA())}function ui(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Selling Price"),t.qZA())}function mi(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"%"),t.qZA())}function _i(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",34)(1,"input",45),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}function gi(n,a){if(1&n&&t._UZ(0,"td",46),2&n){const e=t.oxw().$implicit;t.Q6J("innerHTML",e.Description,t.oJD)}}function fi(n,a){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 hi(n,a){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 vi(n,a){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 xi(n,a){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 Ci=function(n){return{ID:n}},Zi=function(n){return{"text-decoration-line-through":n}};function Ti(n,a){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,_i,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,gi,1,1,"td",41),t.YNc(11,fi,3,3,"td",42),t.YNc(12,hi,3,3,"td",42),t.YNc(13,vi,3,3,"td",42),t.YNc(14,xi,2,1,"td",43),t.TgZ(15,"td",44),t._uU(16),t.ALo(17,"number"),t.qZA()()),2&n){const e=a.$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,Ci,e.ID)),t.xp6(1),t.Q6J("ngClass",t.VKq(17,Zi,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.PriceVisible),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.Discount),t.xp6(2),t.Oqu(t.lcZ(17,13,e.UnitsInStock))}}function bi(n,a){if(1&n&&(t.TgZ(0,"table",24)(1,"thead",25)(2,"tr",26),t.YNc(3,ci,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,si,2,0,"th",29),t.YNc(11,di,2,0,"th",30),t.YNc(12,pi,2,0,"th",31),t.YNc(13,ui,2,0,"th",30),t.YNc(14,mi,2,0,"th",30),t.TgZ(15,"th",32),t._uU(16,"Inventory"),t.qZA()()(),t.TgZ(17,"tbody"),t.YNc(18,Ti,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.PriceVisible),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.Discount),t.xp6(4),t.Q6J("ngForOf",e.data.Data)}}function yi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",50),t.NdJ("page",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onPaginationChange(i))}),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 Ii(n,a){if(1&n&&(t.TgZ(0,"div",48),t.YNc(1,yi,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 Mi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Text=i)})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,ni,3,0,"a",2),t.YNc(3,ii,3,2,"a",3),t.YNc(4,ai,3,0,"button",4),t.YNc(5,li,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.CategoryID=i)}),t.qZA()(),t.TgZ(13,"div")(14,"h6"),t._uU(15,"Supplier"),t.qZA(),t.TgZ(16,"autocompleteV2",10),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.SupplierID=i)}),t.qZA()(),t.TgZ(17,"div")(18,"h6"),t._uU(19,"Type"),t.qZA(),t.TgZ(20,"ng-select",9),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.TypeID=i)}),t.qZA()(),t.TgZ(21,"div")(22,"h6"),t._uU(23,"Discontinued"),t.qZA(),t.TgZ(24,"radio-options",11),t.NdJ("modelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Discontinued=i)}),t.qZA()(),t.TgZ(25,"div")(26,"h6"),t._uU(27,"Description"),t.qZA(),t.TgZ(28,"radio-options",12),t.NdJ("modelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Description=i)}),t.qZA()()()()(),t.TgZ(29,"content")(30,"div",13)(31,"div",14),t.YNc(32,bi,19,7,"table",15),t.qZA(),t.YNc(33,Ii,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 Pi=(()=>{class n extends M.n{constructor(e,o,i,r,d){super(e,"catalog/variant/GetVariantList","catalog/VariantLoader/VariantList",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"more",void 0),(0,l.Z)(this,"options",[{Key:0,Value:"No"},{Key:1,Value:"Yes"}]),this.httpService=e,this.csvConverter=i,this.roleService=r,this.matDialog=d}openExportModal(){this.matDialog.open(K.H,{data:{title:"Variant",exportTypes:[{ID:"ProductExport/VariantExport",Value:"Default",FileName:"Variant"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(G.O),t.Y36(v.N),t.Y36(h.uw))}),(0,l.Z)(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-3",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-3",3,"click"],["aria-hidden","true",1,"fa-solid","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,Mi,34,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.mk,c.sg,c.O5,s.Wl,s.JJ,s.On,nt.NW,x.w9,V.P,L.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 Jt{constructor(){(0,l.Z)(this,"Allocated",void 0),(0,l.Z)(this,"Available",void 0),(0,l.Z)(this,"EntityGroupID",void 0),(0,l.Z)(this,"EntityGroupName",void 0),(0,l.Z)(this,"EntityID",void 0),(0,l.Z)(this,"ID",void 0),(0,l.Z)(this,"IgnoreStock",void 0),(0,l.Z)(this,"MaxStock",void 0),(0,l.Z)(this,"MinStock",void 0),(0,l.Z)(this,"Name",void 0),(0,l.Z)(this,"SerialNumber",void 0),(0,l.Z)(this,"UnitsInStock",void 0),(0,l.Z)(this,"IndirectAllocated",void 0),(0,l.Z)(this,"PickPack",void 0)}}class Vt{constructor(){(0,l.Z)(this,"ParentName",void 0),(0,l.Z)(this,"ParentID",void 0),(0,l.Z)(this,"Ratio",void 0)}}class Di{constructor(){(0,l.Z)(this,"ID",void 0),(0,l.Z)(this,"Code",void 0),(0,l.Z)(this,"CostCurrencyID",1),(0,l.Z)(this,"Discontinued",!1),(0,l.Z)(this,"LoyaltyPoint",!0),(0,l.Z)(this,"Model",void 0),(0,l.Z)(this,"Name",void 0),(0,l.Z)(this,"OrderPriceDiscount",void 0),(0,l.Z)(this,"PackSize",1),(0,l.Z)(this,"PaymentTypeID",0),(0,l.Z)(this,"PriceCurrencyID",1),(0,l.Z)(this,"PriceDiscount",void 0),(0,l.Z)(this,"ProductID",void 0),(0,l.Z)(this,"SalesCommission",void 0),(0,l.Z)(this,"Taxable",!0),(0,l.Z)(this,"TypeID",void 0),(0,l.Z)(this,"UOM",void 0),(0,l.Z)(this,"UnitCost",void 0),(0,l.Z)(this,"UnitPrice",0),(0,l.Z)(this,"Weight",void 0),(0,l.Z)(this,"ComponentID",void 0),(0,l.Z)(this,"UOMName",void 0),(0,l.Z)(this,"Description",void 0),(0,l.Z)(this,"UnitQuantity",void 0),(0,l.Z)(this,"ProductIndex",void 0),(0,l.Z)(this,"UOMQ",void 0),(0,l.Z)(this,"MeasurementID",void 0),(0,l.Z)(this,"Image",void 0),(0,l.Z)(this,"OrderPrice",void 0),(0,l.Z)(this,"PaymentTypeString",void 0),(0,l.Z)(this,"SellPriceTypeString",void 0),(0,l.Z)(this,"UnitExpense",void 0)}}var Ai=p(50494);function Si(n,a){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Minimum Quantity"),t.qZA())}function Ni(n,a){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Minimum Amount"),t.qZA())}function qi(n,a){1&n&&(t.TgZ(0,"th",6),t._uU(1,"Extra Cost"),t.qZA())}function wi(n,a){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 Ui(n,a){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 Oi(n,a){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 Ji(n,a){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,wi,3,3,"td",10),t.YNc(6,Ui,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,Oi,3,3,"td",10),t.qZA()),2&n){const e=a.$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 Vi=(()=>{class n{constructor(e,o){(0,l.Z)(this,"promotions",void 0),(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"modalConfig",void 0),(0,l.Z)(this,"hasMinimumQuantity",void 0),(0,l.Z)(this,"hasMinimumAmount",void 0),(0,l.Z)(this,"hasExtraCost",void 0),this.promotions=e,this.dialogRef=o,this.modalConfig=new y.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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.WI),t.Y36(h.so))}),(0,l.Z)(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,Si,2,0,"th",5),t.YNc(10,Ni,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,qi,2,0,"th",7),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,Ji,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,D.M,c.JJ]})),n})();class kt{constructor(){(0,l.Z)(this,"ComponentID",void 0),(0,l.Z)(this,"CostCurrency",void 0),(0,l.Z)(this,"PriceCurrency",void 0),(0,l.Z)(this,"Quantity",void 0),(0,l.Z)(this,"Variant",void 0)}}let ki=(()=>{class n{constructor(e,o,i,r){(0,l.Z)(this,"_httpService",void 0),(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"toastr",void 0),(0,l.Z)(this,"modalConfig",void 0),(0,l.Z)(this,"composite",void 0),this._httpService=o,this.dialogRef=i,this.toastr=r,this.composite=Object.assign(new kt,e)}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new y.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=>m.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 kt,o)}onOk(){m.gT.IsEmpty(this.composite.ComponentID)?this.toastr.info("Choose one variant",g.n.Info):this.composite.Quantity>0?this.dialogRef.close(this.composite):this.toastr.info("Quantity can not be zero",g.n.Info)}onClose(){this.dialogRef.close()}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.WI),t.Y36(f.O),t.Y36(h.so),t.Y36(C._W))}),(0,l.Z)(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:[D.M,s.Fj,s.JJ,s.On,A.b,L.J]})),n})();function Fi(n,a){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Unit Cost"),t.qZA())}function Qi(n,a){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Total"),t.qZA())}function Ei(n,a){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 Li(n,a){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 Yi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"tr",13),t.NdJ("click",function(){const i=t.CHM(e),r=i.$implicit,d=i.index,_=t.oxw();return t.KtG(_.onEditComposite(r,d))}),t.TgZ(1,"td",14)(2,"i",15),t.NdJ("click",function(){const r=t.CHM(e).index,d=t.oxw();return t.KtG(d.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,Ei,3,3,"td",17),t.YNc(12,Li,3,3,"td",17),t.qZA()}if(2&n){const e=a.$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 Hi(n,a){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 Ki=(()=>{class n{constructor(e,o){(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"formChange",void 0),(0,l.Z)(this,"totalCompositeCost",void 0),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((i,r)=>{i.ComponentID==e&&(o=r)}),o}openDialog(e,o){let i={ComponentID:m.gT.GuidEmpty,Quantity:0};e&&(i=e),this.matDialog.open(ki,{data:i}).afterClosed().subscribe(d=>{d&&(e?this.form[o]=d:null==this.checkingList(d.ComponentID)?this.form.push(d):this.form[this.checkingList(d.ComponentID)]=d)})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.uw),t.Y36(v.N))}),(0,l.Z)(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,Fi,2,0,"th",9),t.YNc(15,Qi,2,0,"th",9),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,Yi,13,6,"tr",10),t.qZA(),t.YNc(18,Hi,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:[Z.gM,c.sg,c.O5,c.JJ]})),n})();const _t=function(n){return{"bg-light":n}};function Gi(n,a){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Tol(t.VKq(3,_t,!o.roleService.inventory.Edit)),t.xp6(1),t.Oqu(e.OnHand)}}function Ri(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",14),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.OnHand=i)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.OnHand)}}function Bi(n,a){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Tol(t.VKq(3,_t,!o.roleService.product.Create&&!o.roleService.product.Edit)),t.xp6(1),t.hij(" ",e.MinStock," ")}}function $i(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",14),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.MinStock=i)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.MinStock)}}function ji(n,a){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Tol(t.VKq(3,_t,!o.roleService.product.Create&&!o.roleService.product.Edit)),t.xp6(1),t.hij(" ",e.MaxStock," ")}}function Wi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",14),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.MaxStock=i)}),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.Q6J("ngModel",e.MaxStock)}}function zi(n,a){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,Gi,2,5,"span",11),t.YNc(7,Ri,1,1,"input",12),t.qZA(),t.TgZ(8,"td"),t.YNc(9,Bi,2,5,"span",11),t.YNc(10,$i,1,1,"input",12),t.qZA(),t.TgZ(11,"td"),t.YNc(12,ji,2,5,"span",11),t.YNc(13,Wi,1,1,"input",12),t.qZA()()),2&n){const e=a.$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 Xi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",17),t.NdJ("input",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateMinStock(i.target.value))}),t.qZA()}}function ta(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",17),t.NdJ("input",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateMaxStock(i.target.value))}),t.qZA()}}function ea(n,a){if(1&n&&(t.TgZ(0,"tfoot")(1,"tr"),t._UZ(2,"td",15),t.TgZ(3,"td"),t.YNc(4,Xi,1,0,"input",16),t.qZA(),t.TgZ(5,"td"),t.YNc(6,ta,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 na(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"table",1),t.NdJ("matSortChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.sortDataInventrory(i))}),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,zi,14,7,"tr",8),t.qZA(),t.YNc(14,ea,7,2,"tfoot",9),t.qZA()}if(2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.form),t.xp6(1),t.Q6J("ngIf",e.form.length>1)}}let oa=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"outletNameSortDir",void 0),(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"editForm",void 0),(0,l.Z)(this,"sourceData",void 0),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(i,r){return-1==o?r[e].localeCompare(i[e]):i[e].localeCompare(r[e])}}sortDataInventrory(e){const o=this.form;let i="desc"==e.direction?"-":"";m.gT.IsEmpty(e.direction)?this.form=Object.assign([],this.sourceData):(i+="Name",this.form=o.sort(this.dynamicSort(i)))}updateMaxStock(e){this.form.map(o=>{o.MaxStock=e})}updateMinStock(e){this.form.map(o=>{o.MinStock=e})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,na,15,2,"table",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[Z.gM,c.sg,c.O5,s.Fj,s.JJ,s.On,P.YE,P.nU,A.b]})),n})();class ia{constructor(){(0,l.Z)(this,"CostCurrency",void 0),(0,l.Z)(this,"EntityID",void 0),(0,l.Z)(this,"ExtraCost",void 0),(0,l.Z)(this,"PriceCurrencyID",void 0),(0,l.Z)(this,"PriceDiscount",void 0),(0,l.Z)(this,"UnitPrice",void 0),(0,l.Z)(this,"CostCurrencyID",void 0),(0,l.Z)(this,"EntityName",void 0),(0,l.Z)(this,"PriceCurrency",void 0)}}function aa(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.outletPrice.ExtraCost=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.outletPrice.CostCurrencyID=i)}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.outletPrice.ExtraCost)("disabled",!e.roleService.product.Cost),t.xp6(5),t.Q6J("items",e.data.Currencies)("ngModel",e.outletPrice.CostCurrencyID)("clearable",!1)}}const ra=function(n){return{selected:n}};let la=(()=>{class n{constructor(e,o,i){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"modalConfig",void 0),(0,l.Z)(this,"outletPrice",void 0),(0,l.Z)(this,"data",void 0),this.dialogRef=o,this.roleService=i,this.outletPrice=Object.assign(new ia,e.form),this.data=e.data,this.initModalConfig()}IsNotEmpty(e){return m.gT.IsNotEmpty(e)}onOk(){this.dialogRef.close(this.outletPrice)}onClose(){this.dialogRef.close()}initModalConfig(){this.modalConfig=new y.O,this.modalConfig.title="Add New Outlet Price?"}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.WI),t.Y36(h.so),t.Y36(v.N))}),(0,l.Z)(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,aa,9,5,"div",7),t.TgZ(10,"div",2)(11,"div",8)(12,"div",9)(13,"input",10),t.NdJ("ngModelChange",function(r){return o.outletPrice.UnitPrice=r}),t.qZA(),t.TgZ(14,"label",11),t._uU(15,"Price"),t.qZA()()(),t.TgZ(16,"div",12)(17,"div",13)(18,"ng-select",14),t.NdJ("ngModelChange",function(r){return o.outletPrice.PriceCurrencyID=r}),t.qZA()()()(),t.TgZ(19,"div",2)(20,"div",8)(21,"div",13)(22,"input",15),t.NdJ("ngModelChange",function(r){return o.outletPrice.PriceDiscount=r}),t.qZA(),t.TgZ(23,"label",16),t._uU(24,"Disc%"),t.qZA()()()()()()()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(5),t.Q6J("ngClass",t.VKq(11,ra,o.IsNotEmpty(o.outletPrice.EntityID))),t.xp6(1),t.Q6J("items",o.data.Entities)("clearable",!1)("ngModel",o.outletPrice.EntityID),t.xp6(3),t.Q6J("ngIf",o.roleService.product.Cost),t.xp6(4),t.Q6J("ngModel",o.outletPrice.UnitPrice),t.xp6(5),t.Q6J("items",o.data.Currencies)("ngModel",o.outletPrice.PriceCurrencyID)("clearable",!1),t.xp6(4),t.Q6J("ngModel",o.outletPrice.PriceDiscount))},dependencies:[c.mk,c.O5,D.M,s.Fj,s.JJ,s.On,x.w9,A.b]})),n})();function ca(n,a){1&n&&(t.TgZ(0,"th",7),t._uU(1,"Extra Cost"),t.qZA())}function sa(n,a){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 da(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"tr",10),t.NdJ("click",function(){const i=t.CHM(e),r=i.$implicit,d=i.index,_=t.oxw();return t.KtG(_.onUpdateOutletPrice(r,d))}),t.TgZ(1,"td")(2,"i",11),t.NdJ("click",function(){const r=t.CHM(e).index,d=t.oxw();return t.KtG(d.form.splice(r,1))}),t.qZA()(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.YNc(5,sa,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=a.$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 pa=(()=>{class n{constructor(e,o){(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"form",void 0),this.matDialog=e,this.roleService=o}ngOnInit(){}onAddOutletPrice(){this.openDialog({data:this.data,form:{EntityID:m.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 i;return this.data.Currencies.forEach(r=>{r.ID==e&&(i=r.Symbol)}),i}getEntityNameByID(e){let i;return this.data.Entities.forEach(r=>{r.ID==e&&(i=r.Name)}),i}openDialog(e,o){let i={data:e.data,form:e.form};o&&(i=e),this.matDialog.open(la,{data:i}).afterClosed().pipe((0,H.h)(d=>m.gT.IsNotEmpty(d))).subscribe(d=>{d&&(o||0==o?this.form[o]=d:this.form.push(d))})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.uw),t.Y36(v.N))}),(0,l.Z)(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,ca,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,da,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:[Z.gM,c.sg,c.O5,c.JJ]})),n})();function ua(n,a){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(i){const d=t.CHM(e).$implicit;return t.KtG(d.UnitPrice=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onChange())}),t.qZA()(),t.TgZ(7,"td")(8,"input",9),t.NdJ("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.PriceDiscount=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onChange())}),t.qZA()()()}if(2&n){const e=a.$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 ma=(()=>{class n{constructor(){(0,l.Z)(this,"outletNameSortDir",void 0),(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"formChange",void 0),this.formChange=new t.vpe}ngOnInit(){}onChange(){this.formChange.emit(this.form)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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,ua,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,A.b]})),n})();function _a(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",13)(2,"div",6)(3,"div",14)(4,"div",2)(5,"input",15),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.salesCommission.discount=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return i.calculateCommission(),t.KtG(i.onChange())}),t.qZA(),t.TgZ(6,"label",16),t._uU(7,"Commission (%) Calculator"),t.qZA()()(),t.TgZ(8,"div",17)(9,"label",18),t._uU(10,"%"),t.qZA()()()(),t.BQk()}if(2&n){const e=t.oxw();t.xp6(5),t.Q6J("ngModel",e.salesCommission.discount)}}function ga(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",19)(2,"span",20),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.showCalculator=!0)}),t._UZ(3,"i",21),t.TgZ(4,"p",22),t._uU(5,"Show Calculator"),t.qZA()()(),t.BQk()}}function fa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td")(4,"input",23),t.NdJ("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.Amount=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onChange())}),t.qZA()()()}if(2&n){const e=a.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Q6J("ngModel",e.Amount)}}const ha=function(n,a){return{"col-sm-6":n,"col-sm-11":a}};let va=(()=>{class n{constructor(){(0,l.Z)(this,"salesCommission",void 0),(0,l.Z)(this,"commisionPercentage",void 0),(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"formChange",void 0),(0,l.Z)(this,"showCalculator",!1),this.formChange=new t.vpe}ngOnInit(){}calculateCommission(){this.salesCommission.commission=this.salesCommission.discount/100*this.data.UnitPrice}onChange(){this.formChange.emit(this.form)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-form-variant-nav-commission"]],inputs:{salesCommission:"salesCommission",form:"form",data:"data"},outputs:{formChange:"formChange"},decls:20,vars:8,consts:[[1,"row","bg-white"],[3,"ngClass"],[1,"form-floating-outline"],["type","text","id","inputCommission","placeholder","Commission","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCommission"],[4,"ngIf"],[1,"row"],[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"],[1,"col-sm-6","bg-white"],[1,"col-sm-11","pe-0"],["type","text","id","inputPercentage","placeholder","Commission (%) Calculator","max","100","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],["for","inputPercentage"],[1,"col-sm-1","px-0"],[1,"mt-8","fs-3"],[1,"col-sm-1","text-center","px-0","pt-4"],[1,"cursor-pointer",3,"click"],[1,"fa-solid","fa-calculator",2,"font-size","30px"],[1,"fs-6","fw-bold","mb-0"],["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.YNc(6,_a,11,1,"ng-container",5),t.YNc(7,ga,6,0,"ng-container",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7)(10,"div",2)(11,"table",8)(12,"thead")(13,"tr",9)(14,"th",10),t._uU(15,"Sales Group"),t.qZA(),t.TgZ(16,"th",11),t._uU(17,"Commission"),t.qZA()()(),t.TgZ(18,"tbody"),t.YNc(19,fa,5,2,"tr",12),t.qZA()()()()()),2&e&&(t.xp6(1),t.Q6J("ngClass",t.WLB(5,ha,o.showCalculator,!o.showCalculator)),t.xp6(2),t.Q6J("ngModel",o.salesCommission.commission),t.xp6(3),t.Q6J("ngIf",o.showCalculator),t.xp6(1),t.Q6J("ngIf",!o.showCalculator),t.xp6(12),t.Q6J("ngForOf",o.form))},dependencies:[c.mk,c.sg,c.O5,s.Fj,s.JJ,s.On,A.b]})),n})(),xa=(()=>{class n{constructor(){(0,l.Z)(this,"outletNameSortDir",void 0),(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"formChange",void 0),this.formChange=new t.vpe}onChange(){this.formChange.emit(this.form)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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 Ca=p(77890);const ot=function(n){return{selected:n}};let Za=(()=>{class n{constructor(){(0,l.Z)(this,"paymentType",Ca._),(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"formChange",void 0),(0,l.Z)(this,"sellPriceOptions",[{Key:0,Value:"Require Authorization"},{Key:1,Value:"Do Not Require Authorization"},{Key:2,Value:"Do Not Require Authorization and Sync Cost"}]),(0,l.Z)(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 m.gT.IsNotEmpty(e)}onChange(){this.formChange.emit(this.form)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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","pt-7","ps-4"],["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"],[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",2)(61,"label"),t._uU(62,"Sell Price Type"),t.qZA(),t.TgZ(63,"div")(64,"radio-options",30),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,ot,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,ot,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,ot,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,ot,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,Q.VQ,Q.U0,x.w9,V.P,A.b]})),n})();function Ta(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.form.ParentID=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.form.Ratio=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.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 ba=(()=>{class n{set _form(e){e?(this.form=e,console.log(this.form)):this.form=new Vt}constructor(){(0,l.Z)(this,"form",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"option",void 0),(0,l.Z)(this,"formChange",void 0),this.formChange=new t.vpe}onChange(){this.formChange.emit(this.form)}ngOnInit(){}onSelectParent(e){this.form.ParentID=e,console.log(e)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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,Ta,20,5,"div",0),2&e&&t.Q6J("ngIf",o.form)},dependencies:[c.O5,s.Fj,s.JJ,s.On,x.w9,A.b]})),n})();var gt=p(34782);function ya(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td")(3,"div",13)(4,"span",14),t._UZ(5,"i",15),t.qZA(),t.TgZ(6,"input",16),t.NdJ("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.Serial=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.onSerialNameChange())}),t.qZA()()(),t.TgZ(7,"td",17),t._uU(8),t.ALo(9,"number"),t.qZA()(),t.BQk()}if(2&n){const e=a.$implicit;t.xp6(6),t.Q6J("ngModel",e.Serial),t.xp6(2),t.hij(" ",t.lcZ(9,2,e.Quantity)," ")}}function Ia(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",12),t._uU(3),t.qZA()(),t.YNc(4,ya,10,4,"ng-container",11),t.BQk()),2&n){const e=a.$implicit;t.xp6(2),t.Q6J("rowSpan",e.Serial.length+1),t.xp6(1),t.Oqu(e.EntityName),t.xp6(1),t.Q6J("ngForOf",e.Serial)}}let Ma=(()=>{class n{set variantId(e){this.initSerial(e)}constructor(e){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"outletSerial$",void 0),(0,l.Z)(this,"serials",void 0),(0,l.Z)(this,"serialsChange",void 0),(0,l.Z)(this,"serialChanges",new tt.x),this.httpService=e,this.serialsChange=new t.vpe}ngOnInit(){}initSerial(e){this.outletSerial$=this.httpService.post("/api/catalog/variant/GetVariantSerialByVariantID",{ID:e}).pipe((0,mt.b)(i=>{this.serials=i}),(0,gt.d)())}onSerialNameChange(){this.serialsChange.emit(this.serials)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["app-form-variant-tab-serial"]],inputs:{variantId:"variantId",serials:"serials"},outputs:{serialsChange:"serialsChange"},decls:18,vars:3,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],[1,"content"],[1,"table","custom-table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],[2,"width","200px"],[2,"width","50px"],[4,"ngFor","ngForOf"],[3,"rowSpan"],[1,"input-group","mb-3"],[1,"input-group-text"],[1,"fa","fa-barcode","fa-lg"],["type","text",1,"form-control",3,"ngModel","ngModelChange"],[1,"text-end"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"table",6)(7,"thead",7)(8,"tr",8)(9,"th"),t._uU(10,"Outlet"),t.qZA(),t.TgZ(11,"th",9),t._uU(12,"Serial"),t.qZA(),t.TgZ(13,"th",10),t._uU(14,"Quantity"),t.qZA()()(),t.TgZ(15,"tbody"),t.YNc(16,Ia,5,3,"ng-container",11),t.ALo(17,"async"),t.qZA()()()()()()()()),2&e&&(t.xp6(16),t.Q6J("ngForOf",t.lcZ(17,1,o.outletSerial$)))},dependencies:[c.sg,s.Fj,s.JJ,s.On,c.Ov,c.JJ]})),n})();function Pa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"small",66),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.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 Da(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",5)(2,"div",67)(3,"div",11)(4,"input",68),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.UnitCost=i)}),t.qZA(),t.TgZ(5,"label",69),t._uU(6,"Buying Cost"),t.qZA()()(),t.TgZ(7,"div",70)(8,"div",11)(9,"input",71),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.OrderPriceDiscount=i)}),t.qZA(),t.TgZ(10,"label",72),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 Aa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",5)(2,"div",67)(3,"div",11)(4,"input",73),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.UnitPrice=i)}),t.qZA(),t.TgZ(5,"label",74),t._uU(6,"Selling Price"),t.qZA()()(),t.TgZ(7,"div",70)(8,"div",11)(9,"input",75),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variant.PriceDiscount=i)}),t.qZA(),t.TgZ(10,"label",76),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 Sa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",29)(2,"div",11)(3,"input",77),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.VariantPoint.Point=i)}),t.qZA(),t.TgZ(4,"label",78),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 Na(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",5)(1,"div",10)(2,"div",11)(3,"input",79),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.VariantPoint.ExpiredDay=i)}),t.qZA(),t.TgZ(4,"label",80),t._uU(5,"Day(s) +"),t.qZA()()(),t.TgZ(6,"div",10)(7,"div",11)(8,"input",81),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.VariantPoint.ExpiredMonth=i)}),t.qZA(),t.TgZ(9,"label",82),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 qa(n,a){1&n&&(t.TgZ(0,"li",40)(1,"a",83),t._uU(2,"Inventory"),t.qZA()())}function wa(n,a){1&n&&(t.TgZ(0,"li",40)(1,"a",84),t._uU(2,"Component"),t.qZA()())}function Ua(n,a){1&n&&(t.ynx(0),t.TgZ(1,"li",40)(2,"a",85),t._uU(3,"MultiUOM"),t.qZA()(),t.BQk())}function Oa(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"li",40)(2,"a",86),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.initSerialTab=!0)}),t._uU(3,"Serials"),t.qZA()(),t.BQk()}}function Ja(n,a){1&n&&(t.ynx(0),t.TgZ(1,"div",7)(2,"div",91)(3,"p"),t._uU(4," This variant type does not have an inventory "),t.qZA()()(),t.BQk())}function Va(n,a){if(1&n&&t._UZ(0,"POS-form-variant-tab-inventory",92),2&n){const e=t.oxw(4);t.Q6J("form",e.entities)("editForm",e.getQueryParams)("data",e.data)}}function ka(n,a){if(1&n&&(t.TgZ(0,"div",53),t.YNc(1,Ja,5,0,"ng-container",89),t.YNc(2,Va,1,3,"ng-template",null,90,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 Fa(n,a){if(1&n&&(t.TgZ(0,"div",87)(1,"div",50)(2,"div",9)(3,"div",51)(4,"div",5)(5,"div",52)(6,"div",5),t.YNc(7,ka,4,2,"div",88),t.qZA()()()()()()()),2&n){const e=t.oxw(2);t.xp6(7),t.Q6J("ngIf",e.entities.length>0&&e.data)}}function Qa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"POS-form-variant-tab-multi-UOM",93),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.variantParent=i)}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("form",e.variantParent)("variant",e.variant)("option",e.variantParentList)}}function Ea(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"app-form-variant-tab-serial",94),t.NdJ("serialsChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.serials=i)}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("variantId",e.variant.ID)("serials",e.serials)}}const La=function(){return["/menu/Products/Catalog/Products"]},Ft=function(n){return{selected:n}};function Ya(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onSelectProduct(i))})("ngModel",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.ProductID=i)}),t.qZA()()(),t.TgZ(19,"div",13)(20,"div",11)(21,"input",14),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return r.variant.Model=i,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(i){t.CHM(e);const r=t.oxw();return r.variant.Code=i,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Name=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Weight=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.UOM=i)}),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,Pa,2,1,"small",26),t.qZA(),t.TgZ(50,"div",9)(51,"div",5),t.YNc(52,Da,12,2,"div",27),t.YNc(53,Aa,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.getVariantWithSameProductID(i))}),t.qZA(),t.TgZ(66,"label",31),t._uU(67,"Type"),t.qZA()()()(),t.YNc(68,Sa,6,1,"div",32),t.YNc(69,Na,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Taxable=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.LoyaltyPoint=i)}),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",37),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant.Discontinued=i)}),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",38),t.YNc(103,qa,3,0,"li",39),t.YNc(104,wa,3,0,"li",39),t.TgZ(105,"li",40)(106,"a",41),t._uU(107,"Outlet Price"),t.qZA()(),t.TgZ(108,"li",40)(109,"a",42),t._uU(110,"Pricebook"),t.qZA()(),t.TgZ(111,"li",40)(112,"a",43),t._uU(113,"Commission"),t.qZA()(),t.TgZ(114,"li",40)(115,"a",44),t._uU(116,"Description"),t.qZA()(),t.TgZ(117,"li",40)(118,"a",45),t._uU(119,"Advanced"),t.qZA()(),t.YNc(120,Ua,4,0,"ng-container",46),t.YNc(121,Oa,4,0,"ng-container",46),t.qZA(),t.TgZ(122,"div",47),t.YNc(123,Fa,8,1,"div",48),t.TgZ(124,"div",49)(125,"div",50)(126,"div",9)(127,"div",51)(128,"div",5)(129,"div",52)(130,"div",5)(131,"div",53)(132,"POS-form-variant-tab-component",54),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.composites=i)}),t.qZA()()()()()()()()(),t.TgZ(133,"div",55)(134,"div",50)(135,"div",9)(136,"div",51)(137,"div",5)(138,"div",52)(139,"div",5)(140,"div",53)(141,"POS-form-variant-tab-outlet-price",54),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.outletPrices=i)}),t.qZA()()()()()()()()(),t.TgZ(142,"div",56)(143,"div",50)(144,"div",9)(145,"div",51)(146,"div",5)(147,"div",52)(148,"div",5)(149,"div",53)(150,"POS-form-variant-tab-pricebook",54),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pricebooks=i)}),t.qZA()()()()()()()()(),t.TgZ(151,"div",57)(152,"div",50)(153,"div",9)(154,"div",51)(155,"div",5)(156,"div",52)(157,"div",5)(158,"div",53)(159,"POS-form-variant-nav-commission",58),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.salesGroups=i)}),t.qZA()()()()()()()()(),t.TgZ(160,"div",59)(161,"div",50)(162,"div",9)(163,"div",51)(164,"div",5)(165,"div",52)(166,"div",5)(167,"div",53)(168,"POS-form-variant-nav-description",60),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant=i)}),t.qZA()()()()()()()()(),t.TgZ(169,"div",61)(170,"div",50)(171,"div",9)(172,"div",51)(173,"div",62)(174,"div",52)(175,"div",5)(176,"div",53)(177,"POS-form-variant-nav-advanced",54),t.NdJ("formChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.variant=i)}),t.qZA()()()()()()()()(),t.TgZ(178,"div",63)(179,"div",50)(180,"div",9)(181,"div",51)(182,"div",62)(183,"div",52)(184,"div",5)(185,"div",53),t.YNc(186,Qa,1,3,"POS-form-variant-tab-multi-UOM",64),t.qZA()()()()()()()(),t.TgZ(187,"div",65)(188,"div",50)(189,"div",9)(190,"div",51)(191,"div",62)(192,"div",52)(193,"div",5)(194,"div",53),t.YNc(195,Ea,2,2,"ng-container",46),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(55,La)),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(56,Ft,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?null:e.roleService.sell.PriceVisible),t.xp6(11),t.Q6J("ngClass",t.VKq(58,Ft,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("disabled",e.productDiscontinued)("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(16),t.Q6J("ngIf",e.variant.TypeID==e.variantTypeID.MultipleUOM),t.xp6(1),t.Q6J("ngIf",e.variant.TypeID==e.variantTypeID.Serialized),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),t.xp6(9),t.Q6J("ngIf",e.initSerialTab)}}let Ha=(()=>{class n extends q.U{constructor(e,o,i,r,d,_){super(e,"catalog/variant/GetVariantFormInitialData",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variantTypeID",k.J),(0,l.Z)(this,"getQueryParams",null),(0,l.Z)(this,"PageTitle",void 0),(0,l.Z)(this,"ParentName",void 0),(0,l.Z)(this,"ProductName",void 0),(0,l.Z)(this,"SupplierName",void 0),(0,l.Z)(this,"productName",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"composites",void 0),(0,l.Z)(this,"outletPrices",void 0),(0,l.Z)(this,"pricebooks",void 0),(0,l.Z)(this,"salesGroups",void 0),(0,l.Z)(this,"entities",void 0),(0,l.Z)(this,"variantParent",void 0),(0,l.Z)(this,"variantParentList",[]),(0,l.Z)(this,"VariantPoint",void 0),(0,l.Z)(this,"sales",void 0),(0,l.Z)(this,"isEdit",!1),(0,l.Z)(this,"promotions",void 0),(0,l.Z)(this,"serials",[]),(0,l.Z)(this,"initSerialTab",!1),(0,l.Z)(this,"productDiscontinued",void 0),this.httpService=e,this.activatedRoute=o,this.router=i,this.toaster=r,this.matDialog=d,this.roleService=_,this.variant=new Di,this.composites=[],this.outletPrices=[],this.pricebooks=[],this.salesGroups=[],this.entities=[],this.VariantPoint={ExpiredDay:0,Point:0,ExpiredMonth:0},this.variantParent=new Vt,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 Jt,m.gT.IsEmpty(r.EntityID)&&(r.EntityID=r.ID),o=(0,Ai.d8)(Jt,r),o))}calculateCompositeCost(e){let i,r,o=0;return e.forEach(d=>{i=d.Variant.Variant.UnitCost,r=d.Quantity,o+=i*r}),o}generateVariantSubmitData(){let e=this.generateOutletStock(this.entities),o=this.calculateCompositeCost(this.composites),i={};(this.variant?.TypeID==this.variantTypeID.PrepaidPackage||this.variant?.TypeID==this.variantTypeID.PrepaidPoint)&&(i=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:i};return m.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 m.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.productDiscontinued=e.ProductDiscontinued,this.VariantPoint=m.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==k.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(i=>{this.variantParentList=i,i.length>0&&!this.variantParent.ParentID&&(this.variantParent.ParentID=i[0].ID)})}onShowPromotionDetail(){this.matDialog.open(Vi,{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(),m.gT.IsEmpty(this.data.Form.Variant.Name)?this.toaster.warning("Display name cannot be empty",g.n.Warning):e&&e.length>500?this.toaster.warning("Maximum 500 characters allowed","Warning"):7==this.variant.TypeID&&m.gT.IsEmpty(this.formData.VariantParent.ParentID)?this.toaster.warning("Parent must be set for MultiUOM Product","Warning"):(this.formData.Serials=this.generateSerialPayload(),this.onSubmit("catalog/variant/SubmitVariant"))}generateSerialPayload(){let e=[];return this.serials.forEach(o=>{o.Serial.forEach(i=>{e=[...e,{ID:i.ID,serial:i.Serial}]})}),e}onSubmitSuccess(e){this.toaster.success(`Success ${this.isEdit?"update ":"add "}variant`,g.n.Success),this.router.navigate(["/menu/Products/Catalog/Variants/Info"],{queryParams:{ID:e}})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W),t.Y36(h.uw),t.Y36(v.N))}),(0,l.Z)(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"],["aria-label","Select an option",3,"disabled","ngModel","ngModelChange"],["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"],[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"],["id","serials","role","tabpanel",1,"tab-pane","fade","show","mt-0","pt-0"],[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","serials-tab","data-bs-toggle","tab","href","#serials","role","tab","aria-controls","serials","aria-selected","false",1,"nav-link",3,"click"],["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"],[3,"variantId","serials","serialsChange"]],template:function(e,o){1&e&&t.YNc(0,Ya,196,60,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[u.rH,T.p,c.mk,c.O5,s.Fj,s.JJ,s.nD,s.On,Q.VQ,Q.U0,x.w9,A.b,L.J,Ki,oa,pa,ma,va,xa,Za,ba,Ma]})),n})();var it=(()=>{return(n=it||(it={}))[n.CashAndPoint=0]="CashAndPoint",n[n.Cash=1]="Cash",n[n.Point=2]="Point",it;var n})();function Ka(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getSalesHistory())}),t._uU(1,"View"),t.qZA()}}const Ra=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},Ba=function(n){return{VariantID:n}};function $a(n,a){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,Ra))("queryParams",t.VKq(3,Ba,null==e.variant?null:e.variant.ID))}}function ja(n,a){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function Wa(n,a){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function za(n,a){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net "),t.qZA())}function Xa(n,a){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 tr(n,a){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 er(n,a){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 nr=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},or=function(n){return{ID:n}};function ir(n,a){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,Xa,3,3,"td",15),t.YNc(11,tr,3,3,"td",15),t.YNc(12,er,3,3,"td",15),t.qZA()),2&n){const e=a.$implicit,o=t.oxw().ngIf,i=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,nr))("queryParams",t.VKq(14,or,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",i.roleService.sell.PriceVisible),t.xp6(1),t.Q6J("ngIf",i.roleService.sell.PriceVisible&&(null==o?null:o.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",i.roleService.sell.PriceVisible&&(null==o?null:o.DiscountCount)>0)}}function ar(n,a){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,ja,2,0,"th",15),t.YNc(11,Wa,2,0,"th",16),t.YNc(12,za,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,ir,13,16,"tr",17),t.qZA()()()),2&n){const e=a.ngIf,o=t.oxw();t.xp6(10),t.Q6J("ngIf",o.roleService.sell.PriceVisible),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.PriceVisible&&(null==e?null:e.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.PriceVisible&&(null==e?null:e.DiscountCount)>0),t.xp6(2),t.Q6J("ngForOf",null==e?null:e.Data)}}let rr=(()=>{class n{constructor(e,o){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"salesHistory$",void 0),(0,l.Z)(this,"salesHistoryRequested",void 0),this.httpService=e,this.roleService=o}ngOnInit(){}getSalesHistory(){this.salesHistory$=this.httpService.post("/Api/catalog/product/GetSalesHistory",this.variant).pipe((0,F.U)(e=>(e.Data=e.Data.sort((o,i)=>new Date(o.Date).getTime()>new Date(i.Date).getTime()?-1:1),e))),this.salesHistoryRequested=!this.salesHistoryRequested}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(v.N))}),(0,l.Z)(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,Ka,2,0,"a",3),t.YNc(7,$a,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,ar,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:[u.rH,c.sg,c.O5,c.Ov,c.JJ,c.uU]})),n})();function lr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getHistory())}),t._uU(1,"View"),t.qZA()}}const cr=function(){return["/menu/Logistics/Report/Transfer/Product"]},Qt=function(n){return{ID:n}};function sr(n,a){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,cr))("queryParams",t.VKq(3,Qt,null==e.variant?null:e.variant.ID))}}const dr=function(){return["/menu/Logistics/Archive/Transfer_Order/Info"]};function pr(n,a){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=a.$implicit;t.xp6(2),t.Oqu(t.xi3(3,7,e.Date,"dd/MM/yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(12,dr))("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 ur(n,a){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,pr,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 mr=(()=>{class n{constructor(e,o){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"History",void 0),(0,l.Z)(this,"isMore",!1),this.httpService=e,this.roleService=o}ngOnInit(){}getHistory(){this.httpService.post("/Api/catalog/product/GetTransferOrder",this.variant).subscribe(e=>{this.History=e,this.isMore=!0})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(v.N))}),(0,l.Z)(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,lr,2,0,"a",3),t.YNc(7,sr,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,ur,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:[u.rH,c.sg,c.O5,c.JJ,c.uU]})),n})();function _r(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getPurchaseHistory())}),t._uU(1,"View"),t.qZA()}}const gr=function(){return["/menu/Reports/Purchases_Report/History"]},fr=function(n){return{VariantID:n}};function hr(n,a){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,gr))("queryParams",t.VKq(3,fr,e.variant.ID))}}function vr(n,a){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function xr(n,a){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function Cr(n,a){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net"),t.qZA())}function Zr(n,a){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 Tr(n,a){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 br(n,a){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 yr=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},Ir=function(n){return{ID:n}};function Mr(n,a){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,Zr,3,3,"td",15),t.YNc(11,Tr,3,3,"td",15),t.YNc(12,br,3,3,"td",15),t.qZA()),2&n){const e=a.$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,yr))("queryParams",t.VKq(14,Ir,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 Pr(n,a){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,vr,2,0,"th",15),t.YNc(11,xr,2,0,"th",16),t.YNc(12,Cr,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,Mr,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 Dr=(()=>{class n{constructor(e,o){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"purchaseHistoryRequested",void 0),(0,l.Z)(this,"purchaseHistory",void 0),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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(v.N))}),(0,l.Z)(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,_r,2,0,"a",3),t.YNc(7,hr,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,Pr,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:[u.rH,c.sg,c.O5,c.JJ,c.uU]})),n})();function Ar(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getParkedHistory())}),t._uU(1,"View"),t.qZA()}}const Sr=function(){return["/menu/Orders/Order/Parked_Order"]},Et=function(n){return{ID:n}};function Nr(n,a){if(1&n&&(t.TgZ(0,"a",11),t._uU(1,"more"),t.qZA()),2&n){const e=t.oxw();t.Q6J("queryParams",t.DdM(2,Sr))("queryParams",t.VKq(3,Et,null==e.variant?null:e.variant.ID))}}function qr(n,a){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Price"),t.qZA())}function wr(n,a){1&n&&(t.TgZ(0,"th",19),t._uU(1,"%"),t.qZA())}function Ur(n,a){1&n&&(t.TgZ(0,"th",18),t._uU(1,"Net "),t.qZA())}function Or(n,a){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 Jr(n,a){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,a){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 kr=function(){return["/menu/Orders/Order/Sales_Order/Info"]};function Fr(n,a){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,Or,3,3,"td",15),t.YNc(11,Jr,3,3,"td",15),t.YNc(12,Vr,3,3,"td",15),t.qZA()),2&n){const e=a.$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,kr))("queryParams",t.VKq(14,Et,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.PriceVisible),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.PriceVisible&&(null==o.parkedHistory?null:o.parkedHistory.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",o.roleService.sell.PriceVisible&&(null==o.parkedHistory?null:o.parkedHistory.DiscountCount)>0)}}function Qr(n,a){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,qr,2,0,"th",15),t.YNc(11,wr,2,0,"th",16),t.YNc(12,Ur,2,0,"th",15),t.qZA()(),t.TgZ(13,"tbody"),t.YNc(14,Fr,13,16,"tr",17),t.qZA()()()),2&n){const e=t.oxw();t.xp6(10),t.Q6J("ngIf",e.roleService.sell.PriceVisible),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.PriceVisible&&(null==e.parkedHistory?null:e.parkedHistory.DiscountCount)>0),t.xp6(1),t.Q6J("ngIf",e.roleService.sell.PriceVisible&&(null==e.parkedHistory?null:e.parkedHistory.DiscountCount)>0),t.xp6(2),t.Q6J("ngForOf",null==e.parkedHistory?null:e.parkedHistory.Data)}}let Er=(()=>{class n{constructor(e,o){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"parkedHistory",void 0),(0,l.Z)(this,"parkHistoryRequested",void 0),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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(v.N))}),(0,l.Z)(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,Ar,2,0,"a",3),t.YNc(7,Nr,2,5,"a",4),t.qZA()(),t.TgZ(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8),t.YNc(12,Qr,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:[u.rH,c.sg,c.O5,c.JJ,c.uU]})),n})();function Lr(n,a){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,a){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 Hr(n,a){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 Kr=(()=>{class n{constructor(){(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"categoryMeasurement",void 0)}ngOnChanges(){this.variantInfoModel&&(this.variant=this.variantInfoModel.Data.Variant,this.categoryMeasurement=this.variantInfoModel.Data.CategoryMeasurement)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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,Lr,5,1,"div",11),t.YNc(20,Yr,5,1,"div",11),t.YNc(21,Hr,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 Gr(n,a){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 Rr(n,a){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=a.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(5,2,e.Amount))}}function Br(n,a){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,Rr,6,4,"tr",14),t.qZA()()()),2&n){const e=t.oxw();t.xp6(9),t.Q6J("ngForOf",e.commisions)}}let $r=(()=>{class n{constructor(){(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"commisions",void 0),(0,l.Z)(this,"variant",void 0)}ngOnChanges(){this.variantInfoModel&&(this.commisions=this.variantInfoModel.Data.Commission,this.variant=this.variantInfoModel.Data.Variant)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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,Gr,6,3,"div",3),t.qZA(),t.TgZ(5,"div",2),t.YNc(6,Br,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 jr(n,a){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Unit Cost"),t.qZA())}function Wr(n,a){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Total Cost"),t.qZA())}function zr(n,a){1&n&&t._UZ(0,"i",16)}function Xr(n,a){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 tl(n,a){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 el=function(){return["/menu/Products/Catalog/Variants/Info"]},nl=function(n){return{ID:n}};function ol(n,a){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"div",12)(3,"a",13),t._uU(4),t.qZA(),t.YNc(5,zr,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,Xr,3,3,"td",15),t.YNc(13,tl,3,3,"td",15),t.qZA()),2&n){const e=a.$implicit,o=t.oxw();t.xp6(3),t.Q6J("routerLink",t.DdM(9,el))("queryParams",t.VKq(10,nl,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 il=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"composites",void 0),(0,l.Z)(this,"role",void 0),(0,l.Z)(this,"currencies",void 0),this.roleService=e}findCurrencySymbolById(e){let o;return this.currencies.forEach(i=>{i.ID===e&&(o=i.Symbol)}),o}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,jr,2,0,"th",9),t.YNc(16,Wr,2,0,"th",9),t.qZA()(),t.TgZ(17,"tbody"),t.YNc(18,ol,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:[u.rH,Z.gM,c.sg,c.O5,c.JJ]})),n})();const al=function(n){return{ID:n}};function rl(n,a){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=a.$implicit;t.xp6(2),t.Q6J("queryParams",t.VKq(5,al,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(6,3,e.Quantity))}}let ll=(()=>{class n{constructor(){(0,l.Z)(this,"dependencyOf",void 0)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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,rl,7,7,"tr",8),t.qZA()()()()()()),2&e&&(t.xp6(12),t.Q6J("ngForOf",o.dependencyOf))},dependencies:[u.rH,c.sg,c.JJ],styles:["a[_ngcontent-%COMP%]{color:#0976b4;text-decoration:none;background-color:transparent}"]})),n})(),cl=(()=>{class n{constructor(){(0,l.Z)(this,"variant",void 0)}ngOnInit(){}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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 sl(n,a){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 Lt=function(){return["/menu/Products/Catalog/Variants/Log"]},dl=function(n){return{ID:n}};function pl(n,a){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,Lt))("queryParams",t.VKq(3,dl,e.variant.ID))}}function ul(n,a){if(1&n&&(t.TgZ(0,"div",23),t.YNc(1,pl,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 ml(n,a){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function _l(n,a){1&n&&(t.TgZ(0,"th",26),t._uU(1,"Indirect Allocated"),t.qZA())}function gl(n,a){1&n&&(t.TgZ(0,"th",27),t._uU(1,"ROP"),t.qZA())}function fl(n,a){1&n&&(t.TgZ(0,"th",28),t._uU(1,"Max"),t.qZA())}function hl(n,a){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 vl(n,a){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 xl(n,a){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),"")}}const Cl=function(n,a){return{ID:n,EntityID:a}},Yt=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},Zl=function(n,a){return{VariantID:n,OutletID:a}};function Tl(n,a){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,hl,3,3,"td",33),t.TgZ(12,"td",32),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,vl,3,4,"td",34),t.ALo(16,"sum"),t.YNc(17,xl,3,4,"td",35),t.ALo(18,"sum"),t.qZA()),2&n){const e=a.$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(24,Lt))("queryParams",t.WLB(25,Cl,o.variant.ID,e.EntityID)),t.xp6(1),t.Oqu(t.lcZ(6,12,e.OnHand)),t.xp6(3),t.Q6J("routerLink",t.DdM(28,Yt))("queryParams",t.WLB(29,Zl,o.variant.ID,e.EntityID)),t.xp6(1),t.hij(" ",t.lcZ(10,14,e.Allocated)," "),t.xp6(2),t.Q6J("ngIf",o.totalAllocatedIndrection>0),t.xp6(2),t.hij(" ",t.lcZ(14,16,e.Available)," "),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(16,18,o.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(18,21,o.entityStock,"MaxStock"))}}function bl(n,a){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 yl(n,a){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 Il(n,a){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 Pl(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(i))}),t.TgZ(7,"thead",8)(8,"tr",9)(9,"th"),t._uU(10," Outlet "),t.YNc(11,ul,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,ml,2,0,"span",13),t._uU(16," Allocated"),t.qZA(),t.YNc(17,_l,2,0,"th",14),t.TgZ(18,"th",15),t._uU(19,"Available "),t.qZA(),t.YNc(20,gl,2,0,"th",16),t.ALo(21,"sum"),t.YNc(22,fl,2,0,"th",17),t.ALo(23,"sum"),t.qZA()(),t.TgZ(24,"tbody"),t.YNc(25,Tl,19,32,"tr",18),t.qZA(),t.TgZ(26,"tfoot")(27,"tr"),t._UZ(28,"td",19),t.TgZ(29,"td",20),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.qZA(),t.TgZ(33,"td",20)(34,"a",21),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA()(),t.YNc(38,bl,4,6,"td",22),t.TgZ(39,"td",20),t._uU(40),t.ALo(41,"number"),t.ALo(42,"sum"),t.qZA(),t.YNc(43,yl,4,6,"td",22),t.ALo(44,"sum"),t.YNc(45,Il,4,6,"td",22),t.ALo(46,"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,14,e.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!=t.xi3(23,17,e.entityStock,"MaxStock")),t.xp6(3),t.Q6J("ngForOf",e.entityStock),t.xp6(5),t.hij(" ",t.lcZ(31,20,t.xi3(32,22,e.entityStock,"OnHand"))," "),t.xp6(4),t.Q6J("routerLink",t.DdM(41,Yt))("queryParams",t.VKq(42,Ml,e.variant.ID)),t.xp6(1),t.hij(" ",t.lcZ(36,25,t.xi3(37,27,e.entityStock,"Allocated"))," "),t.xp6(3),t.Q6J("ngIf",e.totalAllocatedIndrection>0),t.xp6(2),t.hij(" ",t.lcZ(41,30,t.xi3(42,32,e.entityStock,"Available"))," "),t.xp6(3),t.Q6J("ngIf",0!==t.xi3(44,35,e.entityStock,"MinStock")),t.xp6(2),t.Q6J("ngIf",0!==t.xi3(46,38,e.entityStock,"MaxStock"))}}let Dl=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"originalStock",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"variantParent",void 0),(0,l.Z)(this,"entityStock",void 0),(0,l.Z)(this,"totalAllocatedIndrection",0),(0,l.Z)(this,"variantType",k.J),this.roleService=e}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((i,r)=>this.compare(i[e.active],r[e.active],"asc"===e.direction)):this.originalStock}compare(e,o,i){return(e<o?-1:1)*(i?1:-1)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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"]],template:function(e,o){1&e&&(t.YNc(0,sl,4,0,"div",0),t.YNc(1,Pl,47,44,"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:[u.rH,Z.gM,c.mk,c.sg,c.O5,P.YE,P.nU,c.JJ,S.qU]})),n})(),Al=(()=>{class n{constructor(){(0,l.Z)(this,"variantParent",void 0),(0,l.Z)(this,"variant",void 0)}ngOnInit(){}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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 Sl(n,a){1&n&&(t.TgZ(0,"th",9),t._uU(1,"Extra Cost"),t.qZA())}function Nl(n,a){1&n&&(t.TgZ(0,"th",12),t._uU(1,"Disc."),t.qZA())}function ql(n,a){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 wl(n,a){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 Ul(n,a){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.YNc(3,ql,3,3,"td",13),t.TgZ(4,"td"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.YNc(7,wl,2,1,"td",13),t.qZA()),2&n){const e=a.$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 Ol=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"outletPrices",void 0),(0,l.Z)(this,"currencies",void 0),(0,l.Z)(this,"outletPriceVisible",void 0),this.roleService=e}ngOnChanges(){this.variantInfoModel&&(this.outletPrices=this.variantInfoModel.Data.OutletPrice,this.currencies=this.variantInfoModel.Data.Currencies,this.outletPriceVisible=this.roleService.product.Cost)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,Sl,2,0,"th",8),t.TgZ(11,"th",9),t._uU(12,"Price"),t.qZA(),t.YNc(13,Nl,2,0,"th",10),t.qZA()(),t.TgZ(14,"tbody"),t.YNc(15,Ul,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 Jl(n,a){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=a.$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 Vl=(()=>{class n{constructor(){(0,l.Z)(this,"pricebooks",void 0)}ngOnInit(){}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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,Jl,11,8,"tr",11),t.qZA()()()()()()()),2&e&&(t.xp6(17),t.Q6J("ngForOf",o.pricebooks))},dependencies:[c.sg,c.JJ]})),n})();function kl(n,a){1&n&&(t.TgZ(0,"th",13),t._uU(1,"Minimum Quantity"),t.qZA())}function Fl(n,a){1&n&&(t.TgZ(0,"th",13),t._uU(1,"Minimum Amount"),t.qZA())}function Ql(n,a){1&n&&(t.TgZ(0,"th",10),t._uU(1,"Extra Cost"),t.qZA())}function El(n,a){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 Ll(n,a){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 Yl(n,a){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 Hl=function(){return["/menu/Promotion/Main/Event/Form"]},Kl=function(n){return{ID:n}};function Gl(n,a){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,El,3,3,"td",16),t.YNc(11,Ll,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,Yl,3,3,"td",16),t.qZA()),2&n){const e=a.$implicit,o=t.oxw();t.xp6(2),t.Q6J("routerLink",t.DdM(21,Hl))("queryParams",t.VKq(22,Kl,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 Rl=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"promotions",[]),(0,l.Z)(this,"hasMinimumQuantity",void 0),(0,l.Z)(this,"hasMinimumAmount",void 0),(0,l.Z)(this,"hasExtraCost",void 0),this.roleService=e}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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,kl,2,0,"th",9),t.YNc(13,Fl,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,Ql,2,0,"th",11),t.qZA()(),t.TgZ(19,"tbody"),t.YNc(20,Gl,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:[u.rH,c.sg,c.O5,c.JJ,c.uU]})),n})(),Bl=(()=>{class n{constructor(){(0,l.Z)(this,"variant",void 0)}ngOnInit(){}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(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 $l=p(19835);function jl(n,a){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function Wl(n,a){1&n&&(t.TgZ(0,"th",19)(1,"span",20),t._uU(2,"Indirect Allocated"),t.qZA()())}function zl(n,a){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 Xl=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},tc=function(n){return{VariantID:n}};function ec(n,a){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,zl,2,1,"td",18),t.TgZ(10,"td",17),t._uU(11),t.qZA()()),2&n){const e=a.$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,Xl))("queryParams",t.VKq(10,tc,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 nc(n,a){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 oc=(()=>{class n{constructor(){(0,l.Z)(this,"compositeInventories",void 0),(0,l.Z)(this,"variantID",void 0),(0,l.Z)(this,"totalCompositeInventory",void 0),(0,l.Z)(this,"compositeSortDirec",void 0),(0,l.Z)(this,"TotalIndirect",0)}ngOnInit(){for(let e of this.compositeInventories)this.TotalIndirect+=e.IndirectAllocated}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-info-variant-nav-composite-inventory"]],inputs:{compositeInventories:"compositeInventories",variantID:"variantID",totalCompositeInventory:"totalCompositeInventory"},decls:33,vars:11,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"table","table-bordered","custom-table"],[1,"table-secondary"],[1,"border-end"],["ng-click","compositeSortDirec = !compositeSortDirec",1,"border-end","text-end",2,"width","100px"],[1,"pointer"],[1,"fa-solid","fa-sort"],["matTooltipPosition","above","matTooltip","Allocated that associate directly with the product",1,"border-end","pointer","text-end",2,"width","100px"],["customTooltip","Allocated that associate directly with the product","position","top"],[4,"ngIf"],["class","border-end text-end pointer","style","width:100px",4,"ngIf"],[1,"border-end","text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["colspan","1"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"border-end","text-end","pointer",2,"width","100px"],["customTooltip","Allocated that associate indirectly with the product (either its parent, or its component)","position","top"],[1,"text-end","border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr",5)(7,"th",6),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"th",7),t._uU(10," On Hand "),t.TgZ(11,"span",8),t._UZ(12,"i",9),t.qZA()(),t.TgZ(13,"th",10)(14,"div",11),t.YNc(15,jl,2,0,"span",12),t._uU(16," Allocated "),t.qZA()(),t.YNc(17,Wl,3,0,"th",13),t.TgZ(18,"th",14),t._uU(19," Available "),t.qZA()()(),t.TgZ(20,"tbody"),t.YNc(21,ec,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,nc,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:[u.rH,Z.gM,c.sg,c.O5,$l.i,c.JJ,S.W7]})),n})(),ic=(()=>{class n{constructor(e,o,i){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"toastr",void 0),(0,l.Z)(this,"modalConfig",void 0),(0,l.Z)(this,"lastDays",void 0),this.dialogRef=e,this.data=o,this.toastr=i,this.modalConfig=new y.O,this.modalConfig.title="Daily Sales",this.modalConfig.customWidth="250px",this.lastDays=o}ngOnInit(){}onOk(){m.gT.IsEmpty(this.lastDays)?this.toastr.warning("This field Can't be blank","Warning"):this.dialogRef.close(this.lastDays)}onCancel(){this.dialogRef.close()}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.so),t.Y36(h.WI),t.Y36(C._W))}),(0,l.Z)(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:[D.M,s.Fj,s.JJ,s.On,A.b]})),n})();function ac(n,a){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=a.$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 rc=(()=>{class n{constructor(e,o){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"dialog",void 0),(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"listData$",void 0),(0,l.Z)(this,"lastDays",30),(0,l.Z)(this,"originalData$",void 0),this.httpService=e,this.dialog=o}ngOnChanges(e){e.variantInfoModel&&(this.lastDays=this.variantInfoModel.Config.ToZeroDays,this.initListData())}initListData(){let i,o=this.variantInfoModel.Data.EntityStockOutlet;this.listData$=this.getForecastData(this.variantInfoModel.Data.Variant.ID,this.lastDays).pipe((0,F.U)(r=>r.Data),(0,F.U)(r=>o.filter(d=>-1!=r.findIndex(_=>_.EntityID==d.EntityID)).map(d=>{if(i=r.findIndex(_=>d.EntityID==_.EntityID),-1!=i)return{outlet:d.Name,available:d.Available,sales:r[i].Quantity,QtyPerDay:r[i].Quantity/this.lastDays,daysToZero:d.Available>0?d.Available/(r[i].Quantity/this.lastDays):0}}))),this.originalData$=this.listData$}onUpdateLastDays(){this.dialog.open(ic,{data:this.lastDays}).afterClosed().pipe((0,H.h)(e=>m.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,gt.d)(1))}onSort(e){this.listData$=e.active&&""!==e.direction?this.listData$.pipe((0,F.U)(o=>o.sort((i,r)=>m.gT.compare(i[e.active],r[e.active],"asc"===e.direction)))):this.originalData$}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(h.uw))}),(0,l.Z)(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"],["mat-sort-header","daysToZero","arrowPosition","before",1,"text-end"],["matTooltipPosition","above","matTooltip","How many days left until you run out of inventory",1,"fa-solid","fa-circle-info","me-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",12),t._UZ(19,"i",13),t._uU(20," Days to Zero "),t.qZA()()(),t.TgZ(21,"tbody"),t.YNc(22,ac,15,17,"tr",14),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:[Z.gM,c.sg,P.YE,P.nU,c.Ov,c.JJ]})),n})();function lc(n,a){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 cc(n,a){1&n&&(t.TgZ(0,"span"),t._uU(1,"Direct"),t.qZA())}function sc(n,a){1&n&&(t.TgZ(0,"th",11),t._uU(1,"Indirect Allocated"),t.qZA())}function dc(n,a){1&n&&(t.TgZ(0,"th",22),t._uU(1,"ROP"),t.qZA())}function pc(n,a){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Max"),t.qZA())}function uc(n,a){1&n&&(t.TgZ(0,"th"),t._uU(1,"Serial"),t.qZA())}function mc(n,a){1&n&&t._UZ(0,"th")}function _c(n,a){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 gc(n,a){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 fc(n,a){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 hc(n,a){if(1&n&&(t.TgZ(0,"li",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",e," ")}}function vc(n,a){if(1&n&&(t.TgZ(0,"td")(1,"ul",33),t.YNc(2,hc,2,1,"li",34),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(2),t.Q6J("ngForOf",e.SerialNumber)}}const xc=function(){return["/menu/Products/Catalog/Variants/Serial_Form"]},Cc=function(n,a){return{VariantID:n,EntityID:a}};function Zc(n,a){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,xc))("queryParams",t.WLB(3,Cc,o.variant.ID,e.EntityID))}}const Tc=function(){return["/menu/Products/Catalog/Variants/Log"]},bc=function(n,a){return{ID:n,EntityID:a}},Ht=function(){return["/menu/Fulfillment/Allocated/Unfulfilled_Products"]},yc=function(n,a){return{VariantID:n,OutletID:a}};function Ic(n,a){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,_c,3,3,"td",28),t.TgZ(12,"td",27),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,gc,3,4,"td",29),t.ALo(16,"sum"),t.YNc(17,fc,3,4,"td",30),t.ALo(18,"sum"),t.YNc(19,vc,3,1,"td",12),t.YNc(20,Zc,3,6,"td",12),t.qZA()),2&n){const e=a.$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,Tc))("queryParams",t.WLB(27,bc,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,Ht))("queryParams",t.WLB(31,yc,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 Mc(n,a){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 Pc(n,a){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 Dc(n,a){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 Ac(n,a){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 Sc=function(n){return{VariantID:n}};function Nc(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(i))}),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,cc,2,0,"span",12),t._uU(15," Allocated"),t.qZA(),t.YNc(16,sc,2,0,"th",13),t.TgZ(17,"th",14),t._uU(18,"Available "),t.qZA(),t.YNc(19,dc,2,0,"th",15),t.ALo(20,"sum"),t.YNc(21,pc,2,0,"th",16),t.ALo(22,"sum"),t.YNc(23,uc,2,0,"th",12),t.YNc(24,mc,1,0,"th",12),t.qZA()(),t.TgZ(25,"tbody"),t.YNc(26,Ic,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,Mc,4,6,"td",21),t.YNc(40,Pc,4,6,"td",21),t.ALo(41,"sum"),t.YNc(42,Dc,4,6,"td",21),t.ALo(43,"sum"),t.YNc(44,Ac,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,Ht))("queryParams",t.VKq(41,Sc,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 qc=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"originalStock",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"variantParent",void 0),(0,l.Z)(this,"entityStock",void 0),(0,l.Z)(this,"totalAllocatedIndrection",0),(0,l.Z)(this,"variantType",k.J),this.roleService=e}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((i,r)=>this.compare(i[e.active],r[e.active],"asc"===e.direction)):this.originalStock}compare(e,o,i){return(e<o?-1:1)*(i?1:-1)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,lc,4,0,"div",0),t.YNc(1,Nc,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:[u.rH,Z.gM,c.mk,c.sg,c.O5,P.YE,P.nU,c.JJ,S.qU]})),n})();function wc(n,a){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 Uc=function(){return["/menu/Products/Catalog/Variants/Log"]},Oc=function(n){return{ID:n}};function Jc(n,a){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,Uc))("queryParams",t.VKq(3,Oc,e.variant.ID))}}function Vc(n,a){if(1&n&&(t.TgZ(0,"div",18),t.YNc(1,Jc,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 kc(n,a){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=a.$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 Fc(n,a){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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(i))}),t.TgZ(7,"thead",8)(8,"tr",9)(9,"th"),t._uU(10," Outlet "),t.YNc(11,Vc,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,kc,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 Qc=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"variantInfoModel",void 0),(0,l.Z)(this,"originalStock",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"variantParent",void 0),(0,l.Z)(this,"entityStock",void 0),(0,l.Z)(this,"totalAllocatedIndrection",0),(0,l.Z)(this,"variantType",k.J),this.roleService=e}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((i,r)=>this.compare(i[e.active],r[e.active],"asc"===e.direction)):this.originalStock}compare(e,o,i){return(e<o?-1:1)*(i?1:-1)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(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,wc,4,0,"div",0),t.YNc(1,Fc,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:[u.rH,Z.gM,c.sg,c.O5,P.YE,c.JJ,S.qU]})),n})();function Ec(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"tr")(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td",14),t._uU(5),t.ALo(6,"number"),t.qZA()(),t.BQk()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(e.Serial),t.xp6(2),t.hij(" ",t.lcZ(6,2,e.Quantity)," ")}}function Lc(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",13),t._uU(3),t.qZA()(),t.YNc(4,Ec,7,4,"ng-container",12),t.BQk()),2&n){const e=a.$implicit;t.xp6(2),t.Q6J("rowSpan",e.Serial.length+1),t.xp6(1),t.Oqu(e.EntityName),t.xp6(1),t.Q6J("ngForOf",e.Serial)}}function Yc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th"),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",10),t.NdJ("matSortChange",function(i){const d=t.CHM(e).ngIf,_=t.oxw();return t.KtG(_.onSort(i,d))}),t._uU(7," Serial"),t.qZA(),t.TgZ(8,"th",11),t.NdJ("matSortChange",function(i){const d=t.CHM(e).ngIf,_=t.oxw();return t.KtG(_.onSort(i,d))}),t._uU(9," Quantity"),t.qZA()()(),t.TgZ(10,"tbody"),t.YNc(11,Lc,5,3,"ng-container",12),t.qZA()()()}if(2&n){const e=a.ngIf;t.xp6(11),t.Q6J("ngForOf",e)}}let Hc=(()=>{class n{set variantId(e){m.gT.IsNotEmpty(e)&&this.initSerial(e)}constructor(e){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"sourceData",void 0),(0,l.Z)(this,"outletSerial$",void 0),this.httpService=e}initSerial(e){this.outletSerial$=this.httpService.post("/api/catalog/variant/GetVariantSerialByVariantID",{ID:e}).pipe((0,gt.d)(),(0,mt.b)(i=>{this.sourceData=JSON.parse(JSON.stringify(i))}))}onSort(e,o){o=e.active&&""!==e.direction?o.sort((i,r)=>{const d="asc"===e.direction,_=i.Serial.reduce((N,X)=>X.Quantity>N.Quantity?X:N,i.Serial[0]),b=r.Serial.reduce((N,X)=>X.Quantity>N.Quantity?X:N,r.Serial[0]);switch(e.active){case"Serial":return m.gT.compare(_.Serial,b.Serial,d);case"Quantity":return m.gT.compare(_.Quantity,b.Quantity,d);default:return 0}}):JSON.parse(JSON.stringify(this.sourceData))}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["app-info-variant-nav-serial"]],inputs:{variantId:"variantId"},decls:7,vars:3,consts:[[1,"card","border-top-0"],[1,"card-body"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["class","content",4,"ngIf"],[1,"content"],[1,"table","custom-table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"table-secondary"],["matSort","","mat-sort-header","Serial",2,"width","150px",3,"matSortChange"],["matSort","","mat-sort-header","Quantity",2,"width","50px",3,"matSortChange"],[4,"ngFor","ngForOf"],[3,"rowSpan"],[1,"text-end"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t.YNc(5,Yc,12,1,"div",5),t.ALo(6,"async"),t.qZA()()()()()),2&e&&(t.xp6(5),t.Q6J("ngIf",t.lcZ(6,1,o.outletSerial$)))},dependencies:[c.sg,c.O5,P.YE,P.nU,c.Ov,c.JJ]})),n})();function Kc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",26),t._uU(2,"Inventory"),t.qZA()())}function Gc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",27),t._uU(2,"Component"),t.qZA()())}function Rc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",28),t._uU(2,"Outlet Price"),t.qZA()())}function Bc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",29),t._uU(2,"Pricebook"),t.qZA()())}function $c(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",30),t._uU(2,"Promotion"),t.qZA()())}function jc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",31),t._uU(2,"Purchase"),t.qZA()())}function Wc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",32),t._uU(2,"Description"),t.qZA()())}function zc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",33),t._uU(2,"Commission"),t.qZA()())}function Xc(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",34),t._uU(2,"MultiUOM"),t.qZA()())}function ts(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",35),t._uU(2,"Composite Inventory"),t.qZA()())}function es(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",36),t._uU(2,"Dependency Of"),t.qZA()())}function ns(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",37),t._uU(2,"Group"),t.qZA()())}function os(n,a){1&n&&(t.TgZ(0,"li",2)(1,"button",38),t._uU(2,"Pick Pack"),t.qZA()())}function is(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"li",2)(2,"button",39),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.initSerialTab=!0)}),t._uU(3,"Serial"),t.qZA()(),t.BQk()}}function as(n,a){if(1&n&&(t.TgZ(0,"div",40),t._UZ(1,"POS-info-variant-nav-inventory",14),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function rs(n,a){if(1&n&&(t.TgZ(0,"div",41),t._UZ(1,"POS-info-variant-nav-component",42),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("composites",e.composites)("currencies",e.currencies)}}function ls(n,a){if(1&n&&(t.TgZ(0,"div",43),t._UZ(1,"POS-info-variant-nav-outlet-price",14),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function cs(n,a){if(1&n&&(t.TgZ(0,"div",44),t._UZ(1,"POS-info-variant-nav-pricebook",45),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("pricebooks",e.pricebooks)}}function ss(n,a){if(1&n&&(t.TgZ(0,"div",46),t._UZ(1,"POS-info-variant-nav-promotion",47),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("costRole",e.roleService.product.Cost)("promotions",e.promotions)}}function ds(n,a){1&n&&(t.TgZ(0,"div",48),t._UZ(1,"POS-info-variant-nav-purchase"),t.qZA())}function ps(n,a){if(1&n&&t._UZ(0,"POS-info-variant-nav-multiuom",52),2&n){const e=t.oxw(2);t.Q6J("variant",e.variant)("variantParent",e.variantParent)}}function us(n,a){1&n&&(t.TgZ(0,"div",53)(1,"div",54)(2,"div",55)(3,"div",56),t._uU(4," Parent has not been set "),t.qZA()()()())}function ms(n,a){if(1&n&&(t.TgZ(0,"div",49),t.YNc(1,ps,1,2,"POS-info-variant-nav-multiuom",50),t.YNc(2,us,5,0,"ng-template",null,51,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 _s(n,a){if(1&n&&(t.TgZ(0,"div",57),t._UZ(1,"POS-info-variant-nav-composite-inventory",58),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 gs(n,a){if(1&n&&(t.TgZ(0,"div",59),t._UZ(1,"POS-info-variant-nav-group-inventory",14),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function fs(n,a){if(1&n&&(t.ynx(0),t._UZ(1,"app-info-variant-mav-forecast",14),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantInfoModel",e.data)}}function hs(n,a){if(1&n&&(t.ynx(0),t._UZ(1,"app-info-variant-nav-serial",60),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("variantId",null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID)}}let vs=(()=>{class n{constructor(e){(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"initToZeroTab",!1),(0,l.Z)(this,"initSerialTab",!1),(0,l.Z)(this,"outletPrices",void 0),(0,l.Z)(this,"pricebooks",void 0),(0,l.Z)(this,"commisions",void 0),(0,l.Z)(this,"totalCompositeInventory",void 0),(0,l.Z)(this,"promotions",[]),(0,l.Z)(this,"compositeInventories",void 0),(0,l.Z)(this,"dependencyOf",[]),(0,l.Z)(this,"composites",[]),(0,l.Z)(this,"currencies",void 0),(0,l.Z)(this,"variant",void 0),(0,l.Z)(this,"variantParent",void 0),(0,l.Z)(this,"variantType",k.J),(0,l.Z)(this,"role",void 0),(0,l.Z)(this,"isPickPacked",0),this.roleService=e,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,i)=>o+i)}}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(v.N))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-info-variant-nav"]],inputs:{data:"data"},features:[t.TTD],decls:45,vars:30,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"],[4,"ngIf"],["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"],["id","Serial","role","tabpanel",1,"tab-pane","fade","mt-0","pt-0"],["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","group-inventory-tab","data-bs-toggle","tab","data-bs-target","#Serial","role","tab","aria-controls","Serial","aria-selected","false",1,"nav-link",3,"click"],["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"],[3,"variantId"]],template:function(e,o){1&e&&(t.TgZ(0,"ul",0),t.YNc(1,Kc,3,0,"li",1),t.YNc(2,Gc,3,0,"li",1),t.YNc(3,Rc,3,0,"li",1),t.YNc(4,Bc,3,0,"li",1),t.YNc(5,$c,3,0,"li",1),t.YNc(6,jc,3,0,"li",1),t.TgZ(7,"li",2)(8,"button",3),t._uU(9,"Advanced"),t.qZA()(),t.YNc(10,Wc,3,0,"li",1),t.YNc(11,zc,3,0,"li",1),t.YNc(12,Xc,3,0,"li",1),t.YNc(13,ts,3,0,"li",1),t.YNc(14,es,3,0,"li",1),t.YNc(15,ns,3,0,"li",1),t.YNc(16,os,3,0,"li",1),t.TgZ(17,"li",2)(18,"button",4),t.NdJ("click",function(){return o.initToZeroTab=!0}),t._uU(19,"To Zero"),t.qZA()(),t.YNc(20,is,4,0,"ng-container",5),t.qZA(),t.TgZ(21,"div",6),t.YNc(22,as,2,1,"div",7),t.YNc(23,rs,2,2,"div",8),t.YNc(24,ls,2,1,"div",9),t.YNc(25,cs,2,1,"div",10),t.YNc(26,ss,2,2,"div",11),t.YNc(27,ds,2,0,"div",12),t.TgZ(28,"div",13),t._UZ(29,"POS-info-variant-nav-commision",14),t.qZA(),t.TgZ(30,"div",15),t._UZ(31,"POS-info-variant-nav-advanced",14),t.qZA(),t.TgZ(32,"div",16),t._UZ(33,"POS-info-variant-nav-description",17),t.qZA(),t.YNc(34,ms,4,2,"div",18),t.YNc(35,_s,2,3,"div",19),t.TgZ(36,"div",20),t._UZ(37,"POS-info-variant-nav-dependency-of",21),t.qZA(),t.YNc(38,gs,2,1,"div",22),t.TgZ(39,"div",23),t._UZ(40,"POS-info-variant-pickpack",14),t.qZA(),t.TgZ(41,"div",24),t.YNc(42,fs,2,1,"ng-container",5),t.qZA(),t.TgZ(43,"div",25),t.YNc(44,hs,2,1,"ng-container",5),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",o.roleService.product.Expense&&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",o.roleService.product.CommissionView&&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(4),t.Q6J("ngIf",(null==o.data||null==o.data.Data?null:o.data.Data.Variant.TypeID)==o.variantType.Serialized),t.xp6(2),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.initToZeroTab),t.xp6(2),t.Q6J("ngIf",o.initSerialTab))},dependencies:[c.O5,Kr,$r,il,ll,cl,Dl,Al,Ol,Vl,Rl,Bl,oc,rc,qc,Qc,Hc]})),n})();const Cs=function(){return["/menu/Products/Catalog/Variants/Inventory_Cost_History"]},ft=function(n){return{VariantID:n}};function Zs(n,a){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,Cs))("queryParams",t.VKq(3,ft,null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID))}}function Ts(n,a){if(1&n&&(t.TgZ(0,"div",43),t.YNc(1,Zs,3,5,"a",6),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Edit)}}const Kt=function(){return["/menu/Products/Add-Ons/Variant_History"]};function bs(n,a){if(1&n&&(t.TgZ(0,"a",46),t._UZ(1,"i",47),t._uU(2,"\xa0\xa0Update History "),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink",t.DdM(2,Kt))("queryParams",t.VKq(3,ft,null==e.data||null==e.data.Data||null==e.data.Data.Variant?null:e.data.Data.Variant.ID))}}function ys(n,a){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 Is=function(){return["/menu/Products/Catalog/Variants/Form"]},Gt=function(n){return{ID:n}};function Ms(n,a){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,Is))("queryParams",t.VKq(3,Gt,e.data.Data.Variant.ID))}}function Ps(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",51),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.deleteVariantInfo())}),t._UZ(1,"i",52),t._uU(2,"\xa0\xa0Delete"),t.qZA()}}function Ds(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"img",53),t.NdJ("click",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.openBigPicture(r.data.Data.Variant,i))}),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("src",e.data.Data.Variant.Image,t.LSH)}}function As(n,a){1&n&&(t.TgZ(0,"div",54),t._UZ(1,"i",55),t.qZA())}function Ss(n,a){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 Ns(n,a){1&n&&(t.TgZ(0,"p",57),t._uU(1,"Point(s)"),t.qZA())}function qs(n,a){1&n&&(t.TgZ(0,"p",58),t._uU(1," Expiration "),t.qZA())}function ws(n,a){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 Us(n,a){if(1&n&&(t.TgZ(0,"div",60)(1,"div",61)(2,"a",62),t._uU(3),t.ALo(4,"number"),t.qZA(),t.TgZ(5,"label"),t._uU(6,"Buying Cost"),t.qZA()()()),2&n){const e=t.oxw(2);t.Q6J("ngClass",e.data.Data.Variant.OrderPriceDiscount>0?"col-sm-3":""),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Kt))("queryParams",t.VKq(7,ft,e.data.Data.Variant.ID)),t.xp6(1),t.Oqu(t.lcZ(4,4,e.data.Data.Variant.UnitCost))}}function Os(n,a){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 Js(n,a){if(1&n&&(t.TgZ(0,"div",60)(1,"div",32),t._UZ(2,"POS-info-page-input",65),t.ALo(3,"number"),t.qZA()()),2&n){const e=t.oxw(2);t.Q6J("ngClass",e.data.Data.Variant.OrderPriceDiscount>0?"col-sm-3":"")("ngClass",null!=e.roleService&&e.roleService.product.Cost?"ps-0":""),t.xp6(2),t.Q6J("inputValue",t.lcZ(3,3,e.data.Data.Variant.UnitPrice))}}function Vs(n,a){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 ks(n,a){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 Fs(n,a){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 Qs(n,a){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 Es(n,a){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 Ls(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"div",68),t._UZ(2,"POS-info-variant-parked-history",67),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("variant",e.data.Data.Variant)}}const Ys=function(){return["/menu/Products/Catalog/Products/Info"]};function Hs(n,a){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Ts,2,1,"div",2),t.YNc(3,bs,3,5,"a",3),t.TgZ(4,"div",4),t.YNc(5,ys,3,1,"a",5),t.qZA(),t.TgZ(6,"div",4),t.YNc(7,Ms,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,As,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,Ss,2,1,"p",20),t.YNc(27,Ns,2,0,"p",21),t.TgZ(28,"p",22),t._uU(29),t.qZA(),t.YNc(30,qs,2,0,"p",23),t.YNc(31,ws,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,Us,7,9,"div",28),t.YNc(40,Os,3,1,"div",29),t.YNc(41,Js,4,5,"div",28),t.YNc(42,Vs,3,1,"div",29),t.qZA(),t.TgZ(43,"div",9),t.YNc(44,ks,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,Fs,2,1,"div",41),t.qZA(),t.YNc(77,Qs,3,1,"div",42),t.YNc(78,Es,3,1,"div",42),t.YNc(79,Ls,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",null==e.roleService?null:e.roleService.product.BarcodePrinting),t.xp6(2),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Edit),t.xp6(1),t.Q6J("ngIf",null==e.roleService?null:e.roleService.product.Delete),t.xp6(9),t.Q6J("ngIf",e.data.Data.Variant.Image),t.xp6(1),t.Q6J("ngIf",!e.data.Data.Variant.Image),t.xp6(2),t.Q6J("routerLink",t.DdM(40,Ys))("queryParams",t.VKq(41,Gt,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?null:e.roleService.sell.PriceVisible),t.xp6(1),t.Q6J("ngIf",e.data.Data.Variant.PriceDiscount&&!(null!=e.roleService&&e.roleService.sell.PriceVisible)),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 Ks=BiggerPicture({target:document.body});let Gs=(()=>{class n extends q.U{constructor(e,o,i,r,d,_){super(e,"catalog/variant/GetVariantInfoModelById",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"title",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"AutoGenerateCode",void 0),(0,l.Z)(this,"destroy$",void 0),(0,l.Z)(this,"outletPriceVisible",void 0),(0,l.Z)(this,"isUsingPoint",void 0),(0,l.Z)(this,"IsPurchaseRoleHistory",void 0),(0,l.Z)(this,"paymentType",it),this.httpService=e,this.activatedRoute=o,this.router=i,this.toaster=r,this.title=d,this.roleService=_,this.destroy$=new tt.x,this.router.routeReuseStrategy.shouldReuseRoute=function(){return!1}}initRoles(){this.outletPriceVisible=this.roleService.product.Cost,this.IsPurchaseRoleHistory=this.roleService.buy.Create&&this.roleService.report.View,this.isUsingPoint=this.data?.Variant?.TypeID==k.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",g.n.Success)}openBigPicture(e,o){return(0,O.Z)(function*(){o.preventDefault();try{const i=yield(0,m.FI)(e.Image.replace("w_80",""));Ks.open({items:[i],intro:"fadeup"})}catch(i){alert(i)}})()}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W),t.Y36(Ut.Dx),t.Y36(v.N))}),(0,l.Z)(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,Hs,80,43,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data.Data)},dependencies:[u.rH,Z.gM,T.p,c.mk,c.O5,j.o,rr,mr,Dr,Er,vs,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 z=(()=>{return(n=z||(z={}))[n.PurchaseOrder=2]="PurchaseOrder",n[n.Archive=3]="Archive",z;var n})();function Rs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openExportModal())}),t._UZ(1,"i",17),t._uU(2," Export"),t.qZA()}}function Bs(n,a){1&n&&(t.TgZ(0,"th"),t._uU(1,"Variant"),t.qZA())}function $s(n,a){1&n&&(t.TgZ(0,"th",24),t._uU(1,"Buying Cost"),t.qZA())}function js(n,a){1&n&&(t.TgZ(0,"th",25),t._uU(1,"Selling Price"),t.qZA())}const Ws=function(){return["/menu/Products/Catalog/Variants/Info"]},Rt=function(n){return{ID:n}};function zs(n,a){if(1&n&&(t.TgZ(0,"td")(1,"a",31),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,Rt,e.ParentID)),t.xp6(1),t.Oqu(e.VariantName)}}function Xs(n,a){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.Oqu(t.xi3(2,1,e.UnitCost,"1.2-2"))}}function td(n,a){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.Oqu(t.xi3(2,1,e.UnitPrice,"1.2-2"))}}const ed=function(n){return[n]};function nd(n,a){if(1&n&&(t.TgZ(0,"a",33),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(3);t.Q6J("queryParams",t.VKq(3,Rt,e.ReferenceID))("routerLink",t.VKq(5,ed,o.linkReference(e.TypeID))),t.xp6(1),t.hij(" ",e.DisplayReference," ")}}function od(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw().$implicit;t.hij(" ",e.DisplayReference," ")}}function id(n,a){if(1&n&&(t.TgZ(0,"tr",26),t.YNc(1,zs,3,6,"td",20),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",27),t.ALo(8,"newlines"),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.YNc(11,Xs,3,4,"td",28),t.YNc(12,td,3,4,"td",28),t.TgZ(13,"td"),t._uU(14),t.qZA(),t.TgZ(15,"td"),t.YNc(16,nd,2,7,"a",29),t.YNc(17,od,1,1,"ng-template",null,30,t.W1O),t.qZA()()),2&n){const e=a.$implicit,o=t.MAs(18),i=t.oxw(3);t.xp6(1),t.Q6J("ngIf",i.data.ShowColumnVariant),t.xp6(2),t.Oqu(t.xi3(4,10,e.Created,"dd MMM yyyy HH:mm")),t.xp6(3),t.Oqu(e.UserName),t.xp6(1),t.Q6J("innerHTML",t.lcZ(8,13,e.Note),t.oJD),t.xp6(3),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngIf",i.roleService.product.Cost),t.xp6(1),t.Q6J("ngIf",i.roleService.sell.UnitPriceEditor),t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("ngIf",e.ReferenceID)("ngIfElse",o)}}function ad(n,a){if(1&n&&(t.TgZ(0,"table",18)(1,"thead",19)(2,"tr"),t.YNc(3,Bs,2,0,"th",20),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,$s,2,0,"th",21),t.YNc(13,js,2,0,"th",22),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,id,19,15,"tr",23),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 rd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",34),t.NdJ("page",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPaginationChange(i))}),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 ld=function(){return["/menu/Products/Catalog/Variants"]};function cd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.UserName=i)})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,Rs,3,0,"button",2),t.TgZ(3,"a",3),t._uU(4," Return to Variant "),t.qZA()(),t.TgZ(5,"filters")(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Outlet"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.EntityID=i)}),t.qZA()(),t.TgZ(11,"div")(12,"h6"),t._uU(13,"Variant"),t.qZA(),t.TgZ(14,"autocompleteV2",6),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.VariantID=i)}),t.qZA()(),t.TgZ(15,"div")(16,"h6"),t._uU(17,"From - To"),t.qZA(),t.TgZ(18,"div")(19,"datepicker",7),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.From=i)}),t.qZA()(),t.TgZ(20,"div",8)(21,"datepicker",9),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.To=i)}),t.qZA()()(),t.TgZ(22,"div")(23,"h6"),t._uU(24,"Note"),t.qZA(),t.TgZ(25,"input",10),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Note=i)}),t.qZA()(),t.TgZ(26,"div")(27,"h6"),t._uU(28,"Page Size"),t.qZA(),t.TgZ(29,"input",10),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.RowCount=i)}),t.qZA()()()(),t.TgZ(30,"content")(31,"div",11)(32,"div",12),t.YNc(33,ad,20,4,"table",13),t.qZA(),t.TgZ(34,"div",14),t.YNc(35,rd,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(2),t.Q6J("ngIf",e.roleService.global.Export),t.xp6(1),t.Q6J("routerLink",t.DdM(16,ld)),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(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(2),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 sd=(()=>{class n extends M.n{constructor(e,o,i,r,d,_){super(i,"catalog/variant/VariantHistoryList","catalog/VariantLoader/VariantHistoryLoader",r,o),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"variantName",void 0),(0,l.Z)(this,"urlParams",void 0),this.csvConverter=e,this.activatedRoute=o,this.httpService=i,this.roleService=d,this.matDialog=_,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(i=>{let r=i.Note.replace(/"/g,'""');return{...i,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 z.PurchaseOrder:o="/menu/Orders/Order/Purchase_Order/Info";break;case z.Archive:o="/menu/Manufacture/Job_Order/Archive/Info"}return o}openExportModal(){this.matDialog.open(K.H,{data:{title:"Variant History",exportTypes:[{ID:"ProductExport/VariantUpdateHistoryExport",Value:"Default",FileName:"Variant History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(G.O),t.Y36(u.gz),t.Y36(f.O),t.Y36(C._W),t.Y36(v.N),t.Y36(h.uw))}),(0,l.Z)(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"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["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"],[1,"mt-4"],["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"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["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",4,"ngIf","ngIfElse"],["Plain_Text",""],[3,"routerLink","queryParams"],[1,"text-end"],[3,"queryParams","routerLink"],[3,"length","pageSize","pageIndex","page"]],template:function(e,o){1&e&&t.YNc(0,cd,36,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[u.rH,Z.gM,T.p,c.sg,c.O5,s.Fj,s.JJ,s.On,nt.NW,x.w9,R.QB,L.J,c.JJ,c.uU,S.sH]})),n})();function dd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",25),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.deleteRowCustomOutlet())}),t._UZ(1,"i",26),t._uU(2,"Delete "),t.qZA()}}function pd(n,a){1&n&&(t.TgZ(0,"button",27)(1,"span",28),t._uU(2,"Toggle Dropdown"),t.qZA()())}function ud(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.YNc(1,dd,3,0,"a",20),t.YNc(2,pd,3,0,"button",21),t.TgZ(3,"ul",22)(4,"li",23),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.deleteAll(i.pageData.Filter.EntityID,i.pageData.Filter.CategoryID))}),t.TgZ(5,"a",24),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 md(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",29),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openExportModal())}),t._UZ(1,"i",30),t._uU(2," Export"),t.qZA()}}function _d(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",31)(1,"input",32),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(i.target.checked))}),t.qZA()()}}function gd(n,a){1&n&&(t.TgZ(0,"th",15),t._uU(1,"Unit Cost"),t.qZA())}function fd(n,a){1&n&&(t.TgZ(0,"th",15),t._uU(1,"Extra Cost"),t.qZA())}function hd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",35),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)}}function vd(n,a){if(1&n&&(t.TgZ(0,"td",15),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 xd(n,a){if(1&n&&(t.TgZ(0,"td",15),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 Cd(n,a){if(1&n&&(t.TgZ(0,"tr",33),t.YNc(1,hd,2,1,"td",34),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,vd,3,3,"td",14),t.TgZ(11,"td",15),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,xd,3,3,"td",14),t.TgZ(15,"td",15),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",15),t._uU(19),t.ALo(20,"number"),t.qZA()()),2&n){const e=a.$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 Zd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-paginator",36),t.NdJ("page",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onPaginationChange(i))}),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 Td(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,ud,7,2,"div",2),t.YNc(3,md,3,0,"button",3),t.qZA(),t.TgZ(4,"filters")(5,"div",4)(6,"div",5)(7,"div")(8,"h6"),t._uU(9,"Outlet"),t.qZA(),t.TgZ(10,"ng-select",6),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.EntityID=i)}),t.qZA()(),t.TgZ(11,"div")(12,"h6"),t._uU(13,"Category"),t.qZA(),t.TgZ(14,"ng-select",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.CategoryID=i)}),t.qZA()()()()(),t.TgZ(15,"content")(16,"div",8)(17,"div",9)(18,"table",10)(19,"thead",11)(20,"tr",12),t.YNc(21,_d,2,0,"th",13),t.TgZ(22,"th"),t._uU(23,"Name"),t.qZA(),t.TgZ(24,"th"),t._uU(25,"Category"),t.qZA(),t.TgZ(26,"th"),t._uU(27,"Variant"),t.qZA(),t.TgZ(28,"th"),t._uU(29,"Code"),t.qZA(),t.YNc(30,gd,2,0,"th",14),t.TgZ(31,"th",15),t._uU(32,"Unit Price"),t.qZA(),t.YNc(33,fd,2,0,"th",14),t.TgZ(34,"th",15),t._uU(35,"Outlet Price"),t.qZA(),t.TgZ(36,"th",15),t._uU(37,"%"),t.qZA()()(),t.TgZ(38,"tbody"),t.YNc(39,Cd,21,16,"tr",16),t.qZA()()(),t.TgZ(40,"div",17),t.YNc(41,Zd,1,3,"mat-paginator",18),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(1),t.Q6J("ngIf",e.roleService.global.Export),t.xp6(7),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 bd=(()=>{class n extends M.n{constructor(e,o,i,r,d,_){super(o,"catalog/product/OutletPrice","catalog/ProductLoader/OutletPrice",i),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"toasterClient",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.csvConverter=e,this.httpService=o,this.toasterClient=r,this.roleService=d,this.matDialog=_}deleteRowCustomOutlet(){const o=this.getSelectedData().map(i=>({key1:i.VariantID,key2:i.EntityID}));this.httpService.post("/api/catalog/product/DeleteOutletPrice",JSON.stringify({Data:o})).subscribe(()=>{this.toasterClient.success("Success Custom Outlet Price",g.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,g.n.Success),this.getListData()})}openExportModal(){this.matDialog.open(K.H,{data:{title:"Product Outlet Price",exportTypes:[{ID:"ProductExport/OutletPrice",Value:"Default",FileName:"Outlet Price"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(G.O),t.Y36(f.O),t.Y36(C._W),t.Y36(C._W),t.Y36(v.N),t.Y36(h.uw))}),(0,l.Z)(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"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[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"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[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,Td,42,13,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[Z.gM,T.p,c.sg,c.O5,s.Wl,s.JJ,s.On,nt.NW,x.w9,c.JJ]})),n})();function yd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.httpPostListID("ProductSetup/RemoveBrands"))}),t._UZ(1,"i",11),t._uU(2," Delete"),t.qZA()}}const Bt=function(){return["/menu/Products/Setup/Brand/Brand_Form"]};function Id(n,a){1&n&&(t.TgZ(0,"a",12),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Bt))}function Md(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",13)(1,"input",14),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(i.target.checked))}),t.qZA()()}}function Pd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",17),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const Dd=function(n){return{ID:n}};function Ad(n,a){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,Bt))("queryParams",t.VKq(4,Dd,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function Sd(n,a){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 Nd(n,a){if(1&n&&(t.TgZ(0,"tr",15),t.YNc(1,Pd,2,2,"td",16),t.TgZ(2,"td"),t.YNc(3,Ad,3,6,"span",16),t.YNc(4,Sd,2,1,"span",16),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&n){const e=a.$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 qd(n,a){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,yd,3,0,"a",2),t.YNc(3,Id,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,Md,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,Nd,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 wd=(()=>{class n extends M.n{constructor(e,o,i){super(e,"ProductSetup/GetBrandsList",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=e,this.roleService=i}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(v.N))}),(0,l.Z)(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,qd,16,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[u.rH,T.p,c.sg,c.O5,s.Wl,s.JJ,s.On]})),n})();function Ud(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.httpPostListID("ProductSetup/RemoveMeasurements"))}),t._UZ(1,"i",12),t._uU(2," Delete"),t.qZA()}}const $t=function(){return["/menu/Products/Setup/Measurement/Form"]};function Od(n,a){1&n&&(t.TgZ(0,"a",13),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,$t))}function Jd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",14)(1,"input",15),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(i.target.checked))}),t.qZA()()}}function Vd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const kd=function(n){return{ID:n}};function Fd(n,a){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,$t))("queryParams",t.VKq(4,kd,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function Qd(n,a){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 Ed(n,a){if(1&n&&(t.TgZ(0,"tr",16),t.YNc(1,Vd,2,2,"td",17),t.TgZ(2,"td"),t.YNc(3,Fd,3,6,"span",17),t.YNc(4,Qd,2,1,"span",17),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA()()),2&n){const e=a.$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 Ld(n,a){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Ud,3,0,"a",2),t.YNc(3,Od,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,Jd,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,Ed,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 Yd=(()=>{class n extends M.n{constructor(e,o,i){super(e,"ProductSetup/GetMeasurementList",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=e,this.roleService=i}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(v.N))}),(0,l.Z)(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,Ld,16,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[u.rH,T.p,c.sg,c.O5,s.Wl,s.JJ,s.On]})),n})();function Hd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",9),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.httpPostListID("ProductSetup/RemoveTags"))}),t._UZ(1,"i",10),t._uU(2," Delete"),t.qZA()}}const jt=function(){return["/menu/Products/Setup/Tags/Tags_Form"]};function Kd(n,a){1&n&&(t.TgZ(0,"a",11),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,jt))}function Gd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",12)(1,"input",13),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(i.target.checked))}),t.qZA()()}}function Rd(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",16),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const Bd=function(n){return{ID:n}};function $d(n,a){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,jt))("queryParams",t.VKq(4,Bd,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function jd(n,a){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 Wd(n,a){if(1&n&&(t.TgZ(0,"tr",14),t.YNc(1,Rd,2,2,"td",15),t.TgZ(2,"td"),t.YNc(3,$d,3,6,"span",15),t.YNc(4,jd,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 zd(n,a){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,Hd,3,0,"a",2),t.YNc(3,Kd,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,Gd,2,0,"th",7),t.TgZ(10,"th"),t._uU(11,"Name"),t.qZA()()(),t.TgZ(12,"tbody"),t.YNc(13,Wd,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 Xd=(()=>{class n extends M.n{constructor(e,o,i){super(e,"ProductSetup/GetTagsList",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=e,this.roleService=i}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(v.N))}),(0,l.Z)(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,zd,14,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[u.rH,T.p,c.sg,c.O5,s.Wl,s.JJ,s.On]})),n})();function tp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",10),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.httpPostListID("ProductSetup/RemoveUOMs"))}),t._UZ(1,"i",11),t._uU(2," Delete"),t.qZA()}}const Wt=function(){return["/menu/Products/Setup/UOM/Form"]};function ep(n,a){1&n&&(t.TgZ(0,"a",12),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,Wt))}function np(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",13)(1,"input",14),t.NdJ("change",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onSelectAllData(i.target.checked))}),t.qZA()()}}function op(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td")(1,"input",18),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)})("ngModelChange",function(i){t.CHM(e);const r=t.oxw().$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.selected)("ngModel",e.selected)}}const ip=function(n){return{ID:n}};function ap(n,a){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,Wt))("queryParams",t.VKq(4,ip,e.ID)),t.xp6(1),t.Oqu(e.Name)}}function rp(n,a){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 lp(n,a){if(1&n&&(t.TgZ(0,"tr",15),t.YNc(1,op,2,2,"td",16),t.TgZ(2,"td"),t.YNc(3,ap,3,6,"span",16),t.YNc(4,rp,2,1,"span",16),t.qZA(),t._UZ(5,"td",17),t.qZA()),2&n){const e=a.$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 cp(n,a){if(1&n&&(t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,tp,3,0,"a",2),t.YNc(3,ep,2,2,"a",3),t.qZA(),t.TgZ(4,"content")(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr"),t.YNc(9,np,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,lp,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 sp=(()=>{class n extends M.n{constructor(e,o,i){super(e,"ProductSetup/GetUOMList",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=e,this.roleService=i}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(v.N))}),(0,l.Z)(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,cp,16,7,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[u.rH,T.p,c.sg,c.O5,s.Wl,s.JJ,s.On]})),n})();var ht=p(34076);const dp=["inputRename"],pp=["inputAdd"],up=function(){return["/menu/Products/Setup/Storages/Form"]};function mp(n,a){1&n&&(t.TgZ(0,"a",18),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,up))}function _p(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e.label)}}function gp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,20),t.NdJ("keyup",function(i){t.CHM(e);const r=t.MAs(1),d=t.oxw(2);return t.KtG(d.onKeydownEvent(i,"/API/catalog/product/RenameProductStorage",r.dirty))})("focusout",function(){t.CHM(e);const i=t.MAs(1),r=t.oxw(2);return t.KtG(r.saveRename("/API/catalog/product/RenameProductStorage",i.dirty))})("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.label=i)}),t.qZA()}2&n&&t.Q6J("ngModel",a.$implicit.label)}function fp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,21),t.NdJ("keyup",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onKeydownEvent(i,"/API/catalog/product/CreateProductStorage"))})("focusout",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.saveAdd("/API/catalog/product/CreateProductStorage"))})("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.label=i)}),t.qZA()}2&n&&t.Q6J("ngModel",a.$implicit.label)}function hp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,mp,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 i=t.oxw();return t.KtG(i.changeContextMenu())}),t.qZA(),t.TgZ(8,"p-tree",7),t.NdJ("onNodeDrop",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onDrop(i))})("selectionChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.selectedNode=i)}),t.YNc(9,_p,2,1,"ng-template",8),t.YNc(10,gp,3,1,"ng-template",9),t.YNc(11,fp,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 vp=(()=>{class n extends M.n{constructor(e,o,i,r){super(e,"catalog/product/GetProductStorageTreeNew"),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toastr",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"inputNodeRename",void 0),(0,l.Z)(this,"inputNodeAdd",void 0),(0,l.Z)(this,"oldLabel",void 0),(0,l.Z)(this,"oldParent",void 0),(0,l.Z)(this,"newChildren",void 0),(0,l.Z)(this,"selectedNode",void 0),(0,l.Z)(this,"newStorage",void 0),(0,l.Z)(this,"items",void 0),this.router=o,this.toastr=i,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){m.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(d=>{d.Success?e.dropNode.icon="fas fa-folder":this.toastr.error(d.Message,g.n.Success)})}delete(e){if(!e.parent)return this.toastr.error("Can not delete Home",g.n.Error),void(this.selectedNode=null);this.httpService.post("/API/catalog/product/DeleteProductStorage",JSON.stringify(e.id)).subscribe(i=>{if(i.Success){let r=e.parent.children.indexOf(e);e.parent.children.splice(r,1),this.toastr.success(i.Message,g.n.Success)}else this.toastr.error(i.Message,g.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:[]};m.gT.IsEmpty(e.children)&&(e.children=[]),m.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",g.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:i=>{this.selectedNode.id=i.ObjectID,this.selectedNode=null},error:i=>{this.toastr.error(i.error,g.n.Error),this.selectedNode.parent.children.pop(),this.selectedNode=null}})}saveRename(e,o){this.selectedNode.type="default";let i={name:this.selectedNode.label,parentID:this.selectedNode?.parent?.id,guidID:this.selectedNode.id};""==i.name?(this.toastr.error("Name is required",g.n.Error),this.selectedNode.label=this.oldLabel,this.selectedNode=null):o?this.httpService.post(e,JSON.stringify(i)).subscribe(r=>{this.selectedNode=null},r=>{this.toastr.error(r.error,g.n.Error),this.selectedNode.label=this.oldLabel,this.selectedNode=null}):this.selectedNode=null}onKeydownEvent(e,o,i){"Enter"===e.key&&("rename"==this.selectedNode.type?this.saveRename(o,i):this.saveAdd(o))}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.F0),t.Y36(C._W),t.Y36(v.N))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-storage"]],viewQuery:function(e,o){if(1&e&&(t.Gf(dp,5),t.Gf(pp,5)),2&e){let i;t.iGM(i=t.CRH())&&(o.inputNodeRename=i.first),t.iGM(i=t.CRH())&&(o.inputNodeAdd=i.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,hp,23,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[Y.mp,U.jx,ht.xV,u.rH,T.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 xp(n,a){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const Cp=function(){return["/menu/Products/Setup/Brand"]};function Zp(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=i)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,xp,2,0,"span",15),t.qZA(),t.TgZ(24,"div",11)(25,"input",16),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Code=i)}),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,Cp)),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 Tp=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"ProductSetup/BrandFormInitial",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),this.activatedRoute=o,this.router=i,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit Brand",g.n.Success),this.router.navigate(["/menu/Products/Setup/Brand"])}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-form-brands"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-4",3,"routerLink"],["matTooltipPosition","above","matTooltip","Save",1,"button","btn","btn-success",3,"disabled","click"],[1,"container-fluid","bg-light-gray","form-horizontal"],["data","ctrl.Alert"],[1,"row"],[1,"col-sm-12"],[1,"card","mt-10"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","autofocus","","required","","name","Name",1,"form-control",3,"ngModel","ngModelChange"],["Name","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],["type","text","id","inputCode","placeholder","Code","maxlength","100",1,"form-control",3,"ngModel","ngModelChange"],["for","inputCode"],[1,"control-label","text-danger"]],template:function(e,o){1&e&&t.YNc(0,Zp,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.O5,s.Fj,s.JJ,s.Q7,s.nD,s.On]})),n})();function bp(n,a){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const yp=function(){return["/menu/Products/Setup/Measurement"]};function Ip(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=i)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,bp,2,0,"span",15),t.qZA(),t.TgZ(24,"div",11)(25,"textarea",16),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Description=i)}),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,yp)),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 Mp=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"ProductSetup/MeasurementFormInitial",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),this.activatedRoute=o,this.router=i,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit Measurement",g.n.Success),this.router.navigate(["/menu/Products/Setup/Measurement"])}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W))}),(0,l.Z)(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,Ip,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]})),n})();function Pp(n,a){1&n&&(t.TgZ(0,"span",16),t._uU(1," Name required!"),t.qZA())}const Dp=function(){return["/menu/Products/Setup/Tags"]};function Ap(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=i)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,Pp,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,Dp)),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 Sp=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"ProductSetup/TagFormInitials",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),this.activatedRoute=o,this.router=i,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit Tags",g.n.Success),this.router.navigate(["/menu/Products/Setup/Tags"])}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W))}),(0,l.Z)(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,Ap,24,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]})),n})();function Np(n,a){1&n&&(t.TgZ(0,"span",18),t._uU(1," Name required!"),t.qZA())}const qp=function(){return["/menu/Products/Setup/UOM"]};function wp(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=i)}),t.qZA(),t.TgZ(21,"label",14),t._uU(22,"Name"),t.qZA(),t.YNc(23,Np,2,0,"span",15),t.qZA(),t.TgZ(24,"div",11)(25,"textarea",16),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Description=i)}),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,qp)),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 Up=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"ProductSetup/UOMFormInitial",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),this.activatedRoute=o,this.router=i,this.toaster=r}onSubmitSuccess(e){this.toaster.success("Success Submit UOM",g.n.Success),this.router.navigate(["/menu/Products/Setup/UOM"])}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W))}),(0,l.Z)(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,wp,28,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.O5,s.Fj,s.JJ,s.Q7,s.On]})),n})();function Op(n,a){1&n&&(t.TgZ(0,"span",21),t._uU(1," Name required."),t.qZA())}const Jp=function(){return["/menu/Products/Setup/Storages"]},Vp=function(n){return{invalid:n}},kp=function(n){return{selected:n}};function Fp(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Model=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.changeName())}),t.qZA(),t.TgZ(18,"label",13),t._uU(19,"Name"),t.qZA(),t.YNc(20,Op,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 i=t.oxw();return t.KtG(i.changeName())})("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.ParentID=i)}),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,Jp)),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,Vp,o.ValidNameCode)),t.xp6(4),t.Q6J("ngIf",e.touched&&e.invalid),t.xp6(2),t.Q6J("ngClass",t.VKq(15,kp,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 Qp=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"catalog/ProductLoader/ProductStorageForm",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"ValidNameCode",void 0),this.activatedRoute=o,this.router=i,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",g.n.Success),this.router.navigate(["/menu/Products/Setup/Storages"])}changeName(){const e=this.options.Storages,o=this.formData.Model?this.formData.Model:"";let i;this.IsNotEmpty(this.formData.ParentID)&&e.forEach(r=>{r.Key==this.formData.ParentID&&(i=r.Value)}),this.formData.Name=i?`${i}/${o}`:o}IsNotEmpty(e){return m.gT.IsNotEmpty(e)}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W))}),(0,l.Z)(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,Fp,30,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,Z.gM,T.p,c.mk,c.O5,s.Fj,s.JJ,s.Q7,s.On,x.w9]})),n})();const Ep=function(){return["/menu/Products/Setup/Storages/Form"]},zt=function(n){return{ID:n}},Lp=function(){return["/menu/Products/Setup/Storages/Info"]};function Yp(n,a){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 i=t.oxw();return t.KtG(i.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,Ep))("queryParams",t.VKq(11,zt,e.formData.ID)),t.xp6(16),t.Q6J("inputValue",e.formData.Model),t.xp6(3),t.Q6J("routerLink",t.DdM(13,Lp))("queryParams",t.VKq(14,zt,e.formData.ParentID)),t.xp6(1),t.Oqu(e.parentName),t.xp6(4),t.Q6J("inputValue",e.formData.Name)}}let Hp=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"catalog/ProductLoader/ProductStorageForm",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"parentName",void 0),this.httpService=e,this.activatedRoute=o,this.toaster=i,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",g.n.Success),this.router.navigate(["/menu/Products/Setup/Storages"])}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(C._W),t.Y36(u.F0))}),(0,l.Z)(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,Yp,28,16,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,T.p,c.O5,j.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 Kp=p(22863),Gp=p(24351);const Rp=["inputRename"],Bp=["inputAdd"],$p=function(){return["/menu/Products/Catalog/Categories/Form"]};function jp(n,a){1&n&&(t.TgZ(0,"a",18),t._uU(1,"Add"),t.qZA()),2&n&&t.Q6J("routerLink",t.DdM(1,$p))}function Wp(n,a){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e.label)}}function zp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,20),t.NdJ("keyup",function(i){t.CHM(e);const r=t.MAs(1),d=t.oxw(2);return t.KtG(d.onKeydownEvent(i,"/API/catalog/category/RenameProductCategory",r.dirty))})("focusout",function(){t.CHM(e);const i=t.MAs(1),r=t.oxw(2);return t.KtG(r.saveRename("/API/catalog/category/RenameProductCategory",i.dirty))})("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.label=i)}),t.qZA()}2&n&&t.Q6J("ngModel",a.$implicit.label)}function Xp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"input",19,22),t.NdJ("keyup",function(i){t.CHM(e);const r=t.oxw(3);return t.KtG(r.onKeydownEvent(i,"/API/catalog/category/CreateProductCategory"))})("focusout",function(){t.CHM(e);const i=t.oxw(3);return t.KtG(i.saveAdd("/API/catalog/category/CreateProductCategory"))})("ngModelChange",function(i){const d=t.CHM(e).$implicit;return t.KtG(d.label=i)}),t.qZA()}2&n&&t.Q6J("ngModel",a.$implicit.label)}function tu(n,a){1&n&&t.YNc(0,Xp,2,1,"ng-template",21)}function eu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1)(1,"actions"),t.YNc(2,jp,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onDrop(i))})("selectionChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.selectedNode=i)}),t.YNc(9,Wp,2,1,"ng-template",8),t.YNc(10,zp,3,1,"ng-template",9),t.YNc(11,tu,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 nu=(()=>{class n extends Kp.M{constructor(e,o,i,r){super(e),(0,l.Z)(this,"Router",void 0),(0,l.Z)(this,"toastr",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"inputNodeRename",void 0),(0,l.Z)(this,"inputNodeAdd",void 0),(0,l.Z)(this,"oldLabel",void 0),(0,l.Z)(this,"selectedNode",void 0),(0,l.Z)(this,"newStorage",void 0),(0,l.Z)(this,"items",void 0),(0,l.Z)(this,"oldParent",void 0),this.Router=o,this.toastr=i,this.roleService=r,this.menuData$.pipe((0,Gp.b)(()=>this.httpService.post("/API/catalog/category/GetProductCategoryTreeNew"))).subscribe(d=>{this.data=d,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:_=>this.add(this.selectedNode)}),this.roleService.product.Delete&&this.items.push({label:"Delete",icon:"fas fa-trash fa-fw",command:_=>this.delete(this.selectedNode)}),this.roleService.product.Edit&&this.items.push({label:"Rename",icon:"fas fa-edit fa-fw",command:_=>this.rename(this.selectedNode)}),this.items.push({label:"Properties",icon:"fas fa-screwdriver-wrench fa-fw",command:_=>this.properties(this.selectedNode)})})}ngOnInit(){}properties(e){m.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(d=>{d.Message?(e.dropNode.icon="fas fa-folder",this.toastr.success(d.Message,g.n.Success)):this.toastr.error(d.Message,g.n.Error)})}delete(e){if(!e.parent)return this.toastr.error("Can not delete Home",g.n.Error),void(this.selectedNode=null);this.httpService.post("/API/catalog/category/DeleteProductCategory",JSON.stringify({ID:e.id})).subscribe(i=>{let r=e.parent.children.indexOf(e);e.parent.children.splice(r,1),this.toastr.success(i.Message,g.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:[]};m.gT.IsEmpty(e.children)&&(e.children=[]),m.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",g.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:i=>{this.selectedNode.id=i.ID,this.selectedNode=null},error:i=>{this.selectedNode.parent.children.pop(),this.selectedNode=null}})}saveRename(e,o){this.selectedNode.type="default";let i={name:this.selectedNode.label,parentID:this.selectedNode?.parent?.id,guidID:this.selectedNode.id};""==i.name?(this.toastr.error("Name is required",g.n.Error),this.selectedNode.label=this.oldLabel,this.selectedNode=null):o?this.httpService.post(e,JSON.stringify(i)).subscribe({next:r=>{this.selectedNode=null,this.toastr.success("Successfully rename category",g.n.Success)},error:r=>{this.selectedNode.label=this.oldLabel,this.selectedNode=null}}):this.selectedNode=null}onKeydownEvent(e,o,i){"Enter"===e.key&&("rename"==this.selectedNode.type?this.saveRename(o,i):this.saveAdd(o))}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.F0),t.Y36(C._W),t.Y36(v.N))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-category"]],viewQuery:function(e,o){if(1&e&&(t.Gf(Rp,5),t.Gf(Bp,5)),2&e){let i;t.iGM(i=t.CRH())&&(o.inputNodeRename=i.first),t.iGM(i=t.CRH())&&(o.inputNodeAdd=i.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,eu,27,11,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[Y.mp,U.jx,ht.xV,u.rH,T.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 ou(n,a){1&n&&(t.TgZ(0,"span",39),t._uU(1," Name required."),t.qZA())}const iu=function(){return["/menu/Products/Catalog/Categories"]},at=function(n){return{selected:n}};function au(n,a){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 i=t.oxw();return t.KtG(i.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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Model=i)})("ngModelChange",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.changeCategory())}),t.qZA(),t.TgZ(18,"label",13),t._uU(19,"Name"),t.qZA(),t.YNc(20,ou,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 i=t.oxw();return t.KtG(i.changeCategory())})("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.ParentID=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Name=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Code=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.SKUSeed=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.UOM=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.UOMQ=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.MeasurementID=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.TypeID=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.Description=i)}),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,iu)),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 ru=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"catalog/ProductCategoryLoader/ProductCategoryForm",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"toaster",void 0),this.activatedRoute=o,this.router=i,this.toaster=r}postBindForm(e){this.menuData.H=e.PageTitle}IsNotEmpty(e){return m.gT.IsNotEmpty(e)}changeCategory(){const e=this.options.Categories,o=this.formData.Model?this.formData.Model:"";let i;this.IsNotEmpty(this.formData.ParentID)&&e.forEach(r=>{r.Key==this.formData.ParentID&&(i=r.Value)}),this.formData.Name=i?`${i}/${o}`:o}onSubmitSuccess(e){this.toaster.success("Success Submit Category",g.n.Success),this.router.navigate(["/menu/Products/Catalog/Categories"])}validateSubmit(){m.gT.IsEmpty(this.formData.Model.trim())?this.toaster.info("Model name for variant is required",g.n.Info):this.onSubmit("catalog/category/ProductCategorySubmit")}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(u.F0),t.Y36(C._W))}),(0,l.Z)(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,au,76,35,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,T.p,c.mk,c.O5,s.Fj,s.JJ,s.Q7,s.On,x.w9,A.b]})),n})();const lu=function(){return["/menu/Products/Catalog/Categories/Form"]},vt=function(n){return{ID:n}};function cu(n,a){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,lu))("queryParams",t.VKq(3,vt,e.formData.ID))}}function su(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",26),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.removeCategory())}),t._UZ(1,"i",27),t._uU(2," Delete"),t.qZA()}}const du=function(){return["/menu/Inventory/Quantity/Valuation"]},pu=function(){return["/menu/Products/Catalog/Categories/Info"]};function uu(n,a){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,cu,3,5,"a",4),t.YNc(6,su,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,du))("queryParams",t.VKq(17,vt,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,pu))("queryParams",t.VKq(20,vt,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 mu=(()=>{class n extends q.U{constructor(e,o,i,r,d){super(e,"catalog/ProductCategoryLoader/ProductCategoryInfoLoader",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"parentName",void 0),this.httpService=e,this.activatedRoute=o,this.toaster=i,this.router=r,this.roleService=d}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",g.n.Success),this.router.navigate(["/menu/Products/Catalog/Categories"])}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(C._W),t.Y36(u.F0),t.Y36(v.N))}),(0,l.Z)(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,uu,52,22,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[u.rH,T.p,c.O5,j.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})();class _u{constructor(){(0,l.Z)(this,"Issues",void 0),(0,l.Z)(this,"Message",void 0),(0,l.Z)(this,"Success",void 0)}}var gu=p(14656);const fu=["fileInput"];function hu(n,a){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.qZA()()),2&n){const e=a.$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 vu(n,a){if(1&n&&(t.TgZ(0,"div",40)(1,"table",41)(2,"thead",42)(3,"tr")(4,"th",43),t._uU(5,"Issue"),t.qZA(),t.TgZ(6,"th",44),t._uU(7," Row Number "),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Solution"),t.qZA()()(),t.TgZ(10,"tbody"),t.YNc(11,hu,7,3,"tr",45),t.qZA()()()),2&n){const e=t.oxw(3);t.xp6(11),t.Q6J("ngForOf",null==e.importResponse?null:e.importResponse.Issues)}}function xu(n,a){if(1&n&&(t.TgZ(0,"div",38),t.YNc(1,vu,12,1,"div",39),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(null==e.importResponse||null==e.importResponse.Issues?null:e.importResponse.Issues.length)>0)}}const Cu=function(n){return{show:n}};function Zu(n,a){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 i=t.oxw();return t.KtG(i.onSubmitForm("catalog/product/Upload"))}),t._UZ(21,"i",13),t._uU(22),t.qZA()(),t.TgZ(23,"content")(24,"div",14)(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("change",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.onImportFileChange(i.target.files[0]))}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.InventoryUpdate=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.CategoryID=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.StartRow=i)}),t.qZA(),t._uU(75," - "),t.TgZ(76,"input",34),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.EndRow=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.SKU=i)}),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.formData.CostZeroSupport=i)}),t.qZA()()()()()()()(),t.TgZ(92,"a",36),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.toogle())}),t._uU(93,"More Options"),t.qZA(),t.TgZ(94,"div",28),t.YNc(95,xu,2,1,"div",37),t.qZA()()()()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(20),t.Q6J("disabled",!e.fileImport),t.xp6(2),t.hij(" ",e.ignoreWarning?"Proceed":"Upload"," "),t.xp6(15),t.Q6J("ngClass",t.VKq(15,Cu,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",null==e.importResponse?null:e.importResponse.Issues)}}let Tu=(()=>{class n extends q.U{constructor(e,o,i,r){super(e,"catalog/ProductLoader/ProductImportLoader",o),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"toastr",void 0),(0,l.Z)(this,"importService",void 0),(0,l.Z)(this,"fileInput",void 0),(0,l.Z)(this,"extraOption",void 0),(0,l.Z)(this,"ignoreWarning",!1),(0,l.Z)(this,"importResponse",void 0),(0,l.Z)(this,"fileImport",void 0),this.activatedRoute=o,this.toastr=i,this.importService=r,this.importResponse=new _u}onSubmitForm(e){if(!this.alertConfirmInventory())return;this.formData.IgnoreWarning=this.ignoreWarning;const o=JSON.stringify(this.formData),i=this.importService.generateFormData(this.fileImport,o);this.importService.onSubmitForm(e,i).subscribe({next:()=>{this.importResponse=this.importService.importResponse,this.ignoreWarning=this.importService.ignoreWarning,this.clearInput()},error:()=>{this.importResponse=this.importService.importResponse,this.ignoreWarning=this.importService.ignoreWarning,this.fileImport=null}})}alertConfirmInventory(){return!!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?")}onImportFileChange(e){this.fileImport=e}clearInput(){this.ignoreWarning||(this.fileImport=null,this.fileInput.nativeElement.value=null)}toogle(){this.extraOption=!this.extraOption}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(C._W),t.Y36(gu.Y))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["POS-import-product"]],viewQuery:function(e,o){if(1&e&&t.Gf(fu,5),2&e){let i;t.iGM(i=t.CRH())&&(o.fileInput=i.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,"disabled","click"],[1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],[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,"change"],["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"],[1,"col-md-12"],["class","mt-5",4,"ngIf"],[1,"mt-5"],[1,"table","table-bordered","mt-3"],[1,"text-dark","fw-bold","p-3",2,"background-color","#FCECA3 !important"],[2,"width","200px"],[2,"width","100px"],[4,"ngFor","ngForOf"]],template:function(e,o){1&e&&t.YNc(0,Zu,96,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData&&o.data)},dependencies:[Z.gM,T.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.On,x.w9,V.P,A.b]})),n})();var Xt=p(47522);function bu(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",10)(2,"div",5)(3,"h6"),t._uU(4,"From - To"),t.qZA()(),t.TgZ(5,"div",6)(6,"app-datepicker-range",11),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.onFilterDateChange(i))}),t.qZA()()(),t.BQk()}if(2&n){const e=t.oxw(2);t.xp6(6),t.Q6J("from",e.startDate)("to",e.endDate)}}function yu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",10)(1,"div",5)(2,"h6"),t._uU(3,"Row Count"),t.qZA()(),t.TgZ(4,"div",6)(5,"input",12),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.rowCount=i)}),t.qZA()()()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.rowCount)}}function Iu(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"div",4)(2,"div",5)(3,"h6"),t._uU(4,"Outlet"),t.qZA()(),t.TgZ(5,"div",6)(6,"ng-select",7),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.outletId=i)}),t.qZA()()(),t.TgZ(7,"div",4)(8,"div",5)(9,"h6"),t._uU(10,"Type"),t.qZA()(),t.TgZ(11,"div",6)(12,"radio-options",8),t.NdJ("modelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.isFilterByRange=i)}),t.qZA()()(),t.YNc(13,bu,7,2,"ng-container",1),t.YNc(14,yu,6,1,"ng-template",null,9,t.W1O),t.BQk()}if(2&n){const e=t.MAs(15),o=t.oxw();t.xp6(6),t.Q6J("items",o.outletOptions)("ngModel",o.outletId)("clearable",!1),t.xp6(6),t.Q6J("options",o.filterTypeOptions)("model",o.isFilterByRange),t.xp6(1),t.Q6J("ngIf",o.isFilterByRange)("ngIfElse",e)}}function Mu(n,a){if(1&n&&(t.TgZ(0,"tr")(1,"td",23),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td",23),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",23),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.ALo(16,"date"),t.qZA(),t.TgZ(17,"td"),t._uU(18),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,7,e.RowNumber)),t.xp6(3),t.Oqu(e.InvoiceNumber),t.xp6(2),t.Oqu(e.Type),t.xp6(2),t.Oqu(t.lcZ(10,9,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(13,11,e.UnitInStock)),t.xp6(3),t.Oqu(t.xi3(16,13,e.EntryDate,"dd MMM yyyy HH:mm")),t.xp6(3),t.Oqu(e.UserName)}}function Pu(n,a){1&n&&(t.ynx(0),t.TgZ(1,"div",31),t._uU(2," No Problem Found "),t.qZA(),t.BQk())}function Du(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"div",14)(2,"div",15)(3,"table",16)(4,"tr",17)(5,"td",18)(6,"h6",19),t._uU(7,"Row Analyzed"),t.qZA()(),t.TgZ(8,"td",17),t._uU(9,":"),t.qZA(),t.TgZ(10,"td",17),t._uU(11),t.ALo(12,"number"),t.qZA()(),t.TgZ(13,"tr",17)(14,"td",18)(15,"h6",19),t._uU(16,"Problem Found"),t.qZA()(),t.TgZ(17,"td",17),t._uU(18,":"),t.qZA(),t.TgZ(19,"td",17),t._uU(20),t.ALo(21,"number"),t.qZA()()()()(),t.TgZ(22,"div",10)(23,"div",20)(24,"table",21)(25,"thead",22)(26,"tr")(27,"th",23),t._uU(28,"Row"),t.qZA(),t.TgZ(29,"th",24),t._uU(30,"Invoice"),t.qZA(),t.TgZ(31,"th",25),t._uU(32,"Log Type"),t.qZA(),t.TgZ(33,"th",26),t._uU(34,"Quantity"),t.qZA(),t.TgZ(35,"th",27),t._uU(36,"Inventory"),t.qZA(),t.TgZ(37,"th",28),t._uU(38,"Entry Date"),t.qZA(),t.TgZ(39,"th",29),t._uU(40,"Creator"),t.qZA()()(),t.TgZ(41,"tbody"),t.YNc(42,Mu,19,16,"tr",30),t.qZA()(),t.YNc(43,Pu,3,0,"ng-container",13),t.qZA()(),t.BQk()),2&n){const e=a.ngIf;t.xp6(11),t.Oqu(t.lcZ(12,4,null==e?null:e.RowsAnalyzed)),t.xp6(9),t.Oqu(t.lcZ(21,6,null==e?null:e.ProblemsFound)),t.xp6(22),t.Q6J("ngForOf",null==e?null:e.Data),t.xp6(1),t.Q6J("ngIf",0==(null==e||null==e.Data?null:e.Data.length))}}function Au(n,a){if(1&n&&(t.YNc(0,Du,44,8,"ng-container",13),t.ALo(1,"async")),2&n){const e=t.oxw();t.Q6J("ngIf",t.lcZ(1,1,e.stockLog$))}}function Su(n,a){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"button",32),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onNext())}),t._uU(2," Next "),t._UZ(3,"i",33),t.qZA(),t.BQk()}}function Nu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",32),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.onNewFilter())}),t._uU(1," New "),t.qZA()}}let qu=(()=>{class n{constructor(e,o,i,r){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"toastr",void 0),(0,l.Z)(this,"config",void 0),(0,l.Z)(this,"rowCount",20),(0,l.Z)(this,"startDate",void 0),(0,l.Z)(this,"endDate",void 0),(0,l.Z)(this,"outletId",void 0),(0,l.Z)(this,"outletOptions",void 0),(0,l.Z)(this,"isFilterByRange",!0),(0,l.Z)(this,"isShowResult",!1),(0,l.Z)(this,"variantId",void 0),(0,l.Z)(this,"filterTypeOptions",[{Key:!0,Value:"Date Range"},{Key:!1,Value:"Row Count"}]),(0,l.Z)(this,"stockLog$",void 0),this.dialogRef=e,this.data=o,this.httpService=i,this.toastr=r,this.variantId=o.variantId,this.outletOptions=o.outlets,this.rowCount=o.rowCount?o.rowCount:20,this.initModalCOnfig(),this.initSelectedFilterOutlet(),this.initSelectedDate()}initSelectedDate(){m.gT.IsNotEmpty(this.data.startDate)&&this.data.startDate!==m.gT.MinDate&&(this.startDate=this.data.startDate,this.endDate=this.data.endDate)}initSelectedFilterOutlet(){this.outletId=m.gT.IsEmpty(this.data.selectedOutletId)?this.outletOptions[0]?.ID:this.data?.selectedOutletId}initModalCOnfig(){this.config=new y.O,this.config.title="Check Consistency",this.config.customWidth="375px",this.config.hideCancel=!0,this.config.hideOk=!0}filterByRangeDate(){this.stockLog$=this.httpService.post(ut.W.GetStockLogConsistencyByDate,{VariantID:this.variantId,EntityID:this.outletId,From:this.startDate,To:this.endDate})}filterByRowCount(){this.stockLog$=this.httpService.post(ut.W.GetStockLogConsistency,{VariantID:this.variantId,EntityID:this.outletId,RowCount:this.rowCount,PageNumber:1})}onFilterDateChange(e){this.startDate=e.from,this.endDate=e.to}onNext(){m.gT.IsEmpty(this.outletId)?this.toastr.warning("Outlet is required","Warning"):(this.isFilterByRange?this.filterByRangeDate():this.filterByRowCount(),this.isShowResult=!0,this.config.customWidth="800px")}onNewFilter(){this.stockLog$=null,this.isFilterByRange=!0,this.isShowResult=!1,this.config.customWidth="375px"}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(h.so),t.Y36(h.WI),t.Y36(f.O),t.Y36(C._W))}),(0,l.Z)(n,"\u0275cmp",t.Xpm({type:n,selectors:[["app-modal-check-consistency"]],decls:10,vars:5,consts:[[3,"config","onCancel","onClose"],[4,"ngIf","ngIfElse"],["SHOW_RESULT",""],["SHOW_BTN_NEW",""],[1,"row","mb-6"],[1,"col-3","d-flex","align-items-center"],[1,"col-9"],["placeholder","Choose ...","id","inputOutlet","bindLabel","Name","bindValue","ID","appendTo","body",3,"items","ngModel","clearable","ngModelChange"],["name","ProductDiscontinued",3,"options","model","modelChange"],["ROW_COUNT",""],[1,"row"],[3,"from","to","dateChange"],["type","text","id","inputCount","autoNum","",1,"form-control",2,"width","100px",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"row","mb-5"],[1,"col-3"],[1,"table","table-bordered"],[1,"border-0"],[1,"border-0",2,"width","110px"],[1,"py-0"],[1,"col-12"],["id","tableGrid",1,"table","mt-2"],[1,"thead-light"],[1,"text-end"],[2,"width","170px"],[2,"width","180px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","30px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[1,"text-muted","w-100","d-flex","align-items-center","justify-content-center","py-10","fs-4"],[1,"btn","btn-outline-secondary","me-10",3,"click"],[1,"fa-solid","fa-arrow-right","ms-1"]],template:function(e,o){if(1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content")(2,"div"),t.YNc(3,Iu,16,7,"ng-container",1),t.YNc(4,Au,2,3,"ng-template",null,2,t.W1O),t.qZA()(),t.TgZ(6,"footer"),t.YNc(7,Su,4,0,"ng-container",1),t.YNc(8,Nu,2,0,"ng-template",null,3,t.W1O),t.qZA()()),2&e){const i=t.MAs(5),r=t.MAs(9);t.Q6J("config",o.config),t.xp6(3),t.Q6J("ngIf",!o.isShowResult)("ngIfElse",i),t.xp6(4),t.Q6J("ngIf",!o.isShowResult)("ngIfElse",r)}},dependencies:[c.sg,c.O5,D.M,s.Fj,s.JJ,s.On,x.w9,V.P,A.b,Xt.Pg,c.Ov,c.JJ,c.uU],styles:["mat-stepper.mat-stepper-consistency>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{padding-bottom:0!important}"]})),n})();function wu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",31)(1,"a",32),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.exportCSV(i.csvConverter,"Inventory/GetStockLog",i.data.PageTitle))}),t._UZ(2,"i",33),t._uU(3,"\xa0Export "),t.qZA(),t._UZ(4,"button",34),t.TgZ(5,"ul",35)(6,"li",36)(7,"a",37),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.openModalConsistency())}),t._uU(8," Check Consistency "),t.qZA()()()()}}function Uu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",6)(1,"div")(2,"h6"),t._uU(3,"Order"),t.qZA(),t.TgZ(4,"ng-select",38),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.OrderBy=i)}),t.qZA()(),t.TgZ(5,"div")(6,"h6"),t._uU(7,"Hide Canceled Transaction"),t.qZA(),t.TgZ(8,"radio-options",39),t.NdJ("modelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.HideCancelled=i)}),t.qZA()(),t.TgZ(9,"div")(10,"h6"),t._uU(11,"Variant Log"),t.qZA(),t.TgZ(12,"ng-select",40),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw(2);return t.KtG(r.pageData.Filter.LogSourceType=i)}),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 Ou(n,a){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Outlet"),t.qZA())}function Ju(n,a){1&n&&(t.TgZ(0,"th",42),t._uU(1," Price"),t.qZA())}const Vu=function(){return["/menu/Outlets/Master/Outlets/Info"]},xt=function(n){return{ID:n}};function ku(n,a){if(1&n&&(t.TgZ(0,"td")(1,"a",52),t._uU(2),t.qZA()()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("routerLink",t.DdM(3,Vu))("queryParams",t.VKq(4,xt,e.EntityID)),t.xp6(1),t.Oqu(e.Outlet)}}function Fu(n,a){if(1&n&&(t.TgZ(0,"small",48),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 Qu(n,a){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 Eu(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"small",54),t._uU(2),t.ALo(3,"number"),t.YNc(4,Qu,3,3,"span",44),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 Lu(n,a){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 Yu(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"small",55)(2,"span"),t._uU(3),t.ALo(4,"number"),t.qZA(),t.YNc(5,Lu,3,3,"span",44),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,a){if(1&n&&(t.TgZ(0,"td",49),t.YNc(1,Fu,3,3,"small",53),t.YNc(2,Eu,5,4,"ng-container",44),t.YNc(3,Yu,6,4,"ng-container",44),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.PriceVisible),t.xp6(1),t.Q6J("ngIf",2==e.SourceTypeID&&o.roleService.product.Cost)}}const Ku=function(n){return[n]};function Gu(n,a){if(1&n&&(t.TgZ(0,"tr",43),t.YNc(1,ku,3,6,"td",44),t.TgZ(2,"td",45),t._uU(3),t.ALo(4,"IsMinDate"),t.qZA(),t.TgZ(5,"td")(6,"a",46),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",47),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"td",48),t._uU(21),t.ALo(22,"number"),t.qZA(),t.TgZ(23,"td",49),t._uU(24),t.ALo(25,"number"),t.qZA(),t.YNc(26,Hu,4,3,"td",50),t.TgZ(27,"td")(28,"span",51),t.ALo(29,"date"),t._uU(30),t.ALo(31,"date"),t.qZA(),t._UZ(32,"br"),t._uU(33),t.qZA()()),2&n){const e=a.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.data.EntityColumnVisible),t.xp6(2),t.Oqu(t.xi3(4,18,e.LogDate,"dd MMM yyyy")),t.xp6(3),t.Q6J("routerLink",t.VKq(33,Ku,e.NavUrl))("queryParams",t.VKq(35,xt,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,21,e.In)),t.xp6(3),t.Oqu(0==e.Out?"-":t.lcZ(22,23,e.Out)),t.xp6(3),t.Oqu(t.lcZ(25,25,e.UnitsInStock)),t.xp6(2),t.Q6J("ngIf",o.roleService.product.Cost||o.roleService.sell.PriceVisible),t.xp6(2),t.Q6J("matTooltip",t.xi3(29,27,e.EntryDate,"HH:mm:ss.SSS")),t.xp6(2),t.Oqu(t.xi3(31,30,e.EntryDate,"dd MMM yyyy, HH:mm")),t.xp6(3),t.hij(" ",e.UserName," ")}}function Ru(n,a){1&n&&(t.TgZ(0,"td",56)(1,"b"),t._uU(2,"Total"),t.qZA()())}function Bu(n,a){1&n&&(t.TgZ(0,"td",57)(1,"b"),t._uU(2,"Total"),t.qZA()())}const $u=function(){return["/menu/Products/Catalog/Variants/Info"]};function ju(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.Code=i)})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"actions"),t.YNc(2,wu,9,0,"div",2),t.TgZ(3,"a",3),t._UZ(4,"i",4),t._uU(5," Return to Variant "),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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.EntityID=i)}),t.qZA()(),t.TgZ(13,"div")(14,"h6"),t._uU(15,"From - To"),t.qZA(),t.TgZ(16,"div")(17,"datepicker",8),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.From=i)}),t.qZA()(),t.TgZ(18,"div",9)(19,"datepicker",10),t.NdJ("dateChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.To=i)}),t.qZA()()(),t.TgZ(20,"div")(21,"h6"),t._uU(22,"Page Size"),t.qZA(),t.TgZ(23,"input",11),t.NdJ("ngModelChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.pageData.Filter.RowCount=i)}),t.qZA()()(),t.YNc(24,Uu,13,6,"div",12),t.qZA(),t.TgZ(25,"a",13),t.NdJ("click",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.more=!i.more)}),t._uU(26),t._UZ(27,"i",14),t.qZA()(),t.TgZ(28,"content")(29,"div",15)(30,"div",16)(31,"table",17)(32,"thead",18)(33,"tr"),t.YNc(34,Ou,2,0,"th",19),t.TgZ(35,"th",20),t._uU(36,"Date"),t.qZA(),t.TgZ(37,"th",21),t._uU(38,"Number"),t.qZA(),t.TgZ(39,"th",21),t._uU(40," Name"),t._UZ(41,"br"),t.TgZ(42,"i"),t._uU(43,"Note"),t.qZA()(),t.TgZ(44,"th",22),t._uU(45," Log Type"),t._UZ(46,"br"),t.TgZ(47,"i"),t._uU(48,"DB Type"),t.qZA()(),t.TgZ(49,"th",23),t._uU(50,"In"),t.qZA(),t.TgZ(51,"th",23),t._uU(52,"Out"),t.qZA(),t.TgZ(53,"th",23),t._uU(54,"Inventory"),t.qZA(),t.YNc(55,Ju,2,0,"th",24),t.TgZ(56,"th",20),t._uU(57," Created"),t._UZ(58,"br"),t.TgZ(59,"i"),t._uU(60,"By"),t.qZA()()()(),t.TgZ(61,"tbody"),t.YNc(62,Gu,34,37,"tr",25),t.qZA(),t.TgZ(63,"tfoot")(64,"tr"),t.YNc(65,Ru,3,0,"td",26),t.YNc(66,Bu,3,0,"td",27),t.TgZ(67,"td",28)(68,"b"),t._uU(69),t.ALo(70,"number"),t.ALo(71,"sum"),t.qZA()(),t.TgZ(72,"td",29)(73,"b"),t._uU(74),t.ALo(75,"number"),t.ALo(76,"sum"),t.qZA()()()()()(),t.TgZ(77,"POS-complex-pagination",30),t.NdJ("jumpToPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("previousPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.getListData())})("nextPage",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.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.global.Export),t.xp6(1),t.Q6J("routerLink",t.DdM(33,$u))("queryParams",t.VKq(34,xt,e.pageData.Filter.ID)),t.xp6(9),t.Q6J("items",e.pageData.Options.Entities)("ngModel",e.pageData.Filter.EntityID),t.xp6(5),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.From),t.xp6(2),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(2),t.hij("",e.more?"Less":"More"," "),t.xp6(8),t.Q6J("ngIf",e.data.EntityColumnVisible),t.xp6(21),t.Q6J("ngIf",e.roleService.product.Cost||e.roleService.sell.PriceVisible),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(70,23,t.xi3(71,25,e.data.Data,"In"))),t.xp6(5),t.Oqu(t.lcZ(75,28,t.xi3(76,30,e.data.Data,"Out"))),t.xp6(3),t.Q6J("total",e.data.Data.length)("pageData",e.pageData)}}let Wu=(()=>{class n extends M.n{constructor(e,o,i,r,d,_){super(e,"Inventory/GetStockLog","InventoryLoader/StockLogLoader",o,r),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"dialog",void 0),(0,l.Z)(this,"more",void 0),(0,l.Z)(this,"sort",void 0),(0,l.Z)(this,"variantId",void 0),this.csvConverter=i,this.roleService=d,this.dialog=_,this.sort=[{ID:0,Name:"Ascending"},{ID:1,Name:"Descending"}],this.pageData.Filter.OrderBy=0}ngOnInit(){this.variantId=this.route?.snapshot?.queryParams?.ID}postInit(){this.menuData.H=this.data.PageTitle?this.data.PageTitle:this.menuData.H}preInitList(){this.pageData.Filter.EntityID=this.route.snapshot.queryParams.EntityID}openModalConsistency(){this.dialog.open(qu,{data:{outlets:this.pageData?.Options?.Entities,variantId:this.variantId,selectedOutletId:this.pageData.Filter?.EntityID,startDate:this.pageData.Filter?.From,endDate:this.pageData.Filter?.To,rowCount:this.pageData.Filter?.RowCount}})}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(C._W),t.Y36(G.O),t.Y36(u.gz),t.Y36(v.N),t.Y36(h.uw))}),(0,l.Z)(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-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-arrow-left","me-1"],[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"],[1,"mt-4"],["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"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item"],[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"],["matTooltipPosition","above",3,"matTooltip"],[3,"routerLink","queryParams"],["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,ju,78,36,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},dependencies:[u.rH,Z.gM,T.p,c.sg,c.O5,s.Fj,s.JJ,s.On,x.w9,R.QB,V.P,rt.v,c.JJ,c.uU,S.qU,S.$k]})),n})();function zu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){t.CHM(e);const i=t.oxw(2);return t.KtG(i.SubmitForm())}),t._uU(1,"Submit"),t.qZA()}}const Xu=function(n,a){return{alert:!0,"alert-success":n,"alert-danger":a}},tm=function(n,a){return{"fas ":!0,"fa-circle-check":n,"fa-circle-exclamation":a}};function em(n,a){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,Xu,e.alert.Success,!e.alert.Success)),t.xp6(1),t.Q6J("ngClass",t.WLB(6,tm,e.alert.Success,!e.alert.Success)),t.xp6(1),t.Q6J("innerHtml",e.alert.Message,t.oJD)}}function nm(n,a){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 i=t.oxw(2);return t.KtG(i.UploadCSV())}),t.qZA()()()()()}}function om(n,a){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(i){const d=t.CHM(e).$implicit;return t.KtG(d.Serial=i)}),t.qZA()()()}if(2&n){const e=a.$implicit,o=a.index,i=t.oxw(2);t.xp6(3),t.hij("#",o+1,""),t.xp6(5),t.Q6J("ngModel",e.Serial)("disabled",!i.roleService.product.Edit)}}const im=function(){return["/menu/Products/Catalog/Variants/Info"]},am=function(n){return{ID:n}};function rm(n,a){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,zu,2,0,"a",3),t.qZA(),t.TgZ(5,"content")(6,"div",4),t.YNc(7,em,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(i){t.CHM(e);const r=t.oxw();return t.KtG(r.changeOutlet(i))}),t.qZA()()()()(),t.YNc(16,nm,8,0,"div",13),t.TgZ(17,"div",14)(18,"ul",15),t.YNc(19,om,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,im))("queryParams",t.VKq(11,am,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 lm=(()=>{class n extends q.U{constructor(e,o,i){super(e,"catalog/VariantLoader/VariantSerialFormLoader",o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"activeRoute",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"more",void 0),(0,l.Z)(this,"alert",void 0),this.httpService=e,this.activeRoute=o,this.roleService=i,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(i=>{this.data.Form.Data=i})}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(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(f.O),t.Y36(u.gz),t.Y36(v.N))}),(0,l.Z)(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,rm,20,13,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.formData)},dependencies:[u.rH,Z.gM,T.p,c.mk,c.sg,c.O5,s.Fj,s.JJ,s.On,x.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 > span[_ngcontent-%COMP%], ul.serial[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:nth-child(5n+4)>div.title > 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 cm(n,a){1&n&&t._UZ(0,"th",11),2&n&&t.Q6J("innerHtml",a.$implicit.Name,t.oJD)}function sm(n,a){if(1&n&&(t.TgZ(0,"thead",7)(1,"tr")(2,"th",8),t._uU(3,"Model"),t.qZA(),t.YNc(4,cm,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 dm(n,a){if(1&n&&(t.TgZ(0,"td",10),t._uU(1),t.ALo(2,"find"),t.qZA()),2&n){const e=a.$implicit,o=t.oxw().$implicit;let i;t.xp6(1),t.Oqu(null==(i=t.Dn7(2,1,o.Outlet,"EntityID",e.ID))?null:i.Stock)}}function pm(n,a){if(1&n&&(t.TgZ(0,"tr",12)(1,"td"),t._uU(2),t.qZA(),t.YNc(3,dm,3,5,"td",13),t.TgZ(4,"td",10),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&n){const e=a.$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 um(n,a){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=a.$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 mm(n,a){if(1&n&&(t.TgZ(0,"tfoot",14)(1,"tr")(2,"td",15),t._uU(3,"Total"),t.qZA(),t.YNc(4,um,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 _m(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSelect",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.selectItem(i))})("onSubmit",function(){t.CHM(e);const i=t.oxw();return t.KtG(i.searchFromPageOne())}),t.TgZ(1,"content")(2,"div",2)(3,"table",3),t.NdJ("matSortChange",function(i){t.CHM(e);const r=t.oxw();return t.KtG(r.sortData(i))}),t.YNc(4,sm,7,1,"thead",4),t.TgZ(5,"tbody"),t.YNc(6,pm,7,5,"tr",5),t.qZA(),t.YNc(7,mm,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 gm=[{path:"Catalog/Categories",component:nu},{path:"Catalog/Categories/Form",component:ru},{path:"Catalog/Categories/Info",component:mu},{path:"Catalog/Products",component:We},{path:"Catalog/Products/Form",component:bo},{path:"Catalog/Products/Info",component:ei},{path:"Catalog/Products/Import",component:Tu},{path:"Catalog/Products/Inventory",component:(()=>{class n extends M.n{constructor(e,o,i,r){super(o,"catalog/product/GetEntityStock","catalog/ProductLoader/EntityStockLoader",null,e),(0,l.Z)(this,"activeRoute",void 0),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"location",void 0),(0,l.Z)(this,"router",void 0),(0,l.Z)(this,"originalStock",void 0),this.activeRoute=e,this.httpService=o,this.location=i,this.router=r}selectItem(e){const o=JSON.parse(e);this.pageData.Filter.ProductName=o.Value,this.pageData.Filter.ProductID=o.Key;const i=this.router.createUrlTree([],{relativeTo:this.activeRoute,queryParams:{ID:this.pageData.Filter.ProductID}}).toString();this.location.go(i),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((i,r)=>{const d="asc"===e.direction;return this.compare(i[e.active].toLocaleLowerCase(),r[e.active].toLocaleLowerCase(),d)}):this.originalStock}}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)(t.Y36(u.gz),t.Y36(f.O),t.Y36(c.Ye),t.Y36(u.F0))}),(0,l.Z)(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,_m,8,9,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.pageData&&o.data)},dependencies:[T.p,c.sg,c.O5,P.YE,P.nU,c.JJ,S.qU,S.Z0,S.J1]})),n})()},{path:"Catalog/Variants",component:Pi},{path:"Catalog/Variants/Form",component:Ha},{path:"Catalog/Variants/Info",component:Gs},{path:"Catalog/Variants/Log",component:Wu},{path:"Catalog/Variants/Serial_Form",component:lm},{path:"Add-Ons/Variant_History",component:sd},{path:"Price_Editor/Custom_Outlet_Price",component:bd},{path:"Setup/Brand",component:wd},{path:"Setup/Brand/Brand_Form",component:Tp},{path:"Setup/Measurement",component:Yd},{path:"Setup/Measurement/Form",component:Mp},{path:"Setup/Tags",component:Xd},{path:"Setup/Tags/Tags_Form",component:Sp},{path:"Setup/UOM",component:sp},{path:"Setup/UOM/Form",component:Up},{path:"Setup/Storages",component:vp},{path:"Setup/Storages/Form",component:Qp},{path:"Setup/Storages/Info",component:Hp},{path:"",redirectTo:"Catalog/Products",pathMatch:"full"}];let fm=(()=>{class n{}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(n,"\u0275mod",t.oAB({type:n})),(0,l.Z)(n,"\u0275inj",t.cJS({imports:[u.Bz.forChild(gm),u.Bz]})),n})();var hm=p(46510),vm=p(7155),xm=p(99602),te=p(3238),Cm=p(44144),Zm=p(3848),Tm=p(90811),bm=p(65131),ym=p(35355),Im=p(94673),Mm=p(58425);let Pm=(()=>{class n{}return(0,l.Z)(n,"\u0275fac",function(e){return new(e||n)}),(0,l.Z)(n,"\u0275mod",t.oAB({type:n})),(0,l.Z)(n,"\u0275inj",t.cJS({providers:[U.Y],imports:[Y.xc,ht.vI,ym.V,w._t,Z.AV,T.R,c.ez,S.dr,fm,D.d,hm.Z,s.u5,s.UX,xm.FA,te.XK,Q.Fk,Cm.c,te.Ng,Zm.Nh,nt.TU,Tm.vV,x.A0,P.JX,vm.p0,R.ZU,V.K,bm.X,$.Hi,L.Q,rt.T,j.F,P.JX,Im.z,dt.O,Un,K.H,Mm.T5,qt.Ps,Xt.v]})),n})()},19835:(Ct,E,p)=>{p.d(E,{i:()=>D});var l=p(81180),c=p(84080),u=p(94650),O=p(36895);function M(s,x){1&s&&u.GkF(0)}const h=function(s,x){return{"tooltip-container-bottom":s,"tooltip-container-top":x}};let y=(()=>{class s{constructor(){(0,l.Z)(this,"text",void 0),(0,l.Z)(this,"position",void 0),(0,l.Z)(this,"content",void 0)}}return(0,l.Z)(s,"\u0275fac",function(I){return new(I||s)}),(0,l.Z)(s,"\u0275cmp",u.Xpm({type:s,selectors:[["POS-tooltip"]],inputs:{text:"text",position:"position",content:"content"},decls:3,vars:6,consts:[[3,"ngClass"],[4,"ngTemplateOutlet"]],template:function(I,m){1&I&&(u.TgZ(0,"div",0),u._uU(1),u.YNc(2,M,1,0,"ng-container",1),u.qZA()),2&I&&(u.Q6J("ngClass",u.WLB(3,h,"top"==m.position||!m.position,"bottom"==m.position)),u.xp6(1),u.hij(" ",m.text," "),u.xp6(1),u.Q6J("ngTemplateOutlet",m.content))},dependencies:[O.mk,O.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=p(98184);let D=(()=>{class s{constructor(I,m,J){(0,l.Z)(this,"overlayPositionBuilder",void 0),(0,l.Z)(this,"elementRef",void 0),(0,l.Z)(this,"overlay",void 0),(0,l.Z)(this,"content",void 0),(0,l.Z)(this,"position",void 0),(0,l.Z)(this,"overlayRef",void 0),this.overlayPositionBuilder=I,this.elementRef=m,this.overlay=J}ngOnInit(){let I=this.initPosition();const m=this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([I]);this.overlayRef=this.overlay.create({positionStrategy:m})}initPosition(){let I={originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"};return"top"===this.position&&(I={originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"}),I}show(){if(this.content){this.overlayRef.detach();const I=new c.C5(y),m=this.overlayRef.attach(I);"string"==typeof this.content?m.instance.text=this.content:m.instance.content=this.content,m.instance.position=this.position}}hide(){this.overlayRef.detach()}}return(0,l.Z)(s,"\u0275fac",function(I){return new(I||s)(u.Y36(t.wJ),u.Y36(u.SBq),u.Y36(t.aV))}),(0,l.Z)(s,"\u0275dir",u.lG2({type:s,selectors:[["","customTooltip",""]],hostBindings:function(I,m){1&I&&u.NdJ("mouseenter",function(){return m.show()})("mouseleave",function(){return m.hide()})},inputs:{content:["customTooltip","content"],position:"position"}})),s})()},94673:(Ct,E,p)=>{p.d(E,{z:()=>h});var l=p(81180),c=p(24006),u=p(98184),O=p(36895),M=p(94650);let h=(()=>{class y{}return(0,l.Z)(y,"\u0275fac",function(D){return new(D||y)}),(0,l.Z)(y,"\u0275mod",M.oAB({type:y})),(0,l.Z)(y,"\u0275inj",M.cJS({imports:[O.ez,c.u5,u.U8]})),y})()}}]);
|