marketplacepos 2.6.3 → 2.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[475],{9475:(ue,I,c)=>{c.r(I),c.d(I,{OrdersModule:()=>hn});var u=c(6895),v=c(6806),e=c(4650),w=c(7398);let L=(()=>{class i{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new"},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship"},{Title:"3 - Shipped",Url:"/menu/Order/Shipped"},{Title:"4 - Completed",Url:"/menu/Order/Delivered"},{Title:"All",Url:"/menu/Order/All"},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled"},{Title:"Download",Url:"/menu/Order/Download"}]}ngOnInit(){}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-orders"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,n){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",n.ObjectOrderTabs))},dependencies:[w.e,v.lC]}),i})();var f=c(3154),S=c(1318),C=c(7185),D=c(9568),s=c(4006),l=c(7481),p=c(8796),d=c(2594);function h(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.Number)}}function T(i,o){if(1&i&&(e.TgZ(0,"a",16),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,n=e.oxw();e.Q6J("href",n.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function E(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,h,2,1,"span",14),e.YNc(5,T,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"date"),e.qZA()()),2&i){const t=o.$implicit,n=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",n.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!n.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(10,5,t.Created,"dd MMM yyyy HH:mm"))}}let he=(()=>{class i{constructor(t,n,a){this.http=t,this.toastr=n,this.localDataService=a,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Order/Sales_Order/Info?ID=`,this.Get()})}Get(t){this.http.post("api/orders/GetNewOrder",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}UpdateDelivery(){let t=this.getSelected();if(t.length>0){let n=[];t.forEach(a=>n.push(a)),this.http.post("/api/Orders/UpdateStateDelivery",n).subscribe(a=>{this.toastr.success("Successfully updated","Success")})}}getRowCount(){this.http.post("api/orders/GetRowCount",{Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}onCheckboxStateProduct(t){let n=this.data.filter(a=>a.Number==t);if(n.length>0)for(let a of n)a.selected=a.selected}onCheckboxStateChange(){for(let t of this.data)t.selected=this.checkboxState}getSelected(){let t=[];if(this.data){for(let n of this.data)n.selected&&t.push(n);return t}return[]}hasGuidEmpty(t){return t==f.g.GuidEMpty}hasSelection(){return!!this.data&&this.getSelected().length>0}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(C._W),e.Y36(D.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-new-order"]],decls:34,vars:11,consts:[["searchBoxPlaceHolder","Search Orders...",3,"headerTitle","hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"href"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(r){return n.Get(r)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(r){return n.selectedOutlets=r}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(r){return n.filter.PageNumber=r}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(r){return n.filter.PageSize=r}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Created On"),e.qZA()()(),e.TgZ(31,"tbody"),e.YNc(32,E,11,8,"tr",12),e.qZA()(),e.TgZ(33,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.getRowCount()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","1 - New Order")("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(18),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[u.sg,u.O5,s.Fj,s.wV,s.JJ,s.On,l.p,p.w9,d.n,u.uU]}),i})();function me(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&i){const t=o.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}function ge(i,o){if(1&i&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,me,9,7,"tr",16),e.qZA()()()()()),2&i){const t=e.oxw();e.xp6(10),e.hij(" ",t.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,t.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",t.model.Delivery," "),e.xp6(5),e.hij(" ",t.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,t.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",t.model.Customer.Name," "),e.xp6(5),e.hij(" ",t.model.Customer.Email," "),e.xp6(5),e.hij(" ",t.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",t.model.Variants)}}const _e=function(){return["/menu/Order"]};let fe=(()=>{class i{constructor(t,n){this.http=t,this.url=n,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(n=>{this.model=n})}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(v.gz))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2),e.YNc(6,ge,67,15,"div",3),e.qZA()()()),2&t&&(e.Q6J("headerTitle","Order #"+n.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,_e)),e.xp6(4),e.Q6J("ngIf",n.model))},dependencies:[u.sg,u.O5,l.p,v.yS,u.JJ,u.uU]}),i})();var g=c(9694),O=c(5412),$=c(6709);let ve=(()=>{class i{constructor(t){this.dialogRef=t,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(O.so))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],["mat-dialog-title","",1,"text-center","mb-8","fw-bold"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center","mt-6"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"h2",1),e._uU(2,"Cetak label pesanan"),e.qZA(),e.TgZ(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),e._uU(7,"Kamu akan mencetak label yang berisi detail pesanan"),e.qZA(),e.TgZ(8,"div",5)(9,"mat-checkbox",6),e.NdJ("ngModelChange",function(r){return n.tandaiSudahDicetak=r}),e.qZA(),e.TgZ(10,"span",7),e._uU(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),e.qZA()()()()(),e.TgZ(12,"mat-dialog-actions",8)(13,"button",9),e.NdJ("click",function(){return n.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return n.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&t&&(e.xp6(9),e.Q6J("ngModel",n.tandaiSudahDicetak))},dependencies:[s.JJ,s.On,$.oG,O.uh,O.xY,O.H8]}),i})();var be=c(9300),V=c(3900),j=c(4004);let k=(()=>{class i{constructor(t,n,a){this.http=t,this.dialog=n,this.toastr=a}printShippingLabelTokopedia(t){const n={OrderNumber:t,Printed:!0};this.dialog.open(ve).afterClosed().pipe((0,be.h)(a=>void 0!==a),(0,V.w)(a=>(n.Printed=a,this.http.post("api/v1/Shippinglabel/Tokopedia",n)))).subscribe(a=>{const r=window.open("about:blank","_blank");r.document.write(a),r.document.close()})}printShippingLabelTiktok(t,n){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:n,OrderNumber:t}).subscribe(r=>{null!=r.data?window.open(r.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(t,n){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:n,OrderNumber:t},{responseType:"blob"}).pipe((0,j.U)(r=>new Blob([r],{type:"application/pdf"}))).subscribe(r=>{f.g.openDownloadFile(r,`${t}.pdf`)})}}return i.\u0275fac=function(t){return new(t||i)(e.LFG(S.O),e.LFG(O.uw),e.LFG(C._W))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),i})(),R=(()=>{class i{constructor(){}set typeId(t){this.channelLogo=f.g.getChannelLogoByTypeId(t),this.initChannelName(t)}initChannelName(t){switch(t){case g.x.Tokopedia:this.channelName="Tokopedia";break;case g.x.Tiktok:this.channelName="Tiktok";break;case g.x.WooCommerce:this.channelName="WooCommerce";break;case g.x.ShopeeV2:this.channelName="Shopee";break;case g.x.Lazada:this.channelName="Lazada";break;case g.x.KalCare:this.channelName="Kalcare"}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-2","fw-bold"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&t&&(e.xp6(1),e.Q6J("src",n.channelLogo,e.LSH),e.xp6(2),e.Oqu(n.channelName))}}),i})();const Te=function(){return["/menu/Order/detail"]},Se=function(i,o){return{Number:i,Outlet:o}};function Ce(i,o){if(1&i&&(e.TgZ(0,"a",23),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Te))("queryParams",e.WLB(4,Se,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function xe(i,o){if(1&i&&(e.TgZ(0,"a",24),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,n=e.oxw();e.Q6J("href",n.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ye(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"a",25),e.NdJ("click",function(){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.onPrintShippingLabel(a.Number,a.ShopID,a.TypeID))}),e._UZ(1,"i",26),e.qZA()}}function Ze(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"tr")(1,"td")(2,"input",17),e.NdJ("ngModelChange",function(a){const m=e.CHM(t).$implicit;return e.KtG(m.selected=a)})("ngModelChange",function(){const r=e.CHM(t).$implicit,m=e.oxw();return e.KtG(m.onCheckboxStateProduct(r.Number))}),e.qZA()(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Ce,2,7,"a",18),e.YNc(7,xe,2,2,"a",19),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td"),e._uU(14),e.ALo(15,"date"),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",20),e.qZA(),e.TgZ(18,"td",21),e.YNc(19,ye,2,0,"a",22),e.qZA()()}if(2&i){const t=o.$implicit,n=e.oxw();e.xp6(2),e.Q6J("ngModel",t.selected),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",n.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!n.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(12,9,t.Amount)),e.xp6(3),e.Oqu(e.xi3(15,11,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==n.channelType.ShopeeV2||t.TypeID==n.channelType.Tokopedia||t.TypeID==n.channelType.Tiktok)}}let De=(()=>{class i{constructor(t,n,a,r,m){this.http=t,this.toastr=n,this.localDataService=a,this.dialog=r,this.orderService=m,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=g.x}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(t){this.http.post("api/orders/GetReadyToShip",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}onPrintShippingLabel(t,n,a){switch(a){case g.x.Tokopedia:this.orderService.printShippingLabelTokopedia(t);break;case g.x.Tiktok:this.orderService.printShippingLabelTiktok(t,n);break;case g.x.ShopeeV2:this.orderService.printShippingLabelShopee(t,n)}}updateDelivery(){let t=this.getSelected();if(t.length>0){let n=[];t.forEach(a=>n.push(a)),this.http.post("/api/Orders/UpdateStateDelivery",n).subscribe(a=>{this.toastr.success("Successfully updated","Success")})}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}onCheckboxStateProduct(t){let n=this.data.filter(a=>a.Number==t);if(n.length>0)for(let a of n)a.selected=a.selected}onCheckboxStateChange(){for(let t of this.data)t.selected=this.checkboxState}getSelected(){let t=[];if(this.data){for(let n of this.data)n.selected&&t.push(n);return t}return[]}hasSelection(){return!!this.data&&this.getSelected().length>0}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(C._W),e.Y36(D.T),e.Y36(O.uw),e.Y36(k))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-ready-to-ship"]],decls:44,vars:12,consts:[["searchBoxPlaceHolder","Search Ready To Ship...",3,"headerTitle","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"hidden","click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(r){return n.Get(r)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(r){return n.selectedOutlets=r}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(r){return n.filter.PageNumber=r}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(r){return n.filter.PageSize=r}),e.qZA()()()(),e.TgZ(15,"actions")(16,"button",5),e.NdJ("click",function(){return n.updateDelivery()}),e._uU(17," Dispatch "),e.qZA()(),e.TgZ(18,"content")(19,"div",6)(20,"div",7)(21,"div",8)(22,"div",9)(23,"table",10)(24,"thead",11)(25,"tr",12)(26,"th",13)(27,"input",14),e.NdJ("ngModelChange",function(r){return n.checkboxState=r})("ngModelChange",function(){return n.onCheckboxStateChange()}),e.qZA()(),e.TgZ(28,"th"),e._uU(29,"Outlet"),e.qZA(),e.TgZ(30,"th"),e._uU(31,"Order number"),e.qZA(),e.TgZ(32,"th"),e._uU(33,"Customer"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Amount"),e.qZA(),e.TgZ(36,"th"),e._uU(37,"Created On"),e.qZA(),e.TgZ(38,"th"),e._uU(39,"Channel Name"),e.qZA(),e._UZ(40,"th"),e.qZA()(),e.TgZ(41,"tbody"),e.YNc(42,Ze,20,14,"tr",15),e.qZA()(),e.TgZ(43,"app-mat-paginator-no-count",16),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","2 - Ready to Ship"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(2),e.Q6J("hidden",!n.hasSelection()),e.xp6(11),e.Q6J("ngModel",n.checkboxState),e.xp6(15),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[u.sg,u.O5,s.Fj,s.wV,s.Wl,s.JJ,s.On,l.p,v.yS,p.w9,d.n,R,u.JJ,u.uU]}),i})();const Oe=function(){return["/menu/Order/detail"]},Me=function(i,o){return{Number:i,Outlet:o}};function we(i,o){if(1&i&&(e.TgZ(0,"a",19),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Oe))("queryParams",e.WLB(4,Me,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Pe(i,o){if(1&i&&(e.TgZ(0,"a",20),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,n=e.oxw();e.Q6J("href",n.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ne(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"a",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.onPrintShippingLabel(a.Number,a.ShopID,a.TypeID))}),e._UZ(1,"i",22),e.qZA()}}function Ae(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,we,2,7,"a",14),e.YNc(5,Pe,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",16),e.qZA(),e.TgZ(16,"td",17),e.YNc(17,Ne,2,0,"a",18),e.qZA()()),2&i){const t=o.$implicit,n=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",n.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!n.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==n.channelType.ShopeeV2||t.TypeID==n.channelType.Tokopedia||t.TypeID==n.channelType.Tiktok)}}let Ie=(()=>{class i{constructor(t,n,a){this.http=t,this.localDataService=n,this.orderService=a,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.channelType=g.x}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(t){return t==f.g.GuidEMpty}Get(t){this.http.post("api/orders/GetShipped",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}onPrintShippingLabel(t,n,a){switch(a){case g.x.Tokopedia:this.orderService.printShippingLabelTokopedia(t);break;case g.x.Tiktok:this.orderService.printShippingLabelTiktok(t,n);break;case g.x.ShopeeV2:this.orderService.printShippingLabelShopee(t,n)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(D.T),e.Y36(k))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-shipped"]],decls:39,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"headerTitle","onSubmit"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(r){return n.Get(r)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(r){return n.selectedOutlets=r}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(r){return n.filter.PageNumber=r}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(r){return n.filter.PageSize=r}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Channel Name"),e.qZA(),e._UZ(35,"th"),e.qZA()(),e.TgZ(36,"tbody"),e.YNc(37,Ae,18,13,"tr",12),e.qZA()(),e.TgZ(38,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","3 - Shipped"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[u.sg,u.O5,s.Fj,s.wV,s.JJ,s.On,l.p,v.yS,p.w9,d.n,R,u.JJ,u.uU]}),i})();var ke=c(501);const qe=function(){return["/menu/Order/detail"]},Ue=function(i,o){return{Number:i,Outlet:o}};function Je(i,o){if(1&i&&(e.TgZ(0,"a",19),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,qe))("queryParams",e.WLB(4,Ue,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Le(i,o){if(1&i&&(e.TgZ(0,"a",20),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,n=e.oxw();e.Q6J("href",n.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ee(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"a",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.onPrintShippingLabel(a.Number,a.ShopID,a.TypeID))}),e._UZ(1,"i",22),e.qZA()}}function Re(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Je,2,7,"a",14),e.YNc(5,Le,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",16),e.qZA(),e.TgZ(16,"td",17),e.YNc(17,Ee,2,0,"a",18),e.qZA()()),2&i){const t=o.$implicit,n=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",n.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!n.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==n.channelType.ShopeeV2||t.TypeID==n.channelType.Tokopedia||t.TypeID==n.channelType.Tiktok)}}let Fe=(()=>{class i{constructor(t,n,a){this.http=t,this.orderService=n,this.authService=a,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0,this.channelType=g.x}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(t){this.http.post("api/orders/GetDelivered ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}onPrintShippingLabel(t,n,a){switch(a){case g.x.Tokopedia:this.orderService.printShippingLabelTokopedia(t);break;case g.x.Tiktok:this.orderService.printShippingLabelTiktok(t,n);break;case g.x.ShopeeV2:this.orderService.printShippingLabelShopee(t,n)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(k),e.Y36(ke.e))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-delivered"]],decls:39,vars:11,consts:[["searchBoxPlaceHolder","Search Orders...",3,"headerTitle","hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(r){return n.Get(r)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(r){return n.selectedOutlets=r}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(r){return n.filter.PageNumber=r}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(r){return n.filter.PageSize=r}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Channel Name"),e.qZA(),e._UZ(35,"th"),e.qZA()(),e.TgZ(36,"tbody"),e.YNc(37,Re,18,13,"tr",12),e.qZA()(),e.TgZ(38,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","4 - Completed")("hideSearchBox",!0),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[u.sg,u.O5,s.Fj,s.wV,s.JJ,s.On,l.p,v.yS,p.w9,d.n,R,u.JJ,u.uU]}),i})();const Qe=function(){return["/menu/Order/detail"]},ze=function(i,o){return{Number:i,Outlet:o}};function Ge(i,o){if(1&i&&(e.TgZ(0,"a",16),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Qe))("queryParams",e.WLB(4,ze,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ye(i,o){if(1&i&&(e.TgZ(0,"a",17),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,n=e.oxw();e.Q6J("href",n.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function He(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ge,2,7,"a",14),e.YNc(5,Ye,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA()()),2&i){const t=o.$implicit,n=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",n.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!n.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State)}}let Be=(()=>{class i{constructor(t,n){this.http=t,this.localDataService=n,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(t){this.http.post("api/orders/GetAll ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(t){this.filter=t,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(D.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-all-order"]],decls:38,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"headerTitle","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(r){return n.Get(r)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(r){return n.selectedOutlets=r}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(r){return n.filter.PageNumber=r}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(r){return n.filter.PageSize=r}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA(),e.TgZ(33,"th"),e._uU(34,"Status"),e.qZA()()(),e.TgZ(35,"tbody"),e.YNc(36,He,16,12,"tr",12),e.qZA()(),e.TgZ(37,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","All"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(22),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[u.sg,u.O5,s.Fj,s.wV,s.JJ,s.On,l.p,v.yS,p.w9,d.n,u.JJ,u.uU]}),i})();const $e=function(){return["/menu/Order/detail"]},Ve=function(i,o){return{Number:i,Outlet:o}};function je(i,o){if(1&i&&(e.TgZ(0,"a",16),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,$e))("queryParams",e.WLB(4,Ve,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function We(i,o){if(1&i&&(e.TgZ(0,"a",17),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,n=e.oxw();e.Q6J("href",n.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ke(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,je,2,7,"a",14),e.YNc(5,We,2,2,"a",15),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA()()),2&i){const t=o.$implicit,n=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",n.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!n.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,6,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,8,t.Created,"dd MMM yyyy HH:mm"))}}let Xe=(()=>{class i{constructor(t,n){this.http=t,this.localDataService=n,this.filter={PageNumber:null,PageSize:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.outlets=t.Options.Outlet,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(t){this.http.post("api/orders/GetCancelled ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(a=>{this.data=a.Data,this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,Outlet:null!=this.selectedOutlets?this.selectedOutlets:this.outlets}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(D.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-cancelled"]],decls:36,vars:10,consts:[["searchBoxPlaceHolder","Search Orders...",3,"headerTitle","onSubmit"],["container","",1,""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(r){return n.Get(r)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(r){return n.selectedOutlets=r}),e.qZA()(),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(r){return n.filter.PageNumber=r}),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",4),e.NdJ("ngModelChange",function(r){return n.filter.PageSize=r}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",5)(17,"div",6)(18,"div",7)(19,"div",8)(20,"table",9)(21,"thead",10)(22,"tr",11)(23,"th"),e._uU(24,"Outlet"),e.qZA(),e.TgZ(25,"th"),e._uU(26,"Order number"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Customer"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Amount"),e.qZA(),e.TgZ(31,"th"),e._uU(32,"Created On"),e.qZA()()(),e.TgZ(33,"tbody"),e.YNc(34,Ke,14,11,"tr",12),e.qZA()(),e.TgZ(35,"app-mat-paginator-no-count",13),e.NdJ("total",function(){return n.StoreRowsCountAPIResult()})("next",function(){return n.NextPage()})("previous",function(){return n.PreviousPage()}),e.qZA()()()()()()()),2&t&&(e.Q6J("headerTitle","99 - Cancelled"),e.xp6(6),e.Q6J("multiple",!0)("ngModel",n.selectedOutlets)("items",n.outlets),e.xp6(4),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(20),e.Q6J("ngForOf",n.data),e.xp6(1),e.Q6J("filter",n.filter)("totaldata",n.totaldata)("paginationTotal",n.paginationTotal))},dependencies:[u.sg,u.O5,s.Fj,s.wV,s.JJ,s.On,l.p,v.yS,p.w9,d.n,u.JJ,u.uU]}),i})();var W=c(2687),F=c(445),P=c(1281),Q=c(9521),et=c(3353),z=c(7579),tt=c(9646),q=c(8675),N=c(2722);function nt(i,o){1&i&&e.Hsn(0)}const it=["*"];let K=(()=>{class i{constructor(t){this._elementRef=t}focus(){this._elementRef.nativeElement.focus()}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(e.SBq))},i.\u0275dir=e.lG2({type:i,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"]}),i})(),X=(()=>{class i{constructor(t){this.template=t}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(e.Rgc))},i.\u0275dir=e.lG2({type:i,selectors:[["","cdkStepLabel",""]]}),i})(),at=0;const G=new e.OlP("STEPPER_GLOBAL_OPTIONS");let Y=(()=>{class i{constructor(t,n){this._stepper=t,this.interacted=!1,this.interactedStream=new e.vpe,this._editable=!0,this._optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=n||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType}get editable(){return this._editable}set editable(t){this._editable=(0,P.Ig)(t)}get optional(){return this._optional}set optional(t){this._optional=(0,P.Ig)(t)}get completed(){return this._completedOverride??this._getDefaultCompleted()}set completed(t){this._completedOverride=(0,P.Ig)(t)}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return this._customError??this._getDefaultError()}set hasError(t){this._customError=(0,P.Ig)(t)}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}select(){this._stepper.selected=this}reset(){this.interacted=!1,null!=this._completedOverride&&(this._completedOverride=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&this.stepControl.reset()}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this.interacted||(this.interacted=!0,this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??null!=this._customError}}return i.\u0275fac=function(t){return new(t||i)(e.Y36((0,e.Gpc)(()=>H)),e.Y36(G,8))},i.\u0275cmp=e.Xpm({type:i,selectors:[["cdk-step"]],contentQueries:function(t,n,a){if(1&t&&e.Suo(a,X,5),2&t){let r;e.iGM(r=e.CRH())&&(n.stepLabel=r.first)}},viewQuery:function(t,n){if(1&t&&e.Gf(e.Rgc,7),2&t){let a;e.iGM(a=e.CRH())&&(n.content=a.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],state:"state",editable:"editable",optional:"optional",completed:"completed",hasError:"hasError"},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],features:[e.TTD],ngContentSelectors:it,decls:1,vars:0,template:function(t,n){1&t&&(e.F$t(),e.YNc(0,nt,1,0,"ng-template"))},encapsulation:2,changeDetection:0}),i})(),H=(()=>{class i{constructor(t,n,a){this._dir=t,this._changeDetectorRef=n,this._elementRef=a,this._destroyed=new z.x,this.steps=new e.n_E,this._sortedHeaders=new e.n_E,this._linear=!1,this._selectedIndex=0,this.selectionChange=new e.vpe,this._orientation="horizontal",this._groupId=at++}get linear(){return this._linear}set linear(t){this._linear=(0,P.Ig)(t)}get selectedIndex(){return this._selectedIndex}set selectedIndex(t){const n=(0,P.su)(t);this.steps&&this._steps?(this._isValidIndex(n),this.selected?._markAsInteracted(),this._selectedIndex!==n&&!this._anyControlsInvalidOrPending(n)&&(n>=this._selectedIndex||this.steps.toArray()[n].editable)&&this._updateSelectedItemIndex(n)):this._selectedIndex=n}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(t){this.selectedIndex=t&&this.steps?this.steps.toArray().indexOf(t):-1}get orientation(){return this._orientation}set orientation(t){this._orientation=t,this._keyManager&&this._keyManager.withVerticalOrientation("vertical"===t)}ngAfterContentInit(){this._steps.changes.pipe((0,q.O)(this._steps),(0,N.R)(this._destroyed)).subscribe(t=>{this.steps.reset(t.filter(n=>n._stepper===this)),this.steps.notifyOnChanges()})}ngAfterViewInit(){this._stepHeader.changes.pipe((0,q.O)(this._stepHeader),(0,N.R)(this._destroyed)).subscribe(t=>{this._sortedHeaders.reset(t.toArray().sort((n,a)=>n._elementRef.nativeElement.compareDocumentPosition(a._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new W.Em(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:(0,tt.of)()).pipe((0,q.O)(this._layoutDirection()),(0,N.R)(this._destroyed)).subscribe(t=>this._keyManager.withHorizontalOrientation(t)),this._keyManager.updateActiveItem(this._selectedIndex),this.steps.changes.subscribe(()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))}),this._isValidIndex(this._selectedIndex)||(this._selectedIndex=0)}ngOnDestroy(){this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(t=>t.reset()),this._stateChanged()}_getStepLabelId(t){return`cdk-step-label-${this._groupId}-${t}`}_getStepContentId(t){return`cdk-step-content-${this._groupId}-${t}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(t){const n=t-this._selectedIndex;return n<0?"rtl"===this._layoutDirection()?"next":"previous":n>0?"rtl"===this._layoutDirection()?"previous":"next":"current"}_getIndicatorType(t,n="number"){const a=this.steps.toArray()[t],r=this._isCurrentStep(t);return a._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(a,r):this._getGuidelineLogic(a,r,n)}_getDefaultIndicatorLogic(t,n){return t._showError()&&t.hasError&&!n?"error":!t.completed||n?"number":t.editable?"edit":"done"}_getGuidelineLogic(t,n,a="number"){return t._showError()&&t.hasError&&!n?"error":t.completed&&!n?"done":t.completed&&n?a:t.editable&&n?"edit":a}_isCurrentStep(t){return this._selectedIndex===t}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(t){const n=this.steps.toArray();this.selectionChange.emit({selectedIndex:t,previouslySelectedIndex:this._selectedIndex,selectedStep:n[t],previouslySelectedStep:n[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(t):this._keyManager.updateActiveItem(t),this._selectedIndex=t,this._stateChanged()}_onKeydown(t){const n=(0,Q.Vb)(t),a=t.keyCode,r=this._keyManager;null==r.activeItemIndex||n||a!==Q.L_&&a!==Q.K5?r.onKeydown(t):(this.selectedIndex=r.activeItemIndex,t.preventDefault())}_anyControlsInvalidOrPending(t){return!!(this._linear&&t>=0)&&this.steps.toArray().slice(0,t).some(n=>{const a=n.stepControl;return(a?a.invalid||a.pending||!n.interacted:!n.completed)&&!n.optional&&!n._completedOverride})}_layoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_containsFocus(){const t=this._elementRef.nativeElement,n=(0,et.ht)();return t===n||t.contains(n)}_isValidIndex(t){return t>-1&&(!this.steps||t<this.steps.length)}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(F.Is,8),e.Y36(e.sBO),e.Y36(e.SBq))},i.\u0275dir=e.lG2({type:i,selectors:[["","cdkStepper",""]],contentQueries:function(t,n,a){if(1&t&&(e.Suo(a,Y,5),e.Suo(a,K,5)),2&t){let r;e.iGM(r=e.CRH())&&(n._steps=r),e.iGM(r=e.CRH())&&(n._stepHeader=r)}},inputs:{linear:"linear",selectedIndex:"selectedIndex",selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange"},exportAs:["cdkStepper"]}),i})(),ot=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[F.vT]}),i})();var M=(()=>{return(i=M||(M={}))[i.DoNothing=0]="DoNothing",i[i.New=1]="New",i[i.Update=2]="Update",M;var i})(),rt=c(6082),A=c(9602),B=c(4080),st=c(9101),y=c(3238),ee=c(7392),lt=c(727),pt=c(1884),_=c(7340);function dt(i,o){if(1&i&&e.GkF(0,8),2&i){const t=e.oxw();e.Q6J("ngTemplateOutlet",t.iconOverrides[t.state])("ngTemplateOutletContext",t._getIconContext())}}function ct(i,o){if(1&i&&(e.TgZ(0,"span",13),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(t._getDefaultTextForState(t.state))}}function ut(i,o){if(1&i&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(t._intl.completedLabel)}}function ht(i,o){if(1&i&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(t._intl.editableLabel)}}function mt(i,o){if(1&i&&(e.TgZ(0,"mat-icon",13),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(t._getDefaultTextForState(t.state))}}function gt(i,o){if(1&i&&(e.ynx(0,9),e.YNc(1,ct,2,1,"span",10),e.YNc(2,ut,2,1,"span",11),e.YNc(3,ht,2,1,"span",11),e.YNc(4,mt,2,1,"mat-icon",12),e.BQk()),2&i){const t=e.oxw();e.Q6J("ngSwitch",t.state),e.xp6(1),e.Q6J("ngSwitchCase","number"),e.xp6(1),e.Q6J("ngIf","done"===t.state),e.xp6(1),e.Q6J("ngIf","edit"===t.state)}}function _t(i,o){if(1&i&&(e.TgZ(0,"div",15),e.GkF(1,16),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngTemplateOutlet",t._templateLabel().template)}}function ft(i,o){if(1&i&&(e.TgZ(0,"div",15),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Oqu(t.label)}}function vt(i,o){if(1&i&&(e.TgZ(0,"div",17),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Oqu(t._intl.optionalLabel)}}function bt(i,o){if(1&i&&(e.TgZ(0,"div",18),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Oqu(t.errorMessage)}}function Tt(i,o){}function St(i,o){if(1&i&&(e.Hsn(0),e.YNc(1,Tt,0,0,"ng-template",0)),2&i){const t=e.oxw();e.xp6(1),e.Q6J("cdkPortalOutlet",t._portal)}}const Ct=["*"];function xt(i,o){1&i&&e._UZ(0,"div",11)}const te=function(i,o){return{step:i,i:o}};function yt(i,o){if(1&i&&(e.ynx(0),e.GkF(1,9),e.YNc(2,xt,1,0,"div",10),e.BQk()),2&i){const t=o.$implicit,n=o.index,a=o.last;e.oxw(2);const r=e.MAs(4);e.xp6(1),e.Q6J("ngTemplateOutlet",r)("ngTemplateOutletContext",e.WLB(3,te,t,n)),e.xp6(1),e.Q6J("ngIf",!a)}}const ne=function(i){return{animationDuration:i}},ie=function(i,o){return{value:i,params:o}};function Zt(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",12),e.NdJ("@horizontalStepTransition.done",function(a){e.CHM(t);const r=e.oxw(2);return e.KtG(r._animationDone.next(a))}),e.GkF(1,13),e.qZA()}if(2&i){const t=o.$implicit,n=o.index,a=e.oxw(2);e.Q6J("@horizontalStepTransition",e.WLB(7,ie,a._getAnimationDirection(n),e.VKq(5,ne,a._getAnimationDuration())))("id",a._getStepContentId(n)),e.uIk("aria-labelledby",a._getStepLabelId(n))("aria-expanded",a.selectedIndex===n),e.xp6(1),e.Q6J("ngTemplateOutlet",t.content)}}function Dt(i,o){if(1&i&&(e.TgZ(0,"div",4)(1,"div",5),e.YNc(2,yt,3,6,"ng-container",6),e.qZA(),e.TgZ(3,"div",7),e.YNc(4,Zt,2,10,"div",8),e.qZA()()),2&i){const t=e.oxw();e.xp6(2),e.Q6J("ngForOf",t.steps),e.xp6(2),e.Q6J("ngForOf",t.steps)}}function Ot(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",15),e.GkF(1,9),e.TgZ(2,"div",16)(3,"div",17),e.NdJ("@verticalStepTransition.done",function(a){e.CHM(t);const r=e.oxw(2);return e.KtG(r._animationDone.next(a))}),e.TgZ(4,"div",18),e.GkF(5,13),e.qZA()()()()}if(2&i){const t=o.$implicit,n=o.index,a=o.last,r=e.oxw(2),m=e.MAs(4);e.xp6(1),e.Q6J("ngTemplateOutlet",m)("ngTemplateOutletContext",e.WLB(9,te,t,n)),e.xp6(1),e.ekj("mat-stepper-vertical-line",!a),e.xp6(1),e.Q6J("@verticalStepTransition",e.WLB(14,ie,r._getAnimationDirection(n),e.VKq(12,ne,r._getAnimationDuration())))("id",r._getStepContentId(n)),e.uIk("aria-labelledby",r._getStepLabelId(n))("aria-expanded",r.selectedIndex===n),e.xp6(2),e.Q6J("ngTemplateOutlet",t.content)}}function Mt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,Ot,6,17,"div",14),e.BQk()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.steps)}}function wt(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"mat-step-header",19),e.NdJ("click",function(){const r=e.CHM(t).step;return e.KtG(r.select())})("keydown",function(a){e.CHM(t);const r=e.oxw();return e.KtG(r._onKeydown(a))}),e.qZA()}if(2&i){const t=o.step,n=o.i,a=e.oxw();e.ekj("mat-horizontal-stepper-header","horizontal"===a.orientation)("mat-vertical-stepper-header","vertical"===a.orientation),e.Q6J("tabIndex",a._getFocusIndex()===n?0:-1)("id",a._getStepLabelId(n))("index",n)("state",a._getIndicatorType(n,t.state))("label",t.stepLabel||t.label)("selected",a.selectedIndex===n)("active",a._stepIsNavigable(n,t))("optional",t.optional)("errorMessage",t.errorMessage)("iconOverrides",a._iconOverrides)("disableRipple",a.disableRipple||!a._stepIsNavigable(n,t))("color",t.color||a.color),e.uIk("aria-posinset",n+1)("aria-setsize",a.steps.length)("aria-controls",a._getStepContentId(n))("aria-selected",a.selectedIndex==n)("aria-label",t.ariaLabel||null)("aria-labelledby",!t.ariaLabel&&t.ariaLabelledby?t.ariaLabelledby:null)("aria-disabled",!a._stepIsNavigable(n,t)||null)}}let U=(()=>{class i extends X{}return i.\u0275fac=function(){let o;return function(n){return(o||(o=e.n5z(i)))(n||i)}}(),i.\u0275dir=e.lG2({type:i,selectors:[["","matStepLabel",""]],features:[e.qOj]}),i})(),J=(()=>{class i{constructor(){this.changes=new z.x,this.optionalLabel="Optional",this.completedLabel="Completed",this.editableLabel="Editable"}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();const Nt={provide:J,deps:[[new e.FiY,new e.tp0,J]],useFactory:function Pt(i){return i||new J}},At=(0,y.pj)(class extends K{constructor(o){super(o)}},"primary");let ae=(()=>{class i extends At{constructor(t,n,a,r){super(a),this._intl=t,this._focusMonitor=n,this._intlSubscription=t.changes.subscribe(()=>r.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(t,n){t?this._focusMonitor.focusVia(this._elementRef,t,n):this._elementRef.nativeElement.focus(n)}_stringLabel(){return this.label instanceof U?null:this.label}_templateLabel(){return this.label instanceof U?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getIconContext(){return{index:this.index,active:this.active,optional:this.optional}}_getDefaultTextForState(t){return"number"==t?`${this.index+1}`:"edit"==t?"create":"error"==t?"warning":t}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(J),e.Y36(W.tE),e.Y36(e.SBq),e.Y36(e.sBO))},i.\u0275cmp=e.Xpm({type:i,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],inputs:{color:"color",state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple"},features:[e.qOj],decls:10,vars:19,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content",3,"ngSwitch"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngSwitchCase"],[3,"ngSwitch",4,"ngSwitchDefault"],[1,"mat-step-label"],["class","mat-step-text-label",4,"ngIf"],["class","mat-step-optional",4,"ngIf"],["class","mat-step-sub-label-error",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngSwitch"],["aria-hidden","true",4,"ngSwitchCase"],["class","cdk-visually-hidden",4,"ngIf"],["aria-hidden","true",4,"ngSwitchDefault"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[1,"mat-step-text-label"],[3,"ngTemplateOutlet"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"]],template:function(t,n){1&t&&(e._UZ(0,"div",0),e.TgZ(1,"div")(2,"div",1),e.YNc(3,dt,1,2,"ng-container",2),e.YNc(4,gt,5,4,"ng-container",3),e.qZA()(),e.TgZ(5,"div",4),e.YNc(6,_t,2,1,"div",5),e.YNc(7,ft,2,1,"div",5),e.YNc(8,vt,2,1,"div",6),e.YNc(9,bt,2,1,"div",7),e.qZA()),2&t&&(e.Q6J("matRippleTrigger",n._getHostElement())("matRippleDisabled",n.disableRipple),e.xp6(1),e.Gre("mat-step-icon-state-",n.state," mat-step-icon"),e.ekj("mat-step-icon-selected",n.selected),e.xp6(1),e.Q6J("ngSwitch",!(!n.iconOverrides||!n.iconOverrides[n.state])),e.xp6(1),e.Q6J("ngSwitchCase",!0),e.xp6(2),e.ekj("mat-step-label-active",n.active)("mat-step-label-selected",n.selected)("mat-step-label-error","error"==n.state),e.xp6(1),e.Q6J("ngIf",n._templateLabel()),e.xp6(1),e.Q6J("ngIf",n._stringLabel()),e.xp6(1),e.Q6J("ngIf",n.optional&&"error"!=n.state),e.xp6(1),e.Q6J("ngIf","error"==n.state))},dependencies:[u.O5,u.tP,u.RF,u.n9,u.ED,ee.Hw,y.wG],styles:[".mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header.cdk-keyboard-focused,.cdk-high-contrast-active .mat-step-header.cdk-program-focused{outline:solid 3px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.mat-step-optional,.mat-step-sub-label-error{font-size:12px}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}"],encapsulation:2,changeDetection:0}),i})();const se={horizontalStepTransition:(0,_.X$)("horizontalStepTransition",[(0,_.SB)("previous",(0,_.oB)({transform:"translate3d(-100%, 0, 0)",visibility:"hidden"})),(0,_.SB)("current",(0,_.oB)({transform:"none",visibility:"inherit"})),(0,_.SB)("next",(0,_.oB)({transform:"translate3d(100%, 0, 0)",visibility:"hidden"})),(0,_.eR)("* => *",(0,_.jt)("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)"),{params:{animationDuration:"500ms"}})]),verticalStepTransition:(0,_.X$)("verticalStepTransition",[(0,_.SB)("previous",(0,_.oB)({height:"0px",visibility:"hidden"})),(0,_.SB)("next",(0,_.oB)({height:"0px",visibility:"hidden"})),(0,_.SB)("current",(0,_.oB)({height:"*",visibility:"inherit"})),(0,_.eR)("* <=> current",(0,_.jt)("{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)"),{params:{animationDuration:"225ms"}})])};let le=(()=>{class i{constructor(t){this.templateRef=t}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(e.Rgc))},i.\u0275dir=e.lG2({type:i,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:["matStepperIcon","name"]}}),i})(),It=(()=>{class i{constructor(t){this._template=t}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(e.Rgc))},i.\u0275dir=e.lG2({type:i,selectors:[["ng-template","matStepContent",""]]}),i})(),pe=(()=>{class i extends Y{constructor(t,n,a,r){super(t,r),this._errorStateMatcher=n,this._viewContainerRef=a,this._isSelected=lt.w0.EMPTY}ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe((0,V.w)(()=>this._stepper.selectionChange.pipe((0,j.U)(t=>t.selectedStep===this),(0,q.O)(this._stepper.selected===this)))).subscribe(t=>{t&&this._lazyContent&&!this._portal&&(this._portal=new B.UE(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(t,n){return this._errorStateMatcher.isErrorState(t,n)||!!(t&&t.invalid&&this.interacted)}}return i.\u0275fac=function(t){return new(t||i)(e.Y36((0,e.Gpc)(()=>de)),e.Y36(y.rD,4),e.Y36(e.s_b),e.Y36(G,8))},i.\u0275cmp=e.Xpm({type:i,selectors:[["mat-step"]],contentQueries:function(t,n,a){if(1&t&&(e.Suo(a,U,5),e.Suo(a,It,5)),2&t){let r;e.iGM(r=e.CRH())&&(n.stepLabel=r.first),e.iGM(r=e.CRH())&&(n._lazyContent=r.first)}},inputs:{color:"color"},exportAs:["matStep"],features:[e._Bn([{provide:y.rD,useExisting:i},{provide:Y,useExisting:i}]),e.qOj],ngContentSelectors:Ct,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(t,n){1&t&&(e.F$t(),e.YNc(0,St,2,1,"ng-template"))},dependencies:[B.Pl],encapsulation:2,changeDetection:0}),i})(),de=(()=>{class i extends H{constructor(t,n,a){super(t,n,a),this.steps=new e.n_E,this.animationDone=new e.vpe,this.labelPosition="end",this.headerPosition="top",this._iconOverrides={},this._animationDone=new z.x,this._animationDuration="";const r=a.nativeElement.nodeName.toLowerCase();this.orientation="mat-vertical-stepper"===r?"vertical":"horizontal"}get animationDuration(){return this._animationDuration}set animationDuration(t){this._animationDuration=/^\d+$/.test(t)?t+"ms":t}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:t,templateRef:n})=>this._iconOverrides[t]=n),this.steps.changes.pipe((0,N.R)(this._destroyed)).subscribe(()=>{this._stateChanged()}),this._animationDone.pipe((0,pt.x)((t,n)=>t.fromState===n.fromState&&t.toState===n.toState),(0,N.R)(this._destroyed)).subscribe(t=>{"current"===t.toState&&this.animationDone.emit()})}_stepIsNavigable(t,n){return n.completed||this.selectedIndex===t||!this.linear}_getAnimationDuration(){return this.animationDuration?this.animationDuration:"horizontal"===this.orientation?"500ms":"225ms"}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(F.Is,8),e.Y36(e.sBO),e.Y36(e.SBq))},i.\u0275cmp=e.Xpm({type:i,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(t,n,a){if(1&t&&(e.Suo(a,pe,5),e.Suo(a,le,5)),2&t){let r;e.iGM(r=e.CRH())&&(n._steps=r),e.iGM(r=e.CRH())&&(n._icons=r)}},viewQuery:function(t,n){if(1&t&&e.Gf(ae,5),2&t){let a;e.iGM(a=e.CRH())&&(n._stepHeader=a)}},hostAttrs:["role","tablist"],hostVars:11,hostBindings:function(t,n){2&t&&(e.uIk("aria-orientation",n.orientation),e.ekj("mat-stepper-horizontal","horizontal"===n.orientation)("mat-stepper-vertical","vertical"===n.orientation)("mat-stepper-label-position-end","horizontal"===n.orientation&&"end"==n.labelPosition)("mat-stepper-label-position-bottom","horizontal"===n.orientation&&"bottom"==n.labelPosition)("mat-stepper-header-position-bottom","bottom"===n.headerPosition))},inputs:{selectedIndex:"selectedIndex",disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],features:[e._Bn([{provide:H,useExisting:i}]),e.qOj],decls:5,vars:3,consts:[[3,"ngSwitch"],["class","mat-horizontal-stepper-wrapper",4,"ngSwitchCase"],[4,"ngSwitchCase"],["stepTemplate",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-horizontal-stepper-header-container"],[4,"ngFor","ngForOf"],[1,"mat-horizontal-content-container"],["class","mat-horizontal-stepper-content","role","tabpanel",3,"id",4,"ngFor","ngForOf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["class","mat-stepper-horizontal-line",4,"ngIf"],[1,"mat-stepper-horizontal-line"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[3,"ngTemplateOutlet"],["class","mat-step",4,"ngFor","ngForOf"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","tabpanel",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color","click","keydown"]],template:function(t,n){1&t&&(e.ynx(0,0),e.YNc(1,Dt,5,2,"div",1),e.YNc(2,Mt,2,1,"ng-container",2),e.BQk(),e.YNc(3,wt,1,23,"ng-template",null,3,e.W1O)),2&t&&(e.Q6J("ngSwitch",n.orientation),e.xp6(1),e.Q6J("ngSwitchCase","horizontal"),e.xp6(1),e.Q6J("ngSwitchCase","vertical"))},dependencies:[u.sg,u.O5,u.tP,u.RF,u.n9,ae],styles:['.mat-stepper-vertical,.mat-stepper-horizontal{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}'],encapsulation:2,data:{animation:[se.horizontalStepTransition,se.verticalStepTransition]},changeDetection:0}),i})(),kt=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({providers:[Nt,y.rD],imports:[y.BQ,u.ez,B.eL,st.ot,ot,ee.Ps,y.si,y.BQ]}),i})();var ce=c(266);function qt(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){e.CHM(t),e.oxw();const a=e.MAs(11);return e.KtG(a.previous())}),e._uU(1," Back "),e.qZA()}}function Ut(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(),r=e.MAs(11);return e.KtG(a.onNext(r))}),e._uU(1," Next "),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function Jt(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(),r=e.MAs(11);return e.KtG(a.onNew(r))}),e._UZ(1,"i",29),e._uU(2," New "),e.qZA()}}function Lt(i,o){1&i&&e._uU(0,"Filter")}function Et(i,o){if(1&i&&(e.TgZ(0,"ng-option",30),e._UZ(1,"img",31),e._uU(2),e.qZA()),2&i){const t=o.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function Rt(i,o){1&i&&e._uU(0,"Preview")}function Ft(i,o){if(1&i&&(e.TgZ(0,"th",49),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function Qt(i,o){if(1&i&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function zt(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function Gt(i,o){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const t=o.$implicit;e.xp6(1),e.hij("",t," ")}}function Yt(i,o){if(1&i&&(e.TgZ(0,"ul",55),e.YNc(1,Gt,2,1,"li",50),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function Ht(i,o){if(1&i&&(e.TgZ(0,"span",56),e._UZ(1,"i",57),e.qZA()),2&i){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const Bt=function(i,o){return{"over-due-today":i,"over-due":o}};function $t(i,o){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,Qt,3,4,"td",51),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",52)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,zt,2,1,"span",51),e.YNc(16,Yt,2,1,"ul",53),e.qZA(),e.TgZ(17,"td"),e.YNc(18,Ht,2,2,"span",54),e.qZA()()),2&i){const t=o.$implicit,n=o.index,a=e.oxw(3);e.xp6(2),e.Oqu(n+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",a.getTypeID()!=a.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(11,Bt,(null==t?null:t.Action)==a.actionPreviewOrder.Update,(null==t?null:t.Action)==a.actionPreviewOrder.New)),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.hij("",t.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function Vt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,$t,19,14,"tr",50),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function jt(i,o){1&i&&(e.TgZ(0,"tr",58)(1,"td",59)(2,"div",60),e._UZ(3,"i",61),e.qZA(),e.TgZ(4,"h4",62),e._uU(5,"There is no order to processed"),e.qZA()()())}function Wt(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",32)(1,"div",33)(2,"div",34)(3,"ul",35)(4,"li",36)(5,"button",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.filterPreviewData(a.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",36)(8,"button",38),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.filterPreviewData(a.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",36)(11,"button",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.filterPreviewData(a.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",36)(14,"button",40),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.filterPreviewData(a.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",41)(17,"thead",42)(18,"tr"),e._UZ(19,"th",43),e.TgZ(20,"th",44),e._uU(21,"Number"),e.qZA(),e.YNc(22,Ft,2,1,"th",45),e.TgZ(23,"th",46),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",46),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",43),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,Vt,2,1,"ng-container",47),e.YNc(32,jt,6,0,"ng-template",null,48,e.W1O),e.qZA()()()()}if(2&i){const t=e.MAs(33),n=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==n.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",n.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==n.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",n.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==n.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",n.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==n.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",n.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",n.getTypeID()!=n.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",n.displayedPreviewData.length>0)("ngIfElse",t)}}function Kt(i,o){1&i&&e._uU(0,"Finish")}const Xt=function(i){return{"over-due":i}};function en(i,o){if(1&i&&(e.TgZ(0,"tr",52)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&i){const t=o.$implicit,n=o.index;e.Q6J("ngClass",e.VKq(5,Xt,t.Exception)),e.xp6(2),e.Oqu(n+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function tn(i,o){if(1&i&&(e.ynx(0),e.YNc(1,en,9,7,"tr",64),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function nn(i,o){1&i&&(e.TgZ(0,"tr",58)(1,"td",59)(2,"div",60),e._UZ(3,"i",61),e.qZA(),e.TgZ(4,"h4",62),e._uU(5,"There is no order to processed"),e.qZA()()())}function an(i,o){if(1&i&&(e.TgZ(0,"div",32)(1,"div",33)(2,"table",41)(3,"thead",42)(4,"tr"),e._UZ(5,"th",43),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,tn,2,1,"ng-container",47),e.YNc(14,nn,6,0,"ng-template",null,63,e.W1O),e.qZA()()()()),2&i){const t=e.MAs(15),n=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==n.downloadData?null:n.downloadData.length)>0)("ngIfElse",t)}}function on(i,o){1&i&&e._UZ(0,"i",65)}function rn(i,o){1&i&&e._UZ(0,"i",66)}function sn(i,o){1&i&&e._UZ(0,"i",67)}var b=(()=>{return(i=b||(b={})).ALL="all",i.SYNC="sync",i.WRONG="wrong",i.UNSYNC="unsync",b;var i})();let ln=(()=>{class i{constructor(t,n,a,r,m){this.http=t,this.toastr=n,this.datePipe=a,this.url=r,this.productService=m,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=g.x,this.previewStatus=b,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=M}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(t=>{this.channelID=t.ChannelID,this.startDate=new Date(t.Date),this.endDate=new Date(t.Date)})}initPageLoader(){this.productService.loader().subscribe(t=>{this.channelOptions=t.Options.Channel})}onDownload(t){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(a=>{this.downloadData=a.Body,this.onStepperNext(t)})}onPreview(t){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(a=>{0!=a.length?(this.previewData=a,this.groupingPreviewData(),this.filterPreviewData(b.ALL),this.initLengthStatusData(),this.onStepperNext(t)):this.toastrEmptyPreview()})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let t=!0;return f.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),t=!1),t}setPageTitle(t){const n=f.g.formatTitleForFromDate(new Date(this.startDate),new Date(this.endDate));this.pageTitle=`\n ${t} (${this.datePipe.transform(this.startDate,n)} - ${this.datePipe.transform(this.endDate,"dd MMM yyyy")})\n `}onNew(t){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",t.reset()}groupingPreviewData(){let t=this.filterDataByStatus(b.UNSYNC),n=this.filterDataByStatus(b.WRONG);this.downloadedPreviewData=[...t,...n]}filterDataByStatus(t){let n=[];switch(t){case b.ALL:n=this.previewData;break;case b.SYNC:n=this.previewData.filter(a=>a.Action==M.DoNothing);break;case b.WRONG:n=this.previewData.filter(a=>a.Action==M.Update);break;case b.UNSYNC:n=this.previewData.filter(a=>a.Action==M.New)}return n}filterPreviewData(t){this.pillStatus=t,this.displayedPreviewData=this.filterDataByStatus(t)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(b.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(b.SYNC).length,this.unsyncData=this.filterDataByStatus(b.UNSYNC).length}getTypeID(){var t=this.channelOptions.find(n=>n.ID==this.channelID)?.TypeID;return t??0}onStepperChange(t){this.currentState=t.selectedStep.state}onStepperNext(t){t.selected.completed=!0,t.next()}onNext(t){switch(this.currentState){case"filter":this.onPreview(t);break;case"preview":this.onDownload(t)}}stepChange(t){switch(t?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let n=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${n?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let t=!f.g.isValidDate(this.startDate)||!f.g.isValidDate(this.endDate),n=f.g.IsEmpty(this.channelID);return t||n}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(S.O),e.Y36(C._W),e.Y36(u.uU),e.Y36(v.gz),e.Y36(rt.M))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-download"]],features:[e._Bn([{provide:G,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"ngClass"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(t,n){if(1&t){const a=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,qt,2,0,"button",1),e.YNc(3,Ut,2,1,"button",2),e.YNc(4,Jt,3,0,"button",1),e.qZA(),e.TgZ(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"mat-stepper",7,8),e.NdJ("selectionChange",function(m){return n.stepChange(m)})("selectionChange",function(m){return n.onStepperChange(m)}),e.TgZ(12,"mat-step",9),e.YNc(13,Lt,1,0,"ng-template",10),e.TgZ(14,"div",11)(15,"div",5)(16,"div",4)(17,"div",12)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",13),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",12)(23,"ng-select",14),e.NdJ("ngModelChange",function(m){return n.channelID=m}),e.YNc(24,Et,3,3,"ng-option",15),e.qZA()()(),e.TgZ(25,"div",16)(26,"div",12)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",13),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",12)(32,"div",5)(33,"mat-date-range-input",17)(34,"input",18),e.NdJ("ngModelChange",function(m){return n.startDate=m})("click",function(){e.CHM(a);const m=e.MAs(37);return e.KtG(m.open())}),e.qZA(),e.TgZ(35,"input",19),e.NdJ("ngModelChange",function(m){return n.endDate=m})("click",function(){e.CHM(a);const m=e.MAs(37);return e.KtG(m.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,20),e.qZA()()()()()(),e.TgZ(38,"mat-step",21),e.YNc(39,Rt,1,0,"ng-template",10),e.YNc(40,Wt,34,11,"div",22),e.qZA(),e.TgZ(41,"mat-step",23),e.YNc(42,Kt,1,0,"ng-template",10),e.YNc(43,an,16,2,"div",22),e.qZA(),e.YNc(44,on,1,0,"ng-template",24),e.YNc(45,rn,1,0,"ng-template",25),e.YNc(46,sn,1,0,"ng-template",26),e.qZA()()()()()()()}if(2&t){const a=e.MAs(11),r=e.MAs(37);e.Q6J("headerTitle",n.pageTitle)("description",n.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==n.currentState),e.xp6(1),e.Q6J("ngIf","finish"!=n.currentState),e.xp6(1),e.Q6J("ngIf","finish"==n.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+a.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=n.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",n.channelID),e.xp6(1),e.Q6J("ngForOf",n.channelOptions),e.xp6(9),e.Q6J("rangePicker",r),e.xp6(1),e.Q6J("ngModel",n.startDate),e.xp6(1),e.Q6J("ngModel",n.endDate),e.xp6(3),e.Q6J("editable","finish"!=n.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==n.currentState),e.xp6(3),e.Q6J("ngIf","finish"==n.currentState)}},dependencies:[u.mk,u.sg,u.O5,s.Fj,s.JJ,s.On,l.p,p.w9,p.jq,A.wx,A.zY,A.By,A._g,pe,U,de,le,ce.gM,u.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{width:60%;left:18%;position:relative} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:center} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]}),i})();var Z=c(8063);const pn=[{path:"",component:L,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:he,canActivate:[Z.a],data:{title:"New Order"}},{path:"detail",component:fe,canActivate:[Z.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:De,canActivate:[Z.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:Ie,canActivate:[Z.a],data:{title:"Shipped"}},{path:"Delivered",component:Fe,canActivate:[Z.a],data:{title:"Delivered"}},{path:"All",component:Be,canActivate:[Z.a],data:{title:"All Order"}},{path:"Cancelled",component:Xe,canActivate:[Z.a],data:{title:"Cancelled"}},{path:"Download",component:ln,canActivate:[Z.a],data:{title:"Download"}}]}];let dn=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[u.ez,v.Bz.forChild(pn)]}),i})();var cn=c(8739);let un=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[u.ez]}),i})(),hn=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({providers:[k],imports:[u.ez,s.u5,dn,w.Z,l.R,cn.TU,v.Bz,p.A0,A.FA,y.XK,d.K,kt,ce.AV,un,$.p9,O.Is]}),i})()},6082:(ue,I,c)=>{c.d(I,{M:()=>S});var u=c(8505),v=c(9694),e=c(3154),w=c(4650),L=c(1318),f=c(7185);let S=(()=>{class C{constructor(s,l){this.httpService=s,this.toastrService=l}loader(s=e.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:s})}filterChannelByTypeId(s,l){return s.filter(p=>-1!==l.findIndex(d=>p.TypeID==d))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(s){return this.httpService.post("/api/product/TotalProductLive",{ID:s})}clearCacheChannel(s){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:s})}uploadToMultipleChannel(s,l){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:l,Products:s})}uploadMultipleProduct(s,l,p){return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:l,Products:s,CategoryID:p||0})}scanSingle(s,l){return this.httpService.post("/api/product/ScanSingle",{ID:s,SKU:l})}scanNotInChannel(s){return this.httpService.post("/api/product/ScanNotinChannel",{ID:s})}findAllSoldInChannel(s){return this.httpService.post("/api/product/GetSoldInChannel",s)}scanAll(s,l,p,d=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:s,ScanFull:l,UpdatedProduct:p,Async:d})}scanCompareToPos(s){return this.httpService.post("/api/product/CompareMarketplaceToPOS",s)}getVariantCodesProduct(s){return s.Variants.map(p=>p.Code)}downloadMultipleProduct(s){let l=s.map(p=>({ChannelItemID:p.ChannelItemID,ChannelID:p.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",l).pipe((0,u.b)(p=>{this.toastrService.success(`${p.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(s){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}).pipe((0,u.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(s=[]){let l=[];return s.forEach(p=>{p.Variants.forEach(d=>{l=[...l,d.Code]})}),l}filterUnselectedChannel(s,l){let p;return p=s.Channel&&0!=s.Channel.length?l.filter(d=>-1===s.Channel.findIndex(h=>h.ChannelID==d.ID)):l,p}findChannelById(s,l){return l.find(p=>p.ID==s)}sortChannel(s=[]){return s.sort((l,p)=>l.TypeID<p.TypeID?1:l.TypeID===p.TypeID?0:-1)}hasSelection(s=[]){return this.selectedProduct(s).length>0}selectedProduct(s=[]){return s.filter(l=>l.selected)}hasSelectionVariant(s){return this.selectedVariantProduct(s).length>0}selectedVariantProduct(s){let l=[];return s.forEach(p=>{l=[...l,...null!=p.Variants?p.Variants.filter(d=>d.selected):""]}),l}getChannelProduct(s){const l=s.Variants;let p=[];for(let d of l)if(null!=d.Channel)for(let h of d.Channel)0==p.filter(T=>T.ChannelID==h.ChannelID).length&&p.push(h);return this.sortChannel(p)}successToastrScanAllProduct(s,l,p){if(p){const d=s?.NotInPOS?.Product?s?.NotInPOS?.Product:0,h=s?.InChannel?.Product?s?.InChannel?.Product:0;this.toastrService.success(`\n ${d+h} found in ${l.Name} </br>\n (${h} In POS + ${d} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${s.InChannel?s.InChannel.Product:0} product updates in ${l.Name} </br> \n since ${s.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(s,l){let p,d;return s.map(h=>(h.Channel=this.getChannelProduct(h),p=this.filterUnselectedChannel(h,l),d=this.filterChannelByTypeId(p,[v.x.Tiktok,v.x.Tokopedia]),h.hasScan=d.length>0,h))}checkProductHasUploadBtn(s,l){let p;return s.map(d=>(d.Channel=this.getChannelProduct(d),p=this.filterUnselectedChannel(d,l),d.hasUpload=p.length>0,d))}showToastrSuccessUploadMultiple(s,l){let p=s.filter(T=>0==T.Status),d=s.filter(T=>1==T.Status),h=this.generateToastrMessage(p,d,l);this.toastrService.success(h.message,"Success",{enableHtml:!0})}showToastErrorUploadMultiple(s,l){let p=s?.error?.Message.filter(T=>0==T.Status),d=s?.error?.Message.filter(T=>1==T.Status),h=this.generateToastrMessage(p,d,l);"WARNING"==h.status?this.toastrService.warning(h.message,"Warning!",{enableHtml:!0}):this.toastrService.error(h.message,`Error - ${s.status}`,{enableHtml:!0})}generateToastrMessage(s,l,p){let h,d="";return 0==s.length&&l.length>0?(h="SUCCESS",d=this.createSuccessResponse(l,p)):s.length>0&&0==l.length?(h="ERROR",d=this.createErrResponse(s,p)):(h="WARNING",d=`${this.createSuccessResponse(l,p)} ${this.createErrResponse(s,p)}`),d=`<ol>${d}</ol>`,{status:h,message:d}}createErrResponse(s,l){let p="";return s.forEach((d,h)=>{p+=`<li><b>${d.Response}</b> for ${l.Name} in ${d.Name}</li>`}),p}createSuccessResponse(s,l){let p="";return s.forEach((d,h)=>{p+=`<li>Product ${l.Name} was <b>successfully</b> uploaded to ${d.Name}</li>`}),p}getHostName(){if(e.g.IsEmpty(this.hostName)){const s=localStorage.getItem("Authorization");this.hostName=JSON.parse(s)?.Host}return this.hostName}}return C.\u0275fac=function(s){return new(s||C)(w.LFG(L.O),w.LFG(f._W))},C.\u0275prov=w.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"}),C})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[516],{8231:(M,I,r)=>{r.d(I,{j:()=>O});var C=r(5412),g=r(3154),u=r(9694),f=r(6779),e=r(4650),T=r(6806),S=r(6895),p=r(4006),D=r(1948),t=r(9549),n=r(4385),a=r(3238),o=r(266),s=r(6401);function h(d,m){if(1&d&&(e.TgZ(0,"mat-option",9)(1,"div",10),e._UZ(2,"img",11),e.TgZ(3,"span"),e._uU(4),e.qZA()()()),2&d){const i=m.$implicit;e.Q6J("value",i.ID)("disabled",i.disabled),e.xp6(1),e.Q6J("matTooltip",i.disabled?"Single Product Scan disabled for this type of Channel":null),e.xp6(1),e.Q6J("src",i.Img,e.LSH),e.xp6(2),e.Oqu(i.Name)}}function P(d,m){if(1&d){const i=e.EpF();e.TgZ(0,"div")(1,"h5",3),e._uU(2,"Scan Type"),e.qZA(),e.TgZ(3,"mat-radio-group",12),e.NdJ("ngModelChange",function(c){e.CHM(i);const _=e.oxw();return e.KtG(_.filter.ScanFull=c)}),e.TgZ(4,"mat-radio-button",13),e._uU(5," Full (Include Inactive Products) "),e.qZA(),e.TgZ(6,"mat-radio-button",14),e._uU(7," Active "),e.qZA()()()}if(2&d){const i=e.oxw();e.xp6(3),e.Q6J("ngModel",i.filter.ScanFull),e.xp6(1),e.Q6J("value",!0),e.xp6(2),e.Q6J("value",!1)}}function v(d,m){if(1&d){const i=e.EpF();e.TgZ(0,"div",15)(1,"h5",3),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"mat-radio-group",16),e.NdJ("ngModelChange",function(c){e.CHM(i);const _=e.oxw();return e.KtG(_.filter.UpdatedProduct=c)}),e.TgZ(5,"mat-radio-button",17),e._uU(6," Scan All Products "),e.qZA(),e.TgZ(7,"mat-radio-button",18),e._uU(8," Scan Updated Products "),e.qZA()()()}if(2&d){const i=e.oxw();e.xp6(2),e.hij(" Last Scan: ",e.xi3(3,4,i.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),e.xp6(2),e.Q6J("ngModel",i.filter.UpdatedProduct),e.xp6(1),e.Q6J("value",!1),e.xp6(2),e.Q6J("value",!0)}}function E(d,m){if(1&d){const i=e.EpF();e.TgZ(0,"div",15)(1,"h5",3),e._uU(2," Scan Option "),e.qZA(),e.TgZ(3,"mat-radio-group",19),e.NdJ("ngModelChange",function(c){e.CHM(i);const _=e.oxw();return e.KtG(_.filter.Async=c)}),e.TgZ(4,"mat-radio-button",20),e._uU(5," Asynchronous (Get Notified when Complete) "),e.qZA(),e.TgZ(6,"mat-radio-button",21),e._uU(7," Synchronous (Wait until Complete) "),e.qZA()()()}if(2&d){const i=e.oxw();e.xp6(3),e.Q6J("ngModel",i.filter.Async),e.xp6(1),e.Q6J("value",!0),e.xp6(2),e.Q6J("value",!1)}}let O=(()=>{class d{constructor(i,l,c){this.dialogRef=i,this.data=l,this.router=c,this.channelType=u.x,this.disabledChannelOption=!1,this.filter={ChannelID:g.g.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=!!g.g.IsNotEmpty(l.isSingleChannel)&&this.data.isSingleChannel,this.disabledChannelOption=!g.g.IsEmpty(l.disabledChannelOption)&&this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new f.O,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1,1==this.channelOptions.length&&(this.filter.ChannelID=this.data.channelOptions[0].ID,this.selectedChannel=this.data.channelOptions[0])}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==u.x.Tiktok||i.TypeID==u.x.Tokopedia)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let l=this.filterChannelById(i);this.selectedChannel=l,this.filter.Async=!0,l&&l.TypeID==u.x.Tokopedia?(this.filter.ScanFull=!0,this.isTokopedia=!0):(this.filter.ScanFull=!1,this.isTokopedia=!1),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&g.g.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==u.x.ShopeeV2||this.selectedChannel.TypeID==u.x.Tiktok)&&(this.filter.UpdatedProduct=!0)}filterChannelById(i){let l;return this.channelOptions&&(l=this.channelOptions.find(c=>c.ID==i)),l}submit(){this.selectedChannel.TypeID==u.x.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(i){return g.g.IsNotEmpty(i)}onClose(){this.dialogRef.close()}}return d.\u0275fac=function(i){return new(i||d)(e.Y36(C.so),e.Y36(C.WI),e.Y36(T.F0))},d.\u0275cmp=e.Xpm({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-3","fw-normal"],["appearance","outline"],["name","channelid","placeholder","Channel",3,"disabled","ngModel","ngModelChange"],[3,"value","disabled",4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-8",4,"ngIf"],[3,"value","disabled"],["matTooltipClass","my-custom-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],["name","scanType",1,"form-control","h-100","pt-5","round",3,"ngModel","ngModelChange"],["data-toggle","tooltip","title","Full Scan Product",1,"me-5",3,"value"],["data-toggle","tooltip","title","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","pt-5","round",3,"ngModel","ngModelChange"],["data-toggle","tooltip","title","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["data-toggle","tooltip","title","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"],["name","Async",1,"form-control","h-100","pt-5","round",3,"ngModel","ngModelChange"],["data-toggle","tooltip","matTooltipClass","unset-max-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu",1,"me-5",3,"value"],["data-toggle","tooltip",1,"me-5",3,"value"]],template:function(i,l){1&i&&(e.TgZ(0,"modal-material",0),e.NdJ("onOk",function(){return l.submit()})("onClose",function(){return l.onClose()})("onCancel",function(){return l.onClose()}),e.TgZ(1,"div",1)(2,"div",2)(3,"h5",3),e._uU(4,"Select a Channel"),e.qZA(),e.TgZ(5,"mat-form-field",4)(6,"mat-select",5),e.NdJ("ngModelChange",function(_){return l.filter.ChannelID=_})("ngModelChange",function(_){return l.onSelectChannel(_)}),e.YNc(7,h,5,5,"mat-option",6),e.qZA()(),e.YNc(8,P,8,3,"div",7),e.YNc(9,v,9,7,"div",8),e.YNc(10,E,8,3,"div",8),e.qZA()()()),2&i&&(e.Q6J("dynamicValidated",l.isNotEmpty(l.filter.ChannelID))("config",l.modalConfig),e.xp6(6),e.Q6J("disabled",l.disabledChannelOption)("ngModel",l.filter.ChannelID),e.xp6(1),e.Q6J("ngForOf",l.channelOptions),e.xp6(1),e.Q6J("ngIf",!l.isSingleChannel&&!l.isTokopedia&&!l.isSingleChannel&&l.isNotEmpty(l.filter.ChannelID)),e.xp6(1),e.Q6J("ngIf",((null==l.selectedChannel?null:l.selectedChannel.TypeID)==l.channelType.ShopeeV2||(null==l.selectedChannel?null:l.selectedChannel.TypeID)==l.channelType.Tiktok||(null==l.selectedChannel?null:l.selectedChannel.TypeID)==l.channelType.Tokopedia)&&(null==l.selectedChannel?null:l.selectedChannel.LastSync)&&!l.isSingleChannel),e.xp6(1),e.Q6J("ngIf",!(null!=l.filter&&l.filter.UpdatedProduct)&&!l.isSingleChannel&&l.isNotEmpty(l.filter.ChannelID)))},dependencies:[S.sg,S.O5,p.JJ,p.On,D.VQ,D.U0,t.KE,n.gD,a.ey,o.gM,s.M,S.uU],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:60px}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]}),d})()},6082:(M,I,r)=>{r.d(I,{M:()=>S});var C=r(8505),g=r(9694),u=r(3154),f=r(4650),e=r(1318),T=r(7185);let S=(()=>{class p{constructor(t,n){this.httpService=t,this.toastrService=n}loader(t=u.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:t})}filterChannelByTypeId(t,n){return t.filter(a=>-1!==n.findIndex(o=>a.TypeID==o))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(t){return this.httpService.post("/api/product/TotalProductLive",{ID:t})}clearCacheChannel(t){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:t})}uploadToMultipleChannel(t,n){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:n,Products:t})}uploadMultipleProduct(t,n,a){return this.httpService.post("/api/product/UploadToMarketplace",{ChannelID:n,Products:t,CategoryID:a||0})}scanSingle(t,n){return this.httpService.post("/api/product/ScanSingle",{ID:t,SKU:n})}scanNotInChannel(t){return this.httpService.post("/api/product/ScanNotinChannel",{ID:t})}findAllSoldInChannel(t){return this.httpService.post("/api/product/GetSoldInChannel",t)}scanAll(t,n,a,o=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:t,ScanFull:n,UpdatedProduct:a,Async:o})}scanCompareToPos(t){return this.httpService.post("/api/product/CompareMarketplaceToPOS",t)}getVariantCodesProduct(t){return t.Variants.map(a=>a.Code)}downloadMultipleProduct(t){let n=t.map(a=>({ChannelItemID:a.ChannelItemID,ChannelID:a.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",n).pipe((0,C.b)(a=>{this.toastrService.success(`${a.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(t){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:t.ChannelItemID,ChannelID:t.ChannelID}).pipe((0,C.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(t=[]){let n=[];return t.forEach(a=>{a.Variants.forEach(o=>{n=[...n,o.Code]})}),n}filterUnselectedChannel(t,n){let a;return a=t.Channel&&0!=t.Channel.length?n.filter(o=>-1===t.Channel.findIndex(s=>s.ChannelID==o.ID)):n,a}findChannelById(t,n){return n.find(a=>a.ID==t)}sortChannel(t=[]){return t.sort((n,a)=>n.TypeID<a.TypeID?1:n.TypeID===a.TypeID?0:-1)}hasSelection(t=[]){return this.selectedProduct(t).length>0}selectedProduct(t=[]){return t.filter(n=>n.selected)}hasSelectionVariant(t){return this.selectedVariantProduct(t).length>0}selectedVariantProduct(t){let n=[];return t.forEach(a=>{n=[...n,...null!=a.Variants?a.Variants.filter(o=>o.selected):""]}),n}getChannelProduct(t){const n=t.Variants;let a=[];for(let o of n)if(null!=o.Channel)for(let s of o.Channel)0==a.filter(h=>h.ChannelID==s.ChannelID).length&&a.push(s);return this.sortChannel(a)}successToastrScanAllProduct(t,n,a){if(a){const o=t?.NotInPOS?.Product?t?.NotInPOS?.Product:0,s=t?.InChannel?.Product?t?.InChannel?.Product:0;this.toastrService.success(`\n ${o+s} found in ${n.Name} </br>\n (${s} In POS + ${o} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${t.InChannel?t.InChannel.Product:0} product updates in ${n.Name} </br> \n since ${t.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(t,n){let a,o;return t.map(s=>(s.Channel=this.getChannelProduct(s),a=this.filterUnselectedChannel(s,n),o=this.filterChannelByTypeId(a,[g.x.Tiktok,g.x.Tokopedia]),s.hasScan=o.length>0,s))}checkProductHasUploadBtn(t,n){let a;return t.map(o=>(o.Channel=this.getChannelProduct(o),a=this.filterUnselectedChannel(o,n),o.hasUpload=a.length>0,o))}showToastrSuccessUploadMultiple(t,n){let a=t.filter(h=>0==h.Status),o=t.filter(h=>1==h.Status),s=this.generateToastrMessage(a,o,n);this.toastrService.success(s.message,"Success",{enableHtml:!0})}showToastErrorUploadMultiple(t,n){let a=t?.error?.Message.filter(h=>0==h.Status),o=t?.error?.Message.filter(h=>1==h.Status),s=this.generateToastrMessage(a,o,n);"WARNING"==s.status?this.toastrService.warning(s.message,"Warning!",{enableHtml:!0}):this.toastrService.error(s.message,`Error - ${t.status}`,{enableHtml:!0})}generateToastrMessage(t,n,a){let s,o="";return 0==t.length&&n.length>0?(s="SUCCESS",o=this.createSuccessResponse(n,a)):t.length>0&&0==n.length?(s="ERROR",o=this.createErrResponse(t,a)):(s="WARNING",o=`${this.createSuccessResponse(n,a)} ${this.createErrResponse(t,a)}`),o=`<ol>${o}</ol>`,{status:s,message:o}}createErrResponse(t,n){let a="";return t.forEach((o,s)=>{a+=`<li><b>${o.Response}</b> for ${n.Name} in ${o.Name}</li>`}),a}createSuccessResponse(t,n){let a="";return t.forEach((o,s)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${o.Name}</li>`}),a}getHostName(){if(u.g.IsEmpty(this.hostName)){const t=localStorage.getItem("Authorization");this.hostName=JSON.parse(t)?.Host}return this.hostName}}return p.\u0275fac=function(t){return new(t||p)(f.LFG(e.O),f.LFG(T._W))},p.\u0275prov=f.Yz7({token:p,factory:p.\u0275fac,providedIn:"root"}),p})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[566],{8566:(Mn,k,s)=>{s.r(k),s.d(k,{StatusModule:()=>wn});var d=s(6895),t=s(4650),U=s(7398),v=s(6806);const q=function(){return["/menu/products/download/by-url"]};let B=(()=>{class o{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listed SKU",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"}]}ngOnInit(){}}return o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7)(10,"a",8),t._uU(11,"Download Product By Url"),t.qZA()()()()()(),t._UZ(12,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",e.productTabs),t.xp6(7),t.Q6J("routerLink",t.DdM(2,q)))},dependencies:[U.e,v.lC,v.yS]}),o})();var y=s(1290),m=s(8231),h=s(5412),c=s(3154),w=s(6779),D=s(3900),Y=s(9646),V=s(9568),x=s(1318);let A=(()=>{class o{constructor(n,e){this.LocalData=n,this.httpService=e}getCategoriesByTypeId(n){return this.LocalData.getCategoriesByChannelType(n).pipe((0,D.w)(e=>null!=e?(0,Y.of)(e):this._getCategoriesByTypeID(n)))}_getCategoriesByTypeID(n){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:n}).pipe((0,D.w)(i=>this.LocalData.saveCategoriesByChannelType(i,n)))}}return o.\u0275fac=function(n){return new(n||o)(t.LFG(V.T),t.LFG(x.O))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var J=s(5960),M=s(6401);function R(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"h5",5),t._uU(2,"Category"),t.qZA(),t.TgZ(3,"app-select-search",9),t.NdJ("onSelect",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onSelectCategory(i))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.Q6J("appearance","outline")("batchSize",30)("data",n.options)("bindLabel","Value")("bindValue","Key")("placeholder","Select Category")}}let Q=(()=>{class o{constructor(n,e,i,l){this.data=n,this.channelCategoriesService=e,this.http=i,this.dialogRef=l,this.item=n.item,this.selectItemMissingChannel=n.selectedItemMissingChannel,this.options=[],this.optionVisible=!1}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.title="Upload"}onSelectItem(n){this.selectedChannelID=n;let e=this.selectItemMissingChannel.find(i=>i.ID==n);!e||1!==e.TypeID&&7!==e.TypeID?this.optionVisible=!1:this.channelCategoriesService.getCategoriesByTypeId(e.TypeID).subscribe({next:i=>{this.options=i,this.optionVisible=!0},error:i=>{console.error(i)}})}isNotEmpty(n){return c.g.IsNotEmpty(n)}onSelectCategory(n){this.selectedCategoryID=n}onClose(){this.dialogRef.close()}onSave(){this.selectedChannelID&&(this.selectedCategoryID||!this.optionVisible)&&this.dialogRef.close({channelID:this.selectedChannelID,categoryID:this.selectedCategoryID})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(h.WI),t.Y36(A),t.Y36(x.O),t.Y36(h.so))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-uploadProductDialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"row"],[1,"col-12"],[1,"mb-3","fw-normal"],[3,"appearance","data","bindLabel","bindValue","placeholder","onSelect"],[1,"row","mt-3"],[4,"ngIf"],[3,"appearance","batchSize","data","bindLabel","bindValue","placeholder","onSelect"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return e.onSave()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),t.TgZ(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"h5",5),t._uU(6,"Channel :"),t.qZA(),t.TgZ(7,"app-select-search",6),t.NdJ("onSelect",function(l){return e.onSelectItem(l)}),t.qZA()()(),t.TgZ(8,"div",7)(9,"div",4),t.YNc(10,R,4,6,"ng-container",8),t.qZA()()()()()),2&n&&(t.Q6J("dynamicValidated",e.isNotEmpty(e.selectedChannelID))("config",e.modalConfig),t.xp6(7),t.Q6J("appearance","outline")("data",e.selectItemMissingChannel)("bindLabel","Name")("bindValue","ID")("placeholder","Choose "),t.xp6(3),t.Q6J("ngIf",e.optionVisible))},dependencies:[d.O5,J.h,M.M],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();var p=s(9694),_=(()=>{return(o=_||(_={})).Tokopedia="https://seller.tokopedia.com",o.Shoope="https://seller.shopee.co.id",o.Tiktok="https://seller-id.tiktok.com",o.WooCommerce="https://woocommerce.dealpos.app",o.Lazada="https://sellercenter.lazada.co.id",_;var o})(),C=s(266);function H(o,a){if(1&o&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",11),t._uU(3),t.qZA(),t.TgZ(4,"td",11),t._uU(5),t.qZA(),t.TgZ(6,"td",12)(7,"p",13),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&o){const n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function K(o,a){if(1&o&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function G(o,a){if(1&o&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&o){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}const $=function(o){return{"is-disabled":o}};function j(o,a){if(1&o&&(t.TgZ(0,"tr"),t.YNc(1,K,2,2,"td",14),t.YNc(2,G,2,2,"td",14),t.TgZ(3,"td",11)(4,"div",15)(5,"a",16),t._UZ(6,"img",17),t.qZA(),t.TgZ(7,"div",18),t._uU(8),t.qZA()()(),t.TgZ(9,"td",11),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",19),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",19)(16,"a",20),t._UZ(17,"i",21),t.TgZ(18,"span",22),t._uU(19,"Edit"),t.qZA()()()()),2&o){const n=a.$implicit,e=a.index,i=t.oxw(3);t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(3),t.Q6J("href",n.Url,t.LSH)("title",n.Title),t.xp6(1),t.Q6J("src",i.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>55?null==n?null:n.Name:""),t.xp6(1),t.hij(" ",n.Name," "),t.xp6(2),t.Oqu(t.lcZ(11,12,n.Price)),t.xp6(3),t.Oqu(t.lcZ(14,14,n.Inventory)),t.xp6(3),t.Q6J("href",i.getHyperlinkSellerCenter(n),t.LSH)("ngClass",t.VKq(16,$,n.TypeID==i.channelType.KalCare))("matTooltip",n.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function z(o,a){if(1&o&&t.YNc(0,j,20,18,"tr",8),2&o){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function W(o,a){if(1&o&&(t.ynx(0),t.YNc(1,H,9,2,"ng-container",9),t.YNc(2,z,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&o){const n=a.$implicit,e=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",e)}}let E=(()=>{class o{constructor(n,e){this.data=n,this.dialogRef=e,this.channelType=p.x,this.variants=n.variants,this.title=n.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(n){return c.g.getChannelLogoByTypeId(n)}getHyperlinkSellerCenter(n){let e="javascript:void(0)";switch(n.TypeID){case p.x.ShopeeV2:e=`${_.Shoope}/portal/product/${n.ChannelItemID}`;break;case p.x.Tiktok:e=`${_.Tiktok}/product/edit/${n.ChannelItemID}`;break;case p.x.Tokopedia:e=`${_.Tokopedia}/edit-product/${n.ChannelItemID}`;break;case p.x.WooCommerce:e=`${_.WooCommerce}/wp-admin/post.php?post=${n.ChannelItemID}&action=edit`;break;case p.x.Lazada:e=`${_.Lazada}/apps/product/publish?productId=${n.ChannelItemID}`}return e}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(h.WI),t.Y36(h.so))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return e.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),t._uU(6," VARIANT "),t.TgZ(7,"sup"),t._UZ(8,"i",5),t.qZA()(),t.TgZ(9,"th",4),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",4),t._uU(12," PRODUCT "),t.TgZ(13,"sup"),t._UZ(14,"i",6),t.qZA()(),t.TgZ(15,"th",4),t._uU(16,"PRICE"),t.qZA(),t.TgZ(17,"th",7),t._uU(18,"INVENTORY"),t.qZA(),t._UZ(19,"th",4),t.qZA()(),t.TgZ(20,"tbody"),t.YNc(21,W,4,2,"ng-container",8),t.qZA()()()()),2&n&&(t.Q6J("config",e.modalConfig),t.xp6(21),t.Q6J("ngForOf",e.variants))},dependencies:[d.mk,d.sg,d.O5,C.gM,M.M,d.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]}),o})();var g=s(9300),X=s(7579),tt=s(2722),P=s(6082),I=s(7185),u=s(4006);function nt(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"app-select-search",15),t.NdJ("onSelect",function(i){t.CHM(n);const l=t.oxw().index,r=t.oxw();return t.KtG(r.onSelectCategory(i,l))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("data",n.Categories)("batchSize",30)}}function et(o,a){if(1&o&&(t.TgZ(0,"div",16),t._UZ(1,"input",17),t.qZA()),2&o){const n=t.oxw().$implicit,e=t.oxw();t.xp6(1),t.Q6J("placeholder",e.getChannelCategory(n.TypeID))}}function ot(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td",8)(3,"input",9),t.NdJ("ngModelChange",function(i){const r=t.CHM(n).$implicit;return t.KtG(r.Selected=i)})("ngModelChange",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onSelectChannel())}),t.qZA()(),t.TgZ(4,"td")(5,"div",10),t._UZ(6,"img",11),t.TgZ(7,"span",12),t._uU(8),t.qZA()()(),t.TgZ(9,"td"),t.YNc(10,nt,2,2,"ng-container",13),t.YNc(11,et,2,1,"ng-template",null,14,t.W1O),t.qZA()(),t.BQk()}if(2&o){const n=a.$implicit,e=t.MAs(12);t.xp6(3),t.Q6J("ngModel",n.Selected),t.xp6(3),t.Q6J("src",n.Img,t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Q6J("ngIf",n.Categories.length>0)("ngIfElse",e)}}let L=(()=>{class o{constructor(n,e,i,l,r){this.data=n,this.channelService=e,this.productService=i,this.dialogRef=l,this.toastrService=r,this.channelOptions=[],this.uploadResponse=[],this.channelType=p.x,this.enableBtnOk=!1,this.destroy$=new X.x,this.uploadResponse=[],this.channels=this.data.channels,this.products=this.data.products}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e).pipe((0,tt.R)(this.destroy$)).subscribe(i=>{this.setCategoriesChannelOption(e,i)})})}setCategoriesChannelOption(n,e){this.channelOptions=this.channelOptions.map(i=>(i.TypeID==n&&(i.Categories=e),i))}initChannelOptions(){this.channelOptions=this.channels.map(n=>({Name:n.Name,Img:n.Img,ID:n.ID,Selected:!1,CategoryID:0,TypeID:n.TypeID,Categories:[]}))}filterChannelTypeId(){return this.data.channels.map(e=>e.TypeID).filter((e,i,l)=>l.indexOf(e)==i).filter(e=>e==p.x.Tokopedia)}onSelectCategory(n,e){this.channelOptions[e].CategoryID=n,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(n){this.channelOptions=this.channelOptions.map(e=>(e.Selected=n,e)),this.enableBtnOk=n}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(n=>n.Selected)}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const n=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.submitToServer(n)}validateSelectedCategory(){return-1==this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.x.Lazada||e.TypeID==p.x.Tokopedia).findIndex(e=>0==e.CategoryID)}submitToServer(n){this.productService.uploadToMultipleChannel(this.products,n).subscribe({next:e=>{this.dialogRef.close(e),this.productService.showToastrSuccessUploadMultiple(e,this.data.products[0])},error:e=>{this.dialogRef.close("ERROR"),this.productService.showToastErrorUploadMultiple(e,this.data.products[0])}})}getChannelCategory(n){let e;switch(n){case p.x.ShopeeV2:e="Perlengkapan Rumah Lainnya";break;case p.x.Tiktok:e="Perlengkapan Rumah - Dekorasi Rumah - Poster & Produck Cetak";break;case p.x.WooCommerce:e="New Product";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(h.WI),t.Y36(A),t.Y36(P.M),t.Y36(h.so),t.Y36(I._W))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-uploadMultiple-product"]],decls:13,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo",3,"src"],[1,"ms-3"],[4,"ngIf","ngIfElse"],["EMPTY",""],["appearance","outline","bindLabel","Value","bindValue","Key","placeholder","Select Category",3,"data","batchSize","onSelect"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return e.onSave()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),t.NdJ("change",function(l){return e.onSelectAllChannel(l.target.checked)}),t.qZA()(),t.TgZ(7,"th",5),t._uU(8," CHANNEL "),t.qZA(),t.TgZ(9,"th",6),t._uU(10,"CATEGORY"),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,ot,13,5,"ng-container",7),t.qZA()()()()),2&n&&(t.Q6J("dynamicValidated",e.enableBtnOk)("config",e.modalConfig),t.xp6(12),t.Q6J("ngForOf",e.channelOptions))},dependencies:[d.sg,d.O5,u.Wl,u.JJ,u.On,C.gM,J.h,M.M],styles:["input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}img.channel-logo[_ngcontent-%COMP%]{width:24px;height:24px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}"]}),o})();var S=s(7481),Z=s(1739);function it(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",19),t.NdJ("click",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.openBiggerPicture(i))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(1),t.Q6J("src",n.image,t.LSH)}}function at(o,a){1&o&&t._UZ(0,"img",20)}function lt(o,a){if(1&o&&(t.ynx(0),t.TgZ(1,"span",24)(2,"a",25),t._UZ(3,"i",26),t.qZA()(),t.BQk()),2&o){const n=t.oxw(2);t.xp6(2),t.Q6J("href",n.redirectUrl,t.LSH)}}function rt(o,a){if(1&o&&(t.TgZ(0,"div",21),t._UZ(1,"i",22),t.TgZ(2,"span"),t._uU(3),t.qZA(),t.YNc(4,lt,4,1,"ng-container",23),t.qZA()),2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.code),t.xp6(1),t.Q6J("ngIf","SKU not assigned"!==n.code&&n.showRedirectIcon)}}function ct(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",27),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onEventDesc())}),t._UZ(1,"i",28),t.TgZ(2,"span"),t._uU(3),t.qZA()()}if(2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.description)}}function st(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",29)(1,"input",30),t.NdJ("change",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onCheck(i.target.checked))}),t.qZA()()}}function dt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",31),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onDownload())}),t._UZ(1,"i",32),t._uU(2," Download "),t.qZA()}}function pt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",31),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onUpload())}),t._UZ(1,"i",33),t._uU(2," Upload "),t.qZA()}}function ut(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",34),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onScan())}),t._UZ(1,"i",35),t._uU(2," Scan "),t.qZA()}}const ht=function(o){return{"me-3":o}};function gt(o,a){if(1&o&&(t.ynx(0),t.TgZ(1,"a",37),t._UZ(2,"img",38),t.qZA(),t.BQk()),2&o){const n=a.$implicit,e=a.index,i=t.oxw(2);t.xp6(1),t.s9C("href",n.Url,t.LSH),t.xp6(1),t.Q6J("ngClass",t.VKq(4,ht,e!=i.channels.length-1))("src",i.getChannelLogo(n),t.LSH)("matTooltip",n.Title?n.Title:n.Name)}}function mt(o,a){if(1&o&&(t.ynx(0),t.YNc(1,gt,3,6,"ng-container",36),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.channels)}}const _t=function(o){return{"border-bottom pb-2":o}};function Ct(o,a){if(1&o&&(t.TgZ(0,"li")(1,"div",42)(2,"div",43)(3,"a",37),t._UZ(4,"img",44),t.TgZ(5,"span",45),t._uU(6),t.qZA()()()()()),2&o){const n=a.$implicit,e=a.index,i=t.oxw(2);t.xp6(2),t.Q6J("ngClass",t.VKq(4,_t,e!=i.channels.length-1)),t.xp6(1),t.Q6J("href",n.Url,t.LSH),t.xp6(1),t.Q6J("src",i.getChannelLogo(n),t.LSH),t.xp6(2),t.Oqu(n.Title)}}function ft(o,a){if(1&o&&(t.TgZ(0,"div",39)(1,"button",40),t._uU(2),t.qZA(),t.TgZ(3,"ul",41),t.YNc(4,Ct,7,6,"li",36),t.qZA()()),2&o){const n=t.oxw();t.xp6(2),t.hij(" ",n.channels.length," CHANNELS "),t.xp6(2),t.Q6J("ngForOf",n.channels)}}let N=(()=>{class o{constructor(n){this.biggerPictureService=n,this.uploadButton=!1,this.scanButton=!1,this.showCheckBox=!1,this.downloadButton=!1,this.hasZoom=!0,this.showRedirectIcon=!0,this.onUploadEvent=new t.vpe,this.onScanEvent=new t.vpe,this.checkBoxChange=new t.vpe,this.onDescEvent=new t.vpe,this.onDownloadEvent=new t.vpe}ngAfterContentInit(){this.initRedirectUrl()}initRedirectUrl(){let n=localStorage.getItem("Authorization"),e=JSON.parse(n)?.Host;this.redirectUrl=`https://${e}/menu/Products/Catalog/Products/Info?ID=${this.productId}`}onUpload(){this.onUploadEvent.emit()}onScan(){this.onScanEvent.emit()}onCheck(n){this.checkBoxChange.emit(n)}onEventDesc(){this.onDescEvent.emit()}onDownload(){this.onDownloadEvent.emit()}getChannelLogo(n){return c.g.getChannelLogoByTypeId(n.TypeID)}openBiggerPicture(n){this.biggerPictureService.openBiggerPicture(n,this.imageForZoom)}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.k))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-product-card"]],inputs:{productId:"productId",uploadButton:"uploadButton",scanButton:"scanButton",showCheckBox:"showCheckBox",downloadButton:"downloadButton",image:"image",title:"title",code:"code",description:"description",channels:"channels",check:"check",imageForZoom:"imageForZoom",hasZoom:"hasZoom",showRedirectIcon:"showRedirectIcon"},outputs:{onUploadEvent:"onUpload",onScanEvent:"onScan",checkBoxChange:"onCheckBoxChange",onDescEvent:"onDescEvent",onDownloadEvent:"onDownload"},decls:26,vars:11,consts:[[1,"card",2,"margin-bottom","0px"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-7","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle","cursor-pointer",3,"click"],["class","description cursor-pointer",4,"ngIf"],["class","description cursor-pointer",3,"click",4,"ngIf"],[1,"col-1","gx-0","d-flex","justify-content-center"],[1,"text-end"],["class","text-end gx-0",4,"ngIf"],[1,"card-footer","d-flex","justify-content-between","py-5","bg-footer","align-items-center",2,"border-top","0.1px solid rgb(220 220 220)"],["class","fs-6 btn btn-light btn-sm me-3",3,"click",4,"ngIf"],["class","fs-6 btn btn-light btn-sm",3,"click",4,"ngIf"],["DROPDOWN",""],["alt","",1,"rounded","imgUpload","float-left",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description","cursor-pointer"],[1,"fa","fa-barcode","me-2"],[4,"ngIf"],[1,"ms-2"],["target","_blank",2,"color","#0976b4",3,"href"],[1,"fas","fa-external-link-alt"],[1,"description","cursor-pointer",3,"click"],[1,"fa","fa-tag","me-2"],[1,"text-end","gx-0"],["type","checkbox",3,"change"],[1,"fs-6","btn","btn-light","btn-sm","me-3",3,"click"],["aria-hidden","true",1,"fa","fa-download"],["aria-hidden","true",1,"fa","fa-upload"],[1,"fs-6","btn","btn-light","btn-sm",3,"click"],[1,"fa","fa-spinner"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],["alt","",1,"img-logo",3,"ngClass","src","matTooltip"],[1,"dropdown"],["type","button","id","dropdownMenuButton1","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","fs-6","btn-sm","btn-light","dropdown-toggle"],[1,"dropdown-menu"],[1,"dropdown-item","py-2",2,"cursor","pointer"],[3,"ngClass"],[1,"img-logo",3,"src"],[1,"ms-4"]],template:function(n,e){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,it,2,1,"ng-container",6),t.YNc(7,at,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t.NdJ("click",function(){return e.onEventDesc()}),t._uU(11),t.qZA(),t.YNc(12,rt,5,2,"div",10),t.YNc(13,ct,4,1,"div",11),t.qZA(),t.TgZ(14,"div",12)(15,"div",13),t.YNc(16,st,2,0,"div",14),t.qZA()()()(),t.TgZ(17,"div",15)(18,"div"),t.YNc(19,dt,3,0,"button",16),t.YNc(20,pt,3,0,"button",16),t.YNc(21,ut,3,0,"button",17),t.qZA(),t.TgZ(22,"div"),t.YNc(23,mt,2,1,"ng-container",6),t.YNc(24,ft,5,2,"ng-template",null,18,t.W1O),t.qZA()()()),2&n){const i=t.MAs(8),l=t.MAs(25);t.xp6(6),t.Q6J("ngIf",e.image)("ngIfElse",i),t.xp6(5),t.hij(" ",e.title," "),t.xp6(1),t.Q6J("ngIf",e.code),t.xp6(1),t.Q6J("ngIf",e.description),t.xp6(3),t.Q6J("ngIf",e.showCheckBox),t.xp6(3),t.Q6J("ngIf",e.downloadButton),t.xp6(1),t.Q6J("ngIf",e.uploadButton),t.xp6(1),t.Q6J("ngIf",e.scanButton),t.xp6(2),t.Q6J("ngIf",e.channels.length<4)("ngIfElse",l)}},dependencies:[d.mk,d.sg,d.O5,C.gM],styles:[".img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:100%}.bg-footer[_ngcontent-%COMP%]{background-color:#ededed69}.description[_ngcontent-%COMP%]{font-weight:300;margin-left:2px}.productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down;cursor:pointer}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}"]}),o})();var O=s(6732);function xt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",10),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onOpenScanDialog())}),t._UZ(1,"i",11),t._uU(2," Scan Channel "),t.qZA()}}function bt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",12),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onScanMultipleProduct())}),t._UZ(1,"i",11),t._uU(2),t.qZA()}if(2&o){const n=t.oxw();let e;t.xp6(2),t.hij(" Scan Selected Product (",null==(e=n.productService.selectedProduct(n.products))?null:e.length,") ")}}function Pt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onUploadMultipleProductSingleChannel())}),t._UZ(1,"i",14),t._uU(2," Upload Bulk "),t.qZA()}}function St(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",15)(1,"app-product-card",16),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onUploadToMultipleChannel(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanSingleProduct(l))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onOpenDialogVariant(l))})("onCheckBoxChange",function(i){const r=t.CHM(n).$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&o){const n=a.$implicit,e=t.oxw();t.xp6(1),t.Q6J("productId",n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",e.productService.getChannelProduct(n))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<e.channelOptions.length)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}let vt=(()=>{class o{constructor(n,e,i,l){this.http=n,this.toastr=e,this.dialog=i,this.productService=l,this.searchFilter=new y.k,this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter.PageNumber=n.Filter.PageNumber,this.searchFilter.RowCount=n.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text}).subscribe(e=>{this.products=e.Data,this.rowCount=null==e.Total?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=c.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,g.h)(i=>c.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(n,e,!this.searchFilter.UpdatedProduct)}}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(n){this.dialog.open(E,{data:{title:this.products[n].Name,variants:this.products[n].Variants},width:"50%"})}onUploadMultipleProductSingleChannel(){this.dialog.open(Q,{width:"350px",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadMultipleProduct(n.channelID,n.categoryID)})}uploadMultipleProduct(n,e){const i=this.productService.selectedProduct(this.products);this.productService.uploadMultipleProduct(i,n,e).subscribe(l=>{this.getProducts();const r=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(i.length>1?"Successfully uploaded "+i.length+" Product to channel "+r?.Name:r?.Name+" Successfully Created","Success")})}onUploadToMultipleChannel(n){let e=this.productService.getChannelProduct(n);n.Channel=e;let i=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(L,{width:"700px",data:{title:`Upload - ${n.Name}`,channels:i,products:[n]}}).afterClosed().pipe((0,g.h)(l=>"CANCEL"!==l)).subscribe(l=>{this.getProducts()})}searchProduct(n){this.searchFilter.text=n,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=c.g.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[p.x.Tokopedia,p.x.Tiktok]);this.dialog.open(m.j,{data:{filter:n,channelOptions:e,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,g.h)(l=>c.g.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let r=this.productService.selectedProduct(this.products),f=this.productService.getVariantCodesProducts(r);this.scanSingleProduct(f)})}onScanSingleProduct(n){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=c.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,g.h)(i=>c.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;const l=this.productService.getVariantCodesProduct(n);this.scanSingleProduct(l)})}scanSingleProduct(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=c.g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=c.g.GuidEMpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(x.O),t.Y36(I._W),t.Y36(h.uw),t.Y36(P.M))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-in-pos"]],decls:12,vars:9,consts:[["hideSearchDropdown","true","hideSearchDropdown","false","description","All products which is already available in POS",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,xt,3,0,"button",1),t.YNc(3,bt,3,1,"button",2),t.YNc(4,Pt,3,0,"button",3),t.qZA(),t.TgZ(5,"content")(6,"div",4)(7,"div",5),t.YNc(8,St,2,10,"div",6),t.qZA(),t.TgZ(9,"div",7)(10,"div",8)(11,"app-custom-paginator",9),t.NdJ("next",function(){return e.onNextPage()})("previous",function(){return e.onPrevPage()}),t.qZA()()()()()()),2&n&&(t.Q6J("headerTitle","In POS ("+e.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(3),t.Q6J("filter",e.searchFilter)("totaldata",null==e.products?null:e.products.length)("paginationTotal",e.rowCount)("hasClicked",!0))},dependencies:[d.sg,d.O5,S.p,N,O.y],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]}),o})();var b=s(8796);function It(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onOpenScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function Tt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onScanSelectedProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&o){const n=t.oxw();t.xp6(2),t.hij(" Scan Selected Product (",n.productService.selectedProduct(n.products).length,") ")}}function yt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onUploadMultipleProductSingleChannel())}),t._UZ(1,"i",17),t._uU(2," Upload Bulk "),t.qZA()}}function wt(o,a){if(1&o&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&o){const n=a.item,e=t.oxw();t.xp6(1),t.Q6J("src",e.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function Mt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Item ID"),t.qZA(),t.TgZ(3,"input",20),t.NdJ("ngModelChange",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.searchFilter.Item_id=i)}),t.qZA()()}if(2&o){const n=t.oxw();t.xp6(3),t.Q6J("ngModel",n.searchFilter.Item_id)}}function Ot(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",21)(1,"app-product-card",22),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onUploadToMultipleChannel(l))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onOpenVariantDetail(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanSingleProduct(l))})("onCheckBoxChange",function(i){const r=t.CHM(n).$implicit;return t.KtG(r.selected=i)}),t.qZA()()}if(2&o){const n=a.$implicit,e=t.oxw();t.xp6(1),t.Q6J("productId",null==n?null:n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",e.productService.getChannelProduct(n))("code",e.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}function Zt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),t.NdJ("total",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.getRowCount())})("next",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onNextPage())})("previous",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onPreviousPage())}),t.qZA()()()}if(2&o){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}let Nt=(()=>{class o{constructor(n,e,i,l,r){this.http=n,this.dialog=e,this.toastr=i,this.productService=l,this.activateRouter=r,this.searchFilter=new y.k,this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=c.g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(n=>{this.initPageLoader(n.ID?n.ID:c.g.GuidEMpty)})}initPageLoader(n){this.productService.loader(n).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,e.Filter.ChannelID!=c.g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel({ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id}).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(n){this.dialog.open(E,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"50%"})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=c.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,g.h)(i=>c.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe((0,g.h)(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct),this.initPageLoader(c.g.GuidEMpty))})}onScanSingleProduct(n){n.Channel=this.productService.getChannelProduct(n);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(m.j,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,g.h)(i=>c.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;const l=this.productService.getVariantCodesProduct(n);this.scanSingleProduct(l)})}onUploadToMultipleChannel(n){let e=this.productService.getChannelProduct(n);n.Channel=e;let i=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(L,{width:"700px",data:{title:`Upload - ${n.Name}`,channels:i,products:[n]}}).afterClosed().pipe((0,g.h)(l=>"CANCEL"!==l)).subscribe({next:l=>{this.getProducts()}})}onScanSelectedProduct(){let n=this.productService.filterChannelByTypeId(this.channelOptions,[p.x.Tokopedia,p.x.Tiktok]);this.searchFilter.ChannelID=c.g.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(m.j,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"40%"}).afterClosed().pipe((0,g.h)(l=>c.g.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let r=this.productService.selectedProduct(this.products),f=this.productService.getVariantCodesProducts(r);this.scanSingleProduct(f)})}scanSingleProduct(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=c.g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=c.g.GuidEMpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=c.g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProductSingleChannel(){this.dialog.open(Q,{width:"40%",data:{item:null,selectedItemMissingChannel:this.channelOptions}}).afterClosed().subscribe(n=>{n&&this.uploadMultipleProduct(n.channelID,n.categoryID)})}uploadMultipleProduct(n,e){const i=this.productService.selectedProduct(this.products);this.productService.uploadMultipleProduct(i,n,e).subscribe(l=>{this.getProducts();const r=this.productService.findChannelById(n,this.channelOptions);this.toastr.success(i.length>1?"Successfully uploaded "+i.length+" Product to channel "+r?.Name:r?.Name+" Successfully Created","Success")})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text}).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(n){return c.g.getChannelLogoByTypeId(n)}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(x.O),t.Y36(h.uw),t.Y36(I._W),t.Y36(P.M),t.Y36(v.gz))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sold-in-channel"]],decls:19,vars:10,consts:[["headerTitle","Sold in Channel","description","SKU has been mapped between dealpos and marketplace",3,"onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["type","text","name","Item_id","id","Item_id",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,It,3,0,"button",1),t.YNc(3,Tt,3,1,"button",2),t.YNc(4,yt,3,0,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(l){return e.searchFilter.ListChannelID=l})("clear",function(){return e.onClearFilterChannel()}),t.YNc(12,wt,3,2,"ng-template",7),t.qZA()(),t.YNc(13,Mt,4,1,"div",8),t.qZA()()(),t.TgZ(14,"content")(15,"div",9)(16,"div",10),t.YNc(17,Ot,2,10,"div",11),t.qZA(),t.YNc(18,Zt,3,4,"div",12),t.qZA()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),t.xp6(2),t.Q6J("ngIf",null!=e.searchFilter.ListChannelID),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",null==e.products?null:e.products.length))},dependencies:[d.sg,d.O5,u.Fj,u.JJ,u.On,S.p,b.w9,b.ir,N,O.y],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]}),o})();var T=s(8063),Ft=s(8505),kt=s(4004),Ut=s(9425);function Dt(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",28),t.NdJ("click",function(i){t.CHM(n);const l=t.oxw(3).$implicit,r=t.oxw(3);return t.KtG(r.onZoomImage(i,null==l?null:l.ImageUrl))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==n?null:n.ImageUrl,t.LSH)}}function At(o,a){1&o&&t._UZ(0,"img",29)}function Jt(o,a){if(1&o&&(t.ynx(0),t.TgZ(1,"td",21)(2,"div",22),t.YNc(3,Dt,2,1,"ng-container",23),t.YNc(4,At,1,0,"ng-template",null,24,t.W1O),t.qZA()(),t.TgZ(6,"td",25)(7,"h4",26)(8,"span",27),t._uU(9),t.qZA()()(),t.BQk()),2&o){const n=t.MAs(5),e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==e?null:e.Variants.length),t.xp6(2),t.Q6J("ngIf",null==e?null:e.ImageUrl)("ngIfElse",n),t.xp6(3),t.Q6J("rowSpan",null==e?null:e.Variants.length),t.xp6(2),t.Q6J("matTooltip",(null==e||null==e.Name?null:e.Name.length)>50?null==e?null:e.Name:""),t.xp6(1),t.hij(" ",null==e?null:e.Name," ")}}function Qt(o,a){if(1&o&&(t.TgZ(0,"div")(1,"a",17),t._UZ(2,"img",30),t.qZA()()),2&o){const n=a.$implicit;t.xp6(1),t.Q6J("href",n.URL,t.LSH),t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Et(o,a){if(1&o&&(t.TgZ(0,"div"),t._UZ(1,"img",30),t.qZA()),2&o){const n=a.$implicit;t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Lt(o,a){if(1&o&&(t.TgZ(0,"tr"),t.YNc(1,Jt,10,6,"ng-container",13),t.TgZ(2,"td"),t._uU(3),t.qZA(),t.TgZ(4,"td")(5,"span"),t._uU(6),t.qZA(),t.TgZ(7,"span",16)(8,"a",17),t._UZ(9,"i",18),t.qZA()()(),t.TgZ(10,"td",19)(11,"div",20),t.YNc(12,Qt,3,3,"div",15),t.qZA()(),t.TgZ(13,"td",19)(14,"div",20),t.YNc(15,Et,2,2,"div",15),t.qZA()()()),2&o){const n=a.$implicit,e=a.index,i=t.oxw(4);t.xp6(1),t.Q6J("ngIf",0==e),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(3),t.hij(" ",n.Code," "),t.xp6(2),t.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==n?null:n.ID),t.LSH),t.xp6(4),t.Q6J("ngForOf",null==n?null:n.Available),t.xp6(3),t.Q6J("ngForOf",null==n?null:n.NotAvailable)}}function qt(o,a){if(1&o&&(t.ynx(0),t.YNc(1,Lt,16,6,"tr",15),t.BQk()),2&o){const n=a.$implicit;t.xp6(1),t.Q6J("ngForOf",n.Variants)}}function Bt(o,a){if(1&o&&(t.TgZ(0,"tbody"),t.YNc(1,qt,2,1,"ng-container",15),t.qZA()),2&o){const n=a.ngIf;t.xp6(1),t.Q6J("ngForOf",n)}}function Yt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"span",38),t.NdJ("click",function(){t.CHM(n);const i=t.oxw(3);return t.KtG(i.getRowCount())}),t.TgZ(1,"i",39),t._uU(2,"?"),t.qZA()()}}function Vt(o,a){if(1&o&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&o){const n=a.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==n?null:n.Count))}}function Rt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"a",40),t.NdJ("click",function(){t.CHM(n);const i=t.oxw(3);return t.KtG(i.onNextPage())}),t._UZ(1,"i",41),t._uU(2," Next"),t.qZA()}}function Ht(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"a",42),t.NdJ("click",function(){t.CHM(n);const i=t.oxw(3);return t.KtG(i.onLastPage())}),t._UZ(1,"i",43),t._uU(2," Last"),t.qZA()}}function Kt(o,a){if(1&o&&(t.TgZ(0,"div",31)(1,"div",32)(2,"div",33),t._uU(3),t.ALo(4,"number"),t.YNc(5,Yt,3,0,"span",34),t.YNc(6,Vt,3,3,"span",13),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",35),t.YNc(10,Rt,3,0,"a",36),t.YNc(11,Ht,3,0,"a",37),t.qZA()()),2&o){const n=a.ngIf,e=t.oxw(2);t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,null==n?null:n.length)," of "),t.xp6(2),t.Q6J("ngIf",e.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",!e.paginationService.hideCount&&t.lcZ(7,8,e.rowCount$)),t.xp6(2),t.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Gt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.searchProduct(i))}),t.TgZ(1,"actions")(2,"button",2),t.NdJ("click",function(){const l=t.CHM(n).ngIf,r=t.oxw();return t.KtG(r.openScanDialog(l))}),t._UZ(3,"i",3),t._uU(4," Scan Channel "),t.qZA()(),t.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),t._uU(13,"Product"),t.qZA(),t.TgZ(14,"th",10),t._uU(15,"Variant"),t.qZA(),t.TgZ(16,"th",10),t._uU(17,"SKU"),t.qZA(),t.TgZ(18,"th",11),t._uU(19,"Available In"),t.qZA(),t.TgZ(20,"th",12),t._uU(21,"Not Available In"),t.qZA()()(),t.YNc(22,Bt,2,1,"tbody",13),t.ALo(23,"async"),t.qZA()()(),t.YNc(24,Kt,12,10,"div",14),t.ALo(25,"async"),t.qZA()()()}if(2&o){const n=t.oxw();t.Q6J("hideSearchDropdown",!0),t.xp6(22),t.Q6J("ngIf",t.lcZ(23,3,n.data$)),t.xp6(2),t.Q6J("ngIf",t.lcZ(25,5,n.data$))}}let $t=(()=>{class o{constructor(n,e,i,l,r,f){this.http=n,this.dialog=e,this.toastr=i,this.productService=l,this.paginationService=r,this.biggerPictureService=f,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2"}ngOnInit(){this.initPageLoader(),this.iniData(),this.initHostName()}initHostName(){const n=localStorage.getItem("Authorization");this.hostName=JSON.parse(n)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,Ft.b)(n=>{this.filterSearch=n.Filter,this.paginationService.resetToFirstPage(n.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,kt.U)(n=>n.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e))))}assignLogoChannel(n){return n.map(e=>(e.Img=c.g.getChannelLogoByTypeId(e.TypeID),e))}searchProduct(n){this.filterSearch.text=n,this.paginationService.resetToFirstPage(this.filterSearch)}scanAllProduct(n){let e=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(i=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(i,e,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(n){let e=JSON.parse(JSON.stringify(this.filterSearch));e.ChannelID=c.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:e,channelOptions:n.Options.Channel},width:"40%"}).afterClosed().pipe((0,g.h)(l=>c.g.IsNotEmpty(l))).subscribe(l=>{this.filterSearch.ChannelID=l.ChannelID,this.filterSearch.ScanFull=l.ScanFull,this.filterSearch.UpdatedProduct=l.UpdatedProduct,this.filterSearch.Async=l.Async,this.scanAllProduct(n)})}getChannelLogoById(n){return c.g.getChannelLogoByTypeId(n)}uploadProductToSingleChannel(n,e,i,l){let r=this.productService.findChannelById(e,l.Options.Channel);this.productService.uploadMultipleProduct([n],e,i).subscribe(f=>{this.paginationService.resetToFirstPage(l.Filter),this.toastr.success("Successfully uploaded "+n.Name+" to "+r.Name,"Success")})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n.Count)}})}onZoomImage(n,e){this.biggerPictureService.openBiggerPicture(n,e)}ngOnDestroy(){this.paginationService.destroy()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(x.O),t.Y36(h.uw),t.Y36(I._W),t.Y36(P.M),t.Y36(Ut.b),t.Y36(Z.k))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngIf"],["class","d-flex justify-content-between mt-5",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],[2,"padding-right","0px"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){1&n&&(t.YNc(0,Gt,26,7,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,e.loader$))},dependencies:[d.sg,d.O5,S.p,C.gM,d.Ov,d.JJ],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]}),o})();function jt(o,a){if(1&o&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&o){const n=a.$implicit;t.xp6(2),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU)}}let zt=(()=>{class o{constructor(n,e){this.data=n,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new w.O,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(h.WI),t.Y36(h.so))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return e.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),t._uU(6,"Variant"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"SKU"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,jt,5,2,"tr",4),t.qZA()()()()),2&n&&(t.Q6J("config",e.modalConfig),t.xp6(10),t.Q6J("ngForOf",e.data.variants))},dependencies:[d.sg,M.M],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),o})();var F=s(1948);function Wt(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.openScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function Xt(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",15),t.NdJ("click",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",16),t._uU(3),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();let e;t.xp6(3),t.hij(" Download Product (",null==(e=n.productService.selectedProduct(n.products))?null:e.length,") ")}}function tn(o,a){if(1&o&&(t.TgZ(0,"span",17),t._UZ(1,"img",18),t.qZA(),t._uU(2)),2&o){const n=a.item,e=t.oxw();t.xp6(1),t.Q6J("src",e.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}const nn=function(o){return[o]},en=function(){return[]};function on(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",19)(1,"app-product-card",20),t.NdJ("onCheckBoxChange",function(i){const r=t.CHM(n).index,f=t.oxw();return t.KtG(f.onSelectProduct(i,r))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onShowVariantDetail(l))})("onDownload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onDownloadProduct(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanChannel(l))}),t.qZA()()}if(2&o){const n=a.$implicit;t.xp6(1),t.Q6J("showRedirectIcon",!1)("title",null==n?null:n.Name)("image",null==n?null:n.Image)("imageForZoom",null==n?null:n.Image)("code",null==n?null:n.SKU)("description",(null==n||null==n.Variant?null:n.Variant.length)>0?(null==n||null==n.Variant?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=n&&n.Channel?t.VKq(10,nn,null==n?null:n.Channel):t.DdM(12,en))("showCheckBox",!0)("scanButton",!0)}}function an(o,a){if(1&o){const n=t.EpF();t.TgZ(0,"div",21)(1,"div",22)(2,"app-custom-paginator",23),t.NdJ("total",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.getRowCount())})("next",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onNextPage())})("previous",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onPreviousPage())}),t.qZA()()()}if(2&o){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}let ln=(()=>{class o{constructor(n,e,i,l,r){this.http=n,this.dialog=e,this.productService=i,this.toastrService=l,this.activateRouter=r,this.searchFilter=new y.k,this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(n=>{this.initPageLoader(n.ID?n.ID:c.g.GuidEMpty)})}initPageLoader(n){this.productService.loader(n).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",{ChannelID:this.searchFilter.ChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,HaveSku:this.searchFilter.HaveSku}).subscribe(e=>{this.products=e.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(n=>(n.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(e=>e.ID==n.ChannelID))),n)).map(n=>(n.Channel.Url=n.Url,n))}setSkuProduct(){this.products=this.products.map(n=>(n.SKU=0==n?.Variant?.length?c.g.IsNotEmpty(n?.ChannelItemSKU)?n?.ChannelItemSKU:"SKU not assigned":n?.Variant[0]?.ChannelVariationSKU?n?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",n))}onSearch(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=c.g.GuidEMpty}onScanAll(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(c.g.GuidEMpty),this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=c.g.GuidEMpty})}openScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=c.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,g.h)(i=>c.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(n){let e;e="ALL"==n?this.products:this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(n,e){this.products[e].selected=n}onDownloadProduct(n){!confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel.Name} to POS?`)||this.productService.downloadProduct(n).subscribe({next:()=>{this.getProducts()}})}onScanChannel(n){let e=JSON.parse(JSON.stringify(n));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(c.g.GuidEMpty),this.toastrService.success(`product ${n.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${n.Name} is not existed in POS`,"Error")})}onShowVariantDetail(n){let e=this.products[n].Variant;e.length>0&&this.dialog.open(zt,{data:{title:this.products[n].Name,variants:e},width:"30%"})}getRowCount(){let n={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",n).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(n){return c.g.getChannelLogoByTypeId(n)}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(x.O),t.Y36(h.uw),t.Y36(P.M),t.Y36(I._W),t.Y36(v.gz))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-not-in-pos"]],decls:27,vars:11,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],["name","haveSKU",1,"form-control","h-100","pt-3","rounded",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.onSearch(l)}),t.TgZ(1,"actions"),t.YNc(2,Wt,3,0,"button",1),t.YNc(3,Xt,4,1,"ng-container",2),t.qZA(),t.TgZ(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Channel"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(l){return e.searchFilter.ChannelID=l})("clear",function(){return e.onClearChannelFilter()}),t.YNc(11,tn,3,2,"ng-template",6),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"SKU Assigned"),t.qZA(),t.TgZ(15,"mat-radio-group",7),t.NdJ("ngModelChange",function(l){return e.searchFilter.HaveSku=l}),t.TgZ(16,"mat-radio-button",8),t._uU(17," All "),t.qZA(),t.TgZ(18,"mat-radio-button",8),t._uU(19," Yes "),t.qZA(),t.TgZ(20,"mat-radio-button",8),t._uU(21," No "),t.qZA()()()()()(),t.TgZ(22,"content")(23,"div",9)(24,"div",10),t.YNc(25,on,2,13,"div",11),t.qZA(),t.YNc(26,an,3,4,"div",12),t.qZA()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngModel",e.searchFilter.HaveSku),t.xp6(1),t.Q6J("value",0),t.xp6(2),t.Q6J("value",1),t.xp6(2),t.Q6J("value",2),t.xp6(5),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0))},dependencies:[d.sg,d.O5,u.JJ,u.On,S.p,b.w9,b.ir,N,O.y,F.VQ,F.U0],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),o})();function rn(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",14),t.NdJ("click",function(i){t.CHM(n);const l=t.oxw();return t.KtG(l.onZoomImage(i))}),t.qZA(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(1),t.Q6J("src",n.image,t.LSH)}}function cn(o,a){1&o&&t._UZ(0,"img",15)}function sn(o,a){if(1&o&&(t.TgZ(0,"div",16),t._UZ(1,"i",17),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&o){const n=t.oxw();t.xp6(3),t.Oqu(n.code)}}const dn=function(o){return{"border-bottom":o}};function pn(o,a){if(1&o&&(t.ynx(0),t.TgZ(1,"div",28)(2,"div",29),t._uU(3),t.qZA(),t.TgZ(4,"div")(5,"a",30),t._UZ(6,"i",31),t.qZA()()(),t.BQk()),2&o){const n=a.$implicit,e=a.index,i=t.oxw().$implicit;t.xp6(1),t.Q6J("ngClass",t.VKq(3,dn,e!==(null==i?null:i.Map.length)-1)),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(2),t.Q6J("href",n.URL,t.LSH)}}const un=function(o){return{"border-bottom-0":o}};function hn(o,a){if(1&o&&(t.TgZ(0,"div",18)(1,"h2",19)(2,"button",20)(3,"div",21),t._UZ(4,"img",22),t.TgZ(5,"span",23),t._uU(6),t.qZA(),t.TgZ(7,"span",24)(8,"h4"),t._uU(9),t.qZA()()()()(),t.TgZ(10,"div",25)(11,"div",26),t.YNc(12,pn,7,5,"ng-container",27),t.qZA()()()),2&o){const n=a.$implicit,e=a.index,i=t.oxw();t.Q6J("ngClass",t.VKq(11,un,i.channels.length-1==e)),t.xp6(1),t.Q6J("id","heading"+e+i.code),t.xp6(1),t.uIk("data-bs-target","#collapse"+e+i.code)("aria-controls","#collapse"+e+i.code),t.xp6(2),t.Q6J("src",i.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>30?n.Name:""),t.xp6(1),t.Oqu(n.Name),t.xp6(3),t.hij("- ",n.Map.length," Listing"),t.xp6(1),t.Q6J("id","collapse"+e+i.code),t.uIk("aria-labelledby","heading"+e+i.code),t.xp6(2),t.Q6J("ngForOf",n.Map)}}let gn=(()=>{class o{constructor(n){this.biggerPictureService=n}getChannelLogo(n){return c.g.getChannelLogoByTypeId(n)}onZoomImage(n){this.biggerPictureService.openBiggerPicture(n,this.imageForZoom)}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(Z.k))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-duplicate-product-card"]],inputs:{image:"image",imageForZoom:"imageForZoom",title:"title",code:"code",channels:"channels"},decls:16,vars:5,consts:[[1,"card"],[1,"card-body","py-6"],[1,"row"],[1,"col-4"],[1,"productUpload_defaultSize","me-2","image-upload"],[1,"imgContainer"],[4,"ngIf","ngIfElse"],["elsePic",""],[1,"col-8","d-inline-block","justify-content-between","gx-0",2,"padding-left","0px"],[1,"itemTitle"],["class","description",4,"ngIf"],[1,"card-footer",2,"padding-left","0px","padding-right","0px"],["id","accordionParent",1,"accordion","accordion-flush"],["class","accordion-item border-start-0 border-end-0",3,"ngClass",4,"ngFor","ngForOf"],[1,"rounded","imgUpload","float-left","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_110/POS/Images/Icon/products_thumb.png",1,"rounded","float-left","imgUpload"],[1,"description"],[1,"fa","fa-barcode","me-2"],[1,"accordion-item","border-start-0","border-end-0",3,"ngClass"],[1,"accordion-header",3,"id"],["type","button","data-bs-toggle","collapse","aria-expanded","true",1,"accordion-button","collapsed",2,"height","40px"],[1,"d-flex","align-items-center","justify-content-start","w-100"],["alt","",1,"channel-logo",3,"src"],[1,"fs-4","ps-4","text-ellipsis",2,"max-width","13vw",3,"matTooltip"],[1,"ps-2"],["data-bs-parent","#accordionParent",1,"accordion-collapse","collapse",3,"id"],[1,"accordion-body",2,"padding-top","0px","padding-bottom","0px"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","align-items-center","py-4",3,"ngClass"],[1,"text-ellipsis"],["target","_blank",1,"text-secondary",3,"href"],[1,"fa","fa-external-link-alt"]],template:function(n,e){if(1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),t.YNc(6,rn,2,1,"ng-container",6),t.YNc(7,cn,1,0,"ng-template",null,7,t.W1O),t.qZA()()(),t.TgZ(9,"div",8)(10,"h4",9),t._uU(11),t.qZA(),t.YNc(12,sn,4,1,"div",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"div",12),t.YNc(15,hn,13,13,"div",13),t.qZA()()()),2&n){const i=t.MAs(8);t.xp6(6),t.Q6J("ngIf",e.image)("ngIfElse",i),t.xp6(5),t.hij(" ",e.title," "),t.xp6(1),t.Q6J("ngIf",e.code),t.xp6(3),t.Q6J("ngForOf",e.channels)}},dependencies:[d.mk,d.sg,d.O5,C.gM],styles:[".productUpload_defaultSize[_ngcontent-%COMP%]{max-width:100px!important;max-height:100px!important;width:auto!important;height:auto!important}.image-upload[_ngcontent-%COMP%]{position:relative}.imgContainer[_ngcontent-%COMP%]{width:100%;height:100px}.imgUpload[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:scale-down}.channel-logo[_ngcontent-%COMP%]{width:18px;height:18px}.accordion-button[_ngcontent-%COMP%]{background-color:#ededed69!important}.accordion-button[_ngcontent-%COMP%]:not(.collapsed){background-color:#ededed69!important;color:#333}.accordion-button[_ngcontent-%COMP%]:after{background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e\")}.accordion-button[_ngcontent-%COMP%]:focus{box-shadow:none!important}.card[_ngcontent-%COMP%]{margin-bottom:0!important}"]}),o})();function mn(o,a){if(1&o&&(t.TgZ(0,"span",9),t._UZ(1,"img",10),t.qZA(),t._uU(2)),2&o){const n=a.item,e=t.oxw();t.xp6(1),t.Q6J("src",e.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function _n(o,a){if(1&o&&(t.TgZ(0,"div",12),t._UZ(1,"app-duplicate-product-card",13),t.qZA()),2&o){const n=a.$implicit;t.xp6(1),t.Q6J("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("image",n.ThumbnailURL)("channels",n.Channel)}}function Cn(o,a){if(1&o&&(t.ynx(0),t.YNc(1,_n,2,5,"div",11),t.BQk()),2&o){const n=t.oxw();t.xp6(1),t.Q6J("ngForOf",n.products)}}function fn(o,a){1&o&&(t.TgZ(0,"div",14)(1,"div"),t._UZ(2,"i",15),t.qZA(),t.TgZ(3,"h4",16),t._uU(4,"No product found"),t.qZA(),t.TgZ(5,"h6",17),t._uU(6,"Once you have a duplicate product"),t.qZA(),t.TgZ(7,"h6",18),t._uU(8,"you`ll see them here"),t.qZA()())}function xn(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",19)(2,"div",20)(3,"app-custom-paginator",21),t.NdJ("next",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onNextPage())})("previous",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.onPrevPage())})("total",function(){t.CHM(n);const i=t.oxw();return t.KtG(i.getRowCount())}),t.qZA()()(),t.BQk()}if(2&o){const n=t.oxw();t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}let bn=(()=>{class o{constructor(n,e){this.httpService=n,this.productService=e,this.searchFilter=new y.k,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.channelOptions=n.Options.Channel,this.getProducts()})}getProducts(){this.httpService.post("/api/product/GetDuplicateInChannel",{ChannelID:this.searchFilter.ChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text}).subscribe(e=>{this.products=e.Data})}onSearch(n){this.searchFilter.text=n,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=c.g.GuidEMpty}getChannelLogo(n){return c.g.getChannelLogoByTypeId(n)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){this.httpService.post("/api/product/GetDuplicateInChannelRowCount",{text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID}).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(x.O),t.Y36(P.M))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-duplicate-sku"]],decls:15,vars:6,consts:[["headerTitle","Multiple Listed SKU","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],[4,"ngIf","ngIfElse"],["EMPTY",""],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"text-secondary","fw-normal","m-2"],[1,"text-secondary","fw-normal"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(n,e){if(1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.onSearch(l)}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Channel"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(l){return e.searchFilter.ChannelID=l})("clear",function(){return e.onClearFilter()}),t.YNc(7,mn,3,2,"ng-template",3),t.qZA()()()(),t.TgZ(8,"content")(9,"div",4)(10,"div",5),t.YNc(11,Cn,2,1,"ng-container",6),t.YNc(12,fn,9,0,"ng-template",null,7,t.W1O),t.qZA(),t.YNc(14,xn,4,4,"ng-container",8),t.qZA()()()),2&n){const i=t.MAs(13);t.xp6(6),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0)("ngIfElse",i),t.xp6(3),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0)}},dependencies:[d.sg,d.O5,u.JJ,u.On,S.p,b.w9,b.ir,O.y,gn]}),o})();var Pn=s(8739),Sn=s(2594);let vn=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[d.ez,u.u5,C.AV]}),o})();var In=s(7459);let Tn=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[d.ez,u.u5,C.AV]}),o})();const yn=[{component:B,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:vt,canActivate:[T.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Nt,canActivate:[T.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:$t,canActivate:[T.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:ln,canActivate:[T.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:bn,canActivate:[T.a],data:{title:"Duplicate Sku in Channel"}}]}];let wn=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[d.ez,u.u5,S.R,C.AV,b.A0,Pn.TU,Sn.K,vn,In.W,Tn,F.Fk,U.Z,v.Bz.forChild(yn)]}),o})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[717],{6717:(D,g,e)=>{e.r(g),e.d(g,{NotificationModule:()=>b});var c=e(6895),m=e(6806),h=e(3154),d=e(1290),C=e(7579),N=e(2722),r=e(4004),p=e(4782),t=e(4650),v=e(1318),T=e(8964),u=e(8796),l=e(4006),f=e(7481),Z=e(6732);function _(o,a){if(1&o&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.TgZ(3,"span"),t._uU(4,"s"),t.qZA(),t.BQk()),2&o){const n=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,n.DurationInSecond,"1.1-1")," ")}}function x(o,a){1&o&&t._uU(0," - ")}const y=function(o,a){return{"bg-gradient-danger":o,"bg-gradient-warning":a}};function A(o,a){if(1&o&&(t.ynx(0),t.TgZ(1,"tr",12)(2,"td"),t._UZ(3,"img",13),t.TgZ(4,"span"),t._uU(5),t.qZA()(),t.TgZ(6,"td")(7,"b"),t._uU(8),t.qZA(),t._UZ(9,"div",14),t.qZA(),t.TgZ(10,"td"),t.YNc(11,_,5,4,"ng-container",15),t.YNc(12,x,1,0,"ng-template",null,16,t.W1O),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.qZA(),t.TgZ(16,"td"),t._uU(17),t.ALo(18,"date"),t.qZA()(),t.BQk()),2&o){const n=a.$implicit,i=t.MAs(13);t.xp6(1),t.Q6J("ngClass",t.WLB(12,y,1==n.Status,0==n.Status)),t.xp6(2),t.s9C("src",n.Img,t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(3),t.Oqu(n.Label),t.xp6(1),t.Q6J("innerHTML",n.Message,t.oJD),t.xp6(2),t.Q6J("ngIf",n.DurationInSecond)("ngIfElse",i),t.xp6(4),t.Oqu(n.StatusLabel),t.xp6(2),t.Oqu(t.xi3(18,9,n.Created,"dd MMM yyyy HH:mm"))}}function I(o,a){if(1&o){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",4)(2,"div",17)(3,"app-custom-paginator",18),t.NdJ("total",function(){t.CHM(n);const s=t.oxw(2);return t.KtG(s.getRowCount())})("next",function(){t.CHM(n);const s=t.oxw(2);return t.KtG(s.onNextPage())})("previous",function(){t.CHM(n);const s=t.oxw(2);return t.KtG(s.onPreviousPage())}),t.ALo(4,"async"),t.ALo(5,"async"),t.qZA()()(),t.BQk()}if(2&o){const n=t.oxw().ngIf,i=t.oxw();t.xp6(3),t.Q6J("filter",i.filter)("totaldata",null==n?null:n.length)("paginationTotal",t.lcZ(4,4,i.rowCount$))("hasClicked",t.lcZ(5,6,i.rowCount$))}}function S(o,a){if(1&o&&(t.ynx(0),t.YNc(1,I,6,8,"ng-container",11),t.BQk()),2&o){const n=a.ngIf;t.xp6(1),t.Q6J("ngIf",n.length>0)}}const M=[{path:"",component:(()=>{class o{constructor(n,i){this.http=n,this.notificationService=i,this.filter=new d.k,this.destroy$=new C.x}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe((0,N.R)(this.destroy$)).subscribe(n=>{n.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(n=>{this.filter=n.Filter,this.filter.PageSize=this.filter.RowCount,this.channelOptions=n.Options.Channel,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){this.notifications$=this.http.post("/api/notification/Get",{ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber}).pipe((0,r.U)(i=>i.Data),(0,r.U)(i=>(i=this.setChannelLogoToNotifications(i),this.setTimeToSecond(i))),(0,p.d)(1))}setTimeToSecond(n){return n.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i))}setChannelLogoToNotifications(n){return n.map(i=>(i.Img=h.g.getChannelLogoByTypeId(i.TypeID),i))}onNextPage(){this.filter.PageNumber+=1,this.getNotifications()}onPreviousPage(){this.filter.PageNumber-=1,this.getNotifications()}getRowCount(){this.rowCount$=this.http.post("/api/notification/RowCount",{ChannelID:this.filter.ChannelID}).pipe((0,r.U)(i=>i.Count),(0,p.d)(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return o.\u0275fac=function(n){return new(n||o)(t.Y36(v.O),t.Y36(T.g))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-notification"]],decls:30,vars:9,consts:[["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"ngClass"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],["timeNotAvailable",""],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,i){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return i.onFilter()}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Channel"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(J){return i.filter.ChannelID=J}),t.qZA()()()(),t.TgZ(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"table",7)(13,"thead",8)(14,"tr",9)(15,"th"),t._uU(16,"Channel"),t.qZA(),t.TgZ(17,"th"),t._uU(18,"Process"),t.qZA(),t.TgZ(19,"th"),t._uU(20,"Duration"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Status"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Created"),t.qZA()()(),t.TgZ(25,"tbody"),t.YNc(26,A,19,15,"ng-container",10),t.ALo(27,"async"),t.qZA()()()()(),t.YNc(28,S,2,1,"ng-container",11),t.ALo(29,"async"),t.qZA()()()),2&n&&(t.xp6(6),t.Q6J("clearable",!0)("items",i.channelOptions)("ngModel",i.filter.ChannelID),t.xp6(20),t.Q6J("ngForOf",t.lcZ(27,5,i.notifications$)),t.xp6(2),t.Q6J("ngIf",t.lcZ(29,7,i.notifications$)))},dependencies:[c.mk,c.sg,c.O5,u.w9,l.JJ,l.On,f.p,Z.y,c.Ov,c.JJ,c.uU]}),o})()}];let L=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.ez,m.Bz.forChild(M)]}),o})();var U=e(7459);let b=(()=>{class o{}return o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[c.ez,L,u.A0,l.u5,f.R,U.W]}),o})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[913],{2913:(u,a,n)=>{n.r(a),n.d(a,{ProductModule:()=>s});var l=n(6895),i=n(4006),r=n(6806),e=n(4650);let g=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275cmp=e.Xpm({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(o,P){1&o&&e._UZ(0,"router-outlet")},dependencies:[r.lC],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]}),t})();var c=n(8063);const m=[{path:"",component:g,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>Promise.all([n.e(796),n.e(516),n.e(663),n.e(739),n.e(592),n.e(566)]).then(n.bind(n,8566)).then(t=>t.StatusModule),canActivate:[c.a]},{path:"download",loadChildren:()=>n.e(997).then(n.bind(n,1997)).then(t=>t.DownloadModule),canActivate:[c.a]}]}];let p=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[l.ez,r.Bz.forChild(m)]}),t})(),s=(()=>{class t{}return t.\u0275fac=function(o){return new(o||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[l.ez,i.u5,r.Bz,p]}),t})()}}]);