marketplacepos 5.37.0 → 5.37.2

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.
Files changed (37) hide show
  1. package/Marketplace/{chunk-OCQD6PMZ.js → chunk-2H7UKR4Z.js} +1 -1
  2. package/Marketplace/{chunk-7UTZLQI6.js → chunk-3YRPTVAF.js} +1 -1
  3. package/Marketplace/{chunk-TF4BI2XD.js → chunk-4EWARO65.js} +1 -1
  4. package/Marketplace/{chunk-ITXEWTPA.js → chunk-64V4L3IJ.js} +1 -1
  5. package/Marketplace/{chunk-T2C2QH7B.js → chunk-77ESDFMO.js} +2 -2
  6. package/Marketplace/{chunk-A46FZGKG.js → chunk-AVSGKP57.js} +1 -1
  7. package/Marketplace/{chunk-QZDIKVMC.js → chunk-BTPFPDPR.js} +1 -1
  8. package/Marketplace/{chunk-LIEUAEW7.js → chunk-C4ESA6DM.js} +1 -1
  9. package/Marketplace/{chunk-2TAZ7EVF.js → chunk-CAGSG3DY.js} +1 -1
  10. package/Marketplace/{chunk-D2R7H4PZ.js → chunk-CIKNTHCR.js} +1 -1
  11. package/Marketplace/{chunk-72WUBVEI.js → chunk-D7G7GVNH.js} +1 -1
  12. package/Marketplace/{chunk-RO6HPA6M.js → chunk-F6Y7LJ64.js} +1 -1
  13. package/Marketplace/{chunk-XUPB6PPC.js → chunk-GG2SCXTS.js} +1 -1
  14. package/Marketplace/{chunk-S6AGBBNT.js → chunk-HETMK7WT.js} +1 -1
  15. package/Marketplace/chunk-I6PVQBH3.js +1 -0
  16. package/Marketplace/{chunk-IZARECBC.js → chunk-JGKNWNHJ.js} +1 -1
  17. package/Marketplace/{chunk-IIUCEXII.js → chunk-JJFRUJBP.js} +1 -1
  18. package/Marketplace/{chunk-VZBQMPS6.js → chunk-K7LGJFCY.js} +2 -2
  19. package/Marketplace/{chunk-GUDSPIQ4.js → chunk-KC2FFVLF.js} +1 -1
  20. package/Marketplace/{chunk-TESIDZXV.js → chunk-KEFQSTJD.js} +1 -1
  21. package/Marketplace/{chunk-XCM5Z3ZO.js → chunk-KSJLJ53O.js} +1 -1
  22. package/Marketplace/{chunk-CGGZVOPZ.js → chunk-MNMVQQPT.js} +1 -1
  23. package/Marketplace/{chunk-AUGXMJYD.js → chunk-MV2W43TI.js} +1 -1
  24. package/Marketplace/{chunk-UHQVAZB3.js → chunk-QP6X3QVC.js} +1 -1
  25. package/Marketplace/{chunk-2J4TQ5S7.js → chunk-R4FFSLZS.js} +1 -1
  26. package/Marketplace/{chunk-37YRCS7N.js → chunk-S45YFO7W.js} +1 -1
  27. package/Marketplace/{chunk-SZDSHN77.js → chunk-S4D2PHBV.js} +1 -1
  28. package/Marketplace/{chunk-IY224QZQ.js → chunk-TNQMLUO7.js} +1 -1
  29. package/Marketplace/{chunk-45NCWWK5.js → chunk-TR23CMVW.js} +1 -1
  30. package/Marketplace/{chunk-UX5Q3IK5.js → chunk-UI3RKKVM.js} +1 -1
  31. package/Marketplace/{chunk-DAM3G2L2.js → chunk-XJIHUZS4.js} +1 -1
  32. package/Marketplace/{chunk-EPPD6RR3.js → chunk-ZCGHEDGV.js} +1 -1
  33. package/Marketplace/{chunk-FDTJZH7Y.js → chunk-ZHKZ3QZP.js} +1 -1
  34. package/Marketplace/index.html +3 -3
  35. package/Marketplace/{main-FTJE6LDD.js → main-TSXSJ6BP.js} +1 -1
  36. package/package.json +1 -1
  37. package/Marketplace/chunk-IVX7QWP7.js +0 -1
