marketplacepos 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[609],{609:(W,R,g)=>{g.r(R),g.d(R,{OrdersModule:()=>nn});var h=g(6814),C=g(9790),L=g(7826),e=g(5879),M=g(6027);let H=(()=>{var i;class r{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[L.G.downloadOrder]}]}ngOnInit(){}}return(i=r).\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],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)("usePermissions",!0))},dependencies:[M.e,C.lC]}),r})();var m=g(5802),J=g(7081),A=g(9397),b=g(7398),f=g(754),s=g(1449),c=g(5149),d=g(7700),p=g(6223),u=g(5986);let T=(()=>{var i;class r{constructor(t){this.dialogRef=t,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(d.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(l){return n.tandaiSudahDicetak=l}),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:[p.JJ,p.On,u.oG,d.uh,d.xY,d.H8]}),r})();var k=g(2181),$=g(4664),w=g(9659),Y=g(9229);let X=(()=>{var i;class r{constructor(){}convertToCSV(t,n){let o;if("string"==typeof t)o=t;else{var l="object"==typeof t?t:JSON.parse(t);o=this.transformToCSVStringFormat(l)}this.downloadCSV(o,n)}transformToCSVStringFormat(t){if(!t||!t.length)return;const o=Object.keys(t[0]);return t.map(_=>o.map(v=>{let y=null==_[v]?"":_[v];return y=y instanceof Date?y.toLocaleString():y.toString().replace(/"/g,'""'),y.search(/("|,|\n)/g)>=0&&(y=`"${y}"`),y}).join(",")).join("\n")}downloadCSV(t,n){var o=new Blob([t],{type:"text/csv;charset=utf8;"}),l=document.createElement("a");l.setAttribute("href",window.URL.createObjectURL(o)),l.setAttribute("download",n),document.body.appendChild(l),l.click(),document.body.removeChild(l)}}return(i=r).\u0275fac=function(t){return new(t||i)},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),r})(),B=(()=>{var i;class r{constructor(t,n,o,l){this.http=t,this.dialog=n,this.toastr=o,this.exportService=l}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(t){return this.http.post("/api/orders/GetNewOrder",t).pipe((0,b.U)(n=>n.Data))}getTotalNewOrders(t,n,o){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:t,From:n,To:o}).pipe((0,b.U)(_=>_.Count))}printShippingLabelTokopedia(t){const n={OrderNumber:t,Printed:!0};this.dialog.open(T).afterClosed().pipe((0,k.h)(o=>void 0!==o),(0,$.w)(o=>(n.Printed=o,this.http.post("api/v1/Shippinglabel/Tokopedia",n)))).subscribe(o=>{const l=window.open("about:blank","_blank");l.document.write(o),l.document.close()})}printShippingLabelTiktok(t,n){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:n,OrderNumber:t}).subscribe(l=>{null!=l.data?window.open(l.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}).subscribe(l=>{var _=Uint8Array.from(atob(l),y=>y.charCodeAt(0)),v=new Blob([_],{type:"octet/stream"});m.g.openDownloadFile(v,`${t}.pdf`)})}printShippingLabelLazada(t,n){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:n,OrderNumber:t}).subscribe(l=>{null!=l.result.data?window.open(l.result.data.pdf_url,"_blank"):this.toastr.error(l.message,"Cannot Print")})}exportOrders(t,n){return this.http.post("api/Orders/ExportOrder",t).pipe((0,A.b)(o=>{this.exportService.convertToCSV(o,n)}))}}return(i=r).\u0275fac=function(t){return new(t||i)(e.LFG(w.O),e.LFG(d.uw),e.LFG(Y._W),e.LFG(X))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),r})(),z=(()=>{var i;class r{constructor(t,n){this.http=t,this.toastr=n}acceptTokopediaOrders(t){return this.http.post("/api/Orders/AcceptOrderTokopedia",t).pipe((0,A.b)(n=>{this.tokopediaAcceptOrderHandler(n)}))}tokopediaAcceptOrderHandler(t){const n=t.filter(l=>0==l.Status),o=t.filter(l=>1==l.Status);if(0==n.length&&o.length>0){let l=`<ol>${this.generateSuccessMessage(o)}</ol>`;this.toastr.success(l,"Success",{enableHtml:!0})}else if(n.length>0&&o.length>0){let l=`<ol>\n ${this.generateSuccessMessage(o)}\n ${this.generateErrorMessage(n)}\n </ol>`;this.toastr.warning(l,"Warning",{enableHtml:!0})}else{let l=`<ol>${this.generateErrorMessage(n)}</ol>`;this.toastr.error(l,"Error",{enableHtml:!0})}}generateSuccessMessage(t){let n="";return t.forEach(o=>{n+=`<li><b>${o.OrderNumber}</b> was successfully Accept</li>`}),n}generateErrorMessage(t){let n="";return t.forEach(o=>{n+=`<li><b>${o.OrderNumber}</b> ${o.Message}</li>`}),n}}return(i=r).\u0275fac=function(t){return new(t||i)(e.LFG(w.O),e.LFG(Y._W))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac}),r})(),K=(()=>{var i;class r{constructor(t){this.http=t}getTokopediaShippingLabel(t){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:t}).pipe((0,b.U)(n=>n.map(o=>(o.ChannelType=f.x.Tokopedia,o))))}getShopeeShippingLabel(t){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:t}).pipe((0,b.U)(n=>n.map(o=>(o.ChannelType=f.x.ShopeeV2,o))))}getLazadaShippingLabel(t){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:t}).pipe((0,b.U)(n=>n.map(o=>(o.ChannelType=f.x.Lazada,o))))}}return(i=r).\u0275fac=function(t){return new(t||i)(e.LFG(w.O))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),r})();var N=g(4387),Z=g(4807),P=g(6930);let q=(()=>{var i;class r{set typeId(t){this.channelLogo=m.g.getChannelLogoByTypeId(t),this.initChannelName(t)}constructor(){}initChannelName(t){switch(t){case f.x.Tokopedia:this.channelName="Tokopedia";break;case f.x.Tiktok:this.channelName="Tiktok";break;case f.x.WooCommerce:this.channelName="WooCommerce";break;case f.x.ShopeeV2:this.channelName="Shopee";break;case f.x.Lazada:this.channelName="Lazada";break;case f.x.KalCare:this.channelName="Kalcare"}}}return(i=r).\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-3","fw-normal"]],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))}}),r})();var U=g(5439),S=g(3566),I=g(4126);function ee(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"button",13),e.NdJ("click",function(){e.CHM(a);const n=e.oxw().ngIf,o=e.oxw();return e.KtG(o.onAcceptOrder(n))}),e._UZ(2,"i",14),e._uU(3," Accept "),e.qZA(),e.BQk()}}function te(i,r){if(1&i&&(e.ynx(0),e.YNc(1,ee,4,0,"ng-container",1),e.BQk()),2&i){const a=e.oxw();e.xp6(1),e.Q6J("ngIf",a.isTokopediaAvailable&&a.isTokopediaSelected)}}function ne(i,r){if(1&i&&(e.TgZ(0,"span",15),e._UZ(1,"img",16),e.qZA(),e._uU(2)),2&i){const a=r.item;e.xp6(1),e.Q6J("src",a.img,e.LSH),e.xp6(1),e.hij(" ",a.Name," ")}}function ie(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"th",28)(2,"input",29),e.NdJ("ngModelChange",function(n){e.CHM(a);const o=e.oxw(3);return e.KtG(o.isCheckAll=n)})("ngModelChange",function(){e.CHM(a);const n=e.oxw(2).ngIf,o=e.oxw();return e.KtG(o.onSelectAllOrderData(n))}),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw(3);e.xp6(2),e.Q6J("ngModel",a.isCheckAll)}}function ae(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"input",29),e.NdJ("ngModelChange",function(n){e.CHM(a);const o=e.oxw(2).$implicit;return e.KtG(o.selected=n)})("ngModelChange",function(){e.CHM(a);const n=e.oxw(4).ngIf,o=e.oxw();return e.KtG(o.onSelectOrderData(n))}),e.qZA(),e.BQk()}if(2&i){const a=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",a.selected)}}function oe(i,r){if(1&i&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,ae,2,1,"ng-container",1),e.qZA(),e.BQk()),2&i){const a=e.oxw().$implicit,t=e.oxw(3);e.xp6(2),e.Q6J("ngIf",a.Type==t.tokopediaType)}}function re(i,r){if(1&i&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&i){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.Number)}}function le(i,r){if(1&i&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(3);e.Q6J("href",t.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+a.ID,e.LSH),e.xp6(1),e.Oqu(a.Number)}}function se(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,oe,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,re,3,1,"ng-container",17),e.YNc(6,le,2,2,"ng-template",null,30,e.W1O),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td"),e._UZ(14,"app-channel-logo",31),e.qZA()()),2&i){const a=r.$implicit,t=e.MAs(7),n=e.oxw(3);e.xp6(1),e.Q6J("ngIf",n.isTokopediaAvailable),e.xp6(2),e.Oqu(a.Outlet),e.xp6(2),e.Q6J("ngIf",a.ID==n.guidEmpty)("ngIfElse",t),e.xp6(4),e.Oqu(a.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,a.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",a.Type)}}function pe(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",18)(2,"table",19),e.NdJ("matSortChange",function(n){e.CHM(a);const o=e.oxw(2);return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",20)(4,"tr",21),e.YNc(5,ie,3,1,"ng-container",1),e.TgZ(6,"th",22),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",23),e._uU(9,"Order number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Customer"),e.qZA(),e.TgZ(12,"th",24),e._uU(13,"Created On"),e.qZA(),e.TgZ(14,"th",25),e._uU(15,"Channel"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,se,15,10,"tr",26),e.qZA()(),e.TgZ(18,"app-mat-paginator-no-count",27),e.NdJ("total",function(){e.CHM(a);const n=e.oxw(2);return e.KtG(n.getPaginatonTotal())})("next",function(){e.CHM(a);const n=e.oxw(2);return e.KtG(n.onNextPage())})("previous",function(){e.CHM(a);const n=e.oxw(2);return e.KtG(n.onPreviousPage())}),e.ALo(19,"async"),e.ALo(20,"async"),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw().ngIf,t=e.oxw();let n;e.xp6(5),e.Q6J("ngIf",t.isTokopediaAvailable&&a),e.xp6(12),e.Q6J("ngForOf",a),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",null==(n=e.lcZ(19,5,t.newOrdersData$))?null:n.length)("paginationTotal",e.lcZ(20,7,t.paginationTotal$))}}function ce(i,r){if(1&i&&(e.ynx(0),e.YNc(1,pe,21,9,"ng-container",17),e.BQk()),2&i){const a=r.ngIf;e.oxw();const t=e.MAs(31);e.xp6(1),e.Q6J("ngIf",(null==a?null:a.length)>0)("ngIfElse",t)}}function de(i,r){1&i&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}let ge=(()=>{var i;class r{constructor(t,n,o,l,_,v){this.localDataService=t,this.channelService=n,this.orderService=o,this.toastr=l,this.acceptOrderService=_,this.shippingLabelService=v,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=m.g.GuidEMpty,this.tokopediaType=f.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.sourceObs$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).pipe((0,J.d)()),this.newOrdersData$=this.sourceObs$.pipe((0,A.b)(n=>{n.filter(l=>l.Type==f.x.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe((0,J.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(t){this.isTokopediaSelected=!1,t.filter(o=>o.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(t){t=t.map(n=>(n.Type==f.x.Tokopedia&&(n.selected=this.isCheckAll),n)),this.onSelectOrderData(t)}onAcceptOrder(t){let n=this.getSelectedTokopediaOrders(t);this.acceptOrderService.acceptTokopediaOrders(n).subscribe(o=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(t){return t.filter(o=>o.selected).map(o=>o.Number)}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.newOrdersData$=this.newOrdersData$.pipe((0,b.U)(o=>o.sort((l,_)=>m.g.compare(l.Created,_.Created,n))))}}else this.newOrdersData$=this.sourceObs$}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(s.T),e.Y36(c.T),e.Y36(B),e.Y36(Y._W),e.Y36(z),e.Y36(K))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-new-order"]],decls:32,vars:15,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return n.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,te,2,1,"ng-container",1),e.ALo(3,"async"),e.qZA(),e.TgZ(4,"filters")(5,"div",2)(6,"div")(7,"h6"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"ng-select",3),e.NdJ("ngModelChange",function(l){return n.filter.ListChannelID=l}),e.YNc(10,ne,3,2,"ng-template",4),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Number"),e.qZA(),e.TgZ(14,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"Page Size"),e.qZA(),e.TgZ(18,"input",6),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(19,"div")(20,"h6"),e._uU(21,"From/To"),e.qZA(),e.TgZ(22,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(23,"datepicker",8),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),e.YNc(28,ce,2,2,"ng-container",1),e.ALo(29,"async"),e.YNc(30,de,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t&&(e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,11,n.newOrdersData$)),e.xp6(7),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",e.lcZ(29,13,n.newOrdersData$)))},dependencies:[h.sg,h.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,N.p,Z.w9,Z.ir,P.n,q,U.s,S.YE,S.nU,I.Q,h.Ov,h.uU]}),r})();function he(i,r){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 a=r.$implicit;e.xp6(2),e.Oqu(a.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,a.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,a.Price))}}function ue(i,r){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,he,9,7,"tr",16),e.qZA()()()()()),2&i){const a=e.oxw();e.xp6(10),e.hij(" ",a.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,a.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",a.model.Delivery," "),e.xp6(5),e.hij(" ",a.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,a.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",a.model.Customer.Name," "),e.xp6(5),e.hij(" ",a.model.Customer.Email," "),e.xp6(5),e.hij(" ",a.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",a.model.Variants)}}const _e=function(){return["/menu/Order"]};let me=(()=>{var i;class r{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=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36(C.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,ue,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:[h.sg,h.O5,N.p,C.rH,h.JJ,h.uU]}),r})();var fe=g(9315),D=function(i){return i.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",i.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",i.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",i.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",i.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",i.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",i.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",i.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",i}(D||{}),G=function(i){return i.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",i.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",i.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",i}(G||{});function Te(i,r){if(1&i&&(e.ynx(0),e.TgZ(1,"div",34)(2,"div",14)(3,"div",35),e._uU(4),e.qZA()(),e.TgZ(5,"div",14)(6,"div",35),e._uU(7),e.qZA()()(),e.BQk()),2&i){const a=e.oxw();e.xp6(4),e.hij(" ",null==a.recipient?null:a.recipient.City," "),e.xp6(3),e.hij(" ",null==a.recipient?null:a.recipient.District," ")}}function Ce(i,r){if(1&i&&(e.ynx(0),e.TgZ(1,"div")(2,"span",16),e._uU(3,"Berat: "),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA()(),e.BQk()),2&i){const a=e.oxw();e.xp6(5),e.hij("",null==a.shippingLabel?null:a.shippingLabel.Weight," gr")}}function Ze(i,r){if(1&i&&(e.ynx(0),e.TgZ(1,"div",18)(2,"span",16),e._uU(3,"Batas Kirim:"),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.ALo(6,"date"),e.qZA()(),e.BQk()),2&i){const a=e.oxw();e.xp6(5),e.Oqu(e.xi3(6,1,null==a.logistic?null:a.logistic.Batas_kirim,"dd-MM-yyy"))}}function be(i,r){if(1&i&&(e.ynx(0),e.TgZ(1,"div",18)(2,"span",16),e._uU(3,"No.Pesanan:"),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA()(),e.BQk()),2&i){const a=e.oxw();e.xp6(5),e.Oqu(null==a.shippingLabel?null:a.shippingLabel.OrderNumber)}}function Se(i,r){if(1&i&&(e.TgZ(0,"tr")(1,"td",36),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.ALo(9,"number"),e.qZA()()),2&i){const a=r.$implicit,t=r.index;e.xp6(2),e.Oqu(t+1),e.xp6(2),e.Oqu(a.Product_Name),e.xp6(2),e.Oqu(a.SKU),e.xp6(2),e.Oqu(e.lcZ(9,4,a.Quantity))}}let j=(()=>{var i;class r{constructor(){this.minDate=m.g.MinDate}ngOnChanges(t){t.shippingLabel&&t.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case f.x.Tokopedia:this.marketplaceLogo=G.TOKOPEDIA;break;case f.x.ShopeeV2:this.marketplaceLogo=G.SHOPEE;break;case f.x.Lazada:this.marketplaceLogo=G.LAZADA}}getShippingLogo(){let t=this.shippingLabel.Logistic.Logistic_Name;t=t?.toLowerCase(),t.includes("anteraja")?this.shippingLogo=D.ANTERAJA:t.includes("grabexpress")?this.shippingLogo=D.GRAB:t.includes("jne")?this.shippingLogo=D.JNE:t.includes("gosend")?this.shippingLogo=D.GOSEND:t.includes("j&t")?this.shippingLogo=D.JNT:t.includes("sicepat")?this.shippingLogo=D.SICEPAT:t.includes("spx")?this.shippingLogo=D.SPX:t.includes("lex")&&(this.shippingLogo=D.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){m.g.IsNotEmpty(this.logistic?.Resi_Number)&&JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:4}),m.g.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:2})}}return(i=r).\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},standalone:!0,features:[e.TTD,e.jDz],decls:87,vars:19,consts:[[1,"label-container"],[2,"border","1px solid","padding","14px"],[1,"row","mb-4"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","115px",3,"src"],[1,"mb-4"],[1,"row"],[1,"text-center","fw-bold","border","p-2","fs-2","border-dark"],[1,"me-2"],[1,"row","my-2"],[1,"col-12","text-center"],[2,"height","100px",3,"id"],[1,"mb-6"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","me-2"],[1,"fw-bold"],[1,"mt-4"],[1,"mb-0"],[4,"ngIf"],[1,"row","px-6","mt-4"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row","mt-4"],[1,"col-5","pt-6"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"table"],[2,"width","10px"],[2,"width","150px"],[2,"width","100px"],[4,"ngFor","ngForOf"],[1,"row","mt-6"],[1,"text-center","fw-bold","border","p-2","fs-4","border-dark","text-uppercase"],[1,"text-end"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),e._UZ(6,"img",5),e.qZA(),e.TgZ(7,"div")(8,"h1"),e._uU(9),e.qZA()(),e.TgZ(10,"div"),e._UZ(11,"img",5),e.qZA()()()(),e.TgZ(12,"div",6),e._UZ(13,"hr"),e.qZA(),e.TgZ(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),e._uU(18,"No. Resi:"),e.qZA(),e.TgZ(19,"span"),e._uU(20),e.qZA()()()(),e.TgZ(21,"div",10)(22,"div",11),e._UZ(23,"img",12),e.qZA()(),e.TgZ(24,"div",13),e._UZ(25,"hr"),e.qZA(),e.TgZ(26,"div",7)(27,"div",14)(28,"div",15)(29,"div",16),e._uU(30,"Penerima: "),e.qZA(),e.TgZ(31,"div",17),e._uU(32),e.qZA()(),e.TgZ(33,"div",18)(34,"span",17),e._uU(35,"Alamat Pengiriman:"),e.qZA(),e.TgZ(36,"div",19),e._uU(37),e.qZA()()(),e.TgZ(38,"div",14)(39,"div",15)(40,"div",16),e._uU(41,"Pengirim: "),e.qZA(),e.TgZ(42,"div")(43,"div",17),e._uU(44),e.qZA(),e.TgZ(45,"div"),e._uU(46),e.qZA(),e.TgZ(47,"div"),e._uU(48),e.qZA()()(),e._UZ(49,"div"),e.qZA()(),e.YNc(50,Te,8,2,"ng-container",20),e.TgZ(51,"div",21)(52,"div",22)(53,"div",17),e._uU(54,"CASHLESS"),e.qZA()(),e.TgZ(55,"div",23)(56,"small",24),e._uU(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),e.qZA()()(),e.TgZ(58,"div",25)(59,"div",26)(60,"div",27),e.YNc(61,Ce,6,1,"ng-container",20),e.TgZ(62,"div")(63,"span",16),e._uU(64,"COD: "),e.qZA(),e.TgZ(65,"span"),e._uU(66),e.ALo(67,"number"),e.qZA()()(),e.YNc(68,Ze,7,4,"ng-container",20),e.YNc(69,be,6,1,"ng-container",20),e.qZA(),e.TgZ(70,"div",28),e._UZ(71,"img",12),e.qZA()()(),e.TgZ(72,"div",7)(73,"div",3)(74,"table",29)(75,"thead")(76,"tr")(77,"th",30),e._uU(78,"No."),e.qZA(),e.TgZ(79,"th"),e._uU(80,"Nama Produk"),e.qZA(),e.TgZ(81,"th",31),e._uU(82,"SKU"),e.qZA(),e.TgZ(83,"th",32),e._uU(84,"Qty"),e.qZA()()(),e.TgZ(85,"tbody"),e.YNc(86,Se,10,6,"tr",33),e.qZA()()()()()),2&t&&(e.xp6(6),e.Q6J("src",n.marketplaceLogo,e.LSH),e.xp6(3),e.Oqu(null==n.logistic?null:n.logistic.Service),e.xp6(2),e.Q6J("src",n.shippingLogo,e.LSH),e.xp6(9),e.Oqu(null==n.logistic?null:n.logistic.Resi_Number),e.xp6(3),e.Q6J("id","RESI"+n.id),e.xp6(9),e.Oqu(null==n.recipient?null:n.recipient.Name),e.xp6(5),e.hij(" ",null==n.recipient?null:n.recipient.Address," "),e.xp6(7),e.Oqu(null==n.store?null:n.store.Name),e.xp6(2),e.Oqu(null==n.store?null:n.store.Phone),e.xp6(2),e.Oqu(null==n.store?null:n.store.Address),e.xp6(2),e.Q6J("ngIf",(null==n.recipient?null:n.recipient.City)&&(null==n.recipient?null:n.recipient.District)),e.xp6(11),e.Q6J("ngIf",null==n.shippingLabel?null:n.shippingLabel.Weight),e.xp6(5),e.hij("Rp. ",n.shippingLabel.IsCOD?e.lcZ(67,17,null==n.shippingLabel||null==n.shippingLabel.SummaryPrice?null:n.shippingLabel.SummaryPrice.Total):0,""),e.xp6(2),e.Q6J("ngIf",(null==n.logistic?null:n.logistic.Batas_kirim)&&(null==n.logistic?null:n.logistic.Batas_kirim)!==n.minDate),e.xp6(1),e.Q6J("ngIf",null==n.shippingLabel?null:n.shippingLabel.OrderNumber),e.xp6(2),e.Q6J("id","NO"+n.id),e.xp6(15),e.Q6J("ngForOf",n.products))},dependencies:[h.ez,h.sg,h.O5,h.JJ,h.uU],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:100%}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]}),r})();function ve(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"button",15),e.NdJ("click",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.onPrintShippingLabel())}),e._UZ(2,"i",16),e.TgZ(3,"span"),e._uU(4,"Print Shipping Label"),e.qZA()(),e.BQk()}}function xe(i,r){if(1&i&&(e.TgZ(0,"span",17),e._UZ(1,"img",18),e.qZA(),e._uU(2)),2&i){const a=r.item;e.xp6(1),e.Q6J("src",a.img,e.LSH),e.xp6(1),e.hij(" ",a.Name," ")}}function ye(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"input",25),e.NdJ("ngModelChange",function(n){e.CHM(a);const o=e.oxw().$implicit;return e.KtG(o.Selected=n)})("ngModelChange",function(){e.CHM(a);const n=e.oxw(3).ngIf,o=e.oxw();return e.KtG(o.onSelectReadyToShip(n))}),e.qZA(),e.BQk()}if(2&i){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",a.Selected)}}const Ae=function(){return["/menu/Order/detail"]},we=function(i,r){return{Number:i,Outlet:r}};function Ne(i,r){if(1&i&&(e.TgZ(0,"a",35),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Ae))("queryParams",e.WLB(4,we,a.Number,a.Outlet)),e.xp6(1),e.Oqu(a.Number)}}function De(i,r){if(1&i&&(e.TgZ(0,"a",36),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(3);e.Q6J("href",t.domain+a.ID,e.LSH),e.xp6(1),e.Oqu(a.Number)}}function Oe(i,r){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e.YNc(2,ye,2,1,"ng-container",1),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Ne,2,7,"a",32),e.YNc(7,De,2,2,"a",33),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",34),e.qZA()()),2&i){const a=r.$implicit,t=e.oxw(3);e.xp6(2),e.Q6J("ngIf",a.TypeID==t.channelType.ShopeeV2||a.TypeID==t.channelType.Tokopedia||a.TypeID==t.channelType.Tiktok||a.TypeID==t.channelType.Lazada),e.xp6(2),e.Oqu(a.Outlet),e.xp6(2),e.Q6J("ngIf",t.guidEmpty==a.ID),e.xp6(1),e.Q6J("ngIf",t.guidEmpty!=a.ID),e.xp6(2),e.Oqu(a.Customer),e.xp6(2),e.Oqu(e.lcZ(12,8,a.Amount)),e.xp6(3),e.Oqu(e.xi3(15,10,a.Date,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",a.TypeID)}}function Pe(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",20)(2,"table",21),e.NdJ("matSortChange",function(n){e.CHM(a);const o=e.oxw(2);return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",22)(4,"tr",23)(5,"th",24)(6,"input",25),e.NdJ("ngModelChange",function(n){e.CHM(a);const o=e.oxw(2);return e.KtG(o.isCheckAll=n)})("ngModelChange",function(){e.CHM(a);const n=e.oxw().ngIf,o=e.oxw();return e.KtG(o.onSelectAllReadyToShip(n))}),e.qZA()(),e.TgZ(7,"th",26),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"th",27),e._uU(10,"Order number"),e.qZA(),e.TgZ(11,"th"),e._uU(12,"Customer"),e.qZA(),e.TgZ(13,"th",28),e._uU(14,"Amount"),e.qZA(),e.TgZ(15,"th",29),e._uU(16,"Date"),e.qZA(),e.TgZ(17,"th",30),e._uU(18,"Channel"),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,Oe,18,13,"tr",14),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",31),e.NdJ("total",function(){e.CHM(a);const n=e.oxw(2);return e.KtG(n.getRowCount())})("next",function(){e.CHM(a);const n=e.oxw(2);return e.KtG(n.NextPage())})("previous",function(){e.CHM(a);const n=e.oxw(2);return e.KtG(n.PreviousPage())}),e.ALo(22,"async"),e.ALo(23,"async"),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw().ngIf,t=e.oxw();let n;e.xp6(6),e.Q6J("ngModel",t.isCheckAll),e.xp6(14),e.Q6J("ngForOf",a),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",null==(n=e.lcZ(22,5,t.readyToShip$))?null:n.length)("paginationTotal",e.lcZ(23,7,t.paginationTotal$))}}function Ie(i,r){if(1&i&&(e.ynx(0),e.YNc(1,Pe,24,9,"ng-container",19),e.BQk()),2&i){const a=r.ngIf;e.oxw();const t=e.MAs(30);e.xp6(1),e.Q6J("ngIf",a.length>0)("ngIfElse",t)}}function Me(i,r){1&i&&(e.TgZ(0,"div",37),e._UZ(1,"app-empty-state"),e.qZA())}function qe(i,r){1&i&&(e.ynx(0),e._UZ(1,"div",39),e.BQk())}function Ue(i,r){if(1&i&&(e.ynx(0),e._UZ(1,"app-shipping-label",38),e.YNc(2,qe,2,0,"ng-container",1),e.BQk()),2&i){const a=r.$implicit,t=r.index,n=e.oxw();e.xp6(1),e.Q6J("shippingLabel",a)("id",t),e.xp6(1),e.Q6J("ngIf",n.shippingLabels.length!==t+1)}}let Le=(()=>{var i;class r{constructor(t,n,o,l,_,v){this.http=t,this.localDataService=n,this.dialog=o,this.channelService=l,this.shippingLabelService=_,this.datePipe=v,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=f.x,this.guidEmpty=m.g.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!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.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(t){this.sourceObs$=this.http.post("api/orders/GetReadyToShip",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).pipe((0,b.U)(o=>o.Data),(0,J.d)(1)),this.readyToShip$=this.sourceObs$}onPrintShippingLabel(){const t=this.filterReadyToShipByChannel(this.selectedReadyToShip,f.x.Tokopedia),n=this.filterReadyToShipByChannel(this.selectedReadyToShip,f.x.ShopeeV2),o=this.filterReadyToShipByChannel(this.selectedReadyToShip,f.x.Lazada),l=[];t.length>0&&l.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(t))),n.length>0&&l.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(n))),o.length>0&&l.push(this.shippingLabelService.getLazadaShippingLabel(this.shippingLabelPayload(o))),(0,fe.D)(l).pipe((0,b.U)(_=>_.reduce((v,y)=>v.concat(y),[]))).subscribe({next:_=>{this.shippingLabels=_,this.printShippingLabel()}})}filterReadyToShipByChannel(t,n){return t.filter(o=>o.TypeID==n)}shippingLabelPayload(t){return t.map(n=>({ShopID:n.ShopID,OrderNumber:n.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}setPdfname(){if(this.selectedReadyToShip.length>1){const t=new Date,n=this.datePipe.transform(t,"dd-MM-yyyy"),o=this.datePipe.transform(t,"HH-mm");document.title=`ShippingLabel_${n}_${o}`}else document.title=`ShippingLabel_${this.selectedReadyToShip[0].Number}`}getSelectedReadyToShip(t){return t.filter(n=>n.Selected)}getRowCount(){this.paginationTotal$=this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).pipe((0,b.U)(n=>n?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(t){if(""!=t.direction){if("date"==t.active){const n="asc"==t.direction;this.readyToShip$=this.readyToShip$.pipe((0,b.U)(o=>o.sort((l,_)=>m.g.compare(l.Date,_.Date,n))))}}else this.readyToShip$=this.sourceObs$}onSelectReadyToShip(t){this.selectedReadyToShip=this.getSelectedReadyToShip(t)}onSelectAllReadyToShip(t){t=t.map(n=>((n.TypeID==f.x.Tokopedia||n.TypeID==f.x.ShopeeV2||n.TypeID==f.x.Lazada)&&(n.Selected=this.isCheckAll),n)),this.selectedReadyToShip=this.getSelectedReadyToShip(t)}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36(s.T),e.Y36(d.uw),e.Y36(c.T),e.Y36(K),e.Y36(h.uU))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-ready-to-ship"]],decls:33,vars:13,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","130px"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"shippingLabel","id"],[1,"pagebreak"]],template:function(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.getReadyToShip(l)}),e.TgZ(1,"actions"),e.YNc(2,ve,5,0,"ng-container",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2)(5,"div")(6,"h6"),e._uU(7,"Channel"),e.qZA(),e.TgZ(8,"ng-select",3),e.NdJ("ngModelChange",function(l){return n.filter.ListChannelID=l}),e.YNc(9,xe,3,2,"ng-template",4),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Page Number"),e.qZA(),e.TgZ(13,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Page Size"),e.qZA(),e.TgZ(17,"input",6),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"From/To"),e.qZA(),e.TgZ(21,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(22,"datepicker",8),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(23,"content")(24,"div",9)(25,"div",10)(26,"div",11),e.YNc(27,Ie,2,2,"ng-container",1),e.ALo(28,"async"),e.YNc(29,Me,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()(),e.TgZ(31,"div",13),e.YNc(32,Ue,3,3,"ng-container",14),e.qZA()),2&t&&(e.xp6(2),e.Q6J("ngIf",n.selectedReadyToShip.length>0),e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",e.lcZ(28,11,n.readyToShip$)),e.xp6(5),e.Q6J("ngForOf",n.shippingLabels))},dependencies:[h.sg,h.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,N.p,C.rH,Z.w9,Z.ir,P.n,q,U.s,S.YE,S.nU,I.Q,j,h.Ov,h.JJ,h.uU],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.pagebreak[_ngcontent-%COMP%]{page-break-before:always}}"]}),r})();function Je(i,r){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){const a=r.item;e.xp6(1),e.Q6J("src",a.img,e.LSH),e.xp6(1),e.hij(" ",a.Name," ")}}const ke=function(){return["/menu/Order/detail"]},Fe=function(i,r){return{Number:i,Outlet:r}};function Qe(i,r){if(1&i&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ke))("queryParams",e.WLB(4,Fe,a.Number,a.Outlet)),e.xp6(1),e.Oqu(a.Number)}}function Ee(i,r){if(1&i&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+a.ID,e.LSH),e.xp6(1),e.Oqu(a.Number)}}function Re(i,r){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Qe,2,7,"a",26),e.YNc(5,Ee,2,2,"a",27),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",28),e.qZA()()),2&i){const a=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(a.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(a.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(a.ID)),e.xp6(2),e.Oqu(a.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,a.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,a.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",a.TypeID)}}function Ye(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(a);const o=e.oxw();return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,Re,16,12,"tr",24),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",25),e.NdJ("total",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw();e.xp6(18),e.Q6J("ngForOf",a.data),e.xp6(1),e.Q6J("filter",a.filter)("totaldata",a.totaldata)("paginationTotal",a.paginationTotal)}}function Ge(i,r){1&i&&(e.TgZ(0,"div",31),e._UZ(1,"app-empty-state"),e.qZA())}let He=(()=>{var i;class r{constructor(t,n,o){this.http=t,this.localDataService=n,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=f.x}ngOnInit(){this.Load()}getChannelLogo(t){return m.g.getChannelLogoByTypeId(t)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(t){return t==m.g.GuidEMpty}Get(t){this.http.post("api/orders/GetShipped",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.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",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).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()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>m.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36(s.T),e.Y36(c.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-shipped"]],decls:28,vars:10,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.filter.ListChannelID=l}),e.YNc(7,Je,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Ye,20,4,"ng-container",11),e.YNc(26,Ge,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[h.sg,h.O5,p.Fj,p.wV,p.JJ,p.On,N.p,C.rH,Z.w9,Z.ir,P.n,q,U.s,S.YE,S.nU,I.Q,h.JJ,h.uU]}),r})();var $e=g(4750);function Be(i,r){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){const a=r.item;e.xp6(1),e.Q6J("src",a.img,e.LSH),e.xp6(1),e.hij(" ",a.Name," ")}}const ze=function(){return["/menu/Order/detail"]},Ke=function(i,r){return{Number:i,Outlet:r}};function je(i,r){if(1&i&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ze))("queryParams",e.WLB(4,Ke,a.Number,a.Outlet)),e.xp6(1),e.Oqu(a.Number)}}function Ve(i,r){if(1&i&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.customerInfoUrl+a.ID,e.LSH),e.xp6(1),e.Oqu(a.Number)}}function We(i,r){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",26),e.YNc(5,Ve,2,2,"a",27),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",28),e.qZA()()),2&i){const a=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(a.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(a.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(a.ID)),e.xp6(2),e.Oqu(a.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,a.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,a.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",a.TypeID)}}function Xe(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(a);const o=e.oxw();return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,We,16,12,"tr",24),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",25),e.NdJ("total",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw();e.xp6(18),e.Q6J("ngForOf",a.data),e.xp6(1),e.Q6J("filter",a.filter)("totaldata",a.totaldata)("paginationTotal",a.paginationTotal)}}function et(i,r){1&i&&(e.TgZ(0,"div",31),e._UZ(1,"app-empty-state"),e.qZA())}let tt=(()=>{var i;class r{constructor(t,n,o){this.http=t,this.authService=n,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=f.x}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==m.g.GuidEMpty}getChannelLogo(t){return m.g.getChannelLogoByTypeId(t)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.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",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).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()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>m.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36($e.e),e.Y36(c.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-delivered"]],decls:28,vars:11,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.filter.ListChannelID=l}),e.YNc(7,Be,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Xe,20,4,"ng-container",11),e.YNc(26,et,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[h.sg,h.O5,p.Fj,p.wV,p.JJ,p.On,N.p,C.rH,Z.w9,Z.ir,P.n,q,U.s,S.YE,S.nU,I.Q,h.JJ,h.uU]}),r})();function nt(i,r){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){const a=r.item;e.xp6(1),e.Q6J("src",a.img,e.LSH),e.xp6(1),e.hij(" ",a.Name," ")}}const it=function(){return["/menu/Order/detail"]},at=function(i,r){return{Number:i,Outlet:r}};function ot(i,r){if(1&i&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,it))("queryParams",e.WLB(4,at,a.Number,a.Outlet)),e.xp6(1),e.Oqu(a.Number)}}function rt(i,r){if(1&i&&(e.TgZ(0,"a",31),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+a.ID,e.LSH),e.xp6(1),e.Oqu(a.Number)}}function lt(i,r){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ot,2,7,"a",27),e.YNc(5,rt,2,2,"a",28),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(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",29),e.qZA()()),2&i){const a=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(a.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(a.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(a.ID)),e.xp6(2),e.Oqu(a.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,a.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,a.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(a.State),e.xp6(2),e.Q6J("typeId",a.TypeID)}}function st(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(a);const o=e.oxw();return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Status"),e.qZA(),e.TgZ(17,"th",24),e._uU(18,"Channel"),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,lt,18,13,"tr",25),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",26),e.NdJ("total",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw();e.xp6(20),e.Q6J("ngForOf",a.data),e.xp6(1),e.Q6J("filter",a.filter)("totaldata",a.totaldata)("paginationTotal",a.paginationTotal)}}function pt(i,r){1&i&&(e.TgZ(0,"div",32),e._UZ(1,"app-empty-state"),e.qZA())}let ct=(()=>{var i;class r{constructor(t,n,o){this.http=t,this.localDataService=n,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==m.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.Data],this.totaldata=this.data.length})}changePage(t){this.filter=t,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).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()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>m.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36(s.T),e.Y36(c.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-all-order"]],decls:28,vars:10,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.filter.ListChannelID=l}),e.YNc(7,nt,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,st,22,4,"ng-container",11),e.YNc(26,pt,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[h.sg,h.O5,p.Fj,p.wV,p.JJ,p.On,N.p,C.rH,Z.w9,Z.ir,P.n,q,U.s,S.YE,S.nU,I.Q,h.JJ,h.uU]}),r})();function dt(i,r){if(1&i&&(e.TgZ(0,"span",14),e._UZ(1,"img",15),e.qZA(),e._uU(2)),2&i){const a=r.item;e.xp6(1),e.Q6J("src",a.img,e.LSH),e.xp6(1),e.hij(" ",a.Name," ")}}const gt=function(){return["/menu/Order/detail"]},ht=function(i,r){return{Number:i,Outlet:r}};function ut(i,r){if(1&i&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,gt))("queryParams",e.WLB(4,ht,a.Number,a.Outlet)),e.xp6(1),e.Oqu(a.Number)}}function _t(i,r){if(1&i&&(e.TgZ(0,"a",31),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+a.ID,e.LSH),e.xp6(1),e.Oqu(a.Number)}}function mt(i,r){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ut,2,7,"a",27),e.YNc(5,_t,2,2,"a",28),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",29),e.qZA()()),2&i){const a=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(a.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(a.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(a.ID)),e.xp6(2),e.Oqu(a.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,a.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,a.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",a.TypeID)}}function ft(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"table",17),e.NdJ("matSortChange",function(n){e.CHM(a);const o=e.oxw();return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",18)(4,"tr",19)(5,"th",20),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",21),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",22),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",23),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",24),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,mt,16,12,"tr",25),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",26),e.NdJ("total",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&i){const a=e.oxw();e.xp6(18),e.Q6J("ngForOf",a.data),e.xp6(1),e.Q6J("filter",a.filter)("totaldata",a.totaldata)("paginationTotal",a.paginationTotal)}}function Tt(i,r){1&i&&(e.TgZ(0,"div",32),e._UZ(1,"app-empty-state"),e.qZA())}let Ct=(()=>{var i;class r{constructor(t,n,o){this.http=t,this.localDataService=n,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==m.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),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,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.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,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).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()}getChannelLogo(t){return m.g.getChannelLogoByTypeId(t)}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>m.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36(s.T),e.Y36(c.T))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-cancelled"]],decls:32,vars:11,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],["type","text","name","Note",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(l){return n.filter.ListChannelID=l}),e.YNc(7,dt,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Note"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(l){return n.filter.Note=l}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"From/To"),e.qZA(),e.TgZ(23,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(24,"datepicker",8),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(25,"content")(26,"div",9)(27,"div",10)(28,"div",11),e.YNc(29,ft,20,4,"ng-container",12),e.YNc(30,Tt,2,0,"ng-template",null,13,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(31);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("ngModel",n.filter.Note),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[h.sg,h.O5,p.Fj,p.wV,p.JJ,p.On,N.p,C.rH,Z.w9,Z.ir,P.n,q,U.s,S.YE,S.nU,I.Q,h.JJ,h.uU]}),r})();var Zt=g(1657),F=function(i){return i[i.DoNothing=0]="DoNothing",i[i.New=1]="New",i[i.Update=2]="Update",i}(F||{}),bt=g(5993),Q=g(8034),E=g(8257),V=g(2596);function St(i,r){if(1&i){const a=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(a),e.oxw();const n=e.MAs(11);return e.KtG(n.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(a);const n=e.oxw(),o=e.MAs(11);return e.KtG(n.onNext(o))}),e._uU(5," Next "),e.qZA(),e.TgZ(6,"button",31),e._UZ(7,"b",32),e.qZA(),e.TgZ(8,"ul",33)(9,"li",34)(10,"a",35),e.NdJ("click",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&i){const a=e.oxw();e.xp6(4),e.Q6J("disabled",a.checkDisabledNextFilter())}}function vt(i,r){if(1&i){const a=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(a);const n=e.oxw(),o=e.MAs(11);return e.KtG(n.onNext(o))}),e._uU(1," Next "),e.qZA()}if(2&i){const a=e.oxw();e.Q6J("disabled",a.checkDisabledNextFilter())}}function xt(i,r){if(1&i){const a=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(a);const n=e.oxw(),o=e.MAs(11);return e.KtG(n.onNew(o))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function yt(i,r){1&i&&e._uU(0,"Filter")}function At(i,r){if(1&i&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&i){const a=r.$implicit;e.Q6J("value",a.ID),e.xp6(1),e.s9C("src",a.Img,e.LSH),e.xp6(1),e.hij("",a.Name," ")}}function wt(i,r){1&i&&e._uU(0,"Preview")}function Nt(i,r){if(1&i&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&i){const a=e.oxw(2);e.xp6(1),e.Oqu(0==a.getTypeID()?"Last Status Update":"Created Date")}}function Dt(i,r){if(1&i&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&i){const a=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,a.Date,"dd MMM yyyy HH:mm:ss"),"")}}function Ot(i,r){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const a=e.oxw().$implicit;e.xp6(1),e.hij(" ",a.ActionString," ")}}function Pt(i,r){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const a=r.$implicit;e.xp6(1),e.hij("",a," ")}}function It(i,r){if(1&i&&(e.TgZ(0,"ul",63),e.YNc(1,Pt,2,1,"li",59),e.qZA()),2&i){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",a.ActionString)}}function Mt(i,r){if(1&i&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&i){const a=e.oxw().$implicit;e.hYB("title","Delivery : ",a.DeliveryState," \nPayment : ",a.PaymentState,"")}}const qt=function(i,r){return{"over-due-today":i,"over-due":r}};function Ut(i,r){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,Dt,3,4,"td",1),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",60)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,Ot,2,1,"span",1),e.YNc(16,It,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,Mt,2,2,"span",62),e.qZA()()),2&i){const a=r.$implicit,t=r.index,n=e.oxw(3);e.xp6(2),e.Oqu(t+1),e.xp6(2),e.Oqu(a.Number),e.xp6(1),e.Q6J("ngIf",n.getTypeID()!=n.channelType.ShopeeV2),e.xp6(3),e.hij("",a.ChannelStatus," - "),e.xp6(1),e.Oqu(a.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(12,qt,(null==a?null:a.Action)==n.actionPreviewOrder.Update,(null==a?null:a.Action)==n.actionPreviewOrder.New))("matTooltip",91==a.POSStatus||"Conflict"==a.POSStatusDescription?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),e.xp6(2),e.hij("",a.POSStatus," - "),e.xp6(1),e.hij("",a.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==a.ActionString.length),e.xp6(1),e.Q6J("ngIf",a.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=a.ChannelStatus&&99!=a.POSStatus)}}function Lt(i,r){if(1&i&&(e.ynx(0),e.YNc(1,Ut,19,15,"tr",59),e.BQk()),2&i){const a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.displayedPreviewData)}}function Jt(i,r){1&i&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function kt(i,r){if(1&i){const a=e.EpF();e.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),e.NdJ("click",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",45)(8,"button",47),e.NdJ("click",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",45)(11,"button",48),e.NdJ("click",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",45)(14,"button",49),e.NdJ("click",function(){e.CHM(a);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",50)(17,"thead",51)(18,"tr"),e._UZ(19,"th",52),e.TgZ(20,"th",53),e._uU(21,"Number"),e.qZA(),e.YNc(22,Nt,2,1,"th",54),e.TgZ(23,"th",55),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",55),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",52),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,Lt,2,1,"ng-container",56),e.YNc(32,Jt,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&i){const a=e.MAs(33),t=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==t.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",t.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==t.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",t.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==t.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",t.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==t.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",t.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",t.getTypeID()!=t.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",t.displayedPreviewData.length>0)("ngIfElse",a)}}function Ft(i,r){1&i&&e._uU(0,"Finish")}const Qt=function(i){return{"over-due":i}};function Et(i,r){if(1&i&&(e.TgZ(0,"tr",73)(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 a=r.$implicit,t=r.index;e.Q6J("ngClass",e.VKq(5,Qt,a.Exception)),e.xp6(2),e.Oqu(t+1),e.xp6(2),e.Oqu(a.Number),e.xp6(2),e.Oqu(a.Status),e.xp6(2),e.Oqu(a.Exception)}}function Rt(i,r){if(1&i&&(e.ynx(0),e.YNc(1,Et,9,7,"tr",72),e.BQk()),2&i){const a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.downloadData)}}function Yt(i,r){1&i&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Gt(i,r){if(1&i&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),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,Rt,2,1,"ng-container",56),e.YNc(14,Yt,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&i){const a=e.MAs(15),t=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==t.downloadData?null:t.downloadData.length)>0)("ngIfElse",a)}}function Ht(i,r){1&i&&e._UZ(0,"i",74)}function $t(i,r){1&i&&e._UZ(0,"i",75)}function Bt(i,r){1&i&&e._UZ(0,"i",76)}var x=function(i){return i.ALL="all",i.SYNC="sync",i.WRONG="wrong",i.UNSYNC="unsync",i}(x||{});let zt=(()=>{var i;class r{constructor(t,n,o,l,_,v){this.http=t,this.toastr=n,this.datePipe=o,this.url=l,this.productService=_,this.orderService=v,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=f.x,this.previewStatus=x,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=F}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(o=>{this.downloadData=o.Body,this.onStepperNext(t)})}onPreview(t){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(o=>{0!=o.length?(this.previewData=o,this.groupingPreviewData(),this.filterPreviewData(x.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 m.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),t=!1),t}setPageTitle(t){this.pageTitle=`\n ${t} (${this.getDateTitle()})\n `}getDateTitle(){const t=m.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),n=this.datePipe.transform(this.startDate,t);return`${null==t?"":n+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}onNew(t){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",t.reset()}groupingPreviewData(){let t=this.filterDataByStatus(x.UNSYNC),n=this.filterDataByStatus(x.WRONG);this.downloadedPreviewData=[...t,...n]}filterDataByStatus(t){let n=[];switch(t){case x.ALL:n=this.previewData;break;case x.SYNC:n=this.previewData.filter(o=>o.Action==F.DoNothing);break;case x.WRONG:n=this.previewData.filter(o=>o.Action==F.Update);break;case x.UNSYNC:n=this.previewData.filter(o=>o.Action==F.New)}return n}filterPreviewData(t){this.pillStatus=t,this.displayedPreviewData=this.filterDataByStatus(t)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(x.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(x.SYNC).length,this.unsyncData=this.filterDataByStatus(x.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=!m.g.isValidDate(this.startDate)||!m.g.isValidDate(this.endDate),n=m.g.IsEmpty(this.channelID);return t||n}exportOrders(){let t={ID:this.channelID,From:this.startDate,To:this.endDate};const n=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(t,n).subscribe()}}return(i=r).\u0275fac=function(t){return new(t||i)(e.Y36(w.O),e.Y36(Y._W),e.Y36(h.uU),e.Y36(C.gz),e.Y36(bt.M),e.Y36(B))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-download"]],features:[e._Bn([{provide:Zt.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"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-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"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"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["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"],[3,"ngClass"],[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 o=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,St,12,1,"ng-container",1),e.YNc(3,vt,2,1,"button",2),e.YNc(4,xt,3,0,"button",3),e.qZA(),e.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),e.NdJ("selectionChange",function(_){return n.stepChange(_)})("selectionChange",function(_){return n.onStepperChange(_)}),e.TgZ(12,"mat-step",10),e.YNc(13,yt,1,0,"ng-template",11),e.TgZ(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",14),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",13)(23,"ng-select",15),e.NdJ("ngModelChange",function(_){return n.channelID=_}),e.YNc(24,At,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(_){return n.startDate=_})("click",function(){e.CHM(o);const _=e.MAs(37);return e.KtG(_.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(_){return n.endDate=_})("click",function(){e.CHM(o);const _=e.MAs(37);return e.KtG(_.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,wt,1,0,"ng-template",11),e.YNc(40,kt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,Ft,1,0,"ng-template",11),e.YNc(43,Gt,16,2,"div",23),e.qZA(),e.YNc(44,Ht,1,0,"ng-template",25),e.YNc(45,$t,1,0,"ng-template",26),e.YNc(46,Bt,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&t){const o=e.MAs(11),l=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","filter"==n.currentState),e.xp6(1),e.Q6J("ngIf","finish"==n.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+o.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",l),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:[h.mk,h.sg,h.O5,p.Fj,p.JJ,p.On,N.p,Z.w9,Z.jq,Q.wx,Q.zY,Q.By,Q._g,E.C0,E.VY,E.Vq,E.z9,V.gM,h.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{position:relative;width:60%;left:18%} 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:left} 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}"]}),r})();var O=g(4575);const Kt=[{path:"",component:H,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:ge,canActivate:[O.a],data:{title:"New Order"}},{path:"detail",component:me,canActivate:[O.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Le,canActivate:[O.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:He,canActivate:[O.a],data:{title:"Shipped"}},{path:"Delivered",component:tt,canActivate:[O.a],data:{title:"Delivered"}},{path:"All",component:ct,canActivate:[O.a],data:{title:"All Order"}},{path:"Cancelled",component:Ct,canActivate:[O.a],data:{title:"Cancelled"}},{path:"Download",component:zt,canActivate:[O.a],data:{title:"Download"}}]}];let jt=(()=>{var i;class r{}return(i=r).\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({imports:[h.ez,C.Bz.forChild(Kt)]}),r})();var Vt=g(1476),Wt=g(3680),Xt=g(7738),en=g(8525),tn=g(7801);let nn=(()=>{var i;class r{}return(i=r).\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i}),i.\u0275inj=e.cJS({providers:[B,z],imports:[h.ez,p.u5,jt,M.Z,N.R,Vt.TU,C.Bz,Z.A0,Q.FA,Wt.XK,P.n,E.T5,V.AV,Xt.f,u.p9,d.Is,en.LD,S.JX,tn.P,I.Q,j]}),r})()},5993:(W,R,g)=>{g.d(R,{M:()=>J});var h=g(9397),C=g(6306),L=g(8504),e=g(5802),M=g(5879),H=g(9659),m=g(9229);let J=(()=>{var A;class b{constructor(s,c){this.httpService=s,this.toastrService=c}loader(s=e.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:s})}LoadInPOS(s=e.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:s})}filterChannelByTypeId(s,c){return s.filter(d=>-1!==c.findIndex(p=>d.TypeID==p))}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})}uploadSingleProduct(s,c){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:c,Products:s}).pipe((0,h.b)(p=>{this.showToastrSuccessUploadSingle(p,s[0])}),(0,C.K)(p=>(this.showToastErrorUploadSingle(p,s[0]),(0,L._)(()=>new Error(p)))))}uploadMultipleProduct(s,c){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:c,Products:s}).pipe((0,h.b)(p=>{this.showToastrUploadMultiple(p.Message)}),(0,C.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,L._)(()=>new Error(p)))))}uploadNotInChannel(s,c){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:s,Channel:c}).pipe((0,h.b)(p=>{this.showToastrUploadMultiple(p)}),(0,C.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,L._)(()=>new Error(p)))))}scanSingle(s,c){return this.httpService.post("/api/product/ScanSingle",{ID:s,SKU:c})}scanNotInChannel(s){return this.httpService.post("/api/product/ScanNotinChannel",{ID:s})}findAllSoldInChannel(s){return this.httpService.post("/api/product/GetSoldInChannel",s)}scanAll(s,c,d,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:s,ScanFull:c,UpdatedProduct:d,Async:p})}scanCompareToPos(s){return this.httpService.post("/api/product/CompareMarketplaceToPOS",s)}getVariantCodesProduct(s){return s.Variants.map(d=>d.Code)}downloadMultipleProduct(s){let c=s.map(d=>({ChannelItemID:d.ChannelItemID,ChannelID:d.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",c).pipe((0,h.b)(d=>{this.toastrService.success(`${d.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(s){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}).pipe((0,h.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(s=[]){let c=[];return s.forEach(d=>{d.Variants.forEach(p=>{c=[...c,p.Code]})}),c}filterUnselectedChannel(s,c){let p,d=[];if(s.forEach(u=>{d=[...d,...u.Channel]}),d&&0!=d.length){let u=[];p=c.filter(T=>(u=d.filter(k=>k.ChannelID==T.ID),u.length!==s.length))}else p=c;return p}findChannelById(s,c){return c.find(d=>d.ID==s)}sortChannel(s=[]){return s.sort((c,d)=>c.TypeID<d.TypeID?1:c.TypeID===d.TypeID?0:-1)}hasSelection(s=[]){return this.selectedProduct(s).length>0}selectedProduct(s=[]){return s.filter(c=>c.selected)}hasSelectionVariant(s){return this.selectedVariantProduct(s).length>0}selectedVariantProduct(s){let c=[];return s.forEach(d=>{c=[...c,...null!=d.Variants?d.Variants.filter(p=>p.selected):""]}),c}getChannelProduct(s){const c=s.Variants;let d=[];for(let p of c)if(null!=p.Channel)for(let u of p.Channel)0==d.filter(T=>T.ChannelID==u.ChannelID).length&&d.push(u);return this.sortChannel(d)}successToastrScanAllProduct(s,c,d){if(d){const p=s?.NotInPOS?.Product?s?.NotInPOS?.Product:0,u=s?.InChannel?.Product?s?.InChannel?.Product:0;this.toastrService.success(`\n ${p+u} found in ${c.Name} </br>\n (${u} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${s.InChannel?s.InChannel.Product:0} product updates in ${c.Name} </br> \n since ${s.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(s,c){let d;return s.map(p=>(p.Channel=this.getChannelProduct(p),d=this.filterUnselectedChannel([p],c),p.hasScan=d.length>0,p))}checkProductHasUploadBtn(s,c){let d;return s.map(p=>(p.Channel=this.getChannelProduct(p),d=this.filterUnselectedChannel([p],c),p.hasUpload=d.length>0,p))}showToastrUploadMultiple(s=[]){let c=[],d=[];const p=this.getResponseList(s);if(s.forEach(u=>{"string"==typeof u?.Response?d=[...d,p.length>1?this.setHtmlli(u.Response):this.setHtmlli(u.Response,!1)]:(u?.Response?.Success.forEach(T=>{c=[...c,p.length>1?this.setHtmlli(`Product ${T} was <b>successfully</b> uploaded to ${u.Name}`):this.setHtmlli(`Product ${T} was <b>successfully</b> uploaded to ${u.Name}`,!1)]}),u?.Response.Fail.forEach(T=>{d=[...d,p.length>1?this.setHtmlli(T):this.setHtmlli(T,!1)]}))}),d.length>0&&c.length>0){const u=[...c,...d];this.toastrService.warning(this.concatMessage(u),"Warning!",{enableHtml:!0})}else c.length>0&&0==d.length?this.toastrService.success(this.concatMessage(c),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(d),"Error",{enableHtml:!0})}setHtmlli(s,c=!0){return c?`<li>${s}</li>`:s}getResponseList(s){let c=[];return s.forEach(d=>{"string"==typeof d?.Response?c=[...c,d.Response]:(d?.Response?.Success.forEach(p=>{c=[...c,d.Name]}),d?.Response.Fail.forEach(p=>{c=[...c,p]}))}),c}concatMessage(s=[]){let c="";return s.forEach(d=>{c+=d}),s.length>1?`<ol>${c}</ol>`:c}showToastrSuccessUploadSingle(s,c){let d=s.filter(T=>0==T.Status),p=s.filter(T=>1==T.Status),u=this.generateToastrMessage(d,p,c);this.toastrService.success(u.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(s,c){let d=s?.error?.Message.filter(T=>0==T.Status),p=s?.error?.Message.filter(T=>1==T.Status),u=this.generateToastrMessage(d,p,c);"WARNING"==u.status?this.toastrService.warning(u.message,"Warning!",{enableHtml:!0}):this.toastrService.error(u.message,`Error - ${s.status}`,{enableHtml:!0})}generateToastrMessage(s,c,d){let u,p="",T=[...s,...c];return 0==s.length&&c.length>0?(u="SUCCESS",p=this.createSuccessResponse(c,d)):s.length>0&&0==c.length?(u="ERROR",p=this.createErrResponse(s,d)):(u="WARNING",p=`${this.createSuccessResponse(c,d)} ${this.createErrResponse(s,d)}`),T.length>1&&(p=`<ol>${p}</ol>`),{status:u,message:p}}createErrResponse(s,c){let d="";return s.length>1?s.forEach((p,u)=>{d+=`<li>${p.Response}</li>`}):1==s.length&&(d+=`${s[0].Response}`),d}createSuccessResponse(s,c){let d="";return s.length>1?s.forEach((p,u)=>{d+=`<li>Product ${c.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}):1==s.length&&(d+=`Product ${c.Name} was <b>successfully</b> uploaded to ${s[0].Name}`),d}getHostName(){if(e.g.IsEmpty(this.hostName)){const s=localStorage.getItem("Authorization");this.hostName=JSON.parse(s)?.Host}return this.hostName}}return(A=b).\u0275fac=function(s){return new(s||A)(M.LFG(H.O),M.LFG(m._W))},A.\u0275prov=M.Yz7({token:A,factory:A.\u0275fac,providedIn:"root"}),b})()}}]);