marketplacepos 2.7.3 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/Marketplace/174.df8669b6311f928d.js +1 -0
  2. package/Marketplace/25.b70d86f301c02577.js +1 -0
  3. package/Marketplace/360.d6aa15ddc2dfdd69.js +1 -0
  4. package/Marketplace/369.ca96e7763e20bf72.js +1 -0
  5. package/Marketplace/392.f4537160149f627a.js +1 -0
  6. package/Marketplace/397.defbf293e15c7185.js +1 -0
  7. package/Marketplace/3rdpartylicenses.txt +0 -50
  8. package/Marketplace/512.2796526d3f4c83f5.js +1 -0
  9. package/Marketplace/516.23780ce40d15b408.js +1 -0
  10. package/Marketplace/587.2e5583c1fa20a173.js +1 -0
  11. package/Marketplace/61.868e35095821a091.js +1 -0
  12. package/Marketplace/616.b7e1ec6933570169.js +1 -0
  13. package/Marketplace/628.145c54d491d3a429.js +1 -0
  14. package/Marketplace/643.3295801f0b4936a8.js +1 -0
  15. package/Marketplace/717.26634e93ca9b60ed.js +1 -0
  16. package/Marketplace/72.b0c5b137e38d6dbc.js +1 -0
  17. package/Marketplace/833.b0b60f1bcc7f56c1.js +1 -0
  18. package/Marketplace/859.b43bda3adda95fa3.js +1 -0
  19. package/Marketplace/863.490933ee2cce9279.js +1 -0
  20. package/Marketplace/874.8531eff61a70fef4.js +1 -0
  21. package/Marketplace/913.08c7bf72f6b8e4f8.js +1 -0
  22. package/Marketplace/997.6b3f954f35ff3ac0.js +1 -0
  23. package/Marketplace/index.html +2 -2
  24. package/Marketplace/main.26e031734fa543d6.js +1 -0
  25. package/Marketplace/runtime.1fd3a054bc12a0de.js +1 -0
  26. package/Marketplace/{styles.ca007450064f7ae0.css → styles.bd36b2077413d718.css} +1 -1
  27. package/package.json +1 -1
  28. package/Marketplace/174.ef0e2b8b4c9d2b0b.js +0 -1
  29. package/Marketplace/25.43ab1ee524b9049a.js +0 -1
  30. package/Marketplace/291.779ede87479fb9b2.js +0 -1
  31. package/Marketplace/360.45dba871a275bde4.js +0 -1
  32. package/Marketplace/369.fe9dd78b5ae1f834.js +0 -1
  33. package/Marketplace/397.5668d07ae2910130.js +0 -1
  34. package/Marketplace/512.8bb0df7db698606b.js +0 -1
  35. package/Marketplace/516.6cbc60a45960d8fd.js +0 -1
  36. package/Marketplace/587.b913510ac1ecfe12.js +0 -1
  37. package/Marketplace/61.b5326b8a8507ca2b.js +0 -1
  38. package/Marketplace/616.ce2eff13bf85dd2a.js +0 -1
  39. package/Marketplace/628.161d18d5f92f87c9.js +0 -1
  40. package/Marketplace/643.cee753340fd82dfa.js +0 -1
  41. package/Marketplace/717.b70435564cbfa38c.js +0 -1
  42. package/Marketplace/72.23a9b1a59cf7bfca.js +0 -1
  43. package/Marketplace/796.f712080a257b33c0.js +0 -1
  44. package/Marketplace/863.73daa64a1cf098b8.js +0 -1
  45. package/Marketplace/874.23cc68e9ff331b03.js +0 -1
  46. package/Marketplace/913.c2ffbc12dd99b85d.js +0 -1
  47. package/Marketplace/997.c2b107d851cf971c.js +0 -1
  48. package/Marketplace/main.f4b54c0122a625bf.js +0 -1
  49. package/Marketplace/runtime.aa1e68d995bcf102.js +0 -1
@@ -288,31 +288,6 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
288
288
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
289
289
 
290
290
 
291
- ng-mat-select-infinite-scroll
292
- MIT
293
- MIT License
294
-
295
- Copyright (c) 2021 Haidar Zeineddine
296
-
297
- Permission is hereby granted, free of charge, to any person obtaining a copy
298
- of this software and associated documentation files (the "Software"), to deal
299
- in the Software without restriction, including without limitation the rights
300
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
301
- copies of the Software, and to permit persons to whom the Software is
302
- furnished to do so, subject to the following conditions:
303
-
304
- The above copyright notice and this permission notice shall be included in all
305
- copies or substantial portions of the Software.
306
-
307
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
308
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
309
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
310
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
311
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
312
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
313
- SOFTWARE.
314
-
315
-
316
291
  ngx-indexed-db