@@ -1 +1 @@
1
- import{a as Le}from"./chunk-7M4RYU7S.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Re,b as $e,c as Ue,d as Q}from"./chunk-EQD3IUMF.js";import{a as Ce}from"./chunk-BVIRHZTZ.js";import{a as Be}from"./chunk-PF4F4EAR.js";import{a as De}from"./chunk-7KG3DC5J.js";import{b as ke}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import"./chunk-RNWWVG3M.js";import"./chunk-UOAYF4SW.js";import{a as Ve}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Ee,b as Te,c as Oe}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as Ne}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Se,b as ve,d as ye,e as Ie}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as z}from"./chunk-D2R7H4PZ.js";import{b as fe,e as xe}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as we,l as Me,m as Fe}from"./chunk-XOT2SZPE.js";import{r as G,s as K}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{a as ge,b as he,h as V,m as N,y as k}from"./chunk-AI4XRCAL.js";import{c as j,e as Pe,f as be}from"./chunk-W6T7TOHE.js";import{d as pe,f as W,g as de,j as _e,m as ue,n as D}from"./chunk-B6POIFQM.js";import{Dc as q,Eb as T,Ec as p,Fc as ce,G as J,Gc as f,Ic as w,Jc as M,Ka as oe,Kb as _,Kc as F,Mc as A,Na as Z,Oc as O,Pc as se,Qa as ae,Wb as s,Xc as v,Yc as E,Z as X,Zb as re,Zc as me,_c as Y,bc as U,cc as B,ea as ie,ec as L,fc as R,gc as o,hc as a,ic as x,jc as y,kc as I,mc as P,ob as b,pa as $,qb as r,rc as g,sc as m,v as ne,vc as le,wb as S,ya as h,za as C}from"./chunk-EIQCOZF5.js";import{a as ee,b as te}from"./chunk-K2H6WANG.js";var Xe=(n,c)=>({color:n,"font-weight":c});function Ze(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();re(se(7,Xe,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var je=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new oe,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),g("ngModelChange",function(d){return t.change(d)}),_(1,Ze,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[D,W,Oe,Ee,Te,k,V,N,K,G],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();function qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a()),n&2){let e=c.item;r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," ")}}function Ye(n,c){if(n&1){let e=P();o(0,"span",6),g("click",function(){h(e);let t=m(),l=t.item,d=t.clear;return C(d(l))}),p(1,"x"),a()}}function Qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a(),_(4,Ye,2,0,"span",5)),n&2){let e=c.item,i=m();r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," "),r(),U(i.clearable()?4:-1)}}var ze=(()=>{class n{constructor(){this.authService=$(z),this.multiple=Z(!1),this.clearable=Z(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[A([{provide:ge,multi:!0,useExisting:n}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,t){i&1&&(o(0,"ng-select",0),F("ngModelChange",function(d){return M(t.selectedChannels,d)||(t.selectedChannels=d),d}),g("ngModelChange",function(d){return t.onChannelChange(d)}),_(1,qe,4,2,"ng-template",1)(2,Qe,5,3,"ng-template",2),a()),i&2&&(s("clearable",t.clearable())("items",t.options),w("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[D,Ie,ye,Se,ve,k,V,N],encapsulation:2})}}return n})();var Ge=n=>[n],et=n=>({"text-decoration-line-through":n}),tt=n=>({"border-bottom":n}),nt=n=>({"bg-gradient-warning":n});function it(n,c){if(n&1){let e=P();y(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),F("ngModelChange",function(t){h(e);let l=m();return M(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),F("modelChange",function(t){h(e);let l=m();return M(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),I()}if(n&2){let e=m();r(4),s("multiple",!0),w("ngModel",e.searchFilter.ListChannelID),r(4),w("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function ot(n,c){if(n&1){let e=P();o(0,"button",27),g("click",function(){h(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),x(1,"i",28),p(2," Update "),a()}}function at(n,c){if(n&1&&(y(0),o(1,"div",4),_(2,ot,3,0,"button",26),a(),I()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function rt(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),x(2,"img",30),o(3,"div",31),p(4),v(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,b),r(2),f(" ",me(5,3,e.Name,20)," ")}}function lt(n,c){if(n&1){let e=P();o(0,"th")(1,"input",32),F("ngModelChange",function(t){h(e);let l=m();return M(l.checkboxState,t)||(l.checkboxState=t),C(t)}),g("ngModelChange",function(){h(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),w("ngModel",e.checkboxState)}}function ct(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function st(n,c){if(n&1){let e=P();o(0,"img",47),g("click",function(t){h(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;le("src",e==null?null:e.ImageUrl,b)}}function mt(n,c){n&1&&x(0,"img",48)}function pt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function dt(n,c){if(n&1&&(y(0),o(1,"td",42),_(2,st,1,1,"img",43)(3,mt,1,0,"ng-template",null,0,Y),a(),o(5,"td",44)(6,"h5",45),p(7),a(),_(8,pt,2,1,"small",46),a(),I()),n&2){let e=q(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",O(7,tt,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),ce(t==null?null:t.Name),r(),U(t!=null&&t.Category?8:-1)}}function _t(n,c){if(n&1){let e=P();o(0,"td",49)(1,"input",32),F("ngModelChange",function(t){h(e);let l=m().$implicit;return M(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),w("ngModel",e.selected)}}function ut(n,c){if(n&1){let e=P();y(0),o(1,"td",51),p(2),v(3,"number"),a(),o(4,"td",52),g("click",function(){let t=h(e).$implicit,l=m(2).$implicit,d=m().$implicit,u=m(2);return C(u.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),v(8,"number"),a(),o(9,"a",55),g("click",function(t){return h(e),C(t==null?null:t.stopPropagation())}),x(10,"i",40),a()()(),I()}if(n&2){let e=c.$implicit;r(2),f(" ",E(3,4,e.PriceExpected)," "),r(2),s("ngClass",O(8,nt,e.Price!=e.PriceExpected)),r(3),f(" ",E(8,6,e.Price)," "),r(2),s("href",e.Url,b)}}function gt(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function ht(n,c){if(n&1&&(y(0),_(1,ut,11,10,"ng-container",50)(2,gt,4,0,"ng-template",null,1,Y),I()),n&2){let e=c.$implicit,i=q(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function Ct(n,c){if(n&1&&(o(0,"tr"),_(1,dt,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),x(10,"i",40),a()()()(),_(11,_t,2,1,"ng-template",19)(12,ht,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",O(8,et,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),b),r(2),s("ngxPermissionsOnly",O(10,Ge,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function ft(n,c){if(n&1&&(o(0,"tbody"),L(1,Ct,13,12,"tr",null,B),a()),n&2){let e=c.$implicit;r(),R(e.Variants)}}function xt(n,c){if(n&1&&(y(0),L(1,ft,3,0,"tbody",null,B),I()),n&2){let e=c.ngIf;r(),R(e)}}var gn=(()=>{class n{constructor(e,i,t,l,d,u,Ke){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=u,this.paginationService=Ke,this.infinitePagination=$(Q),this.searchFilter=new De,this.checkboxState=!1,this.rolePriceEdit=Ce.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=ae([]),this.filterTypeOptions=[{Key:H.ALL,Value:"All"},{Key:H.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];j.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(X(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ie(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=H.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),X(1))}onSelectAllData(){this.data$=this.data$.pipe(ne(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=te(ee({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(u=>u.ID),d={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Le,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(J(t=>j.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Re,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(J(u=>j.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,t)})}updateProductPrice(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(ke,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(S(xe),S(fe),S(we),S(Ve),S(z),S(Ne),S(Be))}}static{this.\u0275cmp=T({type:n,selectors:[["app-custom-channel-price"]],features:[A([Q])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),g("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),_(2,it,9,4,"ng-container",3),v(3,"async"),a(),o(4,"actions")(5,"div",4),_(6,at,3,1,"ng-container",3),v(7,"async"),o(8,"button",5),g("click",function(){return t.openExportDialog()}),x(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),x(20,"th",14),L(21,rt,6,6,"th",15,B),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),_(31,lt,2,1,"ng-template",19),L(32,ct,7,0,null,null,B),a()(),_(34,xt,3,0,"ng-container",3),v(35,"async"),a(),o(36,"infinite-paginator",20),v(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",E(3,13,t.loader$)),r(4),s("ngIf",E(7,15,t.data$)),r(15),R(t.channels()),r(10),s("ngxPermissionsOnly",O(21,Ge,t.rolePriceEdit)),r(),R(t.channels()),r(2),s("ngIf",E(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",E(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[D,pe,W,de,_e,ue,Fe,Me,k,he,V,N,Ue,je,K,G,$e,be,Pe,ze],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{gn as CustomChannelPriceComponent};
1
+ import{a as Le}from"./chunk-7M4RYU7S.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Re,b as $e,c as Ue,d as Q}from"./chunk-EQD3IUMF.js";import{a as Ce}from"./chunk-BVIRHZTZ.js";import{a as Be}from"./chunk-PF4F4EAR.js";import{a as De}from"./chunk-7KG3DC5J.js";import{b as ke}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import"./chunk-RNWWVG3M.js";import"./chunk-UOAYF4SW.js";import{a as Ve}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Ee,b as Te,c as Oe}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as Ne}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Se,b as ve,d as ye,e as Ie}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as z}from"./chunk-CIKNTHCR.js";import{b as fe,e as xe}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as we,l as Me,m as Fe}from"./chunk-XOT2SZPE.js";import{r as G,s as K}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{a as ge,b as he,h as V,m as N,y as k}from"./chunk-AI4XRCAL.js";import{c as j,e as Pe,f as be}from"./chunk-W6T7TOHE.js";import{d as pe,f as W,g as de,j as _e,m as ue,n as D}from"./chunk-B6POIFQM.js";import{Dc as q,Eb as T,Ec as p,Fc as ce,G as J,Gc as f,Ic as w,Jc as M,Ka as oe,Kb as _,Kc as F,Mc as A,Na as Z,Oc as O,Pc as se,Qa as ae,Wb as s,Xc as v,Yc as E,Z as X,Zb as re,Zc as me,_c as Y,bc as U,cc as B,ea as ie,ec as L,fc as R,gc as o,hc as a,ic as x,jc as y,kc as I,mc as P,ob as b,pa as $,qb as r,rc as g,sc as m,v as ne,vc as le,wb as S,ya as h,za as C}from"./chunk-EIQCOZF5.js";import{a as ee,b as te}from"./chunk-K2H6WANG.js";var Xe=(n,c)=>({color:n,"font-weight":c});function Ze(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();re(se(7,Xe,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var je=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new oe,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),g("ngModelChange",function(d){return t.change(d)}),_(1,Ze,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[D,W,Oe,Ee,Te,k,V,N,K,G],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();function qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a()),n&2){let e=c.item;r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," ")}}function Ye(n,c){if(n&1){let e=P();o(0,"span",6),g("click",function(){h(e);let t=m(),l=t.item,d=t.clear;return C(d(l))}),p(1,"x"),a()}}function Qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a(),_(4,Ye,2,0,"span",5)),n&2){let e=c.item,i=m();r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," "),r(),U(i.clearable()?4:-1)}}var ze=(()=>{class n{constructor(){this.authService=$(z),this.multiple=Z(!1),this.clearable=Z(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[A([{provide:ge,multi:!0,useExisting:n}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,t){i&1&&(o(0,"ng-select",0),F("ngModelChange",function(d){return M(t.selectedChannels,d)||(t.selectedChannels=d),d}),g("ngModelChange",function(d){return t.onChannelChange(d)}),_(1,qe,4,2,"ng-template",1)(2,Qe,5,3,"ng-template",2),a()),i&2&&(s("clearable",t.clearable())("items",t.options),w("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[D,Ie,ye,Se,ve,k,V,N],encapsulation:2})}}return n})();var Ge=n=>[n],et=n=>({"text-decoration-line-through":n}),tt=n=>({"border-bottom":n}),nt=n=>({"bg-gradient-warning":n});function it(n,c){if(n&1){let e=P();y(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),F("ngModelChange",function(t){h(e);let l=m();return M(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),F("modelChange",function(t){h(e);let l=m();return M(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),I()}if(n&2){let e=m();r(4),s("multiple",!0),w("ngModel",e.searchFilter.ListChannelID),r(4),w("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function ot(n,c){if(n&1){let e=P();o(0,"button",27),g("click",function(){h(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),x(1,"i",28),p(2," Update "),a()}}function at(n,c){if(n&1&&(y(0),o(1,"div",4),_(2,ot,3,0,"button",26),a(),I()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function rt(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),x(2,"img",30),o(3,"div",31),p(4),v(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,b),r(2),f(" ",me(5,3,e.Name,20)," ")}}function lt(n,c){if(n&1){let e=P();o(0,"th")(1,"input",32),F("ngModelChange",function(t){h(e);let l=m();return M(l.checkboxState,t)||(l.checkboxState=t),C(t)}),g("ngModelChange",function(){h(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),w("ngModel",e.checkboxState)}}function ct(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function st(n,c){if(n&1){let e=P();o(0,"img",47),g("click",function(t){h(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;le("src",e==null?null:e.ImageUrl,b)}}function mt(n,c){n&1&&x(0,"img",48)}function pt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function dt(n,c){if(n&1&&(y(0),o(1,"td",42),_(2,st,1,1,"img",43)(3,mt,1,0,"ng-template",null,0,Y),a(),o(5,"td",44)(6,"h5",45),p(7),a(),_(8,pt,2,1,"small",46),a(),I()),n&2){let e=q(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",O(7,tt,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),ce(t==null?null:t.Name),r(),U(t!=null&&t.Category?8:-1)}}function _t(n,c){if(n&1){let e=P();o(0,"td",49)(1,"input",32),F("ngModelChange",function(t){h(e);let l=m().$implicit;return M(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),w("ngModel",e.selected)}}function ut(n,c){if(n&1){let e=P();y(0),o(1,"td",51),p(2),v(3,"number"),a(),o(4,"td",52),g("click",function(){let t=h(e).$implicit,l=m(2).$implicit,d=m().$implicit,u=m(2);return C(u.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),v(8,"number"),a(),o(9,"a",55),g("click",function(t){return h(e),C(t==null?null:t.stopPropagation())}),x(10,"i",40),a()()(),I()}if(n&2){let e=c.$implicit;r(2),f(" ",E(3,4,e.PriceExpected)," "),r(2),s("ngClass",O(8,nt,e.Price!=e.PriceExpected)),r(3),f(" ",E(8,6,e.Price)," "),r(2),s("href",e.Url,b)}}function gt(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function ht(n,c){if(n&1&&(y(0),_(1,ut,11,10,"ng-container",50)(2,gt,4,0,"ng-template",null,1,Y),I()),n&2){let e=c.$implicit,i=q(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function Ct(n,c){if(n&1&&(o(0,"tr"),_(1,dt,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),x(10,"i",40),a()()()(),_(11,_t,2,1,"ng-template",19)(12,ht,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",O(8,et,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),b),r(2),s("ngxPermissionsOnly",O(10,Ge,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function ft(n,c){if(n&1&&(o(0,"tbody"),L(1,Ct,13,12,"tr",null,B),a()),n&2){let e=c.$implicit;r(),R(e.Variants)}}function xt(n,c){if(n&1&&(y(0),L(1,ft,3,0,"tbody",null,B),I()),n&2){let e=c.ngIf;r(),R(e)}}var gn=(()=>{class n{constructor(e,i,t,l,d,u,Ke){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=u,this.paginationService=Ke,this.infinitePagination=$(Q),this.searchFilter=new De,this.checkboxState=!1,this.rolePriceEdit=Ce.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=ae([]),this.filterTypeOptions=[{Key:H.ALL,Value:"All"},{Key:H.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];j.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(X(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ie(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=H.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),X(1))}onSelectAllData(){this.data$=this.data$.pipe(ne(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=te(ee({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(u=>u.ID),d={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Le,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(J(t=>j.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Re,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(J(u=>j.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,t)})}updateProductPrice(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(ke,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(S(xe),S(fe),S(we),S(Ve),S(z),S(Ne),S(Be))}}static{this.\u0275cmp=T({type:n,selectors:[["app-custom-channel-price"]],features:[A([Q])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),g("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),_(2,it,9,4,"ng-container",3),v(3,"async"),a(),o(4,"actions")(5,"div",4),_(6,at,3,1,"ng-container",3),v(7,"async"),o(8,"button",5),g("click",function(){return t.openExportDialog()}),x(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),x(20,"th",14),L(21,rt,6,6,"th",15,B),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),_(31,lt,2,1,"ng-template",19),L(32,ct,7,0,null,null,B),a()(),_(34,xt,3,0,"ng-container",3),v(35,"async"),a(),o(36,"infinite-paginator",20),v(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",E(3,13,t.loader$)),r(4),s("ngIf",E(7,15,t.data$)),r(15),R(t.channels()),r(10),s("ngxPermissionsOnly",O(21,Ge,t.rolePriceEdit)),r(),R(t.channels()),r(2),s("ngIf",E(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",E(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[D,pe,W,de,_e,ue,Fe,Me,k,he,V,N,Ue,je,K,G,$e,be,Pe,ze],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{gn as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{b as ae}from"./chunk-5Z63CRGG.js";import{c as re}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-HPS3WVU5.js";import{a as X,b as Y,d as Z,e as ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-D2R7H4PZ.js";import{b as G,e as q}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as ne,m as oe}from"./chunk-XOT2SZPE.js";import{r as te,s as ie}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{h as A,m as H,y as z}from"./chunk-AI4XRCAL.js";import{b as d,c as J}from"./chunk-W6T7TOHE.js";import{J as b,f as W,g as $,j as k,n as v}from"./chunk-B6POIFQM.js";import{Eb as V,Ec as s,Fb as S,Fc as _,Gc as B,Ic as O,Jc as P,Kb as g,Kc as D,Wb as l,Xc as C,Yc as L,Z as M,aa as F,ea as R,gc as o,hc as r,ic as j,jc as I,ka as u,kc as T,mc as w,ob as K,q as U,qb as a,rc as E,sc as h,v as y,wb as f,ya as x,za as N}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";function me(i,m){if(i&1&&(o(0,"span",13),j(1,"img",14),r(),o(2,"span"),s(3),r()),i&2){let t=m.item;a(),l("src",t.Img,K)("alt",t.Name),a(2),B(" ",t.Name," ")}}function pe(i,m){if(i&1){let t=w();I(0),o(1,"a",15),E("click",function(){let n=x(t).ngIf,c=h();return N(c.submitLogistics(n))}),s(2,"Submit"),r(),T()}}function de(i,m){if(i&1){let t=w();I(0),o(1,"ng-select",16),D("ngModelChange",function(n){x(t);let c=h().$implicit;return P(c.ProductSKU,n)||(c.ProductSKU=n),N(n)}),r(),T()}if(i&2){let t=m.ngIf,e=h().$implicit;a(),O("ngModel",e.ProductSKU),l("items",t)}}function ge(i,m){if(i&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),g(8,de,2,2,"ng-container",4),C(9,"async"),r()()),i&2){let t=m.$implicit,e=h();a(2),_(t.Name),a(2),_(t.Service),a(2),_(t.TypeString),a(2),l("ngIf",L(9,4,e.logisticOptions$))}}var le=(()=>{class i{constructor(t,e,n){this.http=t,this.toastr=e,this.authService=n,this.filter={ChannelID:""},this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(t.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(y(e=>t.map(n=>(e.findIndex(p=>p.Name===n.Name&&p.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(y(t=>t.map(e=>(e.ProductSKU=J.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),R(t=>{let e=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=U(e)}),M(1))}iniTitle(){let t=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(e){return new(e||i)(f(q),f(G),f(Q))}}static{this.\u0275cmp=V({type:i,selectors:[["app-logistic"]],standalone:!1,decls:29,vars:11,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",0),E("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),r(),o(5,"ng-select",2),D("ngModelChange",function(p){return P(n.filter.ChannelID,p)||(n.filter.ChannelID=p),p}),g(6,me,4,3,"ng-template",3),r()()(),o(7,"actions"),g(8,pe,3,0,"ng-container",4),C(9,"async"),r(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),r(),o(20,"th"),s(21,"Service"),r(),o(22,"th"),s(23,"Type"),r(),o(24,"th"),s(25,"Logistic Service"),r()()(),o(26,"tbody"),g(27,ge,10,6,"tr",12),C(28,"async"),r()()()()()()()()),e&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),l("clearable",!1)("items",n.channelOptions),O("ngModel",n.filter.ChannelID),a(3),l("ngIf",L(9,7,n.logisticServices$)),a(19),l("ngForOf",L(28,9,n.logisticServices$)))},dependencies:[W,$,A,H,ne,Z,X,Y,te,k],encapsulation:2})}}return i})();var he=[{path:"",component:le}],ce=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b.forChild(he)]})}}return i})();var $e=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b,ce,z,oe,ee,ae,re,ie]})}}return i})();export{$e as LogisticModule};
1
+ import{b as ae}from"./chunk-5Z63CRGG.js";import{c as re}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-HPS3WVU5.js";import{a as X,b as Y,d as Z,e as ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-CIKNTHCR.js";import{b as G,e as q}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as ne,m as oe}from"./chunk-XOT2SZPE.js";import{r as te,s as ie}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{h as A,m as H,y as z}from"./chunk-AI4XRCAL.js";import{b as d,c as J}from"./chunk-W6T7TOHE.js";import{J as b,f as W,g as $,j as k,n as v}from"./chunk-B6POIFQM.js";import{Eb as V,Ec as s,Fb as S,Fc as _,Gc as B,Ic as O,Jc as P,Kb as g,Kc as D,Wb as l,Xc as C,Yc as L,Z as M,aa as F,ea as R,gc as o,hc as r,ic as j,jc as I,ka as u,kc as T,mc as w,ob as K,q as U,qb as a,rc as E,sc as h,v as y,wb as f,ya as x,za as N}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";function me(i,m){if(i&1&&(o(0,"span",13),j(1,"img",14),r(),o(2,"span"),s(3),r()),i&2){let t=m.item;a(),l("src",t.Img,K)("alt",t.Name),a(2),B(" ",t.Name," ")}}function pe(i,m){if(i&1){let t=w();I(0),o(1,"a",15),E("click",function(){let n=x(t).ngIf,c=h();return N(c.submitLogistics(n))}),s(2,"Submit"),r(),T()}}function de(i,m){if(i&1){let t=w();I(0),o(1,"ng-select",16),D("ngModelChange",function(n){x(t);let c=h().$implicit;return P(c.ProductSKU,n)||(c.ProductSKU=n),N(n)}),r(),T()}if(i&2){let t=m.ngIf,e=h().$implicit;a(),O("ngModel",e.ProductSKU),l("items",t)}}function ge(i,m){if(i&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),g(8,de,2,2,"ng-container",4),C(9,"async"),r()()),i&2){let t=m.$implicit,e=h();a(2),_(t.Name),a(2),_(t.Service),a(2),_(t.TypeString),a(2),l("ngIf",L(9,4,e.logisticOptions$))}}var le=(()=>{class i{constructor(t,e,n){this.http=t,this.toastr=e,this.authService=n,this.filter={ChannelID:""},this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(t.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(y(e=>t.map(n=>(e.findIndex(p=>p.Name===n.Name&&p.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(y(t=>t.map(e=>(e.ProductSKU=J.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),R(t=>{let e=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=U(e)}),M(1))}iniTitle(){let t=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(e){return new(e||i)(f(q),f(G),f(Q))}}static{this.\u0275cmp=V({type:i,selectors:[["app-logistic"]],standalone:!1,decls:29,vars:11,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",0),E("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),r(),o(5,"ng-select",2),D("ngModelChange",function(p){return P(n.filter.ChannelID,p)||(n.filter.ChannelID=p),p}),g(6,me,4,3,"ng-template",3),r()()(),o(7,"actions"),g(8,pe,3,0,"ng-container",4),C(9,"async"),r(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),r(),o(20,"th"),s(21,"Service"),r(),o(22,"th"),s(23,"Type"),r(),o(24,"th"),s(25,"Logistic Service"),r()()(),o(26,"tbody"),g(27,ge,10,6,"tr",12),C(28,"async"),r()()()()()()()()),e&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),l("clearable",!1)("items",n.channelOptions),O("ngModel",n.filter.ChannelID),a(3),l("ngIf",L(9,7,n.logisticServices$)),a(19),l("ngForOf",L(28,9,n.logisticServices$)))},dependencies:[W,$,A,H,ne,Z,X,Y,te,k],encapsulation:2})}}return i})();var he=[{path:"",component:le}],ce=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b.forChild(he)]})}}return i})();var $e=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b,ce,z,oe,ee,ae,re,ie]})}}return i})();export{$e as LogisticModule};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-52GRE6TF.js";import"./chunk-77IUCPIQ.js";import{a as K}from"./chunk-6HVHZ3HN.js";import{a as Oe,b as ke}from"./chunk-ARIW575T.js";import"./chunk-OVYL7SOO.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Z,b as Ve}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import{a as W}from"./chunk-AUGXMJYD.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as de,b as pe,d as me,e as Re}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as se}from"./chunk-D2R7H4PZ.js";import{e as D}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as M,m as Le}from"./chunk-XOT2SZPE.js";import{r as Ne,s as Pe}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as oe,h as re,m as ae,o as le,t as Ie,u as Te,y as De,z as Me}from"./chunk-AI4XRCAL.js";import{c as V}from"./chunk-W6T7TOHE.js";import{E as B,F as Ee,H as P,J as he,d as ue,f as Y,g as I,j as we,k as T,l as F,n as ge}from"./chunk-B6POIFQM.js";import{Dc as z,Eb as x,Ec as r,Fb as ne,Fc as d,Gc as k,Ic as y,Jc as C,Kb as f,Kc as S,Nc as U,Oc as A,Wb as p,Xc as _,Yc as L,Z as Ce,Zc as E,_b as xe,_c as J,ea as Se,gc as i,hc as n,ic as N,ja as ce,jc as j,ka as ie,kc as q,mc as R,oa as be,ob as H,qb as l,rc as w,sc as v,v as ye,wb as h,ya as c,za as u}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var We=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"}]}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=x({type:o,selectors:[["app-logs"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(a,t){a&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),N(3,"nav-tab",2),n()()(),N(4,"router-outlet")),a&2&&(l(3),p("Tabs",t.ObjectlogTabs))},dependencies:[Ee,Oe],encapsulation:2})}}return o})();var X=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(e){this._Data=e}Fill(e){return this._Data.find(a=>a._id==e)}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var et=()=>["/menu/log/order/detail-user"],tt=o=>({ID:o}),it=o=>({"bg-warning":o});function nt(o,g){if(o&1&&(i(0,"span",22),N(1,"img",23),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),k(" ",e.Name," ")}}function ot(o,g){o&1&&(i(0,"th",27)(1,"span",33),r(2," Response Body Warning "),n()())}function rt(o,g){o&1&&(i(0,"th")(1,"span",33),r(2," Number Override "),n()())}function at(o,g){if(o&1&&(i(0,"td",27)(1,"span",36),r(2),n()()),o&2){let e=v().$implicit;l(),p("ngClass",A(2,it,e.responseBodyWarning!=null)),l(),d(e.responseBodyWarning)}}function lt(o,g){if(o&1&&(i(0,"td"),r(1),n()),o&2){let e=v().$implicit;l(),k(" ",e.ResponseBodyWarningReference," ")}}function st(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",34),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td",27)(12,"span",35),r(13),n()(),f(14,at,3,4,"td",29)(15,lt,2,1,"td",30),n()),o&2){let e=g.$implicit,a=v(2);l(2),p("routerLink",U(14,et))("queryParams",A(15,tt,e.ID)),l(),k(" ",E(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.MarketTypeString),l(2),d(e.POSActionTypeString),l(2),d(e.Number),l(2),xe(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),l(),k(" ",e.ResponseCode," "),l(),p("ngIf",a.responseBodyWarningVisible),l(),p("ngIf",a.responseBodyWarningVisible)}}function dt(o,g){if(o&1){let e=R();j(0),i(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),r(6,"Date"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"Actions"),n(),i(11,"th"),r(12,"Number"),n(),i(13,"th",27)(14,"span",28),r(15," Response Code "),n()(),f(16,ot,3,0,"th",29)(17,rt,3,0,"th",30),n()(),i(18,"tbody"),f(19,st,16,17,"tr",31),n()(),i(20,"mat-paginator",32),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngIf",e.responseBodyWarningVisible),l(),p("ngIf",e.responseBodyWarningVisible),l(2),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function pt(o,g){o&1&&(i(0,"div",37),N(1,"app-empty-state"),n())}var qe=(()=>{class o{constructor(e,a,t,m){this.http=e,this._RawLogService=a,this.route=t,this.authService=m,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("/api/Orders/Get",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){t._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let m={ID:t._id,Created:t._source["@timestamp_received"],shopId:t._source.shopId,MarketTypeString:t._source.log.type,POSActionTypeString:t._source.message,Number:t._source.log.number,ResponseCode:t._source.log.responseCode,responseBodyWarning:t._source.log.responseBodyWarning,ResponseBodyWarningReference:t._source.log.ResponseBodyWarningReference};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(B),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-order"]],standalone:!1,decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.Number,s)||(t.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,nt,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",2),r(9,"Action"),n(),i(10,"ng-select",6),S("ngModelChange",function(s){return c(m),C(t.filter.ActionType,s)||(t.filter.ActionType=s),u(s)}),n()(),i(11,"div",5)(12,"label",7),r(13,"From/To"),n(),i(14,"div",8)(15,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",5)(19,"label",11),r(20,"Response Code"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.StatusCode,s)||(t.filter.StatusCode=s),u(s)}),n()(),i(22,"div",5)(23,"label",11),r(24,"Response Body Warning"),n(),i(25,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.responseBodyWarning,s)||(t.filter.responseBodyWarning=s),u(s)}),n(),i(26,"datalist",14),N(27,"option",15),n()(),i(28,"div",5)(29,"label",11),r(30,"Page Number"),n(),i(31,"input",16),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(32,"div",5)(33,"label",11),r(34,"Page Size"),n(),i(35,"input",17),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),f(40,dt,21,6,"ng-container",21)(41,pt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(42);y("text",t.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(5),p("clearable",!0)("items",t.ActionTypeList),y("ngModel",t.filter.ActionType),l(5),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.StatusCode),l(4),y("ngModel",t.filter.responseBodyWarning),l(6),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,I,Ie,Te,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,Ne,T],encapsulation:2})}}return o})();var mt=o=>({"bg-gradient-warning":o}),ct=()=>["/menu/log/inventory/sync-inventory/detail"],ut=o=>({ID:o});function gt(o,g){if(o&1&&(i(0,"span",19),N(1,"img",20),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),k(" ",e.Name," ")}}function ht(o,g){if(o&1&&(i(0,"tr",26)(1,"td")(2,"a",27),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td"),r(12),n()()),o&2){let e=g.$implicit;p("ngClass",A(11,mt,e.ResponseCode==400)),l(2),p("routerLink",U(13,ct))("queryParams",A(14,ut,e.ID)),l(),k(" ",E(4,8,e.Created,"dd MMM yyyy HH:mm")," "),l(3),d(e.channelName),l(2),d(e.Sku),l(2),d(e.Stock),l(2),d(e.ResponseCode)}}function ft(o,g){if(o&1){let e=R();j(0),i(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),r(6,"Created"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"SKU"),n(),i(11,"th"),r(12,"Stock"),n(),i(13,"th"),r(14,"Response code"),n()()(),i(15,"tbody"),f(16,ht,13,16,"tr",24),n()(),i(17,"mat-paginator",25),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function vt(o,g){o&1&&(i(0,"div",28),N(1,"app-empty-state"),n())}var Ge=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter=e.Filter,this.ActionTypeList=e.Options.ActionTypeList,this.Get()})}Get(e){e!=null&&(this.filter.Sku=e),this.http.post("api/Inventory/GetLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={ID:t._source.log.id,Created:t._source["@timestamp_received"],channelName:t._source.log.channelName,Sku:t._source.log.sku,Stock:t._source.log.stock,ResponseCode:t._source.log.responseCode};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-log"]],standalone:!1,decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"ngClass"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Sku,s)||(t.filter.Sku=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"actions")(2,"a",2),r(3," Order Inventory Sync Job "),n()(),i(4,"filters")(5,"div",3)(6,"div")(7,"label",4),r(8,"Channel"),n(),i(9,"ng-select",5),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(10,gt,3,3,"ng-template",6),n()(),i(11,"div",7)(12,"label",8),r(13,"From/To"),n(),i(14,"div",9)(15,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",11),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",7)(19,"label",12),r(20,"Page Number"),n(),i(21,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(22,"div",7)(23,"label",12),r(24,"Page Size"),n(),i(25,"input",14),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()()(),i(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),f(30,ft,18,4,"ng-container",18)(31,vt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(32);y("text",t.filter.Sku),l(9),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,I,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();var _t=()=>["/menu/log/rawlog/detail"],yt=o=>({ID:o});function Ct(o,g){if(o&1&&(i(0,"span",17),N(1,"img",18),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),k(" ",e.Name," ")}}function St(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",25),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n()()),o&2){let e=g.$implicit;l(2),p("routerLink",U(9,_t))("queryParams",A(10,yt,e.id)),l(),k(" ",E(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.type),l(2),d(e.number),l(2),d(e.message)}}function bt(o,g){if(o&1){let e=R();j(0),i(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),r(6,"Date"),n(),i(7,"th"),r(8,"Type"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Message"),n()()(),i(13,"tbody"),f(14,St,11,12,"tr",23),n()(),i(15,"mat-paginator",24),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(14),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function xt(o,g){o&1&&(i(0,"div",26),N(1,"app-empty-state"),n())}var He=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-log"]],standalone:!1,decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Number,s)||(t.filter.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,Ct,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",6),r(9,"From/To"),n(),i(10,"div",7)(11,"datepicker",8),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(12,"div")(13,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(14,"div",5)(15,"label",10),r(16,"Page Number"),n(),i(17,"input",11),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(18,"div",5)(19,"label",10),r(20,"Page Size"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),f(26,bt,16,4,"ng-container",16)(27,xt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(28);y("text",t.filter.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[Y,I,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();function wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Et(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var ze=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=V.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=V.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-detail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Et,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(E(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();function It(o,g){if(o&1&&(i(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),r(4,"General"),n()(),i(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),r(10,"Date"),n(),i(11,"div")(12,"span"),r(13),_(14,"date"),n()()()(),i(15,"div",6)(16,"div",12)(17,"label"),r(18,"SKU"),n(),i(19,"div")(20,"span"),r(21),n()()()(),i(22,"div",6)(23,"div",12)(24,"label"),r(25,"Channel"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",6)(30,"div",12)(31,"label"),r(32,"Response Code"),n(),i(33,"div")(34,"span"),r(35),n()()()()()()()()),o&2){let e=v();l(13),d(E(14,4,e.data.Created,"dd MMM yyyy")),l(8),d(e.data.Sku),l(7),d(e.data.ChannelName),l(7),d(e.data.ResponseCode)}}var Ue=(()=>{class o{constructor(e,a,t){this.route=e,this.http=a,this._RawLogService=t,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(m=>{this.ID=m.ID,this.Load()})}ngOnInit(){}Load(){var e={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",e).subscribe(a=>{this.data.Created=a.hits[0]._source["@timestamp_received"],this.data.Sku=a.hits[0]._source.log.sku,this.data.ChannelName=a.hits[0]._source.log.channelName,this.data.ResponseCode=a.hits[0]._source.log.responseCode,this.request=V.IsNotEmpty(a.hits[0]?._source.log?.request)?JSON.parse(a.hits[0]?._source?.log?.request):"",this.response=a.hits[0]._source.log.response})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D),h(X))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-detail"]],standalone:!1,decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3),f(7,It,36,7,"div",4),n(),i(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),r(13,"Request"),n()(),i(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),r(18),_(19,"json"),n()()()()()(),i(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),r(24,"Response"),n()(),i(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),r(29),n()()()()()()()()()()),a&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),l(7),p("ngIf",t.data),l(11),d(L(19,5,t.request)),l(11),d(t.response))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();function Tt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Dt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Je=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=V.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=V.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Tt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Dt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(E(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();var Mt=()=>["/menu/log/exception/detail"],Rt=o=>({ID:o});function Nt(o,g){if(o&1&&(i(0,"tr")(1,"td",12),N(2,"img",13),n(),i(3,"td"),r(4),_(5,"date"),n(),i(6,"td")(7,"a",14),r(8),n()(),i(9,"td")(10,"div",15),r(11),n(),i(12,"div"),r(13),n()()()),o&2){let e=g.$implicit;l(2),p("src",e.logo,H),l(2),d(E(5,7,e.date,"dd-MM-yyyy hh:mm:ss")),l(3),p("routerLink",U(10,Mt))("queryParams",A(11,Rt,e.id)),l(),k(" ",e.number," "),l(3),d(e.message),l(2),d(e.stackTrace)}}function Pt(o,g){if(o&1){let e=R();j(0),i(1,"mat-paginator",16),w("page",function(t){c(e);let m=v(2);return u(m.onPaginationChange(t))}),n(),q()}if(o&2){let e=v(2);l(),p("length",e.pageTotal)("pageSize",e.pageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function Lt(o,g){if(o&1&&(j(0),i(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),r(6,"Channel"),n(),i(7,"th",9),r(8,"Date"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Exception"),n()()(),i(13,"tbody"),f(14,Nt,14,13,"tr",10),n()(),f(15,Pt,2,3,"ng-container",11),n(),q()),o&2){let e=v();l(14),p("ngForOf",e.exceptions),l(),p("ngIf",(e.exceptions==null?null:e.exceptions.length)>0)}}function Ot(o,g){o&1&&(i(0,"div",17),N(1,"app-empty-state"),n())}var Ye=(()=>{class o{constructor(e){this.http=e,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(e=>{this.exceptions=e.hits.map(a=>({id:a._id,logo:V.getChannelLogoByName(a._source.error?.Type),number:a._source.error.number,date:a._source["@timestamp_received"],stackTrace:a._source.error.stackTrace,message:a._source.message,requestJSON:a._source?.error?.requestJSON})),this.pageTotal=e.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getData()}static{this.\u0275fac=function(a){return new(a||o)(h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-log"]],standalone:!1,decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1&&(i(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),f(5,Lt,16,2,"ng-container",5)(6,Ot,2,0,"ng-template",null,0,J),n()()()()()),a&2){let m=z(7);l(5),p("ngIf",t.exceptions.length>0)("ngIfElse",m)}},dependencies:[Y,I,P,M,Z,K,T],encapsulation:2})}}return o})();var Ke=(()=>{class o{constructor(e){this.httpService=e}getExceptionDetail(e){return this.httpService.post("/api/Orders/GetDetailException",{ID:e}).pipe(ye(t=>t?.hits[0]?._source))}static{this.\u0275fac=function(a){return new(a||o)(be(D))}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function Vt(o,g){if(o&1&&(i(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),r(6,"General"),n()(),i(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),r(12,"Date"),n(),i(13,"div")(14,"span"),r(15),_(16,"date"),n()()()(),i(17,"div",9)(18,"div",10)(19,"label"),r(20,"Number"),n(),i(21,"div")(22,"span"),r(23),n()()()(),i(24,"div",9)(25,"div",10)(26,"label"),r(27,"Type"),n(),i(28,"div")(29,"span"),r(30),n()()()(),i(31,"div",9)(32,"div",10)(33,"label"),r(34,"ShopID"),n(),i(35,"div")(36,"span"),r(37),n()()()()()()()()(),i(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),r(43,"Request"),n()(),i(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),r(48),_(49,"json"),n()()()()()(),i(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),r(54,"Exception"),n()(),i(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),r(59),n(),i(60,"pre"),r(61),n()()()()()()()()),o&2){let e=g.ngIf;l(15),d(E(16,7,e["@timestamp"],"dd MMM yyyy HH:mm:ss")),l(8),d(e==null||e.error==null?null:e.error.number),l(7),d(e==null||e.error==null?null:e.error.Type),l(7),d(e==null?null:e.shopId),l(11),d(L(49,10,e==null||e.error==null?null:e.error.requestJSON)),l(11),d(e==null?null:e.message),l(2),d(e==null||e.error==null?null:e.error.stackTrace)}}var Ze=(()=>{class o{constructor(e,a){this.activatedRoute=e,this.exceptionService=a,this.invoiceNumber=""}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(e?.ID)}getExceptionDetail(e){this.exceptionDetail$=this.exceptionService.getExceptionDetail(e).pipe(Se(a=>{this.invoiceNumber=a?.error?.number}),Ce(1))}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(Ke))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-detail"]],standalone:!1,decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"content"),f(2,Vt,62,12,"div",1),_(3,"async"),n()()),a&2&&(p("headerTitle","Order #"+t.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",L(3,4,t.exceptionDetail$)))},dependencies:[I,M,we,F,T],encapsulation:2})}}return o})();function Wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Bt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Qe=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailSyncOrder",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=V.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=V.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail-user"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Bt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(E(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();var At=[{path:"",component:We,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:qe,canActivate:[W],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Ge,canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:He,canActivate:[W],data:{title:"Raw Log"}},{path:"rawlog/detail",component:ze,canActivate:[W],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:Ue,canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:Je,canActivate:[W],data:{title:"Order Details"}},{path:"order/detail-user",component:Qe,canActivate:[W],data:{title:"Order User Details"}},{path:"exception",component:Ye,canActivate:[W],data:{title:"Exception Log"}},{path:"exception/detail",component:Ze,canActivate:[W],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-IVX7QWP7.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-XR4JKTPA.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-2TAZ7EVF.js").then(o=>o.ChannelLogComponent)},canActivate:[W],data:{title:"Authorization Log"}}]}],Xe=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,he.forChild(At)]})}}return o})();var $e=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=ne({type:o});static \u0275inj=ie({})}return o})();var en=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,De,Me,Xe,he,Le,$e,Ve,Re,ke,Q,Pe]})}}return o})();export{en as LogsModule};
1
+ import{a as Q}from"./chunk-52GRE6TF.js";import"./chunk-77IUCPIQ.js";import{a as K}from"./chunk-6HVHZ3HN.js";import{a as Oe,b as ke}from"./chunk-ARIW575T.js";import"./chunk-OVYL7SOO.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Z,b as Ve}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import{a as W}from"./chunk-MV2W43TI.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as de,b as pe,d as me,e as Re}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as se}from"./chunk-CIKNTHCR.js";import{e as D}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as M,m as Le}from"./chunk-XOT2SZPE.js";import{r as Ne,s as Pe}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as oe,h as re,m as ae,o as le,t as Ie,u as Te,y as De,z as Me}from"./chunk-AI4XRCAL.js";import{c as V}from"./chunk-W6T7TOHE.js";import{E as B,F as Ee,H as P,J as he,d as ue,f as Y,g as I,j as we,k as T,l as F,n as ge}from"./chunk-B6POIFQM.js";import{Dc as z,Eb as x,Ec as r,Fb as ne,Fc as d,Gc as k,Ic as y,Jc as C,Kb as f,Kc as S,Nc as U,Oc as A,Wb as p,Xc as _,Yc as L,Z as Ce,Zc as E,_b as xe,_c as J,ea as Se,gc as i,hc as n,ic as N,ja as ce,jc as j,ka as ie,kc as q,mc as R,oa as be,ob as H,qb as l,rc as w,sc as v,v as ye,wb as h,ya as c,za as u}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var We=(()=>{class o{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"}]}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=x({type:o,selectors:[["app-logs"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(a,t){a&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),N(3,"nav-tab",2),n()()(),N(4,"router-outlet")),a&2&&(l(3),p("Tabs",t.ObjectlogTabs))},dependencies:[Ee,Oe],encapsulation:2})}}return o})();var X=(()=>{class o{constructor(){}get Data(){return this._Data}set Data(e){this._Data=e}Fill(e){return this._Data.find(a=>a._id==e)}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var et=()=>["/menu/log/order/detail-user"],tt=o=>({ID:o}),it=o=>({"bg-warning":o});function nt(o,g){if(o&1&&(i(0,"span",22),N(1,"img",23),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),k(" ",e.Name," ")}}function ot(o,g){o&1&&(i(0,"th",27)(1,"span",33),r(2," Response Body Warning "),n()())}function rt(o,g){o&1&&(i(0,"th")(1,"span",33),r(2," Number Override "),n()())}function at(o,g){if(o&1&&(i(0,"td",27)(1,"span",36),r(2),n()()),o&2){let e=v().$implicit;l(),p("ngClass",A(2,it,e.responseBodyWarning!=null)),l(),d(e.responseBodyWarning)}}function lt(o,g){if(o&1&&(i(0,"td"),r(1),n()),o&2){let e=v().$implicit;l(),k(" ",e.ResponseBodyWarningReference," ")}}function st(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",34),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td",27)(12,"span",35),r(13),n()(),f(14,at,3,4,"td",29)(15,lt,2,1,"td",30),n()),o&2){let e=g.$implicit,a=v(2);l(2),p("routerLink",U(14,et))("queryParams",A(15,tt,e.ID)),l(),k(" ",E(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.MarketTypeString),l(2),d(e.POSActionTypeString),l(2),d(e.Number),l(2),xe(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),l(),k(" ",e.ResponseCode," "),l(),p("ngIf",a.responseBodyWarningVisible),l(),p("ngIf",a.responseBodyWarningVisible)}}function dt(o,g){if(o&1){let e=R();j(0),i(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),r(6,"Date"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"Actions"),n(),i(11,"th"),r(12,"Number"),n(),i(13,"th",27)(14,"span",28),r(15," Response Code "),n()(),f(16,ot,3,0,"th",29)(17,rt,3,0,"th",30),n()(),i(18,"tbody"),f(19,st,16,17,"tr",31),n()(),i(20,"mat-paginator",32),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngIf",e.responseBodyWarningVisible),l(),p("ngIf",e.responseBodyWarningVisible),l(2),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function pt(o,g){o&1&&(i(0,"div",37),N(1,"app-empty-state"),n())}var qe=(()=>{class o{constructor(e,a,t,m){this.http=e,this._RawLogService=a,this.route=t,this.authService=m,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("/api/Orders/Get",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){t._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let m={ID:t._id,Created:t._source["@timestamp_received"],shopId:t._source.shopId,MarketTypeString:t._source.log.type,POSActionTypeString:t._source.message,Number:t._source.log.number,ResponseCode:t._source.log.responseCode,responseBodyWarning:t._source.log.responseBodyWarning,ResponseBodyWarningReference:t._source.log.ResponseBodyWarningReference};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(B),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-order"]],standalone:!1,decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.Number,s)||(t.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,nt,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",2),r(9,"Action"),n(),i(10,"ng-select",6),S("ngModelChange",function(s){return c(m),C(t.filter.ActionType,s)||(t.filter.ActionType=s),u(s)}),n()(),i(11,"div",5)(12,"label",7),r(13,"From/To"),n(),i(14,"div",8)(15,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",5)(19,"label",11),r(20,"Response Code"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.StatusCode,s)||(t.filter.StatusCode=s),u(s)}),n()(),i(22,"div",5)(23,"label",11),r(24,"Response Body Warning"),n(),i(25,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.responseBodyWarning,s)||(t.filter.responseBodyWarning=s),u(s)}),n(),i(26,"datalist",14),N(27,"option",15),n()(),i(28,"div",5)(29,"label",11),r(30,"Page Number"),n(),i(31,"input",16),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(32,"div",5)(33,"label",11),r(34,"Page Size"),n(),i(35,"input",17),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),f(40,dt,21,6,"ng-container",21)(41,pt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(42);y("text",t.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(5),p("clearable",!0)("items",t.ActionTypeList),y("ngModel",t.filter.ActionType),l(5),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.StatusCode),l(4),y("ngModel",t.filter.responseBodyWarning),l(6),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,I,Ie,Te,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,Ne,T],encapsulation:2})}}return o})();var mt=o=>({"bg-gradient-warning":o}),ct=()=>["/menu/log/inventory/sync-inventory/detail"],ut=o=>({ID:o});function gt(o,g){if(o&1&&(i(0,"span",19),N(1,"img",20),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),k(" ",e.Name," ")}}function ht(o,g){if(o&1&&(i(0,"tr",26)(1,"td")(2,"a",27),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n(),i(11,"td"),r(12),n()()),o&2){let e=g.$implicit;p("ngClass",A(11,mt,e.ResponseCode==400)),l(2),p("routerLink",U(13,ct))("queryParams",A(14,ut,e.ID)),l(),k(" ",E(4,8,e.Created,"dd MMM yyyy HH:mm")," "),l(3),d(e.channelName),l(2),d(e.Sku),l(2),d(e.Stock),l(2),d(e.ResponseCode)}}function ft(o,g){if(o&1){let e=R();j(0),i(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),r(6,"Created"),n(),i(7,"th"),r(8,"Channel"),n(),i(9,"th"),r(10,"SKU"),n(),i(11,"th"),r(12,"Stock"),n(),i(13,"th"),r(14,"Response code"),n()()(),i(15,"tbody"),f(16,ht,13,16,"tr",24),n()(),i(17,"mat-paginator",25),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(16),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function vt(o,g){o&1&&(i(0,"div",28),N(1,"app-empty-state"),n())}var Ge=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter=e.Filter,this.ActionTypeList=e.Options.ActionTypeList,this.Get()})}Get(e){e!=null&&(this.filter.Sku=e),this.http.post("api/Inventory/GetLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={ID:t._source.log.id,Created:t._source["@timestamp_received"],channelName:t._source.log.channelName,Sku:t._source.log.sku,Stock:t._source.log.stock,ResponseCode:t._source.log.responseCode};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-log"]],standalone:!1,decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"ngClass"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Sku,s)||(t.filter.Sku=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"actions")(2,"a",2),r(3," Order Inventory Sync Job "),n()(),i(4,"filters")(5,"div",3)(6,"div")(7,"label",4),r(8,"Channel"),n(),i(9,"ng-select",5),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(10,gt,3,3,"ng-template",6),n()(),i(11,"div",7)(12,"label",8),r(13,"From/To"),n(),i(14,"div",9)(15,"datepicker",10),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(16,"div")(17,"datepicker",11),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(18,"div",7)(19,"label",12),r(20,"Page Number"),n(),i(21,"input",13),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(22,"div",7)(23,"label",12),r(24,"Page Size"),n(),i(25,"input",14),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()()(),i(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),f(30,ft,18,4,"ng-container",18)(31,vt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(32);y("text",t.filter.Sku),l(9),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[ue,Y,I,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();var _t=()=>["/menu/log/rawlog/detail"],yt=o=>({ID:o});function Ct(o,g){if(o&1&&(i(0,"span",17),N(1,"img",18),n(),r(2)),o&2){let e=g.item;l(),p("src",e.Img,H)("alt",e.Name),l(),k(" ",e.Name," ")}}function St(o,g){if(o&1&&(i(0,"tr")(1,"td")(2,"a",25),r(3),_(4,"date"),n()(),i(5,"td"),r(6),n(),i(7,"td"),r(8),n(),i(9,"td"),r(10),n()()),o&2){let e=g.$implicit;l(2),p("routerLink",U(9,_t))("queryParams",A(10,yt,e.id)),l(),k(" ",E(4,6,e.Created,"dd MMM yyyy HH:mm:ss")," "),l(3),d(e.type),l(2),d(e.number),l(2),d(e.message)}}function bt(o,g){if(o&1){let e=R();j(0),i(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),r(6,"Date"),n(),i(7,"th"),r(8,"Type"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Message"),n()()(),i(13,"tbody"),f(14,St,11,12,"tr",23),n()(),i(15,"mat-paginator",24),w("page",function(t){c(e);let m=v();return u(m.changePage(t))}),n()(),q()}if(o&2){let e=v();l(14),p("ngForOf",e.Result),l(),p("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function xt(o,g){o&1&&(i(0,"div",26),N(1,"app-empty-state"),n())}var He=(()=>{class o{constructor(e,a,t){this.http=e,this._RawLogService=a,this.authService=t,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(a=>{this.filter=a.Filter,this.ActionTypeList=a.Options.ActionTypeList,this.Get()})}Get(e){this.filter.Number=e,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(a=>{this._RawLogService.Data=a.hits,this.Result=Array();for(let t of a.hits){let m={id:t._id,message:t._source.message,responseCode:t._source.log.responseCode,processTypeString:t._source.log.processType,type:t._source.log.type,number:t._source.log.number,Created:t._source["@timestamp_received"]};this.Result.push(m)}this.paginationTotal=a.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}static{this.\u0275fac=function(a){return new(a||o)(h(D),h(X),h(se))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-log"]],standalone:!1,decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=R();i(0,"mainpanel",1),S("textChange",function(s){return c(m),C(t.filter.Number,s)||(t.filter.Number=s),u(s)}),w("onSubmit",function(s){return c(m),u(t.Get(s))}),i(1,"filters")(2,"div")(3,"label",2),r(4,"Channel"),n(),i(5,"ng-select",3),S("ngModelChange",function(s){return c(m),C(t.filter.ChannelID,s)||(t.filter.ChannelID=s),u(s)}),f(6,Ct,3,3,"ng-template",4),n()(),i(7,"div",5)(8,"label",6),r(9,"From/To"),n(),i(10,"div",7)(11,"datepicker",8),S("dateChange",function(s){return c(m),C(t.filter.From,s)||(t.filter.From=s),u(s)}),n()(),i(12,"div")(13,"datepicker",9),S("dateChange",function(s){return c(m),C(t.filter.To,s)||(t.filter.To=s),u(s)}),n()()(),i(14,"div",5)(15,"label",10),r(16,"Page Number"),n(),i(17,"input",11),S("ngModelChange",function(s){return c(m),C(t.filter.PageNumber,s)||(t.filter.PageNumber=s),u(s)}),n()(),i(18,"div",5)(19,"label",10),r(20,"Page Size"),n(),i(21,"input",12),S("ngModelChange",function(s){return c(m),C(t.filter.RowCount,s)||(t.filter.RowCount=s),u(s)}),n()()(),i(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),f(26,bt,16,4,"ng-container",16)(27,xt,2,0,"ng-template",null,0,J),n()()()()()}if(a&2){let m=z(28);y("text",t.filter.Number),l(5),p("clearable",!0)("items",t.channelOptions),y("ngModel",t.filter.ChannelID),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(4),y("ngModel",t.filter.PageNumber),l(4),y("ngModel",t.filter.RowCount),l(5),p("ngIf",(t.Result==null?null:t.Result.length)>0)("ngIfElse",m)}},dependencies:[Y,I,oe,le,re,ae,P,M,Z,me,de,pe,Q,K,T],encapsulation:2})}}return o})();function wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Et(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var ze=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=V.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=V.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-raw-detail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Et,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(E(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();function It(o,g){if(o&1&&(i(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),r(4,"General"),n()(),i(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),r(10,"Date"),n(),i(11,"div")(12,"span"),r(13),_(14,"date"),n()()()(),i(15,"div",6)(16,"div",12)(17,"label"),r(18,"SKU"),n(),i(19,"div")(20,"span"),r(21),n()()()(),i(22,"div",6)(23,"div",12)(24,"label"),r(25,"Channel"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",6)(30,"div",12)(31,"label"),r(32,"Response Code"),n(),i(33,"div")(34,"span"),r(35),n()()()()()()()()),o&2){let e=v();l(13),d(E(14,4,e.data.Created,"dd MMM yyyy")),l(8),d(e.data.Sku),l(7),d(e.data.ChannelName),l(7),d(e.data.ResponseCode)}}var Ue=(()=>{class o{constructor(e,a,t){this.route=e,this.http=a,this._RawLogService=t,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(m=>{this.ID=m.ID,this.Load()})}ngOnInit(){}Load(){var e={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",e).subscribe(a=>{this.data.Created=a.hits[0]._source["@timestamp_received"],this.data.Sku=a.hits[0]._source.log.sku,this.data.ChannelName=a.hits[0]._source.log.channelName,this.data.ResponseCode=a.hits[0]._source.log.responseCode,this.request=V.IsNotEmpty(a.hits[0]?._source.log?.request)?JSON.parse(a.hits[0]?._source?.log?.request):"",this.response=a.hits[0]._source.log.response})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D),h(X))}}static{this.\u0275cmp=x({type:o,selectors:[["app-inventory-detail"]],standalone:!1,decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3),f(7,It,36,7,"div",4),n(),i(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),r(13,"Request"),n()(),i(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),r(18),_(19,"json"),n()()()()()(),i(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),r(24,"Response"),n()(),i(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),r(29),n()()()()()()()()()()),a&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),l(7),p("ngIf",t.data),l(11),d(L(19,5,t.request)),l(11),d(t.response))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();function Tt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Dt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Je=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailChannelWebhook",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=V.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=V.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Tt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Dt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(E(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();var Mt=()=>["/menu/log/exception/detail"],Rt=o=>({ID:o});function Nt(o,g){if(o&1&&(i(0,"tr")(1,"td",12),N(2,"img",13),n(),i(3,"td"),r(4),_(5,"date"),n(),i(6,"td")(7,"a",14),r(8),n()(),i(9,"td")(10,"div",15),r(11),n(),i(12,"div"),r(13),n()()()),o&2){let e=g.$implicit;l(2),p("src",e.logo,H),l(2),d(E(5,7,e.date,"dd-MM-yyyy hh:mm:ss")),l(3),p("routerLink",U(10,Mt))("queryParams",A(11,Rt,e.id)),l(),k(" ",e.number," "),l(3),d(e.message),l(2),d(e.stackTrace)}}function Pt(o,g){if(o&1){let e=R();j(0),i(1,"mat-paginator",16),w("page",function(t){c(e);let m=v(2);return u(m.onPaginationChange(t))}),n(),q()}if(o&2){let e=v(2);l(),p("length",e.pageTotal)("pageSize",e.pageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function Lt(o,g){if(o&1&&(j(0),i(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),r(6,"Channel"),n(),i(7,"th",9),r(8,"Date"),n(),i(9,"th"),r(10,"Number"),n(),i(11,"th"),r(12,"Exception"),n()()(),i(13,"tbody"),f(14,Nt,14,13,"tr",10),n()(),f(15,Pt,2,3,"ng-container",11),n(),q()),o&2){let e=v();l(14),p("ngForOf",e.exceptions),l(),p("ngIf",(e.exceptions==null?null:e.exceptions.length)>0)}}function Ot(o,g){o&1&&(i(0,"div",17),N(1,"app-empty-state"),n())}var Ye=(()=>{class o{constructor(e){this.http=e,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(e=>{this.exceptions=e.hits.map(a=>({id:a._id,logo:V.getChannelLogoByName(a._source.error?.Type),number:a._source.error.number,date:a._source["@timestamp_received"],stackTrace:a._source.error.stackTrace,message:a._source.message,requestJSON:a._source?.error?.requestJSON})),this.pageTotal=e.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getData()}static{this.\u0275fac=function(a){return new(a||o)(h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-log"]],standalone:!1,decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1&&(i(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),f(5,Lt,16,2,"ng-container",5)(6,Ot,2,0,"ng-template",null,0,J),n()()()()()),a&2){let m=z(7);l(5),p("ngIf",t.exceptions.length>0)("ngIfElse",m)}},dependencies:[Y,I,P,M,Z,K,T],encapsulation:2})}}return o})();var Ke=(()=>{class o{constructor(e){this.httpService=e}getExceptionDetail(e){return this.httpService.post("/api/Orders/GetDetailException",{ID:e}).pipe(ye(t=>t?.hits[0]?._source))}static{this.\u0275fac=function(a){return new(a||o)(be(D))}}static{this.\u0275prov=ce({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function Vt(o,g){if(o&1&&(i(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),r(6,"General"),n()(),i(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),r(12,"Date"),n(),i(13,"div")(14,"span"),r(15),_(16,"date"),n()()()(),i(17,"div",9)(18,"div",10)(19,"label"),r(20,"Number"),n(),i(21,"div")(22,"span"),r(23),n()()()(),i(24,"div",9)(25,"div",10)(26,"label"),r(27,"Type"),n(),i(28,"div")(29,"span"),r(30),n()()()(),i(31,"div",9)(32,"div",10)(33,"label"),r(34,"ShopID"),n(),i(35,"div")(36,"span"),r(37),n()()()()()()()()(),i(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),r(43,"Request"),n()(),i(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),r(48),_(49,"json"),n()()()()()(),i(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),r(54,"Exception"),n()(),i(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),r(59),n(),i(60,"pre"),r(61),n()()()()()()()()),o&2){let e=g.ngIf;l(15),d(E(16,7,e["@timestamp"],"dd MMM yyyy HH:mm:ss")),l(8),d(e==null||e.error==null?null:e.error.number),l(7),d(e==null||e.error==null?null:e.error.Type),l(7),d(e==null?null:e.shopId),l(11),d(L(49,10,e==null||e.error==null?null:e.error.requestJSON)),l(11),d(e==null?null:e.message),l(2),d(e==null||e.error==null?null:e.error.stackTrace)}}var Ze=(()=>{class o{constructor(e,a){this.activatedRoute=e,this.exceptionService=a,this.invoiceNumber=""}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(e?.ID)}getExceptionDetail(e){this.exceptionDetail$=this.exceptionService.getExceptionDetail(e).pipe(Se(a=>{this.invoiceNumber=a?.error?.number}),Ce(1))}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(Ke))}}static{this.\u0275cmp=x({type:o,selectors:[["app-exception-detail"]],standalone:!1,decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"content"),f(2,Vt,62,12,"div",1),_(3,"async"),n()()),a&2&&(p("headerTitle","Order #"+t.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),p("ngIf",L(3,4,t.exceptionDetail$)))},dependencies:[I,M,we,F,T],encapsulation:2})}}return o})();function Wt(o,g){if(o&1&&(i(0,"div",9)(1,"div",10)(2,"label"),r(3,"Process Code"),n(),i(4,"div")(5,"span"),r(6),n()()()()),o&2){let e=v();l(6),d(e.ProcessedCode)}}function Bt(o,g){if(o&1){let e=R();i(0,"a",16),w("click",function(){c(e);let t=v();return u(t.Retry())}),r(1,"Retry"),n()}}var Qe=(()=>{class o{constructor(e,a){this.route=e,this.http=a,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(t=>{this.ID=t.ID,this.Load()})}Retry(){var e={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",e).subscribe(a=>{alert(JSON.stringify(a))})}Load(){var e={ID:this.ID};this.http.post("/api/Orders/GetDetailSyncOrder",e).subscribe(a=>{for(let t of a.hits)this.Number=t._source.log.number,this.MarketTypeString=t._source.log.type,this.ResponseCode=t._source.log.responseCode,this.POSActionTypeString=t._source.message,this.ProcessDuration=0,this.Created=t._source["@timestamp_received"],this.request=V.IsNotEmpty(t._source?.log?.request)?JSON.parse(t._source.log?.request):"",this.response=V.IsNotEmpty(t._source?.log?.response)?JSON.parse(t._source.log?.response):"",this.shopId=t._source.shopId,this.ProcessedCode=t._source.log.processedCode})}static{this.\u0275fac=function(a){return new(a||o)(h(B),h(D))}}static{this.\u0275cmp=x({type:o,selectors:[["app-orderdetail-user"]],standalone:!1,decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),r(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),r(11,"General"),n()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),r(17,"Date"),n(),i(18,"div")(19,"span"),r(20),_(21,"date"),n()()()(),i(22,"div",9)(23,"div",10)(24,"label"),r(25,"Number"),n(),i(26,"div")(27,"span"),r(28),n()()()(),i(29,"div",9)(30,"div",10)(31,"label"),r(32,"Type"),n(),i(33,"div")(34,"span"),r(35),n()()()(),i(36,"div",9)(37,"div",10)(38,"label"),r(39,"Response Code"),n(),i(40,"div")(41,"span"),r(42),n()()()(),i(43,"div",9)(44,"div",10)(45,"label"),r(46,"ShopID"),n(),i(47,"div")(48,"span"),r(49),n()()()(),f(50,Wt,7,1,"div",11),i(51,"div",9)(52,"div",10)(53,"label"),r(54,"Action"),n(),i(55,"div")(56,"span"),r(57),n()()()()()()()()(),i(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),r(63,"Request"),n()(),i(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),r(68),_(69,"json"),n()()(),i(70,"actions",14),f(71,Bt,2,0,"a",15),n()()()(),i(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),r(76,"Response"),n()(),i(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),r(81),_(82,"json"),n()()()()()()()()()()),a&2&&(p("headerTitle","Order #"+t.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),l(20),d(E(21,14,t.Created,"dd MMM yyyy HH:mm:ss")),l(8),d(t.Number),l(7),d(t.MarketTypeString),l(7),d(t.ResponseCode),l(7),d(t.shopId),l(),p("ngIf",t.ProcessedCode!=null),l(7),d(t.POSActionTypeString),l(11),d(L(69,17,t.request)),l(3),p("ngIf",t.ResponseCode!="200"&&t.ResponseCode!="201"),l(10),d(L(82,19,t.response)))},dependencies:[I,P,M,F,T],encapsulation:2})}}return o})();var At=[{path:"",component:We,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:qe,canActivate:[W],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Ge,canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:He,canActivate:[W],data:{title:"Raw Log"}},{path:"rawlog/detail",component:ze,canActivate:[W],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:Ue,canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:Je,canActivate:[W],data:{title:"Order Details"}},{path:"order/detail-user",component:Qe,canActivate:[W],data:{title:"Order User Details"}},{path:"exception",component:Ye,canActivate:[W],data:{title:"Exception Log"}},{path:"exception/detail",component:Ze,canActivate:[W],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-I6PVQBH3.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-XR4JKTPA.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-CAGSG3DY.js").then(o=>o.ChannelLogComponent)},canActivate:[W],data:{title:"Authorization Log"}}]}],Xe=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,he.forChild(At)]})}}return o})();var $e=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=ne({type:o});static \u0275inj=ie({})}return o})();var en=(()=>{class o{static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275mod=ne({type:o})}static{this.\u0275inj=ie({imports:[ge,De,Me,Xe,he,Le,$e,Ve,Re,ke,Q,Pe]})}}return o})();export{en as LogsModule};
@@ -1,2 +1,2 @@
1
- import{a as ke}from"./chunk-JLKZR2QZ.js";import"./chunk-WMO2ROK4.js";import{a as N}from"./chunk-7UTZLQI6.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Me,b as Pe,c as De,d as G}from"./chunk-EQD3IUMF.js";import"./chunk-BVIRHZTZ.js";import{a as ye,b as Ie,c as we}from"./chunk-OM7KOQLP.js";import{b as Ve}from"./chunk-OBN6RKRH.js";import{a as Te,b as Ee}from"./chunk-5Z63CRGG.js";import"./chunk-VGXNA5KN.js";import"./chunk-KII7SEQ6.js";import"./chunk-B5JAZPVU.js";import"./chunk-OS53H77X.js";import"./chunk-UOAYF4SW.js";import{a as be}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as Fe}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{e as he}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as ue}from"./chunk-D2R7H4PZ.js";import{b as me,e as _e}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as xe,k as fe,l as Se,m as ve}from"./chunk-XOT2SZPE.js";import{r as Ce,s as ge}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as ae,c as le,h as re,m as se,o as ce,y as pe}from"./chunk-AI4XRCAL.js";import{c as f,f as de}from"./chunk-W6T7TOHE.js";import{d as J,g as ee,j as te,k as ne,m as ie,n as oe}from"./chunk-B6POIFQM.js";import{Dc as Q,Eb as Z,Ec as c,Fc as D,G as Y,Gc as E,Ic as b,Jc as F,Kb as h,Kc as T,Mc as X,Oc as k,Qa as W,Wb as d,Xc as g,Yc as v,Z as B,Zc as R,_c as z,bc as y,cc as O,ea as $,ec as U,fc as j,gc as a,hc as r,ic as x,jc as M,kc as P,mc as S,ob as V,pa as K,qb as s,rc as C,sc as l,v as A,vc as q,wb as w,ya as m,za as _}from"./chunk-EIQCOZF5.js";import{a as L}from"./chunk-K2H6WANG.js";var Le=i=>({"text-decoration-line-through":i}),Ae=i=>({"ms-10":i}),Be=i=>({"bg-gradient-warning":i});function $e(i,p){if(i&1){let e=S();a(0,"button",38),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.onScanInventory(t))}),x(1,"i",39),c(2,"Refresh "),r()}}function We(i,p){if(i&1){let e=S();a(0,"div",36)(1,"button",40),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.updateStock(t))}),x(2,"i",41),c(3," Update "),r(),x(4,"button",42),a(5,"ul",43)(6,"a",44),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(7,"i",45),a(8,"span"),c(9,"Export"),r()()()()}}function Oe(i,p){if(i&1){let e=S();a(0,"button",46),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(1,"i",45),a(2,"span"),c(3,"Export"),r()()}}function Ue(i,p){if(i&1&&(a(0,"div"),h(1,$e,3,0,"button",35)(2,We,10,0,"div",36)(3,Oe,4,0,"button",37),r()),i&2){let e=p.ngIf,o=l(2);s(),d("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function je(i,p){i&1&&(a(0,"div",47)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Qe(i,p){if(i&1){let e=S();a(0,"th")(1,"input",48),T("ngModelChange",function(t){m(e);let n=l(2);return F(n.checkboxState,t)||(n.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=m(e).ngIf,n=l(2);return _(n.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function ze(i,p){i&1&&(a(0,"th",32),c(1," Reserved "),r())}function Ge(i,p){if(i&1){let e=S();a(0,"input",66),T("ngModelChange",function(t){m(e);let n=l(3).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),C("ngModelChange",function(){m(e);let t=l(3).$implicit,n=l(2);return _(n.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function He(i,p){if(i&1){let e=S();a(0,"img",67),C("click",function(t){m(e);let n=l(3).$implicit,u=l(2);return _(u.onZoomImage(t,n==null?null:n.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,V)}}function Ye(i,p){i&1&&x(0,"img",63)}function Ke(i,p){if(i&1&&(x(0,"br"),a(1,"div",68),x(2,"i",69),a(3,"small"),c(4),r()()),i&2){let e=l(3).$implicit;s(4),E("(",e==null?null:e.Category,")")}}function Ze(i,p){if(i&1&&(a(0,"td",59)(1,"div",14),h(2,Ge,1,1,"input",60),a(3,"div",61),h(4,He,1,1,"img",62)(5,Ye,1,0,"img",63),r()()(),a(6,"td",64)(7,"span",65),c(8),r(),h(9,Ke,5,1),r()),i&2){let e=l(2).$implicit,o=l(2);d("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),d("ngClass",k(7,Ae,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),d("rowSpan",e==null?null:e.Variants.length),s(2),D(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function qe(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l(2).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Xe(i,p){if(i&1&&h(0,qe,1,1,"input",53),i&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Je(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l().$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l().$implicit;b("ngModel",e.selected)}}function et(i,p){i&1&&(a(0,"div",70),c(1," Not Found "),r())}function tt(i,p){if(i&1&&(a(0,"div")(1,"span",71),c(2),g(3,"number"),r(),c(4," => "),a(5,"span",72),c(6),g(7,"number"),r()()),i&2){let e=l().$implicit;s(2),E(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),D(v(7,4,e==null?null:e.Inventory))}}function nt(i,p){if(i&1&&(c(0),g(1,"number")),i&2){let e=l().$implicit;E(" ",v(1,1,e==null?null:e.Inventory)," ")}}function it(i,p){if(i&1&&(M(0),a(1,"div",73)(2,"a",74),x(3,"i",75),r()(),P()),i&2){let e=l().$implicit,o=l(3);s(2),d("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function ot(i,p){if(i&1){let e=S();a(0,"span",80),C("click",function(){let t=m(e).ngIf,n=l(2).$implicit,u=l().$implicit,I=l(2);return _(I.openTableDialog(u,n,t))}),c(1),g(2,"number"),r()}if(i&2){let e=l(2).$implicit;s(),E(" ",v(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(i,p){if(i&1){let e=S();a(0,"td",76)(1,"div",54)(2,"div"),h(3,ot,3,3,"span",77),g(4,"async"),r(),a(5,"div",73)(6,"a",74),x(7,"i",75),r()(),a(8,"div",73)(9,"span",78),C("click",function(){m(e);let t=l().$implicit,n=l(3);return _(n.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",79),r()()()()}if(i&2){let e=l().$implicit,o=l(3);d("ngClass",k(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),d("ngIf",v(4,3,o.products$)),s(3),d("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,V)}}function lt(i,p){if(i&1&&(M(0),a(1,"span",81),c(2),g(3,"number"),r(),P()),i&2){let e=l(2).$implicit;s(2),E(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rt(i,p){i&1&&c(0," - ")}function st(i,p){if(i&1&&(M(0),a(1,"td",50),h(2,lt,4,3,"ng-container",58)(3,rt,1,0,"ng-template",null,1,z),r(),P()),i&2){let e=Q(4),o=l().$implicit;s(2),d("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function ct(i,p){i&1&&(M(0),c(1," - "),P())}function pt(i,p){if(i&1&&(a(0,"span",82),g(1,"date"),c(2),g(3,"date"),r()),i&2){let e=l().$implicit;d("matTooltip",R(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),E(" ",R(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(i,p){if(i&1&&(a(0,"tr"),h(1,Ze,10,9),a(2,"td",49),c(3),r(),a(4,"td",50)(5,"span",51),c(6),r()(),a(7,"td",52),h(8,Xe,1,1)(9,Je,1,1,"input",53),r(),a(10,"td")(11,"div",54),h(12,et,2,0,"div",55)(13,tt,8,6,"div")(14,nt,2,3)(15,it,4,1,"ng-container",5),r()(),h(16,at,11,7,"td",56)(17,st,5,2,"ng-container",5),a(18,"td",57),h(19,ct,2,0,"ng-container",58)(20,pt,4,8,"ng-template",null,0,z),r()()),i&2){let e=p.$implicit,o=p.$index,t=Q(21),n=l(3);s(),y(o==0?1:-1),s(2),D(e==null?null:e.Model),s(2),d("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",k(14,Le,e.Discontinued)),s(),D(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),d("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),d("ngIf",(e==null?null:e.I)!=null),s(),d("ngIf",e==null?null:e.Channel),s(),d("ngIf",n.isShowReservedColumn),s(2),d("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==n.minDate)("ngIfElse",t)}}function _t(i,p){if(i&1&&(a(0,"tbody"),U(1,mt,22,16,"tr",null,O),r()),i&2){let e=p.$implicit;s(),j(e.Variants)}}function dt(i,p){if(i&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){m(e);let n=l();return _(n.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,Ue,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){m(e);let n=l();return _(n.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),_(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),_(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityFrom,t)||(n.searchFilter.QuantityFrom=t),_(t)}),r(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityTo,t)||(n.searchFilter.QuantityTo=t),_(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,je,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){m(e);let n=l();return _(n.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){m(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),h(43,Qe,2,1,"th",5),g(44,"async"),a(45,"th",27),c(46," POS "),r(),a(47,"th",28)(48,"div",29),C("click",function(){m(e);let t=l();return _(t.openModalFilter())}),x(49,"img",30),a(50,"span",31),c(51),g(52,"stringLimit"),r()()(),h(53,ze,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),U(56,_t,3,0,"tbody",null,O),g(58,"async"),r(),a(59,"infinite-paginator",34),g(60,"async"),C("onNextPage",function(){m(e);let t=l();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){m(e);let t=l();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){m(e);let t=l();return _(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,o,t,n=l();d("headerTitle","Inventory Comparison")("pageData",n.pageData)("hideSearchBox",!1),s(3),d("ngIf",v(4,21,n.products$)),s(6),d("ngModel",(n.searchFilter==null?null:n.searchFilter.LocationID)||(n.searchFilter==null?null:n.searchFilter.ChannelID)),s(4),b("ngModel",n.searchFilter.PageNumber),s(4),b("ngModel",n.searchFilter.RowCount),s(5),b("ngModel",n.searchFilter.QuantityFrom),s(2),b("ngModel",n.searchFilter.QuantityTo),s(5),d("ngIf",(n.searchFilter==null?null:n.searchFilter.filterModel)==3),s(14),d("ngIf",v(44,23,n.products$)),s(5),d("matTooltip",((e=n.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=n.channelIdentity())==null?null:e.label:""),s(),d("src",(o=n.channelIdentity())==null?null:o.img,V),s(2),E(" ",R(52,25,(t=n.channelIdentity())==null?null:t.label,13)," "),s(2),y(n.isShowReservedColumn?53:-1),s(3),j(v(58,28,n.products$)),s(3),d("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",v(60,30,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}var Zt=(()=>{class i{constructor(e,o,t,n,u,I,Re,Ne){this.http=e,this.toastr=o,this.dialog=t,this.productService=n,this.authService=u,this.biggerPictureService=I,this.inventoryService=Re,this.mainPanelService=Ne,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=W(null),this.channelIdentity=W({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe($(e=>{this.checkShowReservedColumn(e)}),A(e=>(e=this.calculateAvailableStock(e),e)),B(1)),this.products$=this.sourceObs$}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((n,u)=>(n+=u.I?.Available||0,n),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(n=>{t=n.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(1),$(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as ke}from"./chunk-JLKZR2QZ.js";import"./chunk-WMO2ROK4.js";import{a as N}from"./chunk-3YRPTVAF.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Me,b as Pe,c as De,d as G}from"./chunk-EQD3IUMF.js";import"./chunk-BVIRHZTZ.js";import{a as ye,b as Ie,c as we}from"./chunk-OM7KOQLP.js";import{b as Ve}from"./chunk-OBN6RKRH.js";import{a as Te,b as Ee}from"./chunk-5Z63CRGG.js";import"./chunk-VGXNA5KN.js";import"./chunk-KII7SEQ6.js";import"./chunk-B5JAZPVU.js";import"./chunk-OS53H77X.js";import"./chunk-UOAYF4SW.js";import{a as be}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as Fe}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{e as he}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as ue}from"./chunk-CIKNTHCR.js";import{b as me,e as _e}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as xe,k as fe,l as Se,m as ve}from"./chunk-XOT2SZPE.js";import{r as Ce,s as ge}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as ae,c as le,h as re,m as se,o as ce,y as pe}from"./chunk-AI4XRCAL.js";import{c as f,f as de}from"./chunk-W6T7TOHE.js";import{d as J,g as ee,j as te,k as ne,m as ie,n as oe}from"./chunk-B6POIFQM.js";import{Dc as Q,Eb as Z,Ec as c,Fc as D,G as Y,Gc as E,Ic as b,Jc as F,Kb as h,Kc as T,Mc as X,Oc as k,Qa as W,Wb as d,Xc as g,Yc as v,Z as B,Zc as R,_c as z,bc as y,cc as O,ea as $,ec as U,fc as j,gc as a,hc as r,ic as x,jc as M,kc as P,mc as S,ob as V,pa as K,qb as s,rc as C,sc as l,v as A,vc as q,wb as w,ya as m,za as _}from"./chunk-EIQCOZF5.js";import{a as L}from"./chunk-K2H6WANG.js";var Le=i=>({"text-decoration-line-through":i}),Ae=i=>({"ms-10":i}),Be=i=>({"bg-gradient-warning":i});function $e(i,p){if(i&1){let e=S();a(0,"button",38),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.onScanInventory(t))}),x(1,"i",39),c(2,"Refresh "),r()}}function We(i,p){if(i&1){let e=S();a(0,"div",36)(1,"button",40),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.updateStock(t))}),x(2,"i",41),c(3," Update "),r(),x(4,"button",42),a(5,"ul",43)(6,"a",44),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(7,"i",45),a(8,"span"),c(9,"Export"),r()()()()}}function Oe(i,p){if(i&1){let e=S();a(0,"button",46),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(1,"i",45),a(2,"span"),c(3,"Export"),r()()}}function Ue(i,p){if(i&1&&(a(0,"div"),h(1,$e,3,0,"button",35)(2,We,10,0,"div",36)(3,Oe,4,0,"button",37),r()),i&2){let e=p.ngIf,o=l(2);s(),d("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function je(i,p){i&1&&(a(0,"div",47)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Qe(i,p){if(i&1){let e=S();a(0,"th")(1,"input",48),T("ngModelChange",function(t){m(e);let n=l(2);return F(n.checkboxState,t)||(n.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=m(e).ngIf,n=l(2);return _(n.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function ze(i,p){i&1&&(a(0,"th",32),c(1," Reserved "),r())}function Ge(i,p){if(i&1){let e=S();a(0,"input",66),T("ngModelChange",function(t){m(e);let n=l(3).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),C("ngModelChange",function(){m(e);let t=l(3).$implicit,n=l(2);return _(n.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function He(i,p){if(i&1){let e=S();a(0,"img",67),C("click",function(t){m(e);let n=l(3).$implicit,u=l(2);return _(u.onZoomImage(t,n==null?null:n.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,V)}}function Ye(i,p){i&1&&x(0,"img",63)}function Ke(i,p){if(i&1&&(x(0,"br"),a(1,"div",68),x(2,"i",69),a(3,"small"),c(4),r()()),i&2){let e=l(3).$implicit;s(4),E("(",e==null?null:e.Category,")")}}function Ze(i,p){if(i&1&&(a(0,"td",59)(1,"div",14),h(2,Ge,1,1,"input",60),a(3,"div",61),h(4,He,1,1,"img",62)(5,Ye,1,0,"img",63),r()()(),a(6,"td",64)(7,"span",65),c(8),r(),h(9,Ke,5,1),r()),i&2){let e=l(2).$implicit,o=l(2);d("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),d("ngClass",k(7,Ae,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),d("rowSpan",e==null?null:e.Variants.length),s(2),D(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function qe(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l(2).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Xe(i,p){if(i&1&&h(0,qe,1,1,"input",53),i&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Je(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l().$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l().$implicit;b("ngModel",e.selected)}}function et(i,p){i&1&&(a(0,"div",70),c(1," Not Found "),r())}function tt(i,p){if(i&1&&(a(0,"div")(1,"span",71),c(2),g(3,"number"),r(),c(4," => "),a(5,"span",72),c(6),g(7,"number"),r()()),i&2){let e=l().$implicit;s(2),E(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),D(v(7,4,e==null?null:e.Inventory))}}function nt(i,p){if(i&1&&(c(0),g(1,"number")),i&2){let e=l().$implicit;E(" ",v(1,1,e==null?null:e.Inventory)," ")}}function it(i,p){if(i&1&&(M(0),a(1,"div",73)(2,"a",74),x(3,"i",75),r()(),P()),i&2){let e=l().$implicit,o=l(3);s(2),d("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function ot(i,p){if(i&1){let e=S();a(0,"span",80),C("click",function(){let t=m(e).ngIf,n=l(2).$implicit,u=l().$implicit,I=l(2);return _(I.openTableDialog(u,n,t))}),c(1),g(2,"number"),r()}if(i&2){let e=l(2).$implicit;s(),E(" ",v(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(i,p){if(i&1){let e=S();a(0,"td",76)(1,"div",54)(2,"div"),h(3,ot,3,3,"span",77),g(4,"async"),r(),a(5,"div",73)(6,"a",74),x(7,"i",75),r()(),a(8,"div",73)(9,"span",78),C("click",function(){m(e);let t=l().$implicit,n=l(3);return _(n.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",79),r()()()()}if(i&2){let e=l().$implicit,o=l(3);d("ngClass",k(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),d("ngIf",v(4,3,o.products$)),s(3),d("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,V)}}function lt(i,p){if(i&1&&(M(0),a(1,"span",81),c(2),g(3,"number"),r(),P()),i&2){let e=l(2).$implicit;s(2),E(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rt(i,p){i&1&&c(0," - ")}function st(i,p){if(i&1&&(M(0),a(1,"td",50),h(2,lt,4,3,"ng-container",58)(3,rt,1,0,"ng-template",null,1,z),r(),P()),i&2){let e=Q(4),o=l().$implicit;s(2),d("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function ct(i,p){i&1&&(M(0),c(1," - "),P())}function pt(i,p){if(i&1&&(a(0,"span",82),g(1,"date"),c(2),g(3,"date"),r()),i&2){let e=l().$implicit;d("matTooltip",R(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),E(" ",R(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(i,p){if(i&1&&(a(0,"tr"),h(1,Ze,10,9),a(2,"td",49),c(3),r(),a(4,"td",50)(5,"span",51),c(6),r()(),a(7,"td",52),h(8,Xe,1,1)(9,Je,1,1,"input",53),r(),a(10,"td")(11,"div",54),h(12,et,2,0,"div",55)(13,tt,8,6,"div")(14,nt,2,3)(15,it,4,1,"ng-container",5),r()(),h(16,at,11,7,"td",56)(17,st,5,2,"ng-container",5),a(18,"td",57),h(19,ct,2,0,"ng-container",58)(20,pt,4,8,"ng-template",null,0,z),r()()),i&2){let e=p.$implicit,o=p.$index,t=Q(21),n=l(3);s(),y(o==0?1:-1),s(2),D(e==null?null:e.Model),s(2),d("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",k(14,Le,e.Discontinued)),s(),D(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),d("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),d("ngIf",(e==null?null:e.I)!=null),s(),d("ngIf",e==null?null:e.Channel),s(),d("ngIf",n.isShowReservedColumn),s(2),d("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==n.minDate)("ngIfElse",t)}}function _t(i,p){if(i&1&&(a(0,"tbody"),U(1,mt,22,16,"tr",null,O),r()),i&2){let e=p.$implicit;s(),j(e.Variants)}}function dt(i,p){if(i&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){m(e);let n=l();return _(n.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,Ue,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){m(e);let n=l();return _(n.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),_(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),_(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityFrom,t)||(n.searchFilter.QuantityFrom=t),_(t)}),r(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityTo,t)||(n.searchFilter.QuantityTo=t),_(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,je,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){m(e);let n=l();return _(n.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){m(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),h(43,Qe,2,1,"th",5),g(44,"async"),a(45,"th",27),c(46," POS "),r(),a(47,"th",28)(48,"div",29),C("click",function(){m(e);let t=l();return _(t.openModalFilter())}),x(49,"img",30),a(50,"span",31),c(51),g(52,"stringLimit"),r()()(),h(53,ze,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),U(56,_t,3,0,"tbody",null,O),g(58,"async"),r(),a(59,"infinite-paginator",34),g(60,"async"),C("onNextPage",function(){m(e);let t=l();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){m(e);let t=l();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){m(e);let t=l();return _(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,o,t,n=l();d("headerTitle","Inventory Comparison")("pageData",n.pageData)("hideSearchBox",!1),s(3),d("ngIf",v(4,21,n.products$)),s(6),d("ngModel",(n.searchFilter==null?null:n.searchFilter.LocationID)||(n.searchFilter==null?null:n.searchFilter.ChannelID)),s(4),b("ngModel",n.searchFilter.PageNumber),s(4),b("ngModel",n.searchFilter.RowCount),s(5),b("ngModel",n.searchFilter.QuantityFrom),s(2),b("ngModel",n.searchFilter.QuantityTo),s(5),d("ngIf",(n.searchFilter==null?null:n.searchFilter.filterModel)==3),s(14),d("ngIf",v(44,23,n.products$)),s(5),d("matTooltip",((e=n.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=n.channelIdentity())==null?null:e.label:""),s(),d("src",(o=n.channelIdentity())==null?null:o.img,V),s(2),E(" ",R(52,25,(t=n.channelIdentity())==null?null:t.label,13)," "),s(2),y(n.isShowReservedColumn?53:-1),s(3),j(v(58,28,n.products$)),s(3),d("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",v(60,30,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}var Zt=(()=>{class i{constructor(e,o,t,n,u,I,Re,Ne){this.http=e,this.toastr=o,this.dialog=t,this.productService=n,this.authService=u,this.biggerPictureService=I,this.inventoryService=Re,this.mainPanelService=Ne,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=W(null),this.channelIdentity=W({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe($(e=>{this.checkShowReservedColumn(e)}),A(e=>(e=this.calculateAvailableStock(e),e)),B(1)),this.products$=this.sourceObs$}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((n,u)=>(n+=u.I?.Available||0,n),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(n=>{t=n.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(1),$(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let o=this.productService.selectedVariantProduct(e);if(o.length>0){let t=this.searchFilter.LocationID,n=o.map(I=>L({ID:I.ID,Code:I.Code,Inventory:I.Inventory},f.IsNotEmpty(t)&&{LocationID:t})),u={ListChannelID:[this.searchFilter.ChannelID],List:n};this.http.post("/api/Inventory/UpdateChannel",u).subscribe(I=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(I)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,t=e[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",t,o)}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,t,n){let u={ChannelItemID:e,ChannelVariationID:o,ChannelID:t,VariantID:n};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(I=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(t=>(t.selected=this.checkboxState,t)),o))}openTableDialog(e,o,t){this.dialog.open(Me,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(Y(u=>f.IsNotEmpty(u))).subscribe(u=>{this.updateItemAfterDialog(u)})}updateItemAfterDialog(e){let o=this.searchFilter.LocationID,t=L({ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku},f.IsNotEmpty(o)&&{LocationID:o});this.http.post("/api/Inventory/UpdateQuantityByItem",t).subscribe(n=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([n])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(Ve,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=H.DIFFERENCE:this.searchFilter.filterModel=H.ALL,this.initReloadData()}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(A(o=>o.map(t=>(t.Variants=t.Variants.sort((n,u)=>f.compare(n.I?.Available,u.I?.Available,e.direction==="asc")),t)).sort((t,n)=>f.compare(t.totalAvailable,n.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||i)(w(_e),w(me),w(xe),w(be),w(ue),w(Fe),w(N),w(fe))}}static{this.\u0275cmp=Z({type:i,selectors:[["app-single-channel-comparison"]],features:[X([G,N])],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(o,t){o&1&&(h(0,dt,61,32,"mainpanel",2),g(1,"async")),o&2&&d("ngIf",v(1,1,t.loader$))},dependencies:[oe,J,ee,te,ie,ne,ve,Se,he,pe,le,ce,ae,re,se,Pe,De,de,Ee,Te,ge,Ce,we,ye,Ie,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]})}}return i})();export{Zt as SingleChannelComparisonComponent};