marketplacepos 3.2.1 → 3.4.0

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 (112) hide show
  1. package/Marketplace/3rdpartylicenses.txt +202 -187
  2. package/Marketplace/chunk-2KQ4WEPD.js +1 -0
  3. package/Marketplace/chunk-2OB3TW2H.js +4 -0
  4. package/Marketplace/chunk-3ICHEZSE.js +1 -0
  5. package/Marketplace/chunk-3TM7EKQZ.js +1 -0
  6. package/Marketplace/chunk-45IJGKR3.js +1 -0
  7. package/Marketplace/chunk-4O5EV6W4.js +1 -0
  8. package/Marketplace/chunk-5DS4AFTV.js +1 -0
  9. package/Marketplace/chunk-5DVM7TJ7.js +5 -0
  10. package/Marketplace/chunk-5JZJC54P.js +2 -0
  11. package/Marketplace/chunk-67YIEWYV.js +1 -0
  12. package/Marketplace/chunk-7DXQ5BDE.js +1 -0
  13. package/Marketplace/chunk-7RCRNZNI.js +1 -0
  14. package/Marketplace/chunk-7Y73MGEU.js +1 -0
  15. package/Marketplace/chunk-AIZ2SLGZ.js +5 -0
  16. package/Marketplace/chunk-B4RPQGTA.js +1 -0
  17. package/Marketplace/chunk-BELWZRNY.js +1 -0
  18. package/Marketplace/chunk-BYDOIRDD.js +1 -0
  19. package/Marketplace/chunk-CS64SQAA.js +1 -0
  20. package/Marketplace/chunk-CWG6UUW5.js +1 -0
  21. package/Marketplace/chunk-DBEZLCZM.js +1 -0
  22. package/Marketplace/chunk-ECB4VT3U.js +1 -0
  23. package/Marketplace/chunk-FWCMOK42.js +8 -0
  24. package/Marketplace/chunk-G5D7W2T3.js +2 -0
  25. package/Marketplace/chunk-GD6CRVOV.js +1 -0
  26. package/Marketplace/chunk-GFW452UY.js +1 -0
  27. package/Marketplace/chunk-GIFWICGN.js +2 -0
  28. package/Marketplace/chunk-GMALFTAY.js +1 -0
  29. package/Marketplace/chunk-H7KLY4IB.js +1 -0
  30. package/Marketplace/chunk-HWOBJ4Z3.js +1 -0
  31. package/Marketplace/chunk-I4V2RPID.js +1 -0
  32. package/Marketplace/chunk-IJIIMLQ7.js +1 -0
  33. package/Marketplace/chunk-ISBEY2N5.js +1 -0
  34. package/Marketplace/chunk-KEKROO5B.js +1 -0
  35. package/Marketplace/chunk-KX7WACSK.js +1 -0
  36. package/Marketplace/chunk-LJ6J4EIT.js +1 -0
  37. package/Marketplace/chunk-LKSBRXCX.js +1 -0
  38. package/Marketplace/chunk-MA4ZKUP6.js +4 -0
  39. package/Marketplace/chunk-MORUNYG3.js +6 -0
  40. package/Marketplace/chunk-MRWTB7OG.js +8 -0
  41. package/Marketplace/chunk-N76YHCQ6.js +1 -0
  42. package/Marketplace/chunk-NZBQKND7.js +1 -0
  43. package/Marketplace/chunk-O3V3GTIM.js +1 -0
  44. package/Marketplace/chunk-PJQTGT4K.js +1 -0
  45. package/Marketplace/chunk-PQGHN52M.js +1 -0
  46. package/Marketplace/chunk-Q7FH7Z7R.js +1 -0
  47. package/Marketplace/chunk-QK2PM3OO.js +2 -0
  48. package/Marketplace/chunk-QKVTZKIC.js +3 -0
  49. package/Marketplace/chunk-RFTG6MKX.js +1 -0
  50. package/Marketplace/chunk-S65ISV4X.js +5 -0
  51. package/Marketplace/chunk-SKA4KCAB.js +1 -0
  52. package/Marketplace/chunk-SWQXA73A.js +1 -0
  53. package/Marketplace/chunk-T6XRWLCZ.js +1 -0
  54. package/Marketplace/chunk-TBY7FO23.js +3 -0
  55. package/Marketplace/chunk-TJRQ2WWD.js +1 -0
  56. package/Marketplace/chunk-TMUAQXEK.js +1 -0
  57. package/Marketplace/chunk-TNVZKPJP.js +1 -0
  58. package/Marketplace/chunk-TQ6UUVH3.js +1 -0
  59. package/Marketplace/chunk-TT7NBZMD.js +1 -0
  60. package/Marketplace/chunk-UNZLFKB2.js +1 -0
  61. package/Marketplace/chunk-VIJ5HUKS.js +1 -0
  62. package/Marketplace/chunk-VRSV5O5R.js +1 -0
  63. package/Marketplace/chunk-VTFOZMLI.js +1 -0
  64. package/Marketplace/chunk-WBI4ZM2X.js +1 -0
  65. package/Marketplace/chunk-WYMCYQCR.js +1 -0
  66. package/Marketplace/chunk-XWIBRKIY.js +5 -0
  67. package/Marketplace/chunk-YQEEQRFM.js +2 -0
  68. package/Marketplace/chunk-YQXKX6O7.js +7 -0
  69. package/Marketplace/chunk-YWVMHX45.js +1 -0
  70. package/Marketplace/chunk-Z2ABDS6L.js +1 -0
  71. package/Marketplace/index.html +2 -2
  72. package/Marketplace/main-B2AQI7UJ.js +1 -0
  73. package/Marketplace/polyfills-KQQO3SZT.js +2 -0
  74. package/Marketplace/scripts-M46NWPTC.js +5 -0
  75. package/Marketplace/styles-WZSIIWL7.css +1 -0
  76. package/package.json +1 -1
  77. package/Marketplace/103.bc1f4c51ca99f04f.js +0 -1
  78. package/Marketplace/168.07ef2936896a9f4f.js +0 -1
  79. package/Marketplace/231.0c7ab993977632a2.js +0 -1
  80. package/Marketplace/257.d1592e885695ba4b.js +0 -1
  81. package/Marketplace/278.e89610409641d910.js +0 -1
  82. package/Marketplace/296.93310f70e5f9d3a9.js +0 -1
  83. package/Marketplace/311.afcc0c4a03ea0076.js +0 -1
  84. package/Marketplace/389.02d8fd64069d0119.js +0 -1
  85. package/Marketplace/394.11ae606578598904.js +0 -1
  86. package/Marketplace/445.cbf341bc0afe3ffc.js +0 -1
  87. package/Marketplace/452.58ce3ef12b9b5a47.js +0 -1
  88. package/Marketplace/476.d08ef7b92327904d.js +0 -1
  89. package/Marketplace/478.a63c640a3e971a16.js +0 -1
  90. package/Marketplace/500.c2e6963e4771761e.js +0 -1
  91. package/Marketplace/527.984c24771dbd0f8e.js +0 -1
  92. package/Marketplace/556.5d624cfb73f161b2.js +0 -1
  93. package/Marketplace/56.0432dfcbb3e04e39.js +0 -1
  94. package/Marketplace/599.8de0c2b4c7af0f9d.js +0 -1
  95. package/Marketplace/609.0e0a820d30efd4d4.js +0 -1
  96. package/Marketplace/617.4db1b737553fe58b.js +0 -1
  97. package/Marketplace/62.4f9a8ca2692bdd97.js +0 -1
  98. package/Marketplace/687.1fb4b2602d2b185a.js +0 -1
  99. package/Marketplace/699.d68a917277dbe11a.js +0 -1
  100. package/Marketplace/700.755c54d915bd281e.js +0 -1
  101. package/Marketplace/726.40535ee28a35e978.js +0 -1
  102. package/Marketplace/806.4037f673990a5242.js +0 -1
  103. package/Marketplace/810.629a800ca97725b7.js +0 -1
  104. package/Marketplace/877.bbdea3b04cc75780.js +0 -1
  105. package/Marketplace/900.b7de175b628a8dbe.js +0 -1
  106. package/Marketplace/967.2b39f548c7f4eb30.js +0 -1
  107. package/Marketplace/common.2cffc11d42ed963f.js +0 -1
  108. package/Marketplace/main.7c0e9137308de113.js +0 -1
  109. package/Marketplace/polyfills.503b3f4bf922d237.js +0 -1
  110. package/Marketplace/runtime.b0602b888a191d78.js +0 -1
  111. package/Marketplace/scripts.0d34bffadb54993a.js +0 -1
  112. package/Marketplace/styles.095460a0131dd2fc.css +0 -19
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[476],{1476:(w,b,l)=>{l.d(b,{NW:()=>B,TU:()=>F});var d=l(6814),t=l(5879),v=l(8645),m=l(2296),h=l(8525),u=l(2596),_=l(3680),g=l(2495),x=l(4170);function z(a,o){if(1&a&&(t.TgZ(0,"mat-option",19),t._uU(1),t.qZA()),2&a){const i=o.$implicit;t.Q6J("value",i),t.xp6(1),t.hij(" ",i," ")}}function T(a,o){if(1&a){const i=t.EpF();t.TgZ(0,"mat-form-field",16)(1,"mat-select",17),t.NdJ("selectionChange",function(n){t.CHM(i);const s=t.oxw(2);return t.KtG(s._changePageSize(n.value))}),t.YNc(2,z,2,2,"mat-option",18),t.qZA()()}if(2&a){const i=t.oxw(2);t.Q6J("appearance",i._formFieldAppearance)("color",i.color),t.xp6(1),t.Q6J("value",i.pageSize)("disabled",i.disabled)("aria-labelledby",i._pageSizeLabelId)("panelClass",i.selectConfig.panelClass||"")("disableOptionCentering",i.selectConfig.disableOptionCentering),t.xp6(1),t.Q6J("ngForOf",i._displayedPageSizeOptions)}}function I(a,o){if(1&a&&(t.TgZ(0,"div",20),t._uU(1),t.qZA()),2&a){const i=t.oxw(2);t.xp6(1),t.Oqu(i.pageSize)}}function O(a,o){if(1&a&&(t.TgZ(0,"div",12)(1,"div",13),t._uU(2),t.qZA(),t.YNc(3,T,3,8,"mat-form-field",14),t.YNc(4,I,2,1,"div",15),t.qZA()),2&a){const i=t.oxw();t.xp6(1),t.s9C("id",i._pageSizeLabelId),t.xp6(1),t.hij(" ",i._intl.itemsPerPageLabel," "),t.xp6(1),t.Q6J("ngIf",i._displayedPageSizeOptions.length>1),t.xp6(1),t.Q6J("ngIf",i._displayedPageSizeOptions.length<=1)}}function D(a,o){if(1&a){const i=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(i);const n=t.oxw();return t.KtG(n.firstPage())}),t.O4$(),t.TgZ(1,"svg",7),t._UZ(2,"path",22),t.qZA()()}if(2&a){const i=t.oxw();t.Q6J("matTooltip",i._intl.firstPageLabel)("matTooltipDisabled",i._previousButtonsDisabled())("matTooltipPosition","above")("disabled",i._previousButtonsDisabled()),t.uIk("aria-label",i._intl.firstPageLabel)}}function S(a,o){if(1&a){const i=t.EpF();t.O4$(),t.kcU(),t.TgZ(0,"button",23),t.NdJ("click",function(){t.CHM(i);const n=t.oxw();return t.KtG(n.lastPage())}),t.O4$(),t.TgZ(1,"svg",7),t._UZ(2,"path",24),t.qZA()()}if(2&a){const i=t.oxw();t.Q6J("matTooltip",i._intl.lastPageLabel)("matTooltipDisabled",i._nextButtonsDisabled())("matTooltipPosition","above")("disabled",i._nextButtonsDisabled()),t.uIk("aria-label",i._intl.lastPageLabel)}}let p=(()=>{var a;class o{constructor(){this.changes=new v.x,this.itemsPerPageLabel="Items per page:",this.nextPageLabel="Next page",this.previousPageLabel="Previous page",this.firstPageLabel="First page",this.lastPageLabel="Last page",this.getRangeLabel=(e,n,s)=>{if(0==s||0==n)return`0 of ${s}`;const r=e*n;return`${r+1} \u2013 ${r<(s=Math.max(s,0))?Math.min(r+n,s):r+n} of ${s}`}}}return(a=o).\u0275fac=function(e){return new(e||a)},a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),o})();const L={provide:p,deps:[[new t.FiY,new t.tp0,p]],useFactory:function M(a){return a||new p}},E=new t.OlP("MAT_PAGINATOR_DEFAULT_OPTIONS"),A=(0,_.Id)((0,_.dB)(class{}));let k=(()=>{var a;class o extends A{get pageIndex(){return this._pageIndex}set pageIndex(e){this._pageIndex=Math.max((0,g.su)(e),0),this._changeDetectorRef.markForCheck()}get length(){return this._length}set length(e){this._length=(0,g.su)(e),this._changeDetectorRef.markForCheck()}get pageSize(){return this._pageSize}set pageSize(e){this._pageSize=Math.max((0,g.su)(e),0),this._updateDisplayedPageSizeOptions()}get pageSizeOptions(){return this._pageSizeOptions}set pageSizeOptions(e){this._pageSizeOptions=(e||[]).map(n=>(0,g.su)(n)),this._updateDisplayedPageSizeOptions()}get hidePageSize(){return this._hidePageSize}set hidePageSize(e){this._hidePageSize=(0,g.Ig)(e)}get showFirstLastButtons(){return this._showFirstLastButtons}set showFirstLastButtons(e){this._showFirstLastButtons=(0,g.Ig)(e)}constructor(e,n,s){if(super(),this._intl=e,this._changeDetectorRef=n,this._pageIndex=0,this._length=0,this._pageSizeOptions=[],this._hidePageSize=!1,this._showFirstLastButtons=!1,this.selectConfig={},this.page=new t.vpe,this._intlChanges=e.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),s){const{pageSize:r,pageSizeOptions:c,hidePageSize:f,showFirstLastButtons:P}=s;null!=r&&(this._pageSize=r),null!=c&&(this._pageSizeOptions=c),null!=f&&(this._hidePageSize=f),null!=P&&(this._showFirstLastButtons=P)}}ngOnInit(){this._initialized=!0,this._updateDisplayedPageSizeOptions(),this._markInitialized()}ngOnDestroy(){this._intlChanges.unsubscribe()}nextPage(){if(!this.hasNextPage())return;const e=this.pageIndex;this.pageIndex=this.pageIndex+1,this._emitPageEvent(e)}previousPage(){if(!this.hasPreviousPage())return;const e=this.pageIndex;this.pageIndex=this.pageIndex-1,this._emitPageEvent(e)}firstPage(){if(!this.hasPreviousPage())return;const e=this.pageIndex;this.pageIndex=0,this._emitPageEvent(e)}lastPage(){if(!this.hasNextPage())return;const e=this.pageIndex;this.pageIndex=this.getNumberOfPages()-1,this._emitPageEvent(e)}hasPreviousPage(){return this.pageIndex>=1&&0!=this.pageSize}hasNextPage(){const e=this.getNumberOfPages()-1;return this.pageIndex<e&&0!=this.pageSize}getNumberOfPages(){return this.pageSize?Math.ceil(this.length/this.pageSize):0}_changePageSize(e){const s=this.pageIndex;this.pageIndex=Math.floor(this.pageIndex*this.pageSize/e)||0,this.pageSize=e,this._emitPageEvent(s)}_nextButtonsDisabled(){return this.disabled||!this.hasNextPage()}_previousButtonsDisabled(){return this.disabled||!this.hasPreviousPage()}_updateDisplayedPageSizeOptions(){this._initialized&&(this.pageSize||(this._pageSize=0!=this.pageSizeOptions.length?this.pageSizeOptions[0]:50),this._displayedPageSizeOptions=this.pageSizeOptions.slice(),-1===this._displayedPageSizeOptions.indexOf(this.pageSize)&&this._displayedPageSizeOptions.push(this.pageSize),this._displayedPageSizeOptions.sort((e,n)=>e-n),this._changeDetectorRef.markForCheck())}_emitPageEvent(e){this.page.emit({previousPageIndex:e,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})}}return(a=o).\u0275fac=function(e){t.$Z()},a.\u0275dir=t.lG2({type:a,inputs:{color:"color",pageIndex:"pageIndex",length:"length",pageSize:"pageSize",pageSizeOptions:"pageSizeOptions",hidePageSize:"hidePageSize",showFirstLastButtons:"showFirstLastButtons",selectConfig:"selectConfig"},outputs:{page:"page"},features:[t.qOj]}),o})(),C=0,B=(()=>{var a;class o extends k{constructor(e,n,s){super(e,n,s),this._pageSizeLabelId="mat-paginator-page-size-label-"+C++,this._formFieldAppearance=s?.formFieldAppearance||"outline"}}return(a=o).\u0275fac=function(e){return new(e||a)(t.Y36(p),t.Y36(t.sBO),t.Y36(E,8))},a.\u0275cmp=t.Xpm({type:a,selectors:[["mat-paginator"]],hostAttrs:["role","group",1,"mat-mdc-paginator"],inputs:{disabled:"disabled"},exportAs:["matPaginator"],features:[t.qOj],decls:14,vars:14,consts:[[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],["class","mat-mdc-paginator-page-size",4,"ngIf"],[1,"mat-mdc-paginator-range-actions"],["aria-live","polite",1,"mat-mdc-paginator-range-label"],["mat-icon-button","","type","button","class","mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","matTooltipPosition","disabled","click",4,"ngIf"],["mat-icon-button","","type","button",1,"mat-mdc-paginator-navigation-previous",3,"matTooltip","matTooltipDisabled","matTooltipPosition","disabled","click"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true",1,"mat-mdc-paginator-icon"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["mat-icon-button","","type","button",1,"mat-mdc-paginator-navigation-next",3,"matTooltip","matTooltipDisabled","matTooltipPosition","disabled","click"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],["mat-icon-button","","type","button","class","mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","matTooltipPosition","disabled","click",4,"ngIf"],[1,"mat-mdc-paginator-page-size"],[1,"mat-mdc-paginator-page-size-label",3,"id"],["class","mat-mdc-paginator-page-size-select",3,"appearance","color",4,"ngIf"],["class","mat-mdc-paginator-page-size-value",4,"ngIf"],[1,"mat-mdc-paginator-page-size-select",3,"appearance","color"],["hideSingleSelectionIndicator","",3,"value","disabled","aria-labelledby","panelClass","disableOptionCentering","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[1,"mat-mdc-paginator-page-size-value"],["mat-icon-button","","type","button",1,"mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","matTooltipPosition","disabled","click"],["d","M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"],["mat-icon-button","","type","button",1,"mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","matTooltipPosition","disabled","click"],["d","M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t.YNc(2,O,5,4,"div",2),t.TgZ(3,"div",3)(4,"div",4),t._uU(5),t.qZA(),t.YNc(6,D,3,5,"button",5),t.TgZ(7,"button",6),t.NdJ("click",function(){return n.previousPage()}),t.O4$(),t.TgZ(8,"svg",7),t._UZ(9,"path",8),t.qZA()(),t.kcU(),t.TgZ(10,"button",9),t.NdJ("click",function(){return n.nextPage()}),t.O4$(),t.TgZ(11,"svg",7),t._UZ(12,"path",10),t.qZA()(),t.YNc(13,S,3,5,"button",11),t.qZA()()()),2&e&&(t.xp6(2),t.Q6J("ngIf",!n.hidePageSize),t.xp6(3),t.hij(" ",n._intl.getRangeLabel(n.pageIndex,n.pageSize,n.length)," "),t.xp6(1),t.Q6J("ngIf",n.showFirstLastButtons),t.xp6(1),t.Q6J("matTooltip",n._intl.previousPageLabel)("matTooltipDisabled",n._previousButtonsDisabled())("matTooltipPosition","above")("disabled",n._previousButtonsDisabled()),t.uIk("aria-label",n._intl.previousPageLabel),t.xp6(3),t.Q6J("matTooltip",n._intl.nextPageLabel)("matTooltipDisabled",n._nextButtonsDisabled())("matTooltipPosition","above")("disabled",n._nextButtonsDisabled()),t.uIk("aria-label",n._intl.nextPageLabel),t.xp6(3),t.Q6J("ngIf",n.showFirstLastButtons))},dependencies:[d.sg,d.O5,m.RK,x.KE,h.gD,_.ey,u.gM],styles:[".mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color);background-color:var(--mat-paginator-container-background-color);font-family:var(--mat-paginator-container-text-font);line-height:var(--mat-paginator-container-text-line-height);font-size:var(--mat-paginator-container-text-size);font-weight:var(--mat-paginator-container-text-weight);letter-spacing:var(--mat-paginator-container-text-tracking)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size)}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap-reverse;width:100%;min-height:var(--mat-paginator-container-size)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:84px}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color)}.mat-mdc-icon-button[disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color)}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}.cdk-high-contrast-active .mat-mdc-icon-button[disabled] .mat-mdc-paginator-icon,.cdk-high-contrast-active .mat-mdc-paginator-icon{fill:currentColor;fill:CanvasText}.cdk-high-contrast-active .mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}"],encapsulation:2,changeDetection:0}),o})(),F=(()=>{var a;class o{}return(a=o).\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({providers:[L],imports:[d.ez,m.ot,h.LD,u.AV]}),o})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[478],{9478:(Ke,Z,r)=>{r.r(Z),r.d(Z,{PriceModule:()=>$e});var _=r(6814),y=r(6027),m=r(4387),C=r(9790),h=r(6223),q=r(4807),e=r(5879);let E=(()=>{var o;class l{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,i){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",i.priceTabs))},dependencies:[y.e,C.lC]}),l})();var w=r(2383),A=r(7797),F=r(9397),d=r(2181),g=r(5802),f=r(9659),x=r(9229),P=r(7700),N=r(8695),b=r(5993),D=r(6026);function V(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",19),e._uU(2," Scan Channel "),e.qZA()}}function Y(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",20),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.onUpdateItems(i))}),e._UZ(1,"i",21),e._uU(2," Update "),e.qZA()}}function $(o,l){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,V,3,0,"button",16),e.YNc(2,Y,3,0,"button",17),e.qZA()),2&o){const t=l.ngIf,n=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!n.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",n.productService.hasSelectionVariant(t))}}function K(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",22)(1,"app-table",23),e.NdJ("onToggle",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&o){const t=e.oxw().ngIf,n=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,n.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function G(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",25),e._uU(2,"?"),e.qZA()()}}function R(o,l){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=l.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",27),e._uU(2," Next"),e.qZA()}}function B(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",28),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",29),e._uU(2," Last"),e.qZA()}}function j(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,$,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"filters")(6,"div",4)(7,"div")(8,"label"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",5),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.PageNumber=i)}),e.qZA()(),e.TgZ(11,"div")(12,"label"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",5),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.RowCount=i)}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",6)(17,"div",7),e.YNc(18,K,3,6,"div",8),e.ALo(19,"async"),e.qZA(),e.TgZ(20,"div",9)(21,"div",10)(22,"div",11),e._uU(23),e.ALo(24,"number"),e.ALo(25,"async"),e.YNc(26,G,3,0,"span",12),e.YNc(27,R,3,3,"span",3),e.ALo(28,"async"),e._uU(29),e.qZA()(),e.TgZ(30,"div",13),e.YNc(31,H,3,0,"a",14),e.YNc(32,B,3,0,"a",15),e.qZA()()()()()}if(2&o){const t=e.oxw();let n;e.Q6J("pageData",t.pageData)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,12,t.paginationService.data$)),e.xp6(7),e.Q6J("ngModel",t.searchFilter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(4),e.Q6J("ngIf",e.lcZ(19,14,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(24,16,null==(n=e.lcZ(25,18,t.paginationService.data$))?null:n.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(28,20,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let z=(()=>{var o;class l{constructor(n,i,a,c,s){this.http=n,this.toastr=i,this.dialog=a,this.paginationService=c,this.productService=s,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,F.b)(n=>{this.channelOptions=n.Options.Channel,n.Filter={PageNumber:n.Filter.PageNumber,RowCount:n.Filter.RowCount,filterModel:1},this.searchFilter=n.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(n){this.searchFilter.filterModel=1,n&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(n){this.searchFilter.text=n,this.paginationService.reloadPagination(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=g.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(w.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,d.h)(a=>g.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(n,i,!this.searchFilter.UpdatedProduct)}})}updatePrice(n){let i=this.productService.selectedVariantProduct(n);if(i.length>0){let c=i.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice})),s={ListChannelID:this.channelOptions.filter(p=>p.selected).map(p=>p.ID),ListPrice:c};this.http.post("/api/Price/UpdateChannel",s).subscribe(p=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+s.ListPrice.length+" items in "+s.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(n){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:n.Price-0,VariantID:n.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(a=>{let c=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+n.ItemName+"("+n.VarName+") price in "+c.Name+" to "+i.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(n){const i=this.productService.selectedVariantProduct(n);this.dialog.open(A.j,{data:{selectedItems:i,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,d.h)(a=>void 0!==a)).subscribe(a=>{this.channelOptions=a,this.updatePrice(n)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n)}})}ngOnDestroy(){this.paginationService.destroy()}}return(o=l).\u0275fac=function(n){return new(n||o)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(N.b),e.Y36(b.M))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["type","number",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,i){1&n&&(e.YNc(0,j,33,22,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.loader$))},dependencies:[_.O5,h.Fj,h.wV,h.JJ,h.On,m.p,D.a,_.Ov,_.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),l})();var u=r(4910),J=r(236),W=r(5623),M=r(7826),U=r(278),I=r(7466);function X(o,l){if(1&o&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&o){const t=l.$implicit,n=l.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[n]?i.tooltipsText[n]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const ee=function(o){return{"border-0 rounded":o}};let O=(()=>{var o;class l{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(n){this.modelChange.emit(n)}}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275cmp=e.Xpm({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[e.jDz],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(c){return i.change(c)}),e.YNc(2,X,2,4,"mat-radio-button",2),e.qZA()()),2&n&&(e.Q6J("ngClass",e.VKq(3,ee,0==i.border)),e.xp6(1),e.Q6J("ngModel",i.model),e.xp6(1),e.Q6J("ngForOf",i.options))},dependencies:[_.ez,_.mk,_.sg,I.Fk,I.VQ,I.U0,h.u5,h.JJ,h.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]}),l})();var T=r(621);function ne(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function te(o,l){if(1&o&&(e.TgZ(0,"th",20),e._uU(1),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.Oqu(t.Name)}}function ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"th")(1,"input",21),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.checkboxState=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onSelectAllData())}),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.checkboxState)}}function oe(o,l){1&o&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"img",33),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,c=e.oxw();return e.KtG(c.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function le(o,l){1&o&&e._UZ(0,"img",34)}const ce=function(o){return{"border-bottom":o}};function re(o,l){if(1&o&&(e.ynx(0),e.TgZ(1,"td",28),e.YNc(2,ae,1,1,"img",29),e.YNc(3,le,1,0,"ng-template",null,30,e.W1O),e.qZA(),e.TgZ(5,"td",31)(6,"h5",32),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&o){const t=e.MAs(4),n=e.oxw().index,i=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ce,n+1==a.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}function se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"td",35)(1,"input",21),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.selected=i)}),e.qZA()()}if(2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}const pe=function(o){return{"bg-gradient-warning":o}};function _e(o,l){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39),e.NdJ("click",function(){const a=e.CHM(t).$implicit,c=e.oxw(2).$implicit,s=e.oxw().$implicit,p=e.oxw();return e.KtG(p.openTableDialog(c,s,a))}),e.TgZ(5,"span",40),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"a",41),e.NdJ("click",function(i){return null==i?null:i.stopPropagation()}),e._UZ(9,"i",27),e.qZA()(),e.BQk()}if(2&o){const t=l.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,pe,t.Price!=t.PriceExpected)),e.xp6(2),e.hij(" ",e.lcZ(7,6,t.Price)," "),e.xp6(2),e.Q6J("href",t.Url,e.LSH)}}function he(o,l){1&o&&(e.TgZ(0,"td",42),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",42),e._uU(3,"X"),e.qZA())}function ge(o,l){if(1&o&&(e.ynx(0),e.YNc(1,_e,10,10,"ng-container",36),e.YNc(2,he,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&o){const t=l.$implicit,n=e.MAs(3),i=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.getItemFromChannel(i,t.ID))("ngIfElse",n)}}const k=function(o){return[o]};function de(o,l){if(1&o&&(e.TgZ(0,"tr"),e.YNc(1,re,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.YNc(10,se,2,1,"ng-template",16),e.YNc(11,ge,4,2,"ng-container",17),e.qZA()),2&o){const t=l.$implicit,n=l.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==n),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("ngxPermissionsOnly",e.VKq(6,k,i.rolePriceEdit)),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function ue(o,l){if(1&o&&(e.TgZ(0,"tbody"),e.YNc(1,de,12,8,"tr",17),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}let me=(()=>{var o;class l{constructor(n,i,a,c,s){this.http=n,this.toastr=i,this.dialog=a,this.productService=c,this.biggerPictureService=s,this.searchFilter=new W.k,this.products=[],this.checkboxState=!1,this.rolePriceEdit=M.G.price,this.initPageLoader(),this.filterTypeOptions=[{Key:u.v.ALL,Value:"All"},{Key:u.v.DIFFERENCE,Value:"Difference"}],this.filterType=u.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=c.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.onFilter()})}onSelectAllData(){this.products=this.products.map(n=>(n.Variants&&(n.Variants=n.Variants.map(i=>(i.selected=this.checkboxState,i))),n))}onFilter(n){this.http.post("/api/Price/GetOutletPrice",{text:n,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(a=>{this.products=a.Data})}updatePrice(){let n=this.productService.selectedVariantProduct(this.products);if(n.length>0){let i=n.map(s=>s.ID),c={ListChannelID:this.channelOptions.filter(s=>s.selected).map(s=>s.ID),ListID:i};this.http.post("/api/Price/UpdateChannelOutletPrice",c).subscribe({next:s=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+c.ListID.length+" items in "+c.ListChannelID.length+" channels","Success")},error:s=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(n=>(n.selected=!1,n))}getItemFromChannel(n,i){return n.Channel.find(a=>a.ChannelID==i)}onUpdateItems(){const n=this.productService.selectedVariantProduct(this.products);this.dialog.open(A.j,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,d.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.channelOptions=i,this.updatePrice()})}openTableDialog(n,i,a){let c=JSON.parse(JSON.stringify(n));this.dialog.open(J.k,{data:{Name:i.Name,Variant:c,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe((0,d.h)(p=>g.g.IsNotEmpty(p))).subscribe(p=>{this.updateProductPrice(p,a)})}updateProductPrice(n,i){let a={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(c=>{i.Price=a.Price;const s=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${s.Name} to ${a.Price}`,"Success")})}onZoomImage(n,i){this.biggerPictureService.openBiggerPicture(n,i)}}return(o=l).\u0275fac=function(n){return new(n||o)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(U.k))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-custom-channel-price"]],decls:30,vars:14,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["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"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(n,i){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(c){return i.onFilter(c)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(c){return i.filterType=c}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,ne,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,te,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.YNc(27,ie,2,1,"ng-template",16),e.YNc(28,oe,5,0,"ng-container",17),e.qZA()(),e.YNc(29,ue,2,1,"tbody",17),e.qZA()()()()()()()),2&n&&(e.Q6J("pageData",i.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",i.filterType)("options",i.filterTypeOptions)("border",!0),e.xp6(3),e.Q6J("ngIf",i.productService.hasSelectionVariant(i.products)),e.xp6(10),e.Q6J("ngForOf",i.channelOptions),e.xp6(8),e.Q6J("ngxPermissionsOnly",e.VKq(12,k,i.rolePriceEdit)),e.xp6(1),e.Q6J("ngForOf",i.channelOptions),e.xp6(1),e.Q6J("ngForOf",i.products))},dependencies:[_.mk,_.sg,_.O5,h.Wl,h.JJ,h.On,m.p,O,T.gE,_.JJ],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}"]}),l})();var Ce=r(2729),L=r(2599),Q=r(2596);function fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function xe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function Pe(o,l){if(1&o&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,fe,3,0,"button",6),e.YNc(4,xe,3,0,"button",7),e.qZA()()()),2&o){const t=l.ngIf,n=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!n.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",n.productService.hasSelectionVariant(t))}}function be(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"th")(1,"input",32),e.NdJ("change",function(i){e.CHM(t);const a=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.onSelectAllSKU(i.target.checked,a))}),e.qZA()()}}function Ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"input",50),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(4).$implicit;return e.KtG(a.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(4).$implicit,a=e.oxw(3);return e.KtG(a.onCheckboxStateProduct(i))}),e.qZA()}if(2&o){const t=e.oxw(4).$implicit;e.Q6J("ngModel",t.selected)}}function Te(o,l){if(1&o&&e.YNc(0,Ie,1,1,"input",49),2&o){const t=e.oxw(2).$implicit,n=e.oxw().$implicit;e.Q6J("ngIf",t.Inventory>=0||n.Variants.length>1)}}function Se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"img",51),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,c=e.oxw(3);return e.KtG(c.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function ve(o,l){1&o&&e._UZ(0,"img",52)}const S=function(o){return[o]};function Ze(o,l){if(1&o&&(e.ynx(0),e.TgZ(1,"td",43)(2,"div",44),e.YNc(3,Te,1,1,"ng-template",21),e.YNc(4,Se,1,1,"img",45),e.YNc(5,ve,1,0,"ng-template",null,46,e.W1O),e.qZA()(),e.TgZ(7,"td",47)(8,"span",48),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&o){const t=e.MAs(6),n=e.oxw(2).$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("rowSpan",n.Variants.length),e.xp6(2),e.Q6J("ngxPermissionsOnly",e.VKq(7,S,i.rolePriceEdit)),e.xp6(1),e.Q6J("ngIf",n.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",n.Variants.length),e.xp6(2),e.Oqu(n.Name),e.xp6(3),e.hij("(",n.Category,")")}}function ye(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"input",55),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2).$implicit;return e.KtG(a.selected=i)}),e.qZA()}if(2&o){const t=e.oxw(2).$implicit;e.Q6J("ngModel",t.selected)}}function we(o,l){if(1&o&&(e.TgZ(0,"td",53),e.YNc(1,ye,1,1,"input",54),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",t.Inventory>=0)}}function Ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",56),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,a=e.oxw().$implicit,c=e.oxw(2).ngIf,s=e.oxw();return e.KtG(s.openTableDialog(i,a,c))}),e._uU(1),e.ALo(2,"number"),e.qZA()}if(2&o){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const Fe=function(o){return{"bg-gradient-warning":o}};function Ne(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,Ze,13,9,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",33)(8,"a",34),e._UZ(9,"i",35),e.qZA()()(),e.YNc(10,we,2,1,"ng-template",21),e.TgZ(11,"td",22),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",36),e.YNc(15,Ae,3,3,"div",37),e.qZA(),e.TgZ(16,"td")(17,"div",38)(18,"div",39)(19,"a",34),e._UZ(20,"i",40),e.qZA(),e._uU(21," \xa0\xa0 "),e.TgZ(22,"span",41),e.NdJ("click",function(){const a=e.CHM(t).$implicit,c=e.oxw(4);return e.KtG(c.refreshPrice(a))}),e._UZ(23,"i",42),e.qZA()()()()()}if(2&o){const t=l.$implicit,n=l.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==n),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("ngxPermissionsOnly",e.VKq(11,S,i.rolePriceEdit)),e.xp6(2),e.hij(" ",e.lcZ(13,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(13,Fe,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function De(o,l){if(1&o&&(e.ynx(0),e.YNc(1,Ne,24,15,"tr",26),e.BQk()),2&o){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Je(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",56),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",57),e._uU(2,"?"),e.qZA()()}}function Me(o,l){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=l.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Ue(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",61),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",62),e._uU(2," Next"),e.qZA()}}function Oe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",63),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",64),e._uU(2," Last"),e.qZA()}}function ke(o,l){if(1&o&&(e.TgZ(0,"div",58),e.YNc(1,Ue,3,0,"a",59),e.YNc(2,Oe,3,0,"a",60),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Le(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"FILTER DIFFERENT PRICE"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.YNc(16,be,2,0,"ng-template",21),e.TgZ(17,"th",22),e._uU(18,"POS"),e.qZA(),e.TgZ(19,"th",22)(20,"div",23),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onChangeChannel())}),e._UZ(21,"img",24),e._uU(22),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,De,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Je,3,0,"span",30),e.YNc(32,Me,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,ke,3,2,"div",31),e.qZA()()()()}if(2&o){const t=l.ngIf,n=e.oxw(2);e.xp6(9),e.Q6J("ngModel",n.toggleDifferentInventory),e.xp6(7),e.Q6J("ngxPermissionsOnly",e.VKq(15,S,n.rolePriceEdit)),e.xp6(4),e.Q6J("matTooltip","Change "+(null==n.selectedChannel?null:n.selectedChannel.Name)),e.xp6(1),e.Q6J("src",n.selectedChannel.logo,e.LSH),e.xp6(1),e.hij(" ",null!=n.selectedChannel&&n.selectedChannel.Name?null==n.selectedChannel?null:n.selectedChannel.Name:"Choose Channel ..."," "),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,11,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",n.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,13,!n.paginationService.hideCount&&n.allDataCount$)),e.xp6(2),e.hij(" records ~ ",n.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Qe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Number"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.PageNumber=i)}),e.qZA()(),e.TgZ(7,"div")(8,"label"),e._uU(9,"Page Size"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(11,Pe,5,2,"actions",4),e.ALo(12,"async"),e.YNc(13,Le,36,17,"content",4),e.ALo(14,"async"),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(12,6,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(14,8,t.paginationService.data$))}}let qe=(()=>{var o;class l{constructor(n,i,a,c,s,p){this.http=n,this.paginationService=i,this.toastr=a,this.dialog=c,this.productService=s,this.biggerPictureService=p,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=M.G.price,this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,F.b)(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=u.v.ALL,this.paginationService.reloadPagination(this.searchFilter),this.channelOptions=n.Options.Channel,this.initSelectedChannel()}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?u.v.ALL:u.v.DIFFERENCE,this.search()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(i=>(i.selected=n.selected,i))}openScanDialog(n){let i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=g.g.GuidEMpty,this.dialog.open(w.j,{data:{filter:i,channelOptions:n.Options.Channel},width:"600px"}).afterClosed().pipe((0,d.h)(a=>g.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll(n)})}scanAll(n){const i=this.productService.findChannelById(this.searchFilter.ChannelID,n.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${i?.Name}`,"Success"))})}updateStock(n){let a=this.productService.selectedVariantProduct(n).map(s=>({ID:s.ID,ChannelID:s.Channel[0].ChannelID,Code:s.Code,Price:s.UnitPrice})),c={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",c).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${c.ListPrice.length} variants in ${c.ListChannelID.length} channels`,"Success")})}refreshPrice(n){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID}).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.reloadPagination(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:n=>{this.paginationService.getAllData(this.searchFilter,n.Total)}})}openTableDialog(n,i,a){let c=JSON.parse(JSON.stringify(n));this.dialog.open(J.k,{data:{Name:i.Name,Variant:c,ChannelID:c?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:c?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,d.h)(p=>g.g.IsNotEmpty(p))).subscribe(p=>{this.updateItemAfterDialog(p,a,n)})}updateItemAfterDialog(n,i,a){let c={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",c).subscribe(s=>{const p=this.productService.findChannelById(c.ID,i.Options.Channel);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${p.Name} to ${c.Price}`,"Success"),a.Channel[0]&&(a.Channel[0].Price=c.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(n=>n.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=g.g.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Ce.b,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe((0,d.h)(n=>g.g.IsNotEmpty(n))).subscribe(n=>{this.selectedChannel=n,this.searchFilter.ChannelID=n.ID,this.search()})}onSelectAllSKU(n,i){i=i.map(a=>(a.Variants=a.Variants.map(c=>(c.selected=n,c)),a))}onZoomImage(n,i){this.biggerPictureService.openBiggerPicture(n,i)}ngOnDestroy(){this.paginationService.destroy()}}return(o=l).\u0275fac=function(n){return new(n||o)(e.Y36(f.O),e.Y36(N.b),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(U.k))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["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,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,i){1&n&&(e.YNc(0,Qe,15,10,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.loader$))},dependencies:[_.mk,_.sg,_.O5,h.Fj,h.wV,h.Wl,h.JJ,h.On,m.p,L.Rr,Q.gM,T.gE,_.Ov,_.JJ],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]}),l})();var v=r(4575);const Ee=[{path:"",component:E,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:z,canActivate:[v.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:me,canActivate:[v.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:qe,canActivate:[v.a],data:{title:"Price Single Channel Comparison"}}]}];let Ve=(()=>{var o;class l{}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[_.ez,C.Bz.forChild(Ee)]}),l})();var Ye=r(5986);let $e=(()=>{var o;class l{}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[_.ez,h.u5,y.Z,m.R,C.Bz,q.A0,Ve,h.UX,L.rP,Ye.p9,Q.AV,O,D.a,T.VI.forChild()]}),l})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[500],{7738:(M,p,s)=>{s.d(p,{f:()=>f});var i=s(6814),u=s(5879);let f=(()=>{var c;class h{}return(c=h).\u0275fac=function(v){return new(v||c)},c.\u0275mod=u.oAB({type:c}),c.\u0275inj=u.cJS({imports:[i.ez]}),h})()},3566:(M,p,s)=>{s.d(p,{JX:()=>R,YE:()=>A,nU:()=>x});var i=s(5879),u=s(4191),f=s(2495),c=s(6028),h=s(3680),g=s(8645),v=s(3019),t=s(6825),w=s(6814);const C=["mat-sort-header",""];function E(r,n){if(1&r){const o=i.EpF();i.TgZ(0,"div",3),i.NdJ("@arrowPosition.start",function(){i.CHM(o);const a=i.oxw();return i.KtG(a._disableViewStateAnimation=!0)})("@arrowPosition.done",function(){i.CHM(o);const a=i.oxw();return i.KtG(a._disableViewStateAnimation=!1)}),i._UZ(1,"div",4),i.TgZ(2,"div",5),i._UZ(3,"div",6)(4,"div",7)(5,"div",8),i.qZA()()}if(2&r){const o=i.oxw();i.Q6J("@arrowOpacity",o._getArrowViewState())("@arrowPosition",o._getArrowViewState())("@allowChildren",o._getArrowDirectionState()),i.xp6(2),i.Q6J("@indicator",o._getArrowDirectionState()),i.xp6(1),i.Q6J("@leftPointer",o._getArrowDirectionState()),i.xp6(1),i.Q6J("@rightPointer",o._getArrowDirectionState())}}const B=["*"],D=new i.OlP("MAT_SORT_DEFAULT_OPTIONS"),O=(0,h.dB)((0,h.Id)(class{}));let A=(()=>{var r;class n extends O{get direction(){return this._direction}set direction(e){this._direction=e}get disableClear(){return this._disableClear}set disableClear(e){this._disableClear=(0,f.Ig)(e)}constructor(e){super(),this._defaultOptions=e,this.sortables=new Map,this._stateChanges=new g.x,this.start="asc",this._direction="",this.sortChange=new i.vpe}register(e){this.sortables.set(e.id,e)}deregister(e){this.sortables.delete(e.id)}sort(e){this.active!=e.id?(this.active=e.id,this.direction=e.start?e.start:this.start):this.direction=this.getNextSortDirection(e),this.sortChange.emit({active:this.active,direction:this.direction})}getNextSortDirection(e){if(!e)return"";let d=function I(r,n){let o=["asc","desc"];return"desc"==r&&o.reverse(),n||o.push(""),o}(e.start||this.start,e?.disableClear??this.disableClear??!!this._defaultOptions?.disableClear),l=d.indexOf(this.direction)+1;return l>=d.length&&(l=0),d[l]}ngOnInit(){this._markInitialized()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}}return(r=n).\u0275fac=function(e){return new(e||r)(i.Y36(D,8))},r.\u0275dir=i.lG2({type:r,selectors:[["","matSort",""]],hostAttrs:[1,"mat-sort"],inputs:{disabled:["matSortDisabled","disabled"],active:["matSortActive","active"],start:["matSortStart","start"],direction:["matSortDirection","direction"],disableClear:["matSortDisableClear","disableClear"]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[i.qOj,i.TTD]}),n})();const _=h.mZ.ENTERING+" "+h.yN.STANDARD_CURVE,m={indicator:(0,t.X$)("indicator",[(0,t.SB)("active-asc, asc",(0,t.oB)({transform:"translateY(0px)"})),(0,t.SB)("active-desc, desc",(0,t.oB)({transform:"translateY(10px)"})),(0,t.eR)("active-asc <=> active-desc",(0,t.jt)(_))]),leftPointer:(0,t.X$)("leftPointer",[(0,t.SB)("active-asc, asc",(0,t.oB)({transform:"rotate(-45deg)"})),(0,t.SB)("active-desc, desc",(0,t.oB)({transform:"rotate(45deg)"})),(0,t.eR)("active-asc <=> active-desc",(0,t.jt)(_))]),rightPointer:(0,t.X$)("rightPointer",[(0,t.SB)("active-asc, asc",(0,t.oB)({transform:"rotate(45deg)"})),(0,t.SB)("active-desc, desc",(0,t.oB)({transform:"rotate(-45deg)"})),(0,t.eR)("active-asc <=> active-desc",(0,t.jt)(_))]),arrowOpacity:(0,t.X$)("arrowOpacity",[(0,t.SB)("desc-to-active, asc-to-active, active",(0,t.oB)({opacity:1})),(0,t.SB)("desc-to-hint, asc-to-hint, hint",(0,t.oB)({opacity:.54})),(0,t.SB)("hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc, void",(0,t.oB)({opacity:0})),(0,t.eR)("* => asc, * => desc, * => active, * => hint, * => void",(0,t.jt)("0ms")),(0,t.eR)("* <=> *",(0,t.jt)(_))]),arrowPosition:(0,t.X$)("arrowPosition",[(0,t.eR)("* => desc-to-hint, * => desc-to-active",(0,t.jt)(_,(0,t.F4)([(0,t.oB)({transform:"translateY(-25%)"}),(0,t.oB)({transform:"translateY(0)"})]))),(0,t.eR)("* => hint-to-desc, * => active-to-desc",(0,t.jt)(_,(0,t.F4)([(0,t.oB)({transform:"translateY(0)"}),(0,t.oB)({transform:"translateY(25%)"})]))),(0,t.eR)("* => asc-to-hint, * => asc-to-active",(0,t.jt)(_,(0,t.F4)([(0,t.oB)({transform:"translateY(25%)"}),(0,t.oB)({transform:"translateY(0)"})]))),(0,t.eR)("* => hint-to-asc, * => active-to-asc",(0,t.jt)(_,(0,t.F4)([(0,t.oB)({transform:"translateY(0)"}),(0,t.oB)({transform:"translateY(-25%)"})]))),(0,t.SB)("desc-to-hint, asc-to-hint, hint, desc-to-active, asc-to-active, active",(0,t.oB)({transform:"translateY(0)"})),(0,t.SB)("hint-to-desc, active-to-desc, desc",(0,t.oB)({transform:"translateY(-25%)"})),(0,t.SB)("hint-to-asc, active-to-asc, asc",(0,t.oB)({transform:"translateY(25%)"}))]),allowChildren:(0,t.X$)("allowChildren",[(0,t.eR)("* <=> *",[(0,t.IO)("@*",(0,t.pV)(),{optional:!0})])])};let S=(()=>{var r;class n{constructor(){this.changes=new g.x}}return(r=n).\u0275fac=function(e){return new(e||r)},r.\u0275prov=i.Yz7({token:r,factory:r.\u0275fac,providedIn:"root"}),n})();const T={provide:S,deps:[[new i.FiY,new i.tp0,S]],useFactory:function P(r){return r||new S}},y=(0,h.Id)(class{});let x=(()=>{var r;class n extends y{get sortActionDescription(){return this._sortActionDescription}set sortActionDescription(e){this._updateSortActionDescription(e)}get disableClear(){return this._disableClear}set disableClear(e){this._disableClear=(0,f.Ig)(e)}constructor(e,a,d,l,H,k,Y,b){super(),this._intl=e,this._changeDetectorRef=a,this._sort=d,this._columnDef=l,this._focusMonitor=H,this._elementRef=k,this._ariaDescriber=Y,this._showIndicatorHint=!1,this._viewState={},this._arrowDirection="",this._disableViewStateAnimation=!1,this.arrowPosition="after",this._sortActionDescription="Sort",b?.arrowPosition&&(this.arrowPosition=b?.arrowPosition),this._handleStateChanges()}ngOnInit(){!this.id&&this._columnDef&&(this.id=this._columnDef.name),this._updateArrowDirection(),this._setAnimationTransitionState({toState:this._isSorted()?"active":this._arrowDirection}),this._sort.register(this),this._sortButton=this._elementRef.nativeElement.querySelector(".mat-sort-header-container"),this._updateSortActionDescription(this._sortActionDescription)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{const a=!!e;a!==this._showIndicatorHint&&(this._setIndicatorHintVisible(a),this._changeDetectorRef.markForCheck())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._sort.deregister(this),this._rerenderSubscription.unsubscribe()}_setIndicatorHintVisible(e){this._isDisabled()&&e||(this._showIndicatorHint=e,this._isSorted()||(this._updateArrowDirection(),this._setAnimationTransitionState(this._showIndicatorHint?{fromState:this._arrowDirection,toState:"hint"}:{fromState:"hint",toState:this._arrowDirection})))}_setAnimationTransitionState(e){this._viewState=e||{},this._disableViewStateAnimation&&(this._viewState={toState:e.toState})}_toggleOnInteraction(){this._sort.sort(this),("hint"===this._viewState.toState||"active"===this._viewState.toState)&&(this._disableViewStateAnimation=!0)}_handleClick(){this._isDisabled()||this._sort.sort(this)}_handleKeydown(e){!this._isDisabled()&&(e.keyCode===c.L_||e.keyCode===c.K5)&&(e.preventDefault(),this._toggleOnInteraction())}_isSorted(){return this._sort.active==this.id&&("asc"===this._sort.direction||"desc"===this._sort.direction)}_getArrowDirectionState(){return`${this._isSorted()?"active-":""}${this._arrowDirection}`}_getArrowViewState(){const e=this._viewState.fromState;return(e?`${e}-to-`:"")+this._viewState.toState}_updateArrowDirection(){this._arrowDirection=this._isSorted()?this._sort.direction:this.start||this._sort.start}_isDisabled(){return this._sort.disabled||this.disabled}_getAriaSortAttribute(){return this._isSorted()?"asc"==this._sort.direction?"ascending":"descending":"none"}_renderArrow(){return!this._isDisabled()||this._isSorted()}_updateSortActionDescription(e){this._sortButton&&(this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription),this._ariaDescriber?.describe(this._sortButton,e)),this._sortActionDescription=e}_handleStateChanges(){this._rerenderSubscription=(0,v.T)(this._sort.sortChange,this._sort._stateChanges,this._intl.changes).subscribe(()=>{this._isSorted()&&(this._updateArrowDirection(),("hint"===this._viewState.toState||"active"===this._viewState.toState)&&(this._disableViewStateAnimation=!0),this._setAnimationTransitionState({fromState:this._arrowDirection,toState:"active"}),this._showIndicatorHint=!1),!this._isSorted()&&this._viewState&&"active"===this._viewState.toState&&(this._disableViewStateAnimation=!1,this._setAnimationTransitionState({fromState:"active",toState:this._arrowDirection})),this._changeDetectorRef.markForCheck()})}}return(r=n).\u0275fac=function(e){return new(e||r)(i.Y36(S),i.Y36(i.sBO),i.Y36(A,8),i.Y36("MAT_SORT_HEADER_COLUMN_DEF",8),i.Y36(u.tE),i.Y36(i.SBq),i.Y36(u.$s,8),i.Y36(D,8))},r.\u0275cmp=i.Xpm({type:r,selectors:[["","mat-sort-header",""]],hostAttrs:[1,"mat-sort-header"],hostVars:3,hostBindings:function(e,a){1&e&&i.NdJ("click",function(){return a._handleClick()})("keydown",function(l){return a._handleKeydown(l)})("mouseenter",function(){return a._setIndicatorHintVisible(!0)})("mouseleave",function(){return a._setIndicatorHintVisible(!1)}),2&e&&(i.uIk("aria-sort",a._getAriaSortAttribute()),i.ekj("mat-sort-header-disabled",a._isDisabled()))},inputs:{disabled:"disabled",id:["mat-sort-header","id"],arrowPosition:"arrowPosition",start:"start",sortActionDescription:"sortActionDescription",disableClear:"disableClear"},exportAs:["matSortHeader"],features:[i.qOj],attrs:C,ngContentSelectors:B,decls:4,vars:7,consts:[[1,"mat-sort-header-container","mat-focus-indicator"],[1,"mat-sort-header-content"],["class","mat-sort-header-arrow",4,"ngIf"],[1,"mat-sort-header-arrow"],[1,"mat-sort-header-stem"],[1,"mat-sort-header-indicator"],[1,"mat-sort-header-pointer-left"],[1,"mat-sort-header-pointer-right"],[1,"mat-sort-header-pointer-middle"]],template:function(e,a){1&e&&(i.F$t(),i.TgZ(0,"div",0)(1,"div",1),i.Hsn(2),i.qZA(),i.YNc(3,E,6,6,"div",2),i.qZA()),2&e&&(i.ekj("mat-sort-header-sorted",a._isSorted())("mat-sort-header-position-before","before"===a.arrowPosition),i.uIk("tabindex",a._isDisabled()?null:0)("role",a._isDisabled()?null:"button"),i.xp6(3),i.Q6J("ngIf",a._renderArrow()))},dependencies:[w.O5],styles:[".mat-sort-header-container{display:flex;cursor:pointer;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-container::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px) * -1)}.mat-sort-header-content{text-align:center;display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}.mat-sort-header-arrow{height:12px;width:12px;min-width:12px;position:relative;display:flex;opacity:0}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-stem{background:currentColor;height:10px;width:2px;margin:auto;display:flex;align-items:center}.cdk-high-contrast-active .mat-sort-header-stem{width:0;border-left:solid 2px}.mat-sort-header-indicator{width:100%;height:2px;display:flex;align-items:center;position:absolute;top:0;left:0}.mat-sort-header-pointer-middle{margin:auto;height:2px;width:2px;background:currentColor;transform:rotate(45deg)}.cdk-high-contrast-active .mat-sort-header-pointer-middle{width:0;height:0;border-top:solid 2px;border-left:solid 2px}.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{background:currentColor;width:6px;height:2px;position:absolute;top:0}.cdk-high-contrast-active .mat-sort-header-pointer-left,.cdk-high-contrast-active .mat-sort-header-pointer-right{width:0;height:0;border-left:solid 6px;border-top:solid 2px}.mat-sort-header-pointer-left{transform-origin:right;left:0}.mat-sort-header-pointer-right{transform-origin:left;right:0}"],encapsulation:2,data:{animation:[m.indicator,m.leftPointer,m.rightPointer,m.arrowOpacity,m.arrowPosition,m.allowChildren]},changeDetection:0}),n})(),R=(()=>{var r;class n{}return(r=n).\u0275fac=function(e){return new(e||r)},r.\u0275mod=i.oAB({type:r}),r.\u0275inj=i.cJS({providers:[T],imports:[w.ez,h.BQ]}),n})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[527],{2383:(b,O,i)=>{i.d(O,{j:()=>N});var f=i(7700),m=i(5802),u=i(754),T=i(2965),t=i(5879),M=i(9790),I=i(6814),D=i(6223),C=i(7466),E=i(4170),U=i(8525),e=i(3680),n=i(2596),a=i(7380);function o(p,g){if(1&p&&(t.TgZ(0,"mat-option",9)(1,"div",10),t._UZ(2,"img",11),t.TgZ(3,"span"),t._uU(4),t.qZA()()()),2&p){const c=g.$implicit;t.Q6J("value",c.ID)("disabled",c.disabled),t.xp6(1),t.Q6J("matTooltip",c.disabled?"Single Product Scan disabled for this type of Channel":null),t.xp6(1),t.Q6J("src",c.Img,t.LSH),t.xp6(2),t.Oqu(c.Name)}}function s(p,g){if(1&p){const c=t.EpF();t.TgZ(0,"div")(1,"h5",12),t._uU(2,"Scan Type"),t.qZA(),t.TgZ(3,"mat-radio-group",13),t.NdJ("ngModelChange",function(l){t.CHM(c);const h=t.oxw();return t.KtG(h.filter.ScanFull=l)}),t.TgZ(4,"mat-radio-button",14),t._uU(5," Full (Include Inactive Products) "),t.qZA(),t.TgZ(6,"mat-radio-button",15),t._uU(7," Active "),t.qZA()()()}if(2&p){const c=t.oxw();t.xp6(3),t.Q6J("ngModel",c.filter.ScanFull),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}function d(p,g){if(1&p){const c=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"mat-radio-group",17),t.NdJ("ngModelChange",function(l){t.CHM(c);const h=t.oxw();return t.KtG(h.filter.UpdatedProduct=l)}),t.TgZ(5,"mat-radio-button",18),t._uU(6," Scan All Products "),t.qZA(),t.TgZ(7,"mat-radio-button",19),t._uU(8," Scan Updated Products "),t.qZA()()()}if(2&p){const c=t.oxw();t.xp6(2),t.hij(" Last Scan: ",t.xi3(3,4,c.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),t.xp6(2),t.Q6J("ngModel",c.filter.UpdatedProduct),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0)}}function S(p,g){if(1&p){const c=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2," Scan Option "),t.qZA(),t.TgZ(3,"mat-radio-group",20),t.NdJ("ngModelChange",function(l){t.CHM(c);const h=t.oxw();return t.KtG(h.filter.Async=l)}),t.TgZ(4,"mat-radio-button",21),t._uU(5," Asynchronous (Get Notified when Complete) "),t.qZA(),t.TgZ(6,"mat-radio-button",22),t._uU(7," Synchronous (Wait until Complete) "),t.qZA()()()}if(2&p){const c=t.oxw();t.xp6(3),t.Q6J("ngModel",c.filter.Async),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}let N=(()=>{var p;class g{constructor(r,l,h){this.dialogRef=r,this.data=l,this.router=h,this.channelType=u.x,this.disabledChannelOption=!1,this.filter={ChannelID:m.g.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=!!m.g.IsNotEmpty(l.isSingleChannel)&&this.data.isSingleChannel,this.disabledChannelOption=!m.g.IsEmpty(l.disabledChannelOption)&&this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new T.O,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(r=>(r.disabled=!0,(r.TypeID==u.x.Tiktok||r.TypeID==u.x.Tokopedia||r.TypeID==u.x.Lazada||r.TypeID==u.x.WooCommerce)&&(r.disabled=!1),r)).sort(r=>r.disabled?1:-1))}onSelectChannel(r){let l=this.filterChannelById(r);this.selectedChannel=l,this.filter.Async=!0,l&&l.TypeID==u.x.Tokopedia?(this.filter.ScanFull=!0,this.isTokopedia=!0):(this.filter.ScanFull=!1,this.isTokopedia=!1),this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&m.g.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==u.x.ShopeeV2||this.selectedChannel.TypeID==u.x.Tiktok||this.selectedChannel.TypeID==u.x.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.hasScanUpdate=!(this.selectedChannel?.TypeID==u.x.WooCommerce||this.selectedChannel?.TypeID==u.x.KalCare||this.selectedChannel?.TypeID==u.x.None||!m.g.IsNotEmpty(this.selectedChannel?.LastSync)||this.isSingleChannel)}filterChannelById(r){let l;return this.channelOptions&&(l=this.channelOptions.find(h=>h.ID==r)),l}submit(){this.selectedChannel.TypeID==u.x.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(r){return m.g.IsNotEmpty(r)}onClose(){this.dialogRef.close()}}return(p=g).\u0275fac=function(r){return new(r||p)(t.Y36(f.so),t.Y36(f.WI),t.Y36(M.F0))},p.\u0275cmp=t.Xpm({type:p,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-3","fw-normal"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"disabled","ngModel","ngModelChange"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mb-3","fw-normal","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(r,l){1&r&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return l.submit()})("onClose",function(){return l.onClose()})("onCancel",function(){return l.onClose()}),t.TgZ(1,"div",1)(2,"div",2)(3,"h5",3),t._uU(4,"Select a Channel"),t.qZA(),t.TgZ(5,"mat-form-field",4)(6,"mat-select",5),t.NdJ("ngModelChange",function(P){return l.filter.ChannelID=P})("ngModelChange",function(P){return l.onSelectChannel(P)}),t.YNc(7,o,5,5,"mat-option",6),t.qZA()(),t.YNc(8,s,8,3,"div",7),t.YNc(9,d,9,7,"div",8),t.YNc(10,S,8,3,"div",8),t.qZA()()()),2&r&&(t.Q6J("dynamicValidated",l.isNotEmpty(l.filter.ChannelID))("config",l.modalConfig),t.xp6(6),t.Q6J("disabled",l.disabledChannelOption)("ngModel",l.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",l.channelOptions),t.xp6(1),t.Q6J("ngIf",!l.isSingleChannel&&!l.isTokopedia&&l.isNotEmpty(l.filter.ChannelID)),t.xp6(1),t.Q6J("ngIf",l.hasScanUpdate),t.xp6(1),t.Q6J("ngIf",!(null!=l.filter&&l.filter.UpdatedProduct)&&!l.isSingleChannel&&l.isNotEmpty(l.filter.ChannelID)))},dependencies:[I.sg,I.O5,D.JJ,D.On,C.VQ,C.U0,E.KE,U.gD,e.ey,n.gM,a.M,I.uU],encapsulation:2}),g})()},8695:(b,O,i)=>{i.d(O,{b:()=>p});var f=i(5619),m=i(8645),u=i(9773),T=i(2181),t=i(6328),M=i(7398),I=i(9360),D=i(8251),C=i(4829),E=i(2737),U=i(2420),e=i(9940),a=i(6699),o=i(9397),s=i(7081),d=i(5802),S=i(5879),N=i(9659);let p=(()=>{var g;class c{constructor(l){this.http=l,this.pagination$=new f.X(null),this.destroy$=new m.x,this.data$=this.paginationFunction()}onNextPage(l){l.PageNumber+=1,this.pagination$.next(l)}setPageNumberFooter(l){this.footerPageNumber=l.PageNumber}setPaginationButtonState(l,h){this.disableNextButton=0==h||!(h<l.RowCount*l.PageNumber)}reloadPagination(l){d.g.IsEmpty(l.PageNumber)&&(l.PageNumber=1),this.pagination$.next(l),this.hideCount=!0,this.goToLastPage=!1}getAllData(l,h){l.RowCount=h,this.pagination$.next(l),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new f.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,u.R)(this.destroy$),(0,T.h)(l=>null!=l),(0,t.b)(l=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(l)).pipe((0,M.U)(h=>h.Data))),function n(...g){const c=(0,e.jO)(g);return(0,I.e)((r,l)=>{const h=g.length,P=new Array(h);let v=g.map(()=>!1),y=!1;for(let _=0;_<h;_++)(0,C.Xf)(g[_]).subscribe((0,D.x)(l,A=>{P[_]=A,!y&&!v[_]&&(v[_]=!0,(y=v.every(E.y))&&(v=null))},U.Z));r.subscribe((0,D.x)(l,_=>{if(y){const A=[_,...P];l.next(c?c(...A):A)}}))})}(this.pagination$),(0,a.R)((l,h)=>{const[P,v]=l,[y]=h;return 1==v.PageNumber?[y,v]:[P.concat(y),v]}),(0,o.b)(([l,h])=>{this.setPageNumberFooter(h),this.setPaginationButtonState(h,l.length)}),(0,M.U)(([l])=>l),(0,s.d)())}}return(g=c).\u0275fac=function(l){return new(l||g)(S.LFG(N.O))},g.\u0275prov=S.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),c})()},5993:(b,O,i)=>{i.d(O,{M:()=>D});var f=i(9397),m=i(6306),u=i(8504),T=i(5802),t=i(5879),M=i(9659),I=i(9229);let D=(()=>{var C;class E{constructor(e,n){this.httpService=e,this.toastrService=n}loader(e=T.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:e})}LoadInPOS(e=T.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:e})}filterChannelByTypeId(e,n){return e.filter(a=>-1!==n.findIndex(o=>a.TypeID==o))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(e){return this.httpService.post("/api/product/TotalProductLive",{ID:e})}clearCacheChannel(e){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:e})}uploadSingleProduct(e,n){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:n,Products:e}).pipe((0,f.b)(o=>{this.showToastrSuccessUploadSingle(o,e[0])}),(0,m.K)(o=>(this.showToastErrorUploadSingle(o,e[0]),(0,u._)(()=>new Error(o)))))}uploadMultipleProduct(e,n){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:n,Products:e}).pipe((0,f.b)(o=>{this.showToastrUploadMultiple(o.Message)}),(0,m.K)(o=>(this.showToastrUploadMultiple(o.error?.Message),(0,u._)(()=>new Error(o)))))}uploadNotInChannel(e,n){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:e,Channel:n}).pipe((0,f.b)(o=>{this.showToastrUploadMultiple(o)}),(0,m.K)(o=>(this.showToastrUploadMultiple(o.error?.Message),(0,u._)(()=>new Error(o)))))}scanSingle(e,n){return this.httpService.post("/api/product/ScanSingle",{ID:e,SKU:n})}scanNotInChannel(e){return this.httpService.post("/api/product/ScanNotinChannel",{ID:e})}findAllSoldInChannel(e){return this.httpService.post("/api/product/GetSoldInChannel",e)}scanAll(e,n,a,o=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:e,ScanFull:n,UpdatedProduct:a,Async:o})}scanCompareToPos(e){return this.httpService.post("/api/product/CompareMarketplaceToPOS",e)}getVariantCodesProduct(e){return e.Variants.map(a=>a.Code)}downloadMultipleProduct(e){let n=e.map(a=>({ChannelItemID:a.ChannelItemID,ChannelID:a.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",n).pipe((0,f.b)(a=>{this.toastrService.success(`${a.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(e){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID}).pipe((0,f.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(e=[]){let n=[];return e.forEach(a=>{a.Variants.forEach(o=>{n=[...n,o.Code]})}),n}filterUnselectedChannel(e,n){let o,a=[];if(e.forEach(s=>{a=[...a,...s.Channel]}),a&&0!=a.length){let s=[];o=n.filter(d=>(s=a.filter(S=>S.ChannelID==d.ID),s.length!==e.length))}else o=n;return o}findChannelById(e,n){return n.find(a=>a.ID==e)}sortChannel(e=[]){return e.sort((n,a)=>n.TypeID<a.TypeID?1:n.TypeID===a.TypeID?0:-1)}hasSelection(e=[]){return this.selectedProduct(e).length>0}selectedProduct(e=[]){return e.filter(n=>n.selected)}hasSelectionVariant(e){return this.selectedVariantProduct(e).length>0}selectedVariantProduct(e){let n=[];return e.forEach(a=>{n=[...n,...null!=a.Variants?a.Variants.filter(o=>o.selected):""]}),n}getChannelProduct(e){const n=e.Variants;let a=[];for(let o of n)if(null!=o.Channel)for(let s of o.Channel)0==a.filter(d=>d.ChannelID==s.ChannelID).length&&a.push(s);return this.sortChannel(a)}successToastrScanAllProduct(e,n,a){if(a){const o=e?.NotInPOS?.Product?e?.NotInPOS?.Product:0,s=e?.InChannel?.Product?e?.InChannel?.Product:0;this.toastrService.success(`\n ${o+s} found in ${n.Name} </br>\n (${s} In POS + ${o} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${e.InChannel?e.InChannel.Product:0} product updates in ${n.Name} </br> \n since ${e.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(e,n){let a;return e.map(o=>(o.Channel=this.getChannelProduct(o),a=this.filterUnselectedChannel([o],n),o.hasScan=a.length>0,o))}checkProductHasUploadBtn(e,n){let a;return e.map(o=>(o.Channel=this.getChannelProduct(o),a=this.filterUnselectedChannel([o],n),o.hasUpload=a.length>0,o))}showToastrUploadMultiple(e=[]){let n=[],a=[];const o=this.getResponseList(e);if(e.forEach(s=>{"string"==typeof s?.Response?a=[...a,o.length>1?this.setHtmlli(s.Response):this.setHtmlli(s.Response,!1)]:(s?.Response?.Success.forEach(d=>{n=[...n,o.length>1?this.setHtmlli(`Product ${d} was <b>successfully</b> uploaded to ${s.Name}`):this.setHtmlli(`Product ${d} was <b>successfully</b> uploaded to ${s.Name}`,!1)]}),s?.Response.Fail.forEach(d=>{a=[...a,o.length>1?this.setHtmlli(d):this.setHtmlli(d,!1)]}))}),a.length>0&&n.length>0){const s=[...n,...a];this.toastrService.warning(this.concatMessage(s),"Warning!",{enableHtml:!0})}else n.length>0&&0==a.length?this.toastrService.success(this.concatMessage(n),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(a),"Error",{enableHtml:!0})}setHtmlli(e,n=!0){return n?`<li>${e}</li>`:e}getResponseList(e){let n=[];return e.forEach(a=>{"string"==typeof a?.Response?n=[...n,a.Response]:(a?.Response?.Success.forEach(o=>{n=[...n,a.Name]}),a?.Response.Fail.forEach(o=>{n=[...n,o]}))}),n}concatMessage(e=[]){let n="";return e.forEach(a=>{n+=a}),e.length>1?`<ol>${n}</ol>`:n}showToastrSuccessUploadSingle(e,n){let a=e.filter(d=>0==d.Status),o=e.filter(d=>1==d.Status),s=this.generateToastrMessage(a,o,n);this.toastrService.success(s.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(e,n){let a=e?.error?.Message.filter(d=>0==d.Status),o=e?.error?.Message.filter(d=>1==d.Status),s=this.generateToastrMessage(a,o,n);"WARNING"==s.status?this.toastrService.warning(s.message,"Warning!",{enableHtml:!0}):this.toastrService.error(s.message,`Error - ${e.status}`,{enableHtml:!0})}generateToastrMessage(e,n,a){let s,o="",d=[...e,...n];return 0==e.length&&n.length>0?(s="SUCCESS",o=this.createSuccessResponse(n,a)):e.length>0&&0==n.length?(s="ERROR",o=this.createErrResponse(e,a)):(s="WARNING",o=`${this.createSuccessResponse(n,a)} ${this.createErrResponse(e,a)}`),d.length>1&&(o=`<ol>${o}</ol>`),{status:s,message:o}}createErrResponse(e,n){let a="";return e.length>1?e.forEach((o,s)=>{a+=`<li>${o.Response}</li>`}):1==e.length&&(a+=`${e[0].Response}`),a}createSuccessResponse(e,n){let a="";return e.length>1?e.forEach((o,s)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${o.Name}</li>`}):1==e.length&&(a+=`Product ${n.Name} was <b>successfully</b> uploaded to ${e[0].Name}`),a}getHostName(){if(T.g.IsEmpty(this.hostName)){const e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}return this.hostName}}return(C=E).\u0275fac=function(e){return new(e||C)(t.LFG(M.O),t.LFG(I._W))},C.\u0275prov=t.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"}),E})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[556],{7556:(Fn,S,c)=>{c.r(S),c.d(S,{InventoryModule:()=>Nn});var h=c(6814),n=c(5879),C=c(9790),b=c(6027);let P=(()=>{var a;class l{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}return(a=l).\u0275fac=function(e){return new(e||a)},a.\u0275cmp=n.Xpm({type:a,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,i){1&e&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&e&&(n.xp6(3),n.Q6J("Tabs",i.inventoryTabs))},dependencies:[C.lC,b.e]}),l})();var I=c(2383),J=c(7797),f=c(9397),m=c(2181),u=c(5802),d=c(4910),T=c(9659),x=c(9229),Z=c(7700),M=c(8695),w=c(5993),_=c(6223),v=c(4387),A=c(6026),y=c(2596);function U(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"button",22),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(3);return n.KtG(i.openScanDialog())}),n._UZ(1,"i",23),n._uU(2," Scan Channel "),n.qZA()}}function k(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"button",24),n.NdJ("click",function(){n.CHM(t);const i=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.onUpdateItems(i))}),n._UZ(1,"i",25),n._uU(2," Update "),n.qZA()}}function Q(a,l){if(1&a&&(n.TgZ(0,"actions")(1,"div",3)(2,"div"),n.YNc(3,U,3,0,"button",20),n.YNc(4,k,3,0,"button",21),n.qZA()()()),2&a){const t=l.ngIf,e=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!e.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",e.productService.hasSelectionVariant(t))}}function L(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"app-table",26),n.NdJ("onToggle",function(i){n.CHM(t);const o=n.oxw(2);return n.KtG(o.onShowDifferenceStock(i))})("onSubmit",function(i){const r=n.CHM(t).ngIf,s=n.oxw(2);return n.KtG(s.updateStockByVariant(i,r))}),n.qZA()}if(2&a){const t=l.ngIf,e=n.oxw(2);n.Q6J("data",t)("channel",e.channelOptions)("showProductToggle",!0)("filter",e.searchFilter)}}function E(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"span",27),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(2);return n.KtG(i.getRowCount())}),n.TgZ(1,"i",28),n._uU(2,"?"),n.qZA()()}}function O(a,l){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function Y(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"a",29),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(2);return n.KtG(i.nextPage())}),n._UZ(1,"i",30),n._uU(2," Next"),n.qZA()}}function $(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"a",31),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(2);return n.KtG(i.getAllData())}),n._UZ(1,"i",32),n._uU(2," Last"),n.qZA()}}function R(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(i))}),n.YNc(1,Q,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"label",5),n._uU(8,"PageNumber"),n.qZA(),n.TgZ(9,"input",6),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.PageNumber=i)}),n.qZA()(),n.TgZ(10,"div")(11,"label",7),n._uU(12,"Page Size"),n.qZA(),n.TgZ(13,"input",8),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.RowCount=i)}),n.qZA()()()()(),n.TgZ(14,"content")(15,"div",9)(16,"div",10)(17,"div",11),n.YNc(18,L,1,4,"app-table",12),n.ALo(19,"async"),n.ynx(20),n.TgZ(21,"div",13)(22,"div",14)(23,"div",15),n._uU(24),n.ALo(25,"number"),n.ALo(26,"async"),n.YNc(27,E,3,0,"span",16),n.YNc(28,O,3,3,"span",2),n.ALo(29,"async"),n._uU(30),n.qZA()(),n.TgZ(31,"div",17),n.YNc(32,Y,3,0,"a",18),n.YNc(33,$,3,0,"a",19),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&a){const t=n.oxw();let e;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,13,t.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",t.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",t.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",n.lcZ(19,15,t.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(25,17,null==(e=n.lcZ(26,19,t.paginationService.data$))?null:e.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(29,21,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let q=(()=>{var a;class l{constructor(e,i,o,r,s){this.http=e,this.toastr=i,this.dialog=o,this.paginationService=r,this.productService=s,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,f.b)(e=>{this.channelOptions=e.Options.Channel,e.Filter={PageNumber:e.Filter.PageNumber,filterModel:d.v.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e,i){let o=this.productService.selectedVariantProduct(e);if(o.length>0){let s=o.map(p=>({ID:p.ID,Code:p.Code,Inventory:p.Inventory})),g={ListChannelID:i.filter(p=>p.selected).map(p=>p.ID),List:s};this.http.post("/api/Inventory/UpdateChannel",g).subscribe(p=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+g.List.length+" variants in "+g.ListChannelID.length+" channels","Success")})}}openScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(I.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,m.h)(o=>u.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(e,i,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=u.g.GuidEMpty})}updateStockByVariant(e,i){let o={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(r=>{let s=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+s.Name+" to "+o.NewQuantity,"Success")})}onShowDifferenceStock(e){this.searchFilter.filterModel=e?d.v.DIFFERENCE:d.v.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(e){const i=this.productService.selectedVariantProduct(e);this.dialog.open(J.j,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe((0,m.h)(o=>u.g.IsNotEmpty(o))).subscribe(o=>{this.updateStock(e,o)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}}return(a=l).\u0275fac=function(e){return new(e||a)(n.Y36(T.O),n.Y36(x._W),n.Y36(Z.uw),n.Y36(M.b),n.Y36(w.M))},a.\u0275cmp=n.Xpm({type:a,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],[1,"d-flex"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){1&e&&(n.YNc(0,R,34,23,"mainpanel",0),n.ALo(1,"async")),2&e&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[h.O5,_.Fj,_.wV,_.JJ,_.On,v.p,A.a,y.gM,h.Ov,h.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),l})();var H=c(236),V=c(2729),G=c(278);let N=(()=>{var a;class l{constructor(e){this.toastrService=e}showToastrUpdateInventory(e,i){const o=e.length>0,r=i.length>0;if(!r&&o&&this.toastrService.success(`${this.generateSuccessMessage(e.length)}`,"Success",{enableHtml:!0}),r&&o){const s=`<li>${this.generateSuccessMessage(e.length)}</li>`,g=this.generateErrorMessage(i);this.toastrService.warning(`<ol>${s} ${g}</ol>`,"Warning",{enableHtml:!0})}if(r&&!o){const s=`<ol>${this.generateErrorMessage(i)}</ol>`;this.toastrService.error(s,"Error",{enableHtml:!0})}}generateSuccessMessage(e){return`<span class="fw-bold">Successfully</span> updated ${e} variants in 1 channels`}generateErrorMessage(e=[]){let i="";return e.forEach((o,r)=>{i+=`<li><span class="fw-bold">Error</span> Updating stock for [${o.Name}] - <b>${o.Message}</b></li>`}),i}}return(a=l).\u0275fac=function(e){return new(e||a)(n.LFG(x._W))},a.\u0275prov=n.Yz7({token:a,factory:a.\u0275fac}),l})();var F=c(2599);function K(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"button",36),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(2).ngIf,o=n.oxw();return n.KtG(o.openScanDialog(i))}),n._UZ(1,"i",37),n._uU(2," Scan Channel "),n.qZA()}}function B(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"button",38),n.NdJ("click",function(){n.CHM(t);const i=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.updateStock(i))}),n._UZ(1,"i",39),n._uU(2," Update"),n.qZA()}}function j(a,l){if(1&a&&(n.TgZ(0,"div"),n.YNc(1,K,3,0,"button",34),n.YNc(2,B,3,0,"button",35),n.qZA()),2&a){const t=l.ngIf,e=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!e.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",e.productService.hasSelectionVariant(t))}}function z(a,l){1&a&&(n.TgZ(0,"div",40)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function W(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"th")(1,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw(2);return n.KtG(o.checkboxState=i)})("ngModelChange",function(){const o=n.CHM(t).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(o))}),n.qZA()()}if(2&a){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function X(a,l){1&a&&(n.ynx(0),n.TgZ(1,"th",42),n._uU(2," Reserved "),n.qZA(),n.BQk())}function nn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"input",66),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw(3).$implicit;return n.KtG(o.selected=i)})("ngModelChange",function(){n.CHM(t);const i=n.oxw(3).$implicit,o=n.oxw(2);return n.KtG(o.onCheckboxStateProduct(i))}),n.qZA()}if(2&a){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function tn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"img",67),n.NdJ("click",function(i){n.CHM(t);const o=n.oxw(3).$implicit,r=n.oxw(2);return n.KtG(r.onZoomImage(i,null==o?null:o.ImageUrl))}),n.qZA()}if(2&a){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function en(a,l){1&a&&n._UZ(0,"img",68)}function an(a,l){if(1&a&&(n.ynx(0),n.TgZ(1,"td",57)(2,"div",58),n.YNc(3,nn,1,1,"input",59),n.YNc(4,tn,1,1,"img",60),n.YNc(5,en,1,0,"ng-template",null,61,n.W1O),n.qZA()(),n.TgZ(7,"td",62)(8,"span",63),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"div",64),n._UZ(12,"i",65),n.TgZ(13,"small"),n._uU(14),n.qZA()()(),n.BQk()),2&a){const t=n.MAs(6),e=n.oxw().$implicit,i=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==i?null:i.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==e?null:e.Inventory)>=0||i.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==i?null:i.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==i?null:i.Variants.length),n.xp6(2),n.Oqu(null==i?null:i.Name),n.xp6(5),n.hij("(",null==i?null:i.Category,")")}}function on(a,l){if(1&a){const t=n.EpF();n.ynx(0),n.TgZ(1,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw(2).$implicit;return n.KtG(o.selected=i)}),n.qZA(),n.BQk()}if(2&a){const t=n.oxw(2).$implicit;n.xp6(1),n.Q6J("ngModel",t.selected)}}function ln(a,l){if(1&a&&(n.ynx(0),n.YNc(1,on,2,1,"ng-container",3),n.BQk()),2&a){const t=n.oxw().$implicit;n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)<=1e5)}}function rn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw(2).$implicit;return n.KtG(o.selected=i)}),n.qZA()}if(2&a){const t=n.oxw(2).$implicit;n.Q6J("ngModel",t.selected)}}function sn(a,l){if(1&a&&n.YNc(0,rn,1,1,"input",69),2&a){const t=n.oxw().$implicit;n.Q6J("ngIf",(null==t?null:t.Inventory)>=0)}}function cn(a,l){if(1&a&&(n.TgZ(0,"span")(1,"span",70),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",71),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&a){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function pn(a,l){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}const hn=function(a){return{"bg-gradient-warning":a}};function un(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"td",72)(1,"span",73),n.NdJ("click",function(){n.CHM(t);const i=n.oxw().$implicit,o=n.oxw(),r=o.$implicit,s=o.ngForOf,g=n.oxw(2);return n.KtG(g.openTableDialog(r,i,s))}),n._uU(2),n.ALo(3,"number"),n.qZA()()}if(2&a){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,hn,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function _n(a,l){if(1&a&&(n.ynx(0),n.TgZ(1,"span",75),n._uU(2),n.ALo(3,"number"),n.qZA(),n.BQk()),2&a){const t=n.oxw(2).$implicit;n.xp6(2),n.hij(" (",n.lcZ(3,1,null==t||null==t.Channel[0]?null:t.Channel[0].InventoryReserved),") ")}}function gn(a,l){1&a&&n._uU(0," - ")}function mn(a,l){if(1&a&&(n.ynx(0),n.TgZ(1,"td",44),n.YNc(2,_n,4,3,"ng-container",50),n.YNc(3,gn,1,0,"ng-template",null,74,n.W1O),n.qZA(),n.BQk()),2&a){const t=n.MAs(4),e=n.oxw().$implicit;n.xp6(2),n.Q6J("ngIf",null==e||null==e.Channel[0]?null:e.Channel[0].InventoryReserved)("ngIfElse",t)}}function dn(a,l){1&a&&(n.ynx(0),n._uU(1," - "),n.BQk())}function Cn(a,l){if(1&a&&(n.TgZ(0,"span",76),n.ALo(1,"date"),n._uU(2),n.ALo(3,"date"),n.qZA()),2&a){const t=n.oxw().$implicit;n.Q6J("matTooltip",n.xi3(1,2,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),n.xp6(2),n.hij(" ",n.xi3(3,5,null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function fn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,an,15,7,"ng-container",3),n.TgZ(2,"td",43),n._uU(3),n.qZA(),n.TgZ(4,"td",44)(5,"div",45)(6,"span"),n._uU(7),n.qZA(),n.TgZ(8,"span",46)(9,"a",47),n._UZ(10,"i",48),n.qZA()()()(),n.TgZ(11,"td",49),n.YNc(12,ln,2,1,"ng-container",50),n.YNc(13,sn,1,1,"ng-template",null,51,n.W1O),n.qZA(),n.TgZ(15,"td",44),n.YNc(16,cn,8,6,"span",3),n.YNc(17,pn,3,3,"span",3),n.qZA(),n.YNc(18,un,4,6,"td",52),n.YNc(19,mn,5,2,"ng-container",3),n.TgZ(20,"td",26),n.YNc(21,dn,2,0,"ng-container",50),n.YNc(22,Cn,4,8,"ng-template",null,53,n.W1O),n.qZA(),n.TgZ(24,"td")(25,"div",12)(26,"div",54)(27,"a",47),n._UZ(28,"i",48),n.qZA(),n._uU(29," \xa0\xa0 "),n.TgZ(30,"span",55),n.NdJ("click",function(){const o=n.CHM(t).$implicit,r=n.oxw(3);return n.KtG(r.refreshInventory(null==o||null==o.Channel[0]?null:o.Channel[0].ChannelItemID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelVariationID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelID,null==o?null:o.ID))}),n._UZ(31,"i",56),n.qZA()()()()()}if(2&a){const t=l.$implicit,e=l.index,i=n.MAs(14),o=n.MAs(23),r=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==e),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(4),n.Oqu(null==t?null:t.Code),n.xp6(2),n.Q6J("href","https://"+r.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",1==(null==t?null:t.Channel[0].TypeID))("ngIfElse",i),n.xp6(4),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(1),n.Q6J("ngIf",r.isShowReservedColumn),n.xp6(2),n.Q6J("ngIf",(null==t||null==t.Channel[0]?null:t.Channel[0].LastInventorySync)==r.minDate)("ngIfElse",o),n.xp6(6),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function xn(a,l){if(1&a&&(n.TgZ(0,"tbody"),n.YNc(1,fn,32,13,"tr",28),n.qZA()),2&a){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function vn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"span",77),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(2);return n.KtG(i.getRowCount())}),n.TgZ(1,"i",78),n._uU(2,"?"),n.qZA()()}}function yn(a,l){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function Sn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"a",82),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(3);return n.KtG(i.onNextPage())}),n._UZ(1,"i",83),n._uU(2," Next"),n.qZA()}}function bn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"a",84),n.NdJ("click",function(){n.CHM(t);const i=n.oxw(3);return n.KtG(i.onLastPage())}),n._UZ(1,"i",85),n._uU(2," Last"),n.qZA()}}function In(a,l){if(1&a&&(n.TgZ(0,"div",79),n.YNc(1,Sn,3,0,"a",80),n.YNc(2,bn,3,0,"a",81),n.qZA()),2&a){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Tn(a,l){if(1&a){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(i))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,j,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.PageNumber=i)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.RowCount=i)}),n.qZA()(),n.TgZ(16,"div")(17,"h6"),n._uU(18,"Quantity From - To"),n.qZA(),n.TgZ(19,"input",9),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.QuantityFrom=i)}),n.qZA(),n._uU(20," - "),n.TgZ(21,"input",10),n.NdJ("ngModelChange",function(i){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.QuantityTo=i)}),n.qZA()()()()(),n.TgZ(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),n.YNc(26,z,3,0,"div",14),n.TgZ(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),n._uU(31,"Product "),n._UZ(32,"br"),n.TgZ(33,"mat-slide-toggle",18),n.NdJ("toggleChange",function(){n.CHM(t);const i=n.oxw();return i.showDifferenceStock=!i.showDifferenceStock,n.KtG(i.onShowDifferenceStock())}),n.TgZ(34,"small",19),n._uU(35,"FILTER DIFFERENT INVENTORY"),n.qZA()()(),n.TgZ(36,"th",20),n._uU(37,"Variant"),n.qZA(),n.TgZ(38,"th",21),n._uU(39,"SKU"),n.qZA(),n.YNc(40,W,2,1,"th",3),n.ALo(41,"async"),n.TgZ(42,"th",22),n._uU(43,"POS"),n.qZA(),n.TgZ(44,"th",23)(45,"div",24),n.NdJ("click",function(){n.CHM(t);const i=n.oxw();return n.KtG(i.onChangeChannel())}),n._UZ(46,"img",25),n._uU(47),n.qZA()(),n.YNc(48,X,3,0,"ng-container",3),n.TgZ(49,"th",26),n._uU(50,"Last Sync"),n.qZA(),n._UZ(51,"th",27),n.qZA()(),n.YNc(52,xn,2,1,"tbody",28),n.ALo(53,"async"),n.qZA(),n.TgZ(54,"div",29)(55,"div",30)(56,"div",31),n._uU(57),n.ALo(58,"number"),n.ALo(59,"async"),n.YNc(60,vn,3,0,"span",32),n.YNc(61,yn,3,3,"span",3),n.ALo(62,"async"),n._uU(63),n.qZA()(),n.YNc(64,In,3,2,"div",33),n.ALo(65,"async"),n.qZA()()()()()()}if(2&a){const t=n.oxw();let e,i;n.Q6J("headerTitle","Inventory Comparison")("pageData",t.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,20,t.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",t.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",t.searchFilter.RowCount),n.xp6(4),n.Q6J("ngModel",t.searchFilter.QuantityFrom),n.xp6(2),n.Q6J("ngModel",t.searchFilter.QuantityTo),n.xp6(5),n.Q6J("ngIf",3==(null==t.searchFilter?null:t.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(41,22,t.paginationService.data$)),n.xp6(5),n.Q6J("matTooltip","Change "+(null==t.selectedChannel?null:t.selectedChannel.Name)),n.xp6(1),n.Q6J("src",t.selectedChannel.logo,n.LSH),n.xp6(1),n.hij(" ",null!=t.selectedChannel&&t.selectedChannel.Name?null==t.selectedChannel?null:t.selectedChannel.Name:"Choose Channel ..."," "),n.xp6(1),n.Q6J("ngIf",t.isShowReservedColumn),n.xp6(4),n.Q6J("ngForOf",n.lcZ(53,24,t.products$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(58,26,null==(e=n.lcZ(59,28,t.paginationService.data$))?null:e.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(62,30,!t.paginationService.hideCount&&t.rowCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(i=n.lcZ(65,32,t.paginationService.data$))?null:i.length)>0)}}let Zn=(()=>{var a;class l{constructor(e,i,o,r,s,g,p){this.http=e,this.toastr=i,this.dialog=o,this.paginationService=r,this.productService=s,this.biggerPictureService=g,this.inventoryService=p,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=u.g.MinDate,this.isShowReservedColumn=!0,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=s.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe((0,f.b)(e=>{this.checkShowReservedColumn(e)}))}checkShowReservedColumn(e){let o,i=0;e.forEach(r=>{o=r.Variants.find(s=>u.g.IsNotEmpty(s?.Channel[0]?.InventoryReserved)),o&&(i+=1)}),this.isShowReservedColumn=i>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,f.b)(e=>{this.channelOptions=e.Options.Channel,this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),e.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=u.g.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(V.b,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe((0,m.h)(e=>u.g.IsNotEmpty(e))).subscribe(e=>{this.selectedChannel=e,this.onFilterChannel(e.ID)})}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}onFilterChannel(e){this.searchFilter.ChannelID=e,this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e){const i=this.productService.selectedVariantProduct(e);if(i.length>0){let o=i.map(s=>({ID:s.ID,Code:s.Code,Inventory:s.Inventory}));this.http.post("/api/Inventory/UpdateChannel",{ListChannelID:[this.searchFilter.ChannelID],List:o}).subscribe(s=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(s)})}}handlingUpdateStock(e){e[0]?.StatusProduct?this.inventoryService.showToastrUpdateInventory(e[0].StatusProduct.Success_list,e[0].StatusProduct.Fail_list):this.toastr.error(e[0]?.Exception,"Error")}openScanDialog(e){const i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=u.g.GuidEMpty,this.dialog.open(I.j,{data:{filter:i,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe((0,m.h)(r=>u.g.IsNotEmpty(r))).subscribe(r=>{this.searchFilter.ChannelID=r.ChannelID,this.searchFilter.ScanFull=r.ScanFull,this.searchFilter.UpdatedProduct=r.UpdatedProduct,this.searchFilter.Async=r.Async,this.scannALl(e)})}scannALl(e){const i=this.productService.findChannelById(this.searchFilter.ChannelID,e.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+i?.Name,"Success"))})}refreshInventory(e,i,o,r){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:e,ChannelVariationID:i,ChannelID:o,VariantID:r}).subscribe(g=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(i=>(i.Inventory>=0&&(i.selected=e.selected),i))}onCheckboxStateChange(e){e=e.map(i=>(i.Variants=i.Variants.map(o=>(o.selected=this.checkboxState,o)),i))}openTableDialog(e,i,o){this.dialog.open(H.k,{data:{Name:e.Name,Variant:i,ChannelID:i?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe((0,m.h)(s=>u.g.IsNotEmpty(s))).subscribe(s=>{this.updateItemAfterDialog(s,o)})}updateItemAfterDialog(e,i){let o={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};const r=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(s=>{this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+r?.Name+" to "+o.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?d.v.DIFFERENCE:d.v.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const e={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,e)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:i=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,i.Total)}})}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.paginationService.destroy()}}return(a=l).\u0275fac=function(e){return new(e||a)(n.Y36(T.O),n.Y36(x._W),n.Y36(Z.uw),n.Y36(M.b),n.Y36(w.M),n.Y36(G.k),n.Y36(N))},a.\u0275cmp=n.Xpm({type:a,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityFrom",1,"w-25","me-2",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2",3,"ngModel","ngModelChange"],[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"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","100px"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],["class","text-end",3,"ngClass",4,"ngIf"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["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"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){1&e&&(n.YNc(0,Tn,66,34,"mainpanel",0),n.ALo(1,"async")),2&e&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[h.mk,h.sg,h.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,F.Rr,v.p,y.gM,h.Ov,h.JJ,h.uU],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}"]}),l})();var D=c(4575);const Mn=[{path:"",component:P,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:q,canActivate:[D.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:Zn,canActivate:[D.a],data:{title:"Inventory Comparison"}}]}];let wn=(()=>{var a;class l{}return(a=l).\u0275fac=function(e){return new(e||a)},a.\u0275mod=n.oAB({type:a}),a.\u0275inj=n.cJS({imports:[h.ez,C.Bz.forChild(Mn)]}),l})();var An=c(4807);let Nn=(()=>{var a;class l{}return(a=l).\u0275fac=function(e){return new(e||a)},a.\u0275mod=n.oAB({type:a}),a.\u0275inj=n.cJS({providers:[N],imports:[h.ez,wn,C.Bz,b.Z,_.u5,An.A0,F.rP,v.R,A.a,y.AV]}),l})()}}]);