317
292
  ISC
318
293
  The MIT License (MIT)
@@ -335,31 +310,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
335
310
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
336
311
  THE SOFTWARE.
337
312
 
338
- ngx-mat-select-search
339
- MIT
340
- MIT License
341
-
342
- Copyright (c) 2018 Bithost GmbH
343
-
344
- Permission is hereby granted, free of charge, to any person obtaining a copy
345
- of this software and associated documentation files (the "Software"), to deal
346
- in the Software without restriction, including without limitation the rights
347
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
348
- copies of the Software, and to permit persons to whom the Software is
349
- furnished to do so, subject to the following conditions:
350
-
351
- The above copyright notice and this permission notice shall be included in all
352
- copies or substantial portions of the Software.
353
-
354
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
355
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
356
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
357
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
358
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
359
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
360
- SOFTWARE.
361
-
362
-
363
313
  ngx-toastr
364
314
  MIT
365
315
  The MIT License (MIT)
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[512],{5512:(v,p,o)=>{o.r(p),o.d(p,{LogisticModule:()=>a});var d=o(6895),m=o(284),f=o(3154),t=o(4650),C=o(1318),L=o(7185),c=o(4006),u=o(7481),h=o(8796);function T(i,e){if(1&i&&(t.TgZ(0,"span",14),t._UZ(1,"img",15),t.qZA(),t._uU(2)),2&i){const n=e.item,s=t.oxw();t.xp6(1),t.Q6J("src",s.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function Z(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td")(8,"input",16),t.NdJ("ngModelChange",function(g){const b=t.CHM(n).$implicit;return t.KtG(b.ProductSKU=g)}),t.qZA()()()}if(2&i){const n=e.$implicit;t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Oqu(n.Service),t.xp6(2),t.Oqu(n.Type),t.xp6(2),t.Q6J("ngModel",n.ProductSKU)}}class r{constructor(e,n){this.http=e,this.toastr=n,this.filter={ChannelID:""},this.pageData={Title:"Logistic",Nav:[]},this.LoaderChannel()}ngOnInit(){}Validate(){for(let e of this.list)void 0===this.dataold.find(s=>s.ProductSKU==e.ProductSKU&&s.Name==e.Name)&&(e.IsChange=!0);return Promise.resolve(this.list)}Submit(){this.Validate().then(e=>{this.http.post("/api/Logistic/Submit",this.list).subscribe(n=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.Get()})})}LoaderChannel(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.Channel=e.Options.Channel,this.filter=e.Filter,this.Name=this.Channel[0].Name,this.Get()})}Get(){this.dataold=[],this.http.post("/api/Logistic/Get",this.filter).subscribe(e=>{let n=this.Channel.find(s=>s.ID==this.filter.ChannelID);null!=n&&(this.Name=n.Name),this.list=e,this.dataold=JSON.parse(JSON.stringify(this.list))})}getChannelLogo(e){return f.g.getChannelLogoByTypeId(e)}}r.\u0275fac=function(e){return new(e||r)(t.Y36(C.O),t.Y36(L._W))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-logistic"]],decls:29,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","hideSearchDropdown","onSubmit"],["container",""],[1,"mb-3","fw-normal"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["type","text","placeholder","SKU",1,"form-control","w-50",3,"ngModel","ngModelChange"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return n.Get()}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h5",2),t._uU(5,"Select a Channel"),t.qZA(),t.TgZ(6,"ng-select",3),t.NdJ("ngModelChange",function(g){return n.filter.ChannelID=g}),t.YNc(7,T,3,2,"ng-template",4),t.qZA()()()(),t.TgZ(8,"actions")(9,"a",5),t.NdJ("click",function(){return n.Submit()}),t._uU(10,"Submit"),t.qZA()(),t.TgZ(11,"content")(12,"div",6)(13,"div",7)(14,"div",8)(15,"div",9)(16,"table",10)(17,"thead",11)(18,"tr",12)(19,"th"),t._uU(20,"Logistic"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Service"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Type"),t.qZA(),t.TgZ(25,"th"),t._uU(26,"SKU"),t.qZA()()(),t.TgZ(27,"tbody"),t.YNc(28,Z,9,4,"tr",13),t.qZA()()()()()()()()),2&e&&(t.Q6J("headerTitle","Logistic Courier - "+n.Name)("hideSearchDropdown",!1),t.xp6(6),t.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),t.xp6(22),t.Q6J("ngForOf",n.list))},dependencies:[d.sg,c.Fj,c.JJ,c.On,u.p,h.w9,h.ir]});const S=[{path:"",component:r}];class l{}l.\u0275fac=function(e){return new(e||l)},l.\u0275mod=t.oAB({type:l}),l.\u0275inj=t.cJS({imports:[d.ez,m.Bz.forChild(S)]});class a{}a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[d.ez,m.Bz,l,c.u5,u.R,h.A0]})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[516],{8231:(P,D,r)=>{r.d(D,{j:()=>S});var f=r(5412),u=r(3154),c=r(9694),I=r(6779),e=r(4650),g=r(284),_=r(6895),t=r(4006),n=r(1948),a=r(9549),l=r(4385),i=r(3238),d=r(266),C=r(6401);function v(h,s){if(1&h&&(e.TgZ(0,"mat-option",9)(1,"div",10),e._UZ(2,"img",11),e.TgZ(3,"span"),e._uU(4),e.qZA()()()),2&h){const o=s.$implicit;e.Q6J("value",o.ID)("disabled",o.disabled),e.xp6(1),e.Q6J("matTooltip",o.disabled?"Single Product Scan disabled for this type of Channel":null),e.xp6(1),e.Q6J("src",o.Img,e.LSH),e.xp6(2),e.Oqu(o.Name)}}function M(h,s){if(1&h){const o=e.EpF();e.TgZ(0,"div")(1,"h5",12),e._uU(2,"Scan Type"),e.qZA(),e.TgZ(3,"mat-radio-group",13),e.NdJ("ngModelChange",function(m){e.CHM(o);const T=e.oxw();return e.KtG(T.filter.ScanFull=m)}),e.TgZ(4,"mat-radio-button",14),e._uU(5," Full (Include Inactive Products) "),e.qZA(),e.TgZ(6,"mat-radio-button",15),e._uU(7," Active "),e.qZA()()()}if(2&h){const o=e.oxw();e.xp6(3),e.Q6J("ngModel",o.filter.ScanFull),e.xp6(1),e.Q6J("value",!0),e.xp6(2),e.Q6J("value",!1)}}function E(h,s){if(1&h){const o=e.EpF();e.TgZ(0,"div",16)(1,"h5",3),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"mat-radio-group",17),e.NdJ("ngModelChange",function(m){e.CHM(o);const T=e.oxw();return e.KtG(T.filter.UpdatedProduct=m)}),e.TgZ(5,"mat-radio-button",18),e._uU(6," Scan All Products "),e.qZA(),e.TgZ(7,"mat-radio-button",19),e._uU(8," Scan Updated Products "),e.qZA()()()}if(2&h){const o=e.oxw();e.xp6(2),e.hij(" Last Scan: ",e.xi3(3,4,o.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),e.xp6(2),e.Q6J("ngModel",o.filter.UpdatedProduct),e.xp6(1),e.Q6J("value",!1),e.xp6(2),e.Q6J("value",!0)}}function O(h,s){if(1&h){const o=e.EpF();e.TgZ(0,"div",16)(1,"h5",3),e._uU(2," Scan Option "),e.qZA(),e.TgZ(3,"mat-radio-group",20),e.NdJ("ngModelChange",function(m){e.CHM(o);const T=e.oxw();return e.KtG(T.filter.Async=m)}),e.TgZ(4,"mat-radio-button",21),e._uU(5," Asynchronous (Get Notified when Complete) "),e.qZA(),e.TgZ(6,"mat-radio-button",22),e._uU(7," Synchronous (Wait until Complete) "),e.qZA()()()}if(2&h){const o=e.oxw();e.xp6(3),e.Q6J("ngModel",o.filter.Async),e.xp6(1),e.Q6J("value",!0),e.xp6(2),e.Q6J("value",!1)}}class S{constructor(s,o,p){this.dialogRef=s,this.data=o,this.router=p,this.channelType=c.x,this.disabledChannelOption=!1,this.filter={ChannelID:u.g.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=!!u.g.IsNotEmpty(o.isSingleChannel)&&this.data.isSingleChannel,this.disabledChannelOption=!u.g.IsEmpty(o.disabledChannelOption)&&this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new I.O,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1,1==this.channelOptions.length&&(this.filter.ChannelID=this.data.channelOptions[0].ID,this.selectedChannel=this.data.channelOptions[0])}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(s=>(s.disabled=!0,(s.TypeID==c.x.Tiktok||s.TypeID==c.x.Tokopedia||s.TypeID==c.x.Lazada)&&(s.disabled=!1),s)).sort(s=>s.disabled?1:-1))}onSelectChannel(s){let o=this.filterChannelById(s);this.selectedChannel=1==this.channelOptions.length?this.channelOptions[0]:o,this.filter.Async=!0,o&&o.TypeID==c.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&&u.g.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==c.x.ShopeeV2||this.selectedChannel.TypeID==c.x.Tiktok||this.selectedChannel.TypeID==c.x.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.hasScanUpdate=!(this.selectedChannel?.TypeID==c.x.WooCommerce||this.selectedChannel?.TypeID==c.x.KalCare||this.selectedChannel?.TypeID==c.x.None||!u.g.IsNotEmpty(this.selectedChannel?.LastSync)||this.isSingleChannel)}filterChannelById(s){let o;return this.channelOptions&&(o=this.channelOptions.find(p=>p.ID==s)),o}submit(){this.selectedChannel.TypeID==c.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(s){return u.g.IsNotEmpty(s)}onClose(){this.dialogRef.close()}}S.\u0275fac=function(s){return new(s||S)(e.Y36(f.so),e.Y36(f.WI),e.Y36(g.F0))},S.\u0275cmp=e.Xpm({type:S,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content","",2,"min-height","90px"],[1,"mx-4"],[1,"mb-3","fw-normal"],["appearance","outline",1,"mat-formfield-channel"],["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(s,o){1&s&&(e.TgZ(0,"modal-material",0),e.NdJ("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),e.TgZ(1,"div",1)(2,"div",2)(3,"h5",3),e._uU(4,"Select a Channel"),e.qZA(),e.TgZ(5,"mat-form-field",4)(6,"mat-select",5),e.NdJ("ngModelChange",function(m){return o.filter.ChannelID=m})("ngModelChange",function(m){return o.onSelectChannel(m)}),e.YNc(7,v,5,5,"mat-option",6),e.qZA()(),e.YNc(8,M,8,3,"div",7),e.YNc(9,E,9,7,"div",8),e.YNc(10,O,8,3,"div",8),e.qZA()()()),2&s&&(e.Q6J("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),e.xp6(6),e.Q6J("disabled",o.disabledChannelOption)("ngModel",o.filter.ChannelID),e.xp6(1),e.Q6J("ngForOf",o.channelOptions),e.xp6(1),e.Q6J("ngIf",!o.isSingleChannel&&!o.isTokopedia&&o.isNotEmpty(o.filter.ChannelID)),e.xp6(1),e.Q6J("ngIf",o.hasScanUpdate),e.xp6(1),e.Q6J("ngIf",!(null!=o.filter&&o.filter.UpdatedProduct)&&!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[_.sg,_.O5,t.JJ,t.On,n.VQ,n.U0,a.KE,l.gD,i.ey,d.gM,C.M,_.uU],styles:["mat-form-field.mat-formfield-channel{width:100%;height:60px}.mat-dialog-title{margin-bottom:0%;margin-left:24px}.vertical-radio{display:flex;flex-direction:column;margin:15px 0}mat-form-field.mat-formfield-channel .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:13px;padding-bottom:16px}mat-form-field.mat-formfield-channel .mat-mdc-text-field-wrapper{height:50px}mat-select.mat-select-channel{font-size:14px!important}mat-option.channel-option{font-size:14px!important}\n"],encapsulation:2})},6082:(P,D,r)=>{r.d(D,{M:()=>g});var f=r(8505),u=r(3154),c=r(4650),I=r(1318),e=r(7185);class g{constructor(t,n){this.httpService=t,this.toastrService=n}loader(t=u.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:t})}filterChannelByTypeId(t,n){return t.filter(a=>-1!==n.findIndex(l=>a.TypeID==l))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(t){return this.httpService.post("/api/product/TotalProductLive",{ID:t})}clearCacheChannel(t){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:t})}uploadSingleProduct(t,n){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:n,Products:t})}uploadMultipleProduct(t,n){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:n,Products:t})}scanSingle(t,n){return this.httpService.post("/api/product/ScanSingle",{ID:t,SKU:n})}scanNotInChannel(t){return this.httpService.post("/api/product/ScanNotinChannel",{ID:t})}findAllSoldInChannel(t){return this.httpService.post("/api/product/GetSoldInChannel",t)}scanAll(t,n,a,l=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:t,ScanFull:n,UpdatedProduct:a,Async:l})}scanCompareToPos(t){return this.httpService.post("/api/product/CompareMarketplaceToPOS",t)}getVariantCodesProduct(t){return t.Variants.map(a=>a.Code)}downloadMultipleProduct(t){let n=t.map(a=>({ChannelItemID:a.ChannelItemID,ChannelID:a.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",n).pipe((0,f.b)(a=>{this.toastrService.success(`${a.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(t){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:t.ChannelItemID,ChannelID:t.ChannelID}).pipe((0,f.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(t=[]){let n=[];return t.forEach(a=>{a.Variants.forEach(l=>{n=[...n,l.Code]})}),n}filterUnselectedChannel(t,n){let l,a=[];if(t.forEach(i=>{a=[...a,...i.Channel]}),a&&0!=a.length){let i=[];l=n.filter(d=>(i=a.filter(C=>C.ChannelID==d.ID),i.length!==t.length))}else l=n;return l}findChannelById(t,n){return n.find(a=>a.ID==t)}sortChannel(t=[]){return t.sort((n,a)=>n.TypeID<a.TypeID?1:n.TypeID===a.TypeID?0:-1)}hasSelection(t=[]){return this.selectedProduct(t).length>0}selectedProduct(t=[]){return t.filter(n=>n.selected)}hasSelectionVariant(t){return this.selectedVariantProduct(t).length>0}selectedVariantProduct(t){let n=[];return t.forEach(a=>{n=[...n,...null!=a.Variants?a.Variants.filter(l=>l.selected):""]}),n}getChannelProduct(t){const n=t.Variants;let a=[];for(let l of n)if(null!=l.Channel)for(let i of l.Channel)0==a.filter(d=>d.ChannelID==i.ChannelID).length&&a.push(i);return this.sortChannel(a)}successToastrScanAllProduct(t,n,a){if(a){const l=t?.NotInPOS?.Product?t?.NotInPOS?.Product:0,i=t?.InChannel?.Product?t?.InChannel?.Product:0;this.toastrService.success(`\n ${l+i} found in ${n.Name} </br>\n (${i} In POS + ${l} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${t.InChannel?t.InChannel.Product:0} product updates in ${n.Name} </br> \n since ${t.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(t,n){let a;return t.map(l=>(l.Channel=this.getChannelProduct(l),a=this.filterUnselectedChannel([l],n),l.hasScan=a.length>0,l))}checkProductHasUploadBtn(t,n){let a;return t.map(l=>(l.Channel=this.getChannelProduct(l),a=this.filterUnselectedChannel([l],n),l.hasUpload=a.length>0,l))}showToastrUploadMultiple(t=[]){let n=[],a=[];if(t.forEach(l=>{"string"==typeof l?.Response?a=[...a,`<li>${l.Response}</li>`]:(l?.Response?.Success.forEach(i=>{n=[...n,`<li>Product ${i} was <b>successfully</b> uploaded to ${l.Name}</li>`]}),l?.Response.Fail.forEach(i=>{a=[...a,`<li>${i}</li>`]}))}),a.length>0&&n.length>0){const l=[...n,...a];this.toastrService.warning(this.concatMessage(l),"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})}concatMessage(t=[]){let n="";return t.forEach(a=>{n+=a}),`<ol>${n}</ol>`}showToastrSuccessUploadSingle(t,n){let a=t.filter(d=>0==d.Status),l=t.filter(d=>1==d.Status),i=this.generateToastrMessage(a,l,n);this.toastrService.success(i.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(t,n){let a=t?.error?.Message.filter(d=>0==d.Status),l=t?.error?.Message.filter(d=>1==d.Status),i=this.generateToastrMessage(a,l,n);"WARNING"==i.status?this.toastrService.warning(i.message,"Warning!",{enableHtml:!0}):this.toastrService.error(i.message,`Error - ${t.status}`,{enableHtml:!0})}generateToastrMessage(t,n,a){let i,l="";return 0==t.length&&n.length>0?(i="SUCCESS",l=this.createSuccessResponse(n,a)):t.length>0&&0==n.length?(i="ERROR",l=this.createErrResponse(t,a)):(i="WARNING",l=`${this.createSuccessResponse(n,a)} ${this.createErrResponse(t,a)}`),l=`<ol>${l}</ol>`,{status:i,message:l}}createErrResponse(t,n){let a="";return t.forEach((l,i)=>{a+=`<li><b>${l.Response}</b> for ${n.Name} in ${l.Name}</li>`}),a}createSuccessResponse(t,n){let a="";return t.forEach((l,i)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${l.Name}</li>`}),a}getHostName(){if(u.g.IsEmpty(this.hostName)){const t=localStorage.getItem("Authorization");this.hostName=JSON.parse(t)?.Host}return this.hostName}}g.\u0275fac=function(t){return new(t||g)(c.LFG(I.O),c.LFG(e._W))},g.\u0275prov=c.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"})}}]);