marketplacepos 3.13.1 → 3.13.3
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.
- package/Marketplace/{chunk-7GGXFJTH.js → chunk-2HWKPGG2.js} +1 -1
- package/Marketplace/chunk-4QAG4XV5.js +1 -0
- package/Marketplace/{chunk-CBQON7JZ.js → chunk-4QGD62JF.js} +1 -1
- package/Marketplace/{chunk-ISHKU4HS.js → chunk-6NUQBHVK.js} +1 -1
- package/Marketplace/chunk-6OWGDOJP.js +2 -0
- package/Marketplace/{chunk-GIZWO6Z7.js → chunk-AHK65AO6.js} +1 -1
- package/Marketplace/{chunk-44NPBPWD.js → chunk-E5ZXRZGR.js} +1 -1
- package/Marketplace/chunk-EVSENZKK.js +1 -0
- package/Marketplace/{chunk-KYHILYCS.js → chunk-F3ASIPCS.js} +1 -1
- package/Marketplace/{chunk-CJTMR3XH.js → chunk-IIUTIA47.js} +1 -1
- package/Marketplace/chunk-JBAG4TSB.js +1 -0
- package/Marketplace/{chunk-IXXBZERD.js → chunk-MQFYT7UC.js} +1 -1
- package/Marketplace/{chunk-7Q56WDU6.js → chunk-O6SPNQMQ.js} +1 -1
- package/Marketplace/{chunk-DIUAKNJ7.js → chunk-P7KW5VRW.js} +1 -1
- package/Marketplace/{chunk-RVULTBBA.js → chunk-QCFKCDKM.js} +1 -1
- package/Marketplace/{chunk-O2A46B27.js → chunk-QPAHUI3H.js} +1 -1
- package/Marketplace/{chunk-OQANLBWC.js → chunk-RGIPA4RC.js} +1 -1
- package/Marketplace/{chunk-JODEGY3A.js → chunk-VD46BM3E.js} +1 -1
- package/Marketplace/chunk-WQ26K26X.js +1 -0
- package/Marketplace/{chunk-WBRE5DAH.js → chunk-XKP2LBOB.js} +1 -1
- package/Marketplace/chunk-Y2XXDDNX.js +1 -0
- package/Marketplace/{chunk-IOH6ZWW2.js → chunk-YERME2YY.js} +1 -1
- package/Marketplace/{chunk-T6ZAW4FG.js → chunk-YOU5DY2R.js} +1 -1
- package/Marketplace/{chunk-VTTUEN2J.js → chunk-ZHBHYT7I.js} +1 -1
- package/Marketplace/{chunk-4IP4M4HU.js → chunk-ZVNVZRA7.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-A3GNL4C4.js → main-PVT3FMFE.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-BRTVFFDI.js +0 -1
- package/Marketplace/chunk-JAFFZL32.js +0 -1
- package/Marketplace/chunk-O7ORKR43.js +0 -1
- package/Marketplace/chunk-TZKWQXOG.js +0 -2
- package/Marketplace/chunk-Y4G6RN56.js +0 -1
- package/Marketplace/chunk-Y7E7FG5M.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b}from"./chunk-7CEWM7GE.js";import{a as r}from"./chunk-
|
|
1
|
+
import{a as v,b}from"./chunk-7CEWM7GE.js";import{a as r}from"./chunk-QCFKCDKM.js";import"./chunk-YERME2YY.js";import"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import"./chunk-2UXFUEON.js";import{Ia as s,Nb as f,_a as u,aa as l,cd as h,ga as m,gd as i,ha as c,kb as d,lb as C,mb as a,zc as o}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var T=(()=>{let e=class e{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"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-4QAG4XV5.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-JBAG4TSB.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-EVSENZKK.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Q}from"./chunk-LIS3LB3F.js";import{a as Y}from"./chunk-E5ZXRZGR.js";import{a as X}from"./chunk-WJI6JIBR.js";import{b as V,c as Z}from"./chunk-Y2XXDDNX.js";import"./chunk-2GZOVNPU.js";import"./chunk-662E5VTA.js";import{a as J}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as H}from"./chunk-YERME2YY.js";import{b as O,e as U}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as K,l as q,m as z}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as k,h as j,k as G,m as W,u as $}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{B as F,Fb as _,Ia as u,Ja as h,Jb as S,Kb as v,Lb as y,Mb as E,Nb as R,Q as D,Wb as C,X as T,Xb as x,Ya as w,_a as d,da as M,ga as N,kb as a,lb as p,mb as b,oa as s,pa as c,qb as I,sc as L,tb as g,vb as o,vc as A,zc as B}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";function ee(r,l){if(r&1){let n=I();a(0,"button",15),g("click",function(){s(n);let t=o().ngIf,i=o(2);return c(i.onUpdateItems(t))}),b(1,"i",16),_(2," Update "),p()}}function te(r,l){if(r&1&&(a(0,"div"),w(1,ee,3,0,"button",14),p()),r&2){let n=l.ngIf,e=o(2);u(),d("ngIf",e.productService.hasSelectionVariant(n))}}function ie(r,l){if(r&1){let n=I();a(0,"mainpanel",1),g("onSubmit",function(t){s(n);let i=o();return c(i.onSearch(t))}),a(1,"actions")(2,"div",2),w(3,te,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){s(n);let t=o();return c(t.openExportDialog())}),b(6,"i",5),a(7,"span"),_(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),_(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(n);let i=o();return v(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),c(t)}),p()(),a(14,"div",8)(15,"label",6),_(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(n);let i=o();return v(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),c(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(t){s(n);let i=o();return c(i.onShowDifferencePrice(t))})("onSubmit",function(t){s(n);let i=o();return c(i.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){s(n);let t=o();return c(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(n);let t=o();return c(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(n);let t=o();return c(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let n=l.ngIf,e=o();d("textButton","Search"),u(3),d("ngIf",x(4,14,e.data$)),u(10),S("ngModel",e.searchFilter.PageNumber),u(4),S("ngModel",e.searchFilter.RowCount),u(5),d("showProductToggle",!0)("data",x(23,16,e.data$))("channel",e.channelOptions)("filter",n.Filter),u(2),d("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",x(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var Se=(()=>{let l=class l{constructor(e,t,i,P,f){this.http=e,this.toastr=t,this.dialog=i,this.productService=P,this.authService=f,this.infinitePagination=M(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(D()),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}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(T(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let P=t.map(m=>({ID:m.ID,Code:m.Code,Price:m.UnitPrice}));var i=this.channelOptions.filter(m=>m.selected).map(m=>m.ID);let f={ListChannelID:i,ListPrice:P};this.http.post("/api/Price/UpdateChannel",f).subscribe(m=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+f.ListPrice.length+" items in "+f.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(i=>{let P=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+P.Name+" to "+t.Price,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(X,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(F(i=>i!==void 0)).subscribe(i=>{this.channelOptions=i,this.updatePrice(e)})}openExportDialog(){this.dialog.open(Q,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}};l.\u0275fac=function(t){return new(t||l)(h(U),h(O),h(K),h(J),h(H))},l.\u0275cmp=N({type:l,selectors:[["app-price-pos-channel"]],standalone:!0,features:[E([V]),R],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","filter"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(t,i){t&1&&(w(0,ie,26,20,"mainpanel",0),C(1,"async")),t&2&&d("ngIf",x(1,1,i.loader$))},dependencies:[B,L,A,$,k,W,j,G,Z,z,q,Y],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=l;return r})();export{Se as PricePosChannelComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ke}from"./chunk-CP7VAKTQ.js";import{a as Ue}from"./chunk-OFRBPREK.js";import{a as Ve,b as Ne}from"./chunk-DXJFMERC.js";import{a as Fe}from"./chunk-IP2WADIR.js";import{a as De,d as we,e as Pe}from"./chunk-2Y4N4NSS.js";import{f as Le}from"./chunk-AAIK6JQ3.js";import{f as xe}from"./chunk-IOH6ZWW2.js";import{b as Te,e as ve}from"./chunk-IPX66YIX.js";import{b as D,c as w,i as P,j as E}from"./chunk-PIDUM6XT.js";import{t as j}from"./chunk-43TMSPFC.js";import{X as Ee}from"./chunk-4TYJR476.js";import{b as Me,h as $,k as W,u as Oe}from"./chunk-F5YRASNU.js";import{b as p,c as v}from"./chunk-2UXFUEON.js";import{$ as ce,$a as me,B as le,Bb as he,Cb as fe,Db as ge,Eb as Y,Fb as c,Gb as S,H as re,Ha as M,Hb as O,Ia as s,Ja as g,Jb as k,K as se,Kb as V,Lb as N,Nb as ue,Pb as Ce,Q as de,T as q,V as H,Wb as A,Xb as B,Ya as f,Za as Z,Zb as J,_a as d,c as z,ca as X,da as pe,dd as Ie,fb as ee,ga as T,kb as l,lb as r,mb as b,n as ae,nb as F,oa as _,ob as U,pa as y,pc as _e,q as K,qb as I,rc as x,sc as R,tb as u,vb as h,vc as ye,yc as Se,za as Q,zc as be}from"./chunk-77JORVC2.js";function je(a,i){if(a&1&&(l(0,"mat-option",10)(1,"div",11),b(2,"img",12),l(3,"span"),c(4),r()()()),a&2){let n=i.$implicit;d("value",n.ID)("disabled",n.disabled),s(),d("matTooltip",n.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",n.Img,M),s(2),S(n.Name)}}function ze(a,i){if(a&1){let n=I();l(0,"div",13)(1,"label",14),c(2,"Scan Type"),r(),l(3,"mat-radio-group",15),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.ScanFull,e)||(o.filter.ScanFull=e),y(e)}),l(4,"mat-radio-button",16),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",17),c(7," Active "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Ge(a,i){a&1&&(l(0,"span"),c(1,"Never"),r())}function Ke(a,i){if(a&1&&(l(0,"span"),c(1),A(2,"async"),r()),a&2){let n=h(2);s(),S(B(2,1,n.lastSync$))}}function He(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3)(2,"span",18),c(3,"Last Scan:"),r(),f(4,Ge,2,0,"span"),A(5,"async"),f(6,Ke,3,3,"span"),r(),l(7,"mat-radio-group",19),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),y(e)}),l(8,"mat-radio-button",20),c(9," Scan All Products "),r(),l(10,"mat-radio-button",21),c(11),r()()()}if(a&2){let n=h();s(4),ee(B(5,6,n.lastSync$)==null?4:6),s(3),k("ngModel",n.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),O(" ",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Qe(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",22),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.Async,e)||(o.filter.Async=e),y(e)}),l(4,"mat-radio-button",23),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",24),c(7," Synchronous (Wait until Complete) "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var Mt=(()=>{let i=class i{constructor(t,e,o){this.dialogRef=t,this.data=e,this.router=o,this.channelService=pe(ke),this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:v.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=v.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=v.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new P,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(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(K(e=>v.IsNotEmpty(e.LastSync)?v.convertToReadableDate(e.LastSync):null),de(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&v.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return v.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};i.\u0275fac=function(e){return new(e||i)(g(D),g(w),g(Ie))},i.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["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,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["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,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["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",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["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(e,o){e&1&&(l(0,"modal-material",0),u("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(o.filter.ChannelID,C)||(o.filter.ChannelID=C),C}),u("ngModelChange",function(C){return o.onSelectChannel(C)}),f(7,je,5,5,"mat-option",6),r()(),f(8,ze,8,3,"div",7)(9,He,12,8,"div",8)(10,Qe,8,3,"div",9),r()()()),e&2&&(d("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),s(6),d("disabled",o.disabledChannelOption),k("ngModel",o.filter.ChannelID),s(),d("ngForOf",o.channelOptions),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),s(),ee(o.hasScanUpdate&&o.selectedChannel?9:-1),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[x,R,$,W,Ve,Ne,Le,Fe,Ee,j,E,ye],encapsulation:2});let a=i;return a})();var L=function(a){return a.Tokopedia="https://seller.tokopedia.com",a.Shoope="https://seller.shopee.co.id",a.Tiktok="https://seller-id.tiktok.com",a.WooCommerce="https://woocommerce.dealpos.app",a.Lazada="https://sellercenter.lazada.co.id",a}(L||{});var Ye=a=>({"is-disabled":a});function Je(a,i){if(a&1&&(F(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),U()),a&2){let n=h().$implicit;s(3),O(" ",n==null?null:n.Model,""),s(2),O(" ",n==null?null:n.Code,"")}}function qe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Model,"")}}function Xe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Code,"")}}function Ze(a,i){if(a&1&&(l(0,"tr"),f(1,qe,2,2,"td",14)(2,Xe,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),b(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),A(11,"number"),r(),l(12,"td",19),c(13),A(14,"number"),r(),l(15,"td",19)(16,"a",20),b(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),a&2){let n=i.$implicit,t=i.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",n.Url,M)("title",n.Title),s(),d("src",e.getChannelLogo(n.TypeID),M),s(),d("matTooltip",(n==null||n.Name==null?null:n.Name.length)>55?n==null?null:n.Name:""),s(),O(" ",n.Name," "),s(2),S(B(11,12,n.Price)),s(3),S(B(14,14,n.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(n),M)("ngClass",Ce(16,Ye,n.TypeID==e.channelType.KalCare))("matTooltip",n.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function et(a,i){if(a&1&&f(0,Ze,20,18,"tr",9),a&2){let n=h().$implicit;d("ngForOf",n==null?null:n.Channel)}}function tt(a,i){if(a&1&&(F(0),f(1,Je,9,2,"ng-container",10)(2,et,1,1,"ng-template",null,0,J),U()),a&2){let n=i.$implicit,t=Y(3);s(),d("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",t)}}var Vt=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return v.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),b(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),b(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),b(19,"th",5),r()(),l(20,"tbody"),f(21,tt,4,2,"ng-container",9),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[_e,x,R,j,E,Se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let a=i;return a})();var nt=["selectId"];function it(a,i){if(a&1&&(l(0,"span",3),c(1),r()),a&2){let n=i.item,t=h();d("title",n[t.bindLabel]),s(),S(n[t.bindLabel])}}var Re=(()=>{let i=class i{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new oe,this.selectedChange=new Q,this.selectedLabel=new Q,this.onOpen=new Q}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=T({type:i,selectors:[["ng-select-infinite"]],viewQuery:function(e,o){if(e&1&&he(nt,7),e&2){let m;fe(m=ge())&&(o.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[ue],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(e,o){if(e&1){let m=I();l(0,"ng-select",1,0),u("clear",function(){return _(m),y(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return _(m),y(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return _(m),y(o.onOpenSelect())})("change",function(We){return _(m),y(o.onSelectChange(We))}),f(2,it,2,2,"ng-template",2),r()}e&2&&(me("width",o.width),d("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[be,Pe,we,De,Oe,$,W]});let a=i;return a})(),oe=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new z,this._destroy$=new z,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(re(200),se(),K(i=>(i&&(i=i.toLowerCase()),this.filterData(i))),le(i=>i!==void 0),H(this._destroy$)).subscribe(i=>{this._dataBuffer=i.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(i){let n=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),n=t.indexOf(i),n!==-1||i==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(i){this._data=i||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(i,n){if(Ue.IsNotEmpty(i)){let t=this._data.filter(e=>e[n].toString().toLowerCase().indexOf(i)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(i){this._bufferSize=i}onScrollToEnd(){this.fetchMore()}fetchMore(){let i=this._dataBuffer.length,n=this._data.slice(i,this._bufferSize+i);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(n)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var $e=(()=>{let i=class i{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(q(o=>o!=null?ae(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(q(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};i.\u0275fac=function(e){return new(e||i)(X(xe),X(ve))},i.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();function lt(a,i){if(a&1){let n=I();F(0),l(1,"ng-select-infinite",16),u("selectedChange",function(e){_(n);let o=h().index,m=h();return y(m.onSelectCategory(e,o))}),r(),U()}if(a&2){let n=h().$implicit;s(),d("items",n.Categories)("clearable",!1)}}function rt(a,i){if(a&1&&(l(0,"div",17),b(1,"input",18),r()),a&2){let n=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==n.TypeID||t.channelType.Shopify==n.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(n.TypeID))}}function st(a,i){if(a&1){let n=I();F(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let o=_(n).$implicit;return V(o.Selected,e)||(o.Selected=e),y(e)}),u("ngModelChange",function(){_(n);let e=h();return y(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),b(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),f(10,lt,2,2,"ng-container",15)(11,rt,2,2,"ng-template",null,0,J),r()(),U()}if(a&2){let n=i.$implicit,t=Y(12);s(3),k("ngModel",n.Selected),s(3),d("src",n==null?null:n.Img,M)("alt",n.Name),s(2),S(n.Name),s(2),d("ngIf",n.Categories.length>0)("ngIfElse",t)}}var tn=(()=>{let i=class i{constructor(t,e,o,m){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new z,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,m)=>m.findIndex(C=>e.channelType==C.channelType)==o).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};i.\u0275fac=function(e){return new(e||i)(g(w),g($e),g(D),g(Te))},i.\u0275cmp=T({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),u("change",function(C){return o.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),f(14,st,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[x,R,Me,$,W,j,E,Re],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
|
|
1
|
+
import{a as ke}from"./chunk-CP7VAKTQ.js";import{a as Ue}from"./chunk-OFRBPREK.js";import{a as Ve,b as Ne}from"./chunk-DXJFMERC.js";import{a as Fe}from"./chunk-IP2WADIR.js";import{a as De,d as we,e as Pe}from"./chunk-2Y4N4NSS.js";import{f as Le}from"./chunk-AAIK6JQ3.js";import{f as xe}from"./chunk-YERME2YY.js";import{b as Te,e as ve}from"./chunk-IPX66YIX.js";import{b as D,c as w,i as P,j as E}from"./chunk-PIDUM6XT.js";import{t as j}from"./chunk-43TMSPFC.js";import{X as Ee}from"./chunk-4TYJR476.js";import{b as Me,h as $,k as W,u as Oe}from"./chunk-F5YRASNU.js";import{b as p,c as v}from"./chunk-2UXFUEON.js";import{$ as ce,$a as me,B as le,Bb as he,Cb as fe,Db as ge,Eb as Y,Fb as c,Gb as S,H as re,Ha as M,Hb as O,Ia as s,Ja as g,Jb as k,K as se,Kb as V,Lb as N,Nb as ue,Pb as Ce,Q as de,T as q,V as H,Wb as A,Xb as B,Ya as f,Za as Z,Zb as J,_a as d,c as z,ca as X,da as pe,dd as Ie,fb as ee,ga as T,kb as l,lb as r,mb as b,n as ae,nb as F,oa as _,ob as U,pa as y,pc as _e,q as K,qb as I,rc as x,sc as R,tb as u,vb as h,vc as ye,yc as Se,za as Q,zc as be}from"./chunk-77JORVC2.js";function je(a,i){if(a&1&&(l(0,"mat-option",10)(1,"div",11),b(2,"img",12),l(3,"span"),c(4),r()()()),a&2){let n=i.$implicit;d("value",n.ID)("disabled",n.disabled),s(),d("matTooltip",n.disabled?"Single Product Scan disabled for this type of Channel":null),s(),d("src",n.Img,M),s(2),S(n.Name)}}function ze(a,i){if(a&1){let n=I();l(0,"div",13)(1,"label",14),c(2,"Scan Type"),r(),l(3,"mat-radio-group",15),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.ScanFull,e)||(o.filter.ScanFull=e),y(e)}),l(4,"mat-radio-button",16),c(5," Full (Include Inactive Products) "),r(),l(6,"mat-radio-button",17),c(7," Active "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.ScanFull),s(),d("value",!0),s(2),d("value",!1)}}function Ge(a,i){a&1&&(l(0,"span"),c(1,"Never"),r())}function Ke(a,i){if(a&1&&(l(0,"span"),c(1),A(2,"async"),r()),a&2){let n=h(2);s(),S(B(2,1,n.lastSync$))}}function He(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3)(2,"span",18),c(3,"Last Scan:"),r(),f(4,Ge,2,0,"span"),A(5,"async"),f(6,Ke,3,3,"span"),r(),l(7,"mat-radio-group",19),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),y(e)}),l(8,"mat-radio-button",20),c(9," Scan All Products "),r(),l(10,"mat-radio-button",21),c(11),r()()()}if(a&2){let n=h();s(4),ee(B(5,6,n.lastSync$)==null?4:6),s(3),k("ngModel",n.filter.UpdatedProduct),s(),d("value",!1),s(2),d("value",!0)("matTooltip",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),s(),O(" ",n.selectedChannel.TypeID==n.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Qe(a,i){if(a&1){let n=I();l(0,"div",8)(1,"label",3),c(2," Scan Option "),r(),l(3,"mat-radio-group",22),N("ngModelChange",function(e){_(n);let o=h();return V(o.filter.Async,e)||(o.filter.Async=e),y(e)}),l(4,"mat-radio-button",23),c(5," Asynchronous (Get Notified when Complete) "),r(),l(6,"mat-radio-button",24),c(7," Synchronous (Wait until Complete) "),r()()()}if(a&2){let n=h();s(3),k("ngModel",n.filter.Async),s(),d("value",!0),s(2),d("value",!1)}}var Mt=(()=>{let i=class i{constructor(t,e,o){this.dialogRef=t,this.data=e,this.router=o,this.channelService=pe(ke),this.channelType=p,this.disabledChannelOption=!1,this.filter={ChannelID:v.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=v.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=v.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new P,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(t=>(t.disabled=!0,(t.TypeID==p.Tiktok||t.TypeID==p.Tokopedia||t.TypeID==p.Lazada||t.TypeID==p.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let e=this.filterChannelById(t);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(K(e=>v.IsNotEmpty(e.LastSync)?v.convertToReadableDate(e.LastSync):null),de(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&v.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==p.Shopee||this.selectedChannel.TypeID==p.Tiktok||this.selectedChannel.TypeID==p.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=p.WooCommerce&&this.selectedChannel?.TypeID!=p.KalCare&&this.selectedChannel?.TypeID!=p.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==t)),e}submit(){this.selectedChannel.TypeID==p.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return v.IsNotEmpty(t)}onClose(){this.dialogRef.close()}};i.\u0275fac=function(e){return new(e||i)(g(D),g(w),g(Ie))},i.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["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,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["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,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["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",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["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(e,o){e&1&&(l(0,"modal-material",0),u("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),c(4,"Select a Channel"),r(),l(5,"mat-form-field",4)(6,"mat-select",5),N("ngModelChange",function(C){return V(o.filter.ChannelID,C)||(o.filter.ChannelID=C),C}),u("ngModelChange",function(C){return o.onSelectChannel(C)}),f(7,je,5,5,"mat-option",6),r()(),f(8,ze,8,3,"div",7)(9,He,12,8,"div",8)(10,Qe,8,3,"div",9),r()()()),e&2&&(d("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),s(6),d("disabled",o.disabledChannelOption),k("ngModel",o.filter.ChannelID),s(),d("ngForOf",o.channelOptions),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),s(),ee(o.hasScanUpdate&&o.selectedChannel?9:-1),s(),d("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[x,R,$,W,Ve,Ne,Le,Fe,Ee,j,E,ye],encapsulation:2});let a=i;return a})();var L=function(a){return a.Tokopedia="https://seller.tokopedia.com",a.Shoope="https://seller.shopee.co.id",a.Tiktok="https://seller-id.tiktok.com",a.WooCommerce="https://woocommerce.dealpos.app",a.Lazada="https://sellercenter.lazada.co.id",a}(L||{});var Ye=a=>({"is-disabled":a});function Je(a,i){if(a&1&&(F(0),l(1,"tr")(2,"td",11),c(3),r(),l(4,"td",11),c(5),r(),l(6,"td",12)(7,"p",13),c(8,"Product Not in Channel!"),r()()(),U()),a&2){let n=h().$implicit;s(3),O(" ",n==null?null:n.Model,""),s(2),O(" ",n==null?null:n.Code,"")}}function qe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Model,"")}}function Xe(a,i){if(a&1&&(l(0,"td",11),c(1),r()),a&2){let n=h(3).$implicit;Z("rowspan",n.Channel.length),s(),O(" ",n==null?null:n.Code,"")}}function Ze(a,i){if(a&1&&(l(0,"tr"),f(1,qe,2,2,"td",14)(2,Xe,2,2,"td",14),l(3,"td",11)(4,"div",15)(5,"a",16),b(6,"img",17),r(),l(7,"div",18),c(8),r()()(),l(9,"td",11),c(10),A(11,"number"),r(),l(12,"td",19),c(13),A(14,"number"),r(),l(15,"td",19)(16,"a",20),b(17,"i",21),l(18,"span",22),c(19,"Edit"),r()()()()),a&2){let n=i.$implicit,t=i.index,e=h(3);s(),d("ngIf",t==0),s(),d("ngIf",t==0),s(3),d("href",n.Url,M)("title",n.Title),s(),d("src",e.getChannelLogo(n.TypeID),M),s(),d("matTooltip",(n==null||n.Name==null?null:n.Name.length)>55?n==null?null:n.Name:""),s(),O(" ",n.Name," "),s(2),S(B(11,12,n.Price)),s(3),S(B(14,14,n.Inventory)),s(3),d("href",e.getHyperlinkSellerCenter(n),M)("ngClass",Ce(16,Ye,n.TypeID==e.channelType.KalCare))("matTooltip",n.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function et(a,i){if(a&1&&f(0,Ze,20,18,"tr",9),a&2){let n=h().$implicit;d("ngForOf",n==null?null:n.Channel)}}function tt(a,i){if(a&1&&(F(0),f(1,Je,9,2,"ng-container",10)(2,et,1,1,"ng-template",null,0,J),U()),a&2){let n=i.$implicit,t=Y(3);s(),d("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",t)}}var Vt=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e,this.channelType=p,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return v.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let e="javascript:void(0)";switch(t.TypeID){case p.Shopee:e=`${L.Shoope}/portal/product/${t.ChannelItemID}`;break;case p.Tiktok:e=`${L.Tiktok}/product/edit/${t.ChannelItemID}`;break;case p.Tokopedia:e=`${L.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case p.WooCommerce:e=`${L.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case p.Lazada:e=`${L.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return e}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),c(6," VARIANT "),l(7,"sup"),b(8,"i",6),r()(),l(9,"th",5),c(10,"SKU"),r(),l(11,"th",5),c(12," PRODUCT "),l(13,"sup"),b(14,"i",7),r()(),l(15,"th",5),c(16,"PRICE"),r(),l(17,"th",8),c(18,"INVENTORY"),r(),b(19,"th",5),r()(),l(20,"tbody"),f(21,tt,4,2,"ng-container",9),r()()()()),e&2&&(d("config",o.modalConfig),s(21),d("ngForOf",o.variants))},dependencies:[_e,x,R,j,E,Se],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let a=i;return a})();var nt=["selectId"];function it(a,i){if(a&1&&(l(0,"span",3),c(1),r()),a&2){let n=i.item,t=h();d("title",n[t.bindLabel]),s(),S(n[t.bindLabel])}}var Re=(()=>{let i=class i{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new oe,this.selectedChange=new Q,this.selectedLabel=new Q,this.onOpen=new Q}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=T({type:i,selectors:[["ng-select-infinite"]],viewQuery:function(e,o){if(e&1&&he(nt,7),e&2){let m;fe(m=ge())&&(o.ngSelectElement=m.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},standalone:!0,features:[ue],decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(e,o){if(e&1){let m=I();l(0,"ng-select",1,0),u("clear",function(){return _(m),y(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return _(m),y(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return _(m),y(o.onOpenSelect())})("change",function(We){return _(m),y(o.onSelectChange(We))}),f(2,it,2,2,"ng-template",2),r()}e&2&&(me("width",o.width),d("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[be,Pe,we,De,Oe,$,W]});let a=i;return a})(),oe=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new z,this._destroy$=new z,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(re(200),se(),K(i=>(i&&(i=i.toLowerCase()),this.filterData(i))),le(i=>i!==void 0),H(this._destroy$)).subscribe(i=>{this._dataBuffer=i.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(i){let n=-1,t;return this._data.filter(o=>(t=JSON.stringify(o).toLowerCase(),n=t.indexOf(i),n!==-1||i==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(i){this._data=i||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(i,n){if(Ue.IsNotEmpty(i)){let t=this._data.filter(e=>e[n].toString().toLowerCase().indexOf(i)!==-1);this._dataBuffer=t.slice(0,this._bufferSize)}}set bufferSize(i){this._bufferSize=i}onScrollToEnd(){this.fetchMore()}fetchMore(){let i=this._dataBuffer.length,n=this._data.slice(i,this._bufferSize+i);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(n)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var $e=(()=>{let i=class i{constructor(t,e){this.LocalData=t,this.httpService=e}getCategoriesByTypeId(t,e){return this.LocalData.getCategoriesByChannelType(t).pipe(q(o=>o!=null?ae(o):this._getCategoriesByTypeID(t,e)))}_getCategoriesByTypeID(t,e){let o={TypeID:t,ID:e};return this.httpService.post("/api/Channel/getCategoriesByTypeID",o).pipe(q(m=>this.LocalData.saveCategoriesByChannelType(m,t)))}};i.\u0275fac=function(e){return new(e||i)(X(xe),X(ve))},i.\u0275prov=ce({token:i,factory:i.\u0275fac,providedIn:"root"});let a=i;return a})();function lt(a,i){if(a&1){let n=I();F(0),l(1,"ng-select-infinite",16),u("selectedChange",function(e){_(n);let o=h().index,m=h();return y(m.onSelectCategory(e,o))}),r(),U()}if(a&2){let n=h().$implicit;s(),d("items",n.Categories)("clearable",!1)}}function rt(a,i){if(a&1&&(l(0,"div",17),b(1,"input",18),r()),a&2){let n=h().$implicit,t=h();d("matTooltip",t.channelType.WooCommerce==n.TypeID||t.channelType.Shopify==n.TypeID?"":"Product Category is Harcoded, Please Change Product Category in Seller Center"),s(),d("placeholder",t.getChannelCategory(n.TypeID))}}function st(a,i){if(a&1){let n=I();F(0),l(1,"tr")(2,"td",10)(3,"input",11),N("ngModelChange",function(e){let o=_(n).$implicit;return V(o.Selected,e)||(o.Selected=e),y(e)}),u("ngModelChange",function(){_(n);let e=h();return y(e.onSelectChannel())}),r()(),l(4,"td")(5,"div",12),b(6,"img",13),l(7,"span",14),c(8),r()()(),l(9,"td"),f(10,lt,2,2,"ng-container",15)(11,rt,2,2,"ng-template",null,0,J),r()(),U()}if(a&2){let n=i.$implicit,t=Y(12);s(3),k("ngModel",n.Selected),s(3),d("src",n==null?null:n.Img,M)("alt",n.Name),s(2),S(n.Name),s(2),d("ngIf",n.Categories.length>0)("ngIfElse",t)}}var tn=(()=>{let i=class i{constructor(t,e,o,m){this.data=t,this.channelService=e,this.dialogRef=o,this.toastrService=m,this.channelOptions=[],this.uploadResponse=[],this.channelType=p,this.enableBtnOk=!1,this.destroy$=new z,this.uploadResponse=[],this.channels=this.data.channels,this.product=t.product}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe(H(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(e.channelType,o)})})}setCategoriesChannelOption(t,e){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==t&&(o.Categories=e),o))}initChannelOptions(){this.channelOptions=this.channels.map(t=>({Name:t.Name,Img:t.Img,ID:t.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(t.TypeID),TypeID:t.TypeID,Categories:[]}))}initDefaultChannelCategoryId(t){let e=0;switch(t){case p.Lazada:e=6509;break}return e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,o,m)=>m.findIndex(C=>e.channelType==C.channelType)==o).filter(e=>e.channelType==p.Tokopedia)}onSelectCategory(t,e){this.channelOptions[e].CategoryID=t,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(t){this.channelOptions=this.channelOptions.map(e=>(e.Selected=t,e)),this.enableBtnOk=t}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return this.channelOptions.findIndex(t=>t.Selected)!==-1}onClose(){this.dialogRef.close()}onSave(){if(!this.validateSelectedCategory()){this.toastrService.warning("Category is required","Warning!");return}let t=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(t)}validateSelectedCategory(){return this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==p.Tokopedia).findIndex(e=>e.CategoryID==0)==-1}getChannelCategory(t){let e;switch(t){case p.Shopee:e="Aksesoris Fashion";break;case p.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case p.WooCommerce:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;case p.Lazada:e="Fashion Accessories / Women Accessories / Others";break;case p.Shopify:e=this.product?.Category?this.product?.Category:"Following the category in POS";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};i.\u0275fac=function(e){return new(e||i)(g(w),g($e),g(D),g(Te))},i.\u0275cmp=T({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[["EMPTY",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src","alt"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"selectedChange","items","clearable"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(e,o){e&1&&(l(0,"modal-material",1),u("onOk",function(){return o.onSave()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),l(1,"div",2)(2,"table",3)(3,"thead")(4,"tr")(5,"th",4)(6,"input",5),u("change",function(C){return o.onSelectAllChannel(C.target.checked)}),r()(),l(7,"th",6)(8,"span",7),c(9,"CHANNEL"),r()(),l(10,"th",8)(11,"span",7),c(12,"CATEGORY"),r()()()(),l(13,"tbody"),f(14,st,13,6,"ng-container",9),r()()()()),e&2&&(d("dynamicValidated",o.enableBtnOk)("config",o.modalConfig),s(14),d("ngForOf",o.channelOptions))},dependencies:[x,R,Me,$,W,j,E,Re],styles:[`input[type=checkbox]{width:15px;height:15px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}
|
|
2
2
|
`],encapsulation:2});let a=i;return a})();function dt(a,i){if(a&1&&(l(0,"tr")(1,"td"),c(2),r(),l(3,"td"),c(4),r()()),a&2){let n=i.$implicit;s(2),S(n==null?null:n.Name),s(2),S(n==null?null:n.ChannelVariationSKU)}}var ln=(()=>{let i=class i{constructor(t,e){this.data=t,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new P,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};i.\u0275fac=function(e){return new(e||i)(g(w),g(D))},i.\u0275cmp=T({type:i,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],[4,"ngFor","ngForOf"]],template:function(e,o){e&1&&(l(0,"modal-material",0),u("onCancel",function(){return o.dialogRef.close()}),l(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),c(6,"Variant"),r(),l(7,"th",4),c(8,"SKU"),r()()(),l(9,"tbody"),f(10,dt,5,2,"tr",5),r()()()()),e&2&&(d("config",o.modalConfig),s(10),d("ngForOf",o.data.variants))},dependencies:[x,E],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let a=i;return a})();export{Mt as a,Vt as b,Re as c,tn as d,ln as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as _e}from"./chunk-2Y4N4NSS.js";import{a as ue}from"./chunk-662E5VTA.js";import{b as fe,g as be}from"./chunk-IOH6ZWW2.js";import{b as te,e as y}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{c as ne,h as ie,i as oe,j as re,k as ae,l as se,o as de,p as ce,q as le,r as pe,u as me}from"./chunk-F5YRASNU.js";import{a as M,c as ge,d as he,f as xe}from"./chunk-2UXFUEON.js";import{$ as R,Bb as W,Cb as q,Db as H,Eb as P,Fb as a,Gb as C,Ha as w,Hb as B,Ia as c,Ib as Y,Ja as p,Jb as I,Kb as L,Lb as T,Q as F,Qb as G,Wb as Q,Xb as K,Ya as f,Zb as $,_a as m,aa as A,bd as S,cb as U,dd as v,ga as x,gd as j,ha as N,kb as i,lb as r,mb as l,nb as k,oa as b,ob as E,pa as _,pc as J,qb as z,rc as D,sc as X,tb as u,vb as g,vc as Z,zc as ee}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var ve=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.code=n.code})}addChannelLazada(){let n={Code:this.code};this.http.post("/api/ChannelAdd/AddLazada",n).subscribe(e=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Lazada"),r(),i(13,"div"),a(14," Your Code is "),i(15,"span",8),a(16),r()(),i(17,"button",9),u("click",function(){return s.addChannelLazada()}),l(18,"i",10),a(19," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.code))}});let o=t;return o})();var we=(()=>{let t=class t{constructor(){}getBrowserName(){let n=window.navigator.userAgent.toLowerCase();switch(!0){case(n.indexOf("edge")>-1||n.indexOf("edg")>-1):return"edge";case n.indexOf("opr")>-1:return"opera";case n.indexOf("chrome")>-1:return"chrome";case n.indexOf("trident")>-1:return"ie";case n.indexOf("firefox")>-1:return"firefox";case n.indexOf("safari")>-1:return"safari";default:return"other"}}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})();function Le(o,t){if(o&1&&(i(0,"swiper-slide")(1,"div")(2,"a",2),l(3,"img",3),r()(),i(4,"a",4),a(5),r(),i(6,"p",5),a(7),r()()),o&2){let d=t.$implicit;c(2),m("href",d.href,w),c(),m("src",d.imgSrc,w),c(),m("href",d.href,w),c(),C(d.title),c(2),C(d.description)}}var Me=(()=>{let t=class t{constructor(){this.newsList=[]}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=x({type:t,selectors:[["POS-news-swiper"]],inputs:{newsList:"newsList"},decls:2,vars:1,consts:[["pagination","true","pagination-clickable","true","autoplay-delay","5000","autoplay-disable-on-interaction","false",2,"margin-top","30px"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],[1,"border-0","rounded-1","mb-8",2,"width","252px","height","152px",3,"src"],["target","_blank",1,"fw-bold","h5","text-success","header-title","fs-4",3,"href"],[2,"margin-bottom","3rem"]],template:function(e,s){e&1&&(i(0,"swiper-container",0),f(1,Le,8,5,"swiper-slide",1),r()),e&2&&(c(),m("ngForOf",s.newsList))},dependencies:[D],styles:["swiper-container[_ngcontent-%COMP%]{--swiper-pagination-bullet-inactive-color: #89b03e;--swiper-pagination-color: #89b03e}"]});let o=t;return o})();var Ae=["subdomainEl"],Ne=(o,t)=>({"rounded-end":o,"border-end-0":t});function ze(o,t){if(o&1&&(k(0),i(1,"div",36),l(2,"img",37),r(),E()),o&2){let d=t.$implicit;c(2),m("src",d.img,w)("title",d.title)("alt",d.title)}}function De(o,t){if(o&1){let d=z();k(0),i(1,"div",17)(2,"h3",18),a(3," DealPOS Omnichannel "),r(),i(4,"small",19),a(5," Multichannel Inventory Management Software "),r()(),i(6,"form",20)(7,"div",21)(8,"div",22)(9,"div",23)(10,"span"),l(11,"i",24),r()(),i(12,"input",25,1),T("ngModelChange",function(e){b(d);let s=g();return L(s.subdomain,e)||(s.subdomain=e),_(e)}),r(),i(14,"div")(15,"select",26),T("ngModelChange",function(e){b(d);let s=g();return L(s.domain,e)||(s.domain=e),_(e)}),i(16,"option",27),a(17,".dealpos.co.id"),r(),i(18,"option",28),a(19,".dealpos.net"),r(),i(20,"option",29),a(21,".dealpos.com"),r(),i(22,"option",30),a(23,".dealpos.app"),r()()()(),i(24,"div",31)(25,"button",32),u("click",function(){b(d);let e=g();return _(e.onNextState())}),a(26," Next "),r()(),i(27,"div",33)(28,"div",34),f(29,ze,3,3,"ng-container",35),r()()()(),E()}if(o&2){let d=g();c(12),I("ngModel",d.subdomain),c(3),I("ngModel",d.domain),c(14),m("ngForOf",d.channels)}}function je(o,t){o&1&&(i(0,"p"),a(1," Username is required "),r())}function Ve(o,t){if(o&1&&(k(0),i(1,"div",57),l(2,"div",58),i(3,"div",59),f(4,je,2,0,"p",47),r()(),E()),o&2){g();let d=P(14);c(4),m("ngIf",d.errors.required)}}function Fe(o,t){if(o&1){let d=z();i(0,"i",62),u("click",function(){b(d);let e=g(3);return _(e.hideShowPassword())}),r()}if(o&2){let d=g(3);U("fa "+d.passwordIcon)}}function Re(o,t){if(o&1&&(i(0,"span",60),f(1,Fe,1,2,"i",61),r()),o&2){let d=g(2);c(),m("ngIf",d.password)}}function Ue(o,t){o&1&&(i(0,"p"),a(1," Password is required "),r())}function We(o,t){if(o&1&&(k(0),i(1,"div",57),l(2,"div",58),i(3,"div",59),f(4,Ue,2,0,"p",47),r()(),E()),o&2){g();let d=P(21);c(4),m("ngIf",d.errors.required)}}function qe(o,t){if(o&1){let d=z();i(0,"div",38)(1,"h3",39),a(2,"Sign in"),r(),i(3,"h3",40),a(4," to "),i(5,"h6",41),a(6),r(),i(7,"i",42),u("click",function(){b(d);let e=g();return _(e.onEditDomain())}),r()()(),i(8,"form",43)(9,"div",44)(10,"div",23)(11,"span"),l(12,"i",45),r()(),i(13,"input",46,2),T("ngModelChange",function(e){b(d);let s=g();return L(s.username,e)||(s.username=e),_(e)}),r()(),f(15,Ve,5,1,"ng-container",47),i(16,"div",22)(17,"div",23)(18,"span"),l(19,"i",48),r()(),i(20,"input",49,3),T("ngModelChange",function(e){b(d);let s=g();return L(s.password,e)||(s.password=e),_(e)}),r(),f(22,Re,2,1,"span",50),r(),f(23,We,5,1,"ng-container",47),i(24,"div",51)(25,"button",52),u("click",function(){b(d);let e=g();return _(e.onLogin())}),a(26," Log in "),r()(),i(27,"div",53),l(28,"hr"),i(29,"span",54),a(30,"or"),r(),l(31,"hr"),r(),i(32,"div")(33,"button",55),u("click",function(e){b(d);let s=g();return _(s.onLoginByGoogle(e))}),l(34,"i",56),a(35," Sign In with Google "),r()()()}if(o&2){let d=P(14),n=P(21),e=g();c(6),Y(" (",e.subdomain,"",e.domain,") "),c(7),I("ngModel",e.username),c(2),m("ngIf",d.invalid&&(d.dirty||d.touched)),c(5),m("type",e.passwordType)("ngClass",G(9,Ne,e.browser=="edge",e.browser!="edge")),I("ngModel",e.password),c(2),m("ngIf",e.browser!="edge"),c(),m("ngIf",n.invalid&&(n.dirty||n.touched))}}var Oe=(()=>{let t=class t{constructor(n,e,s,h,ke){this._router=n,this.toastr=e,this.checkBrowser=s,this.authService=h,this.ngxPermission=ke,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="fa-eye",this.channels=[{title:"Shopee",img:M.SHOOPE},{title:"Tokopedia",img:M.TOKOPEDIA},{title:"Tiktok",img:M.TIKTOK},{title:"Woocommerce",img:M.WOOCOMMERCE},{title:"Lazada",img:M.LAZADA},{title:"Shopify",img:M.SHOPIFY}],this.version=fe.version,this.news$=h.getNews().pipe(F(1))}ngOnInit(){this.initLogin(),this.browser=this.checkBrowser.getBrowserName(),document.body.classList.add("login-body"),this.initChangeLogUrl()}initChangeLogUrl(){let n=`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${this.version}`;this.changelogUrl=n}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){let n=JSON.parse(localStorage.getItem("Authorization"));if(n){this.username=n?.username,this.subdomain=n?.Host?.split(".")[0];let e=n?.Host?.split("dealpos");this.domain=`.dealpos${e[1]}`,this.authService.isActiveToken()&&this._router.navigate(["menu"])}}onNextState(){if(ge.IsEmpty(this.subdomain)){this.toastr.warning("Account Domain is required","Warning");return}this.parseSubdomain(),this.loginState="FORM_AUTH"}parseSubdomain(){let n=this.subdomain.indexOf(".dealpos");n!=-1&&(this.subdomain=this.subdomain.substring(0,n))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){let n={Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password};this.authService.login(n).subscribe(e=>{this.onSuccessLogin(e)})}onLoginByGoogle(n){let e=`${this.subdomain}${this.domain}`;this.authService.loginWithGoogle(n,e).subscribe(s=>{this.onSuccessLogin(s)})}onSuccessLogin(n){this.ngxPermission.hasPermission([ue.dashboardView]).then(e=>{e?this._router.navigate(["menu/dashboard"]):n?.TotalChannel<1?this._router.navigate(["menu/channel"]):this._router.navigate(["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType=this.passwordType==="text"?"password":"text",this.passwordIcon=this.passwordIcon==="fa-eye"?"fa-eye-slash":"fa-eye"}ngOnDestroy(){document.body.classList.remove("login-body")}};t.\u0275fac=function(e){return new(e||t)(p(v),p(te),p(we),p(be),p(he))},t.\u0275cmp=x({type:t,selectors:[["app-login"]],viewQuery:function(e,s){if(e&1&&W(Ae,5),e&2){let h;q(h=H())&&(s.subdomainEl=h.first)}},decls:19,vars:7,consts:[["USERNAME_PASSWORD",""],["subdomainEl",""],["usernameCtrl","ngModel"],["passwordCtrl","ngModel"],[1,"container-fluid"],[1,"row","mx-auto","bg-white","login-pane"],[1,"col-md-5","order-md-first","order-last","border-end","features-pane","pt-12","pb-9"],[1,"fw-normal","fs-2","header-title","text-center"],[3,"newsList"],[1,"col-md-7","order-md-last","order-first","py-12","sign-in-pane"],[4,"ngIf","ngIfElse"],[1,"d-flex","copyright",2,"margin-left","20px"],[1,"align-self-center","me-5"],["target","_blank","href","http://www.dealpos.com"],[1,"version",2,"margin-right","18px"],["target","_blank",1,"text-dark","fst-italic",3,"href"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],[1,"text-md-start","text-center"],[1,"fs-2","header-title","me-2","fw-normal"],[1,"text-secondary-emphasis","fst-italic",2,"font-size","11px"],[2,"margin-top","38px"],[1,"form-block","mt-5"],[1,"input-group","input-group-lg","mt-8"],[1,"input-group-text","rounded-start","border-end-0",2,"width","52px"],[1,"fa-solid","fa-cloud"],["placeholder","Store Address","aria-label","Store Address","aria-describedby","basic-addon1","autofocus","","name","Store Address",1,"form-control","form-control-lg","rounded-end-0","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],["name","domainOption",1,"form-select","form-control","form-control-lg","border-start-0","border-start","rounded-end","rounded-start-0","domain-option",2,"height","58px",3,"ngModelChange","ngModel"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],["value",".dealpos.app"],[1,"w-100",2,"margin-top","1.8rem"],["name","next","data-cy","next","type","submit",1,"btn","btn-xl","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-center",2,"margin-top","2.1rem"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[4,"ngFor","ngForOf"],[1,""],[1,"border-0",2,"width","34px","height","34px",3,"src","title","alt"],[1,"d-flex","align-items-center","justify-content-start","mb-2"],[1,"robotoslab","fw-normal"],[1,"ms-2","fw-normal"],[1,"me-2","robotoslab","d-inline-block","text-success"],["title","Edit Store Address",1,"fa-solid","fa-edit","link-success","fs-5","pointer",3,"click"],[2,"margin-top","29px"],[1,"input-group","input-group-lg"],[1,"fas","fa-user","fa-lg"],["id","txtUsername","type","text","data-cy","username","required","","placeholder","Username","aria-label","Username","aria-describedby","basic-addon1","autofocus","","name","username",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"fas","fa-key","fa-lg"],["id","txtPassword","data-cy","password","placeholder","Password","aria-label","Password","aria-describedby","basic-addon1","autofocus","","name","password","required","",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","type","ngClass","ngModel"],["class","input-group-text border-start-0 rounded-end",4,"ngIf"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-success","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"d-flex","justify-content-start","w-50","mb-4",2,"height","16px"],[2,"width","52px"],[1,"text-danger","ps-1"],[1,"input-group-text","border-start-0","rounded-end"],[3,"class","click",4,"ngIf"],[3,"click"]],template:function(e,s){if(e&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"h3",7),a(4,"New Features"),r(),l(5,"POS-news-swiper",8),Q(6,"async"),r(),i(7,"div",9),f(8,De,30,3,"ng-container",10)(9,qe,36,12,"ng-template",null,0,$),r()(),i(11,"div",11)(12,"span",12),a(13,"powered by :"),r(),l(14,"a",13),r(),i(15,"div",14)(16,"a",15),a(17),l(18,"i",16),r()()()),e&2){let h=P(10);c(5),m("newsList",K(6,5,s.news$)),c(3),m("ngIf",s.loginState=="FORM_DOMAIN")("ngIfElse",h),c(8),m("href",s.changelogUrl,w),c(),B("version ",s.version,"")}},dependencies:[J,D,X,se,ce,le,ne,de,ie,oe,pe,ae,re,Me,Z],styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}"]});let o=t;return o})();var Pe=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.shopID=n.shop_id,this.code=n.code})}addShopee(){let n={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",n).subscribe(s=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-t",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Shopee"),r(),i(13,"div"),a(14," Your shopID is "),i(15,"span",8),a(16),r()(),i(17,"button",9),u("click",function(){return s.addShopee()}),l(18,"i",10),a(19," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.shopID))},styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});let o=t;return o})();var ye=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.code=n.code,this.state=n.state})}addChannelTiktok(){let n={Code:this.code};this.http.post("/api/ChannelAdd/AddTiktok",n).subscribe(e=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Tiktok"),r(),i(13,"div"),a(14," Your Code is "),i(15,"span",8),a(16),r()(),i(17,"div"),a(18," Your State is "),i(19,"span",8),a(20),r()(),i(21,"button",9),u("click",function(){return s.addChannelTiktok()}),l(22,"i",10),a(23," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.code),c(4),C(s.state))},styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});let o=t;return o})();var He=[{path:"",component:Oe,data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:Pe,data:{title:"Success"}},{path:"tiktok",component:ye,data:{title:"Success"}},{path:"lazada",component:ve,data:{title:"Success"}}],Se=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=N({type:t}),t.\u0275inj=A({imports:[j.forChild(He),j]});let o=t;return o})();var yt=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=N({type:t}),t.\u0275inj=A({imports:[ee,me,Se,_e,xe]});let o=t;return o})();export{yt as LoginModule};
|
|
1
|
+
import{e as _e}from"./chunk-2Y4N4NSS.js";import{a as ue}from"./chunk-662E5VTA.js";import{b as fe,g as be}from"./chunk-YERME2YY.js";import{b as te,e as y}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{c as ne,h as ie,i as oe,j as re,k as ae,l as se,o as de,p as ce,q as le,r as pe,u as me}from"./chunk-F5YRASNU.js";import{a as M,c as ge,d as he,f as xe}from"./chunk-2UXFUEON.js";import{$ as R,Bb as W,Cb as q,Db as H,Eb as P,Fb as a,Gb as C,Ha as w,Hb as B,Ia as c,Ib as Y,Ja as p,Jb as I,Kb as L,Lb as T,Q as F,Qb as G,Wb as Q,Xb as K,Ya as f,Zb as $,_a as m,aa as A,bd as S,cb as U,dd as v,ga as x,gd as j,ha as N,kb as i,lb as r,mb as l,nb as k,oa as b,ob as E,pa as _,pc as J,qb as z,rc as D,sc as X,tb as u,vb as g,vc as Z,zc as ee}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var ve=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.code=n.code})}addChannelLazada(){let n={Code:this.code};this.http.post("/api/ChannelAdd/AddLazada",n).subscribe(e=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Lazada"),r(),i(13,"div"),a(14," Your Code is "),i(15,"span",8),a(16),r()(),i(17,"button",9),u("click",function(){return s.addChannelLazada()}),l(18,"i",10),a(19," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.code))}});let o=t;return o})();var we=(()=>{let t=class t{constructor(){}getBrowserName(){let n=window.navigator.userAgent.toLowerCase();switch(!0){case(n.indexOf("edge")>-1||n.indexOf("edg")>-1):return"edge";case n.indexOf("opr")>-1:return"opera";case n.indexOf("chrome")>-1:return"chrome";case n.indexOf("trident")>-1:return"ie";case n.indexOf("firefox")>-1:return"firefox";case n.indexOf("safari")>-1:return"safari";default:return"other"}}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"});let o=t;return o})();function Le(o,t){if(o&1&&(i(0,"swiper-slide")(1,"div")(2,"a",2),l(3,"img",3),r()(),i(4,"a",4),a(5),r(),i(6,"p",5),a(7),r()()),o&2){let d=t.$implicit;c(2),m("href",d.href,w),c(),m("src",d.imgSrc,w),c(),m("href",d.href,w),c(),C(d.title),c(2),C(d.description)}}var Me=(()=>{let t=class t{constructor(){this.newsList=[]}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=x({type:t,selectors:[["POS-news-swiper"]],inputs:{newsList:"newsList"},decls:2,vars:1,consts:[["pagination","true","pagination-clickable","true","autoplay-delay","5000","autoplay-disable-on-interaction","false",2,"margin-top","30px"],[4,"ngFor","ngForOf"],["target","_blank",3,"href"],[1,"border-0","rounded-1","mb-8",2,"width","252px","height","152px",3,"src"],["target","_blank",1,"fw-bold","h5","text-success","header-title","fs-4",3,"href"],[2,"margin-bottom","3rem"]],template:function(e,s){e&1&&(i(0,"swiper-container",0),f(1,Le,8,5,"swiper-slide",1),r()),e&2&&(c(),m("ngForOf",s.newsList))},dependencies:[D],styles:["swiper-container[_ngcontent-%COMP%]{--swiper-pagination-bullet-inactive-color: #89b03e;--swiper-pagination-color: #89b03e}"]});let o=t;return o})();var Ae=["subdomainEl"],Ne=(o,t)=>({"rounded-end":o,"border-end-0":t});function ze(o,t){if(o&1&&(k(0),i(1,"div",36),l(2,"img",37),r(),E()),o&2){let d=t.$implicit;c(2),m("src",d.img,w)("title",d.title)("alt",d.title)}}function De(o,t){if(o&1){let d=z();k(0),i(1,"div",17)(2,"h3",18),a(3," DealPOS Omnichannel "),r(),i(4,"small",19),a(5," Multichannel Inventory Management Software "),r()(),i(6,"form",20)(7,"div",21)(8,"div",22)(9,"div",23)(10,"span"),l(11,"i",24),r()(),i(12,"input",25,1),T("ngModelChange",function(e){b(d);let s=g();return L(s.subdomain,e)||(s.subdomain=e),_(e)}),r(),i(14,"div")(15,"select",26),T("ngModelChange",function(e){b(d);let s=g();return L(s.domain,e)||(s.domain=e),_(e)}),i(16,"option",27),a(17,".dealpos.co.id"),r(),i(18,"option",28),a(19,".dealpos.net"),r(),i(20,"option",29),a(21,".dealpos.com"),r(),i(22,"option",30),a(23,".dealpos.app"),r()()()(),i(24,"div",31)(25,"button",32),u("click",function(){b(d);let e=g();return _(e.onNextState())}),a(26," Next "),r()(),i(27,"div",33)(28,"div",34),f(29,ze,3,3,"ng-container",35),r()()()(),E()}if(o&2){let d=g();c(12),I("ngModel",d.subdomain),c(3),I("ngModel",d.domain),c(14),m("ngForOf",d.channels)}}function je(o,t){o&1&&(i(0,"p"),a(1," Username is required "),r())}function Ve(o,t){if(o&1&&(k(0),i(1,"div",57),l(2,"div",58),i(3,"div",59),f(4,je,2,0,"p",47),r()(),E()),o&2){g();let d=P(14);c(4),m("ngIf",d.errors.required)}}function Fe(o,t){if(o&1){let d=z();i(0,"i",62),u("click",function(){b(d);let e=g(3);return _(e.hideShowPassword())}),r()}if(o&2){let d=g(3);U("fa "+d.passwordIcon)}}function Re(o,t){if(o&1&&(i(0,"span",60),f(1,Fe,1,2,"i",61),r()),o&2){let d=g(2);c(),m("ngIf",d.password)}}function Ue(o,t){o&1&&(i(0,"p"),a(1," Password is required "),r())}function We(o,t){if(o&1&&(k(0),i(1,"div",57),l(2,"div",58),i(3,"div",59),f(4,Ue,2,0,"p",47),r()(),E()),o&2){g();let d=P(21);c(4),m("ngIf",d.errors.required)}}function qe(o,t){if(o&1){let d=z();i(0,"div",38)(1,"h3",39),a(2,"Sign in"),r(),i(3,"h3",40),a(4," to "),i(5,"h6",41),a(6),r(),i(7,"i",42),u("click",function(){b(d);let e=g();return _(e.onEditDomain())}),r()()(),i(8,"form",43)(9,"div",44)(10,"div",23)(11,"span"),l(12,"i",45),r()(),i(13,"input",46,2),T("ngModelChange",function(e){b(d);let s=g();return L(s.username,e)||(s.username=e),_(e)}),r()(),f(15,Ve,5,1,"ng-container",47),i(16,"div",22)(17,"div",23)(18,"span"),l(19,"i",48),r()(),i(20,"input",49,3),T("ngModelChange",function(e){b(d);let s=g();return L(s.password,e)||(s.password=e),_(e)}),r(),f(22,Re,2,1,"span",50),r(),f(23,We,5,1,"ng-container",47),i(24,"div",51)(25,"button",52),u("click",function(){b(d);let e=g();return _(e.onLogin())}),a(26," Log in "),r()(),i(27,"div",53),l(28,"hr"),i(29,"span",54),a(30,"or"),r(),l(31,"hr"),r(),i(32,"div")(33,"button",55),u("click",function(e){b(d);let s=g();return _(s.onLoginByGoogle(e))}),l(34,"i",56),a(35," Sign In with Google "),r()()()}if(o&2){let d=P(14),n=P(21),e=g();c(6),Y(" (",e.subdomain,"",e.domain,") "),c(7),I("ngModel",e.username),c(2),m("ngIf",d.invalid&&(d.dirty||d.touched)),c(5),m("type",e.passwordType)("ngClass",G(9,Ne,e.browser=="edge",e.browser!="edge")),I("ngModel",e.password),c(2),m("ngIf",e.browser!="edge"),c(),m("ngIf",n.invalid&&(n.dirty||n.touched))}}var Oe=(()=>{let t=class t{constructor(n,e,s,h,ke){this._router=n,this.toastr=e,this.checkBrowser=s,this.authService=h,this.ngxPermission=ke,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="fa-eye",this.channels=[{title:"Shopee",img:M.SHOOPE},{title:"Tokopedia",img:M.TOKOPEDIA},{title:"Tiktok",img:M.TIKTOK},{title:"Woocommerce",img:M.WOOCOMMERCE},{title:"Lazada",img:M.LAZADA},{title:"Shopify",img:M.SHOPIFY}],this.version=fe.version,this.news$=h.getNews().pipe(F(1))}ngOnInit(){this.initLogin(),this.browser=this.checkBrowser.getBrowserName(),document.body.classList.add("login-body"),this.initChangeLogUrl()}initChangeLogUrl(){let n=`https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete&v=${this.version}`;this.changelogUrl=n}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){let n=JSON.parse(localStorage.getItem("Authorization"));if(n){this.username=n?.username,this.subdomain=n?.Host?.split(".")[0];let e=n?.Host?.split("dealpos");this.domain=`.dealpos${e[1]}`,this.authService.isActiveToken()&&this._router.navigate(["menu"])}}onNextState(){if(ge.IsEmpty(this.subdomain)){this.toastr.warning("Account Domain is required","Warning");return}this.parseSubdomain(),this.loginState="FORM_AUTH"}parseSubdomain(){let n=this.subdomain.indexOf(".dealpos");n!=-1&&(this.subdomain=this.subdomain.substring(0,n))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){let n={Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password};this.authService.login(n).subscribe(e=>{this.onSuccessLogin(e)})}onLoginByGoogle(n){let e=`${this.subdomain}${this.domain}`;this.authService.loginWithGoogle(n,e).subscribe(s=>{this.onSuccessLogin(s)})}onSuccessLogin(n){this.ngxPermission.hasPermission([ue.dashboardView]).then(e=>{e?this._router.navigate(["menu/dashboard"]):n?.TotalChannel<1?this._router.navigate(["menu/channel"]):this._router.navigate(["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType=this.passwordType==="text"?"password":"text",this.passwordIcon=this.passwordIcon==="fa-eye"?"fa-eye-slash":"fa-eye"}ngOnDestroy(){document.body.classList.remove("login-body")}};t.\u0275fac=function(e){return new(e||t)(p(v),p(te),p(we),p(be),p(he))},t.\u0275cmp=x({type:t,selectors:[["app-login"]],viewQuery:function(e,s){if(e&1&&W(Ae,5),e&2){let h;q(h=H())&&(s.subdomainEl=h.first)}},decls:19,vars:7,consts:[["USERNAME_PASSWORD",""],["subdomainEl",""],["usernameCtrl","ngModel"],["passwordCtrl","ngModel"],[1,"container-fluid"],[1,"row","mx-auto","bg-white","login-pane"],[1,"col-md-5","order-md-first","order-last","border-end","features-pane","pt-12","pb-9"],[1,"fw-normal","fs-2","header-title","text-center"],[3,"newsList"],[1,"col-md-7","order-md-last","order-first","py-12","sign-in-pane"],[4,"ngIf","ngIfElse"],[1,"d-flex","copyright",2,"margin-left","20px"],[1,"align-self-center","me-5"],["target","_blank","href","http://www.dealpos.com"],[1,"version",2,"margin-right","18px"],["target","_blank",1,"text-dark","fst-italic",3,"href"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],[1,"text-md-start","text-center"],[1,"fs-2","header-title","me-2","fw-normal"],[1,"text-secondary-emphasis","fst-italic",2,"font-size","11px"],[2,"margin-top","38px"],[1,"form-block","mt-5"],[1,"input-group","input-group-lg","mt-8"],[1,"input-group-text","rounded-start","border-end-0",2,"width","52px"],[1,"fa-solid","fa-cloud"],["placeholder","Store Address","aria-label","Store Address","aria-describedby","basic-addon1","autofocus","","name","Store Address",1,"form-control","form-control-lg","rounded-end-0","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],["name","domainOption",1,"form-select","form-control","form-control-lg","border-start-0","border-start","rounded-end","rounded-start-0","domain-option",2,"height","58px",3,"ngModelChange","ngModel"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],["value",".dealpos.app"],[1,"w-100",2,"margin-top","1.8rem"],["name","next","data-cy","next","type","submit",1,"btn","btn-xl","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"d-flex","align-items-center","justify-content-center",2,"margin-top","2.1rem"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[4,"ngFor","ngForOf"],[1,""],[1,"border-0",2,"width","34px","height","34px",3,"src","title","alt"],[1,"d-flex","align-items-center","justify-content-start","mb-2"],[1,"robotoslab","fw-normal"],[1,"ms-2","fw-normal"],[1,"me-2","robotoslab","d-inline-block","text-success"],["title","Edit Store Address",1,"fa-solid","fa-edit","link-success","fs-5","pointer",3,"click"],[2,"margin-top","29px"],[1,"input-group","input-group-lg"],[1,"fas","fa-user","fa-lg"],["id","txtUsername","type","text","data-cy","username","required","","placeholder","Username","aria-label","Username","aria-describedby","basic-addon1","autofocus","","name","username",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"fas","fa-key","fa-lg"],["id","txtPassword","data-cy","password","placeholder","Password","aria-label","Password","aria-describedby","basic-addon1","autofocus","","name","password","required","",1,"form-control","form-control-lg","rounded-end","border-start-0","ps-1",2,"height","58px",3,"ngModelChange","type","ngClass","ngModel"],["class","input-group-text border-start-0 rounded-end",4,"ngIf"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-success","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-success","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"d-flex","justify-content-start","w-50","mb-4",2,"height","16px"],[2,"width","52px"],[1,"text-danger","ps-1"],[1,"input-group-text","border-start-0","rounded-end"],[3,"class","click",4,"ngIf"],[3,"click"]],template:function(e,s){if(e&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"h3",7),a(4,"New Features"),r(),l(5,"POS-news-swiper",8),Q(6,"async"),r(),i(7,"div",9),f(8,De,30,3,"ng-container",10)(9,qe,36,12,"ng-template",null,0,$),r()(),i(11,"div",11)(12,"span",12),a(13,"powered by :"),r(),l(14,"a",13),r(),i(15,"div",14)(16,"a",15),a(17),l(18,"i",16),r()()()),e&2){let h=P(10);c(5),m("newsList",K(6,5,s.news$)),c(3),m("ngIf",s.loginState=="FORM_DOMAIN")("ngIfElse",h),c(8),m("href",s.changelogUrl,w),c(),B("version ",s.version,"")}},dependencies:[J,D,X,se,ce,le,ne,de,ie,oe,pe,ae,re,Me,Z],styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}"]});let o=t;return o})();var Pe=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.shopID=n.shop_id,this.code=n.code})}addShopee(){let n={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",n).subscribe(s=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-t",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Shopee"),r(),i(13,"div"),a(14," Your shopID is "),i(15,"span",8),a(16),r()(),i(17,"button",9),u("click",function(){return s.addShopee()}),l(18,"i",10),a(19," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.shopID))},styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});let o=t;return o})();var ye=(()=>{let t=class t{constructor(n,e,s){this.route=n,this.http=e,this.service=s}ngOnInit(){this.route.queryParams.subscribe(n=>{this.code=n.code,this.state=n.state})}addChannelTiktok(){let n={Code:this.code};this.http.post("/api/ChannelAdd/AddTiktok",n).subscribe(e=>{this.service.navigate(["/menu/channel"])})}};t.\u0275fac=function(e){return new(e||t)(p(S),p(y),p(v))},t.\u0275cmp=x({type:t,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,s){e&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),l(5,"i",5),i(6,"div",6),a(7,"Success !"),r()(),i(8,"div",7)(9,"div"),a(10,"You have successfully authorized "),r(),i(11,"div"),a(12,"DEALPOS to manage your Tiktok"),r(),i(13,"div"),a(14," Your Code is "),i(15,"span",8),a(16),r()(),i(17,"div"),a(18," Your State is "),i(19,"span",8),a(20),r()(),i(21,"button",9),u("click",function(){return s.addChannelTiktok()}),l(22,"i",10),a(23," Add to my Channel"),r()()()()()()),e&2&&(c(16),C(s.code),c(4),C(s.state))},styles:[".login-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:115px}@media (max-width: 768px){.login-pane[_ngcontent-%COMP%]{margin-top:0}}@media only screen and (max-width: 1300px) and (min-width: 1024px){.login-pane[_ngcontent-%COMP%]{margin-top:30px}}.header-title[_ngcontent-%COMP%]{font-family:Roboto Slab}.carousel-inner[_ngcontent-%COMP%]{height:310px}.carousel-inner[_ngcontent-%COMP%] div.carousel-item[_ngcontent-%COMP%]{top:28px}@media (max-width: 820px){.carousel-indicators[_ngcontent-%COMP%]{bottom:-8px}}.carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{background-color:#ddd;width:1.25rem;height:.375rem;transition:.3s}.carousel-indicators[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--bs-success)}.sign-in-pane[_ngcontent-%COMP%]{padding:0 3rem 0 3.5rem}@media (max-width: 768px){.sign-in-pane[_ngcontent-%COMP%]{padding:24px 12px}.sign-in-pane[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:8px!important}}@media (min-width: 1200px){.sign-in-pane[_ngcontent-%COMP%]{border-bottom:1px solid #89b03e;border-right:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:0 10px 10px 0}}.subscription.danger[_ngcontent-%COMP%]{background-color:#f2dede;border-color:#eb415d;color:#a94442}.subscription.warning[_ngcontent-%COMP%]{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}@media (max-width: 768px){.features-pane[_ngcontent-%COMP%]{border-right:0px!important}}@media (min-width: 1200px){.features-pane[_ngcontent-%COMP%]{border-left:1px solid #89b03e;border-bottom:1px solid #89b03e;border-top:1px solid #89b03e;border-radius:10px 0 0 10px}}.copyright[_ngcontent-%COMP%]{position:absolute;bottom:1.25rem;left:1.25rem}.copyright[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{width:8.125rem;height:2.5rem;background-image:url(//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png);background-position:left top;background-repeat:no-repeat;background-size:contain}.version[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem;position:absolute}@media (max-width: 768px){.copyright[_ngcontent-%COMP%], .version[_ngcontent-%COMP%]{position:static;margin-top:10px}.copyright[_ngcontent-%COMP%]{justify-content:center}}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%], .btn-login[_ngcontent-%COMP%]{border:1px solid var(--bs-success)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited i[_ngcontent-%COMP%]{color:#f4f4f4!important}.version[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:visited{margin-left:-10px}.domain-option[_ngcontent-%COMP%]{padding:.75rem;color:#343434;font-size:.875rem;width:8.5rem}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});let o=t;return o})();var He=[{path:"",component:Oe,data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:Pe,data:{title:"Success"}},{path:"tiktok",component:ye,data:{title:"Success"}},{path:"lazada",component:ve,data:{title:"Success"}}],Se=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=N({type:t}),t.\u0275inj=A({imports:[j.forChild(He),j]});let o=t;return o})();var yt=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=N({type:t}),t.\u0275inj=A({imports:[ee,me,Se,_e,xe]});let o=t;return o})();export{yt as LoginModule};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as R}from"./chunk-FX43R2N5.js";import{a as Ce,b as he,d as fe,e as xe}from"./chunk-2Y4N4NSS.js";import{a as $}from"./chunk-BSBYMQ7J.js";import{a as Ve,b as j,c as De}from"./chunk-Y2XXDDNX.js";import"./chunk-662E5VTA.js";import{a as Te,c as Ee}from"./chunk-NNPT3RN6.js";import{a as Me,b as Fe}from"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as Pe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as ge}from"./chunk-YERME2YY.js";import{b as le,e as re}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as ye,k as Ie,l as we,m as be}from"./chunk-PIDUM6XT.js";import{t as Se,u as ve}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{b as se,c as pe,h as ce,k as me,m as _e,u as de}from"./chunk-F5YRASNU.js";import{c as D,f as ue}from"./chunk-2UXFUEON.js";import{B as z,Eb as O,Fb as c,Gb as V,Ha as M,Hb as P,Ia as s,Ib as Z,Ja as T,Jb as I,Kb as w,Lb as b,Mb as X,Nb as q,Pb as k,Q as G,Wb as C,X as B,Xb as f,Ya as u,Yb as N,Zb as U,_a as m,da as H,fb as v,ga as Y,gb as L,ib as A,jb as W,kb as o,lb as l,mb as x,nb as F,oa as _,ob as E,pa as d,pc as J,qb as y,rc as ee,sc as ne,tb as S,vb as r,vc as te,wc as ie,yb as K,yc as ae,zc as oe}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Re=t=>({"text-decoration-line-through":t}),Be=t=>({"ms-10":t}),Le=t=>({"bg-gradient-warning":t});function Ae(t,p){if(t&1){let e=y();o(0,"button",37),S("click",function(){_(e);let n=r().ngIf,a=r(2);return d(a.updateStock(n))}),x(1,"i",38),c(2," Update "),l()}}function We(t,p){if(t&1&&(o(0,"div"),u(1,Ae,3,0,"button",36),l()),t&2){let e=p.ngIf,i=r(2);s(),m("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(t,p){if(t&1&&(o(0,"span",39),x(1,"img",40),l(),c(2)),t&2){let e=p.item;s(),m("src",e==null?null:e.Img,M),s(),P(" ",e.Name," ")}}function Ue(t,p){t&1&&(o(0,"div",41)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function $e(t,p){if(t&1){let e=y();o(0,"th")(1,"input",42),b("ngModelChange",function(n){_(e);let a=r(2);return w(a.checkboxState,n)||(a.checkboxState=n),d(n)}),S("ngModelChange",function(){let n=_(e).ngIf,a=r(2);return d(a.onCheckboxStateChange(n))}),l()()}if(t&2){let e=r(2);s(),I("ngModel",e.checkboxState)}}function je(t,p){t&1&&(o(0,"th",33),c(1," Reserved "),l())}function Qe(t,p){}function ze(t,p){if(t&1){let e=y();o(0,"input",61),b("ngModelChange",function(n){_(e);let a=r(3).$implicit;return w(a.selected,n)||(a.selected=n),d(n)}),S("ngModelChange",function(){_(e);let n=r(3).$implicit,a=r(2);return d(a.onCheckboxStateProduct(n))}),l()}if(t&2){let e=r(3).$implicit;I("ngModel",e.selected)}}function Ge(t,p){if(t&1){let e=y();o(0,"img",62),S("click",function(n){_(e);let a=r(3).$implicit,h=r(2);return d(h.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(t&2){let e=r(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,M)}}function He(t,p){t&1&&x(0,"img",58)}function Ye(t,p){if(t&1&&(x(0,"br"),o(1,"div",63),x(2,"i",64),o(3,"small"),c(4),l()()),t&2){let e=r(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(t,p){if(t&1&&(o(0,"td",54)(1,"div",15),u(2,ze,1,1,"input",55),o(3,"div",56),u(4,Ge,1,1,"img",57)(5,He,1,0,"img",58),l()()(),o(6,"td",59)(7,"span",60),c(8),l(),u(9,Ye,5,1),l()),t&2){let e=r(2).$implicit,i=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),v(e.Variants.length>1?2:-1),s(),m("ngClass",k(7,Be,e.Variants.length<=1)),s(),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(t,p){if(t&1){let e=y();o(0,"input",42),b("ngModelChange",function(n){_(e);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),d(n)}),l()}if(t&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Xe(t,p){if(t&1&&u(0,Ze,1,1,"input",48),t&2){let e=r().$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(t,p){if(t&1){let e=y();o(0,"input",42),b("ngModelChange",function(n){_(e);let a=r().$implicit;return w(a.selected,n)||(a.selected=n),d(n)}),l()}if(t&2){let e=r().$implicit;I("ngModel",e.selected)}}function Je(t,p){t&1&&(o(0,"div",65),c(1," Not Found "),l())}function en(t,p){if(t&1&&(o(0,"div")(1,"span",66),c(2),C(3,"number"),l(),c(4," => "),o(5,"span",67),c(6),C(7,"number"),l()()),t&2){let e=r().$implicit;s(2),P(" ",f(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(f(7,4,e==null?null:e.Inventory))}}function nn(t,p){if(t&1&&(c(0),C(1,"number")),t&2){let e=r().$implicit;P(" ",f(1,1,e==null?null:e.Inventory)," ")}}function tn(t,p){if(t&1&&(F(0),o(1,"div",68)(2,"a",69),x(3,"i",70),l()(),E()),t&2){let e=r().$implicit,i=r(3);s(2),m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),M)}}function an(t,p){if(t&1){let e=y();o(0,"span",75),S("click",function(){let n=_(e).ngIf,a=r(2).$implicit,h=r().$implicit,g=r(2);return d(g.openTableDialog(h,a,n))}),c(1),C(2,"number"),l()}if(t&2){let e=r(2).$implicit;s(),P(" ",f(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function on(t,p){if(t&1){let e=y();o(0,"td",71)(1,"div",49)(2,"div"),u(3,an,3,3,"span",72),C(4,"async"),l(),o(5,"div",68)(6,"a",69),x(7,"i",70),l()(),o(8,"div",68)(9,"span",73),S("click",function(){_(e);let n=r().$implicit,a=r(3);return d(a.refreshInventory(n==null||n.Channel[0]==null?null:n.Channel[0].ChannelItemID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelVariationID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelID,n==null?null:n.ID))}),x(10,"i",74),l()()()()}if(t&2){let e=r().$implicit,i=r(3);m("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",f(4,3,i.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,M)}}function ln(t,p){if(t&1&&(F(0),o(1,"span",76),c(2),C(3,"number"),l(),E()),t&2){let e=r(2).$implicit;s(2),P(" (",f(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rn(t,p){t&1&&c(0," - ")}function sn(t,p){if(t&1&&(F(0),o(1,"td",45),u(2,ln,4,3,"ng-container",53)(3,rn,1,0,"ng-template",null,1,U),l(),E()),t&2){let e=O(4),i=r().$implicit;s(2),m("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function pn(t,p){t&1&&(F(0),c(1," - "),E())}function cn(t,p){if(t&1&&(o(0,"span",77),C(1,"date"),c(2),C(3,"date"),l()),t&2){let e=r().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mn(t,p){if(t&1&&(o(0,"tr"),u(1,Ke,10,9),o(2,"td",44),c(3),l(),o(4,"td",45)(5,"span",46),c(6),l()(),o(7,"td",47),u(8,Xe,1,1)(9,qe,1,1,"input",48),l(),o(10,"td")(11,"div",49),u(12,Je,2,0,"div",50)(13,en,8,6,"div")(14,nn,2,3)(15,tn,4,1,"ng-container",5),l()(),u(16,on,11,7,"td",51)(17,sn,5,2,"ng-container",5),o(18,"td",52),u(19,pn,2,0,"ng-container",53)(20,cn,4,8,"ng-template",null,0,U),l()()),t&2){let e=p.$implicit,i=p.index,n=O(21),a=r(3);s(),v(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?a.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),v((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",a.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",n)}}function _n(t,p){if(t&1&&(o(0,"tbody"),A(1,Qe,0,0,null,null,L),u(3,mn,22,16,"tr",43),l()),t&2){let e=p.$implicit;s(),W(e.Variants),s(2),m("ngForOf",e.Variants)}}function dn(t,p){if(t&1){let e=y();o(0,"mainpanel",3),S("onSubmit",function(n){_(e);let a=r();return d(a.onSearch(n))}),o(1,"actions")(2,"div",4),u(3,We,2,1,"div",5),C(4,"async"),l()(),o(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),o(9,"ng-select",7),b("ngModelChange",function(n){_(e);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),d(n)}),u(10,Oe,3,2,"ng-template",8),l()(),o(11,"div",9)(12,"label",10),c(13,"PageNumber"),l(),o(14,"input",11),b("ngModelChange",function(n){_(e);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),d(n)}),l()(),o(15,"div",9)(16,"label",12),c(17,"Page Size"),l(),o(18,"input",13),b("ngModelChange",function(n){_(e);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),d(n)}),l()(),o(19,"div",9)(20,"label",14),c(21,"Quantity From - To"),l(),o(22,"div",15)(23,"input",16),b("ngModelChange",function(n){_(e);let a=r();return w(a.searchFilter.QuantityFrom,n)||(a.searchFilter.QuantityFrom=n),d(n)}),l(),c(24," - "),o(25,"input",17),b("ngModelChange",function(n){_(e);let a=r();return w(a.searchFilter.QuantityTo,n)||(a.searchFilter.QuantityTo=n),d(n)}),l()()()(),o(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),o(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),c(35," Product "),x(36,"br"),o(37,"mat-slide-toggle",25),S("toggleChange",function(){_(e);let n=r();return n.showDifferenceStock=!n.showDifferenceStock,d(n.onShowDifferenceStock())}),o(38,"small",14),c(39,"FILTER DIFFERENT INVENTORY"),l()()(),o(40,"th",26),c(41,"Variant"),l(),o(42,"th",27),c(43,"SKU"),l(),u(44,$e,2,1,"th",5),C(45,"async"),o(46,"th",28),c(47,"POS"),l(),o(48,"th",29)(49,"div",30),S("click",function(){_(e);let n=r();return d(n.openModalFilter())}),x(50,"img",31),o(51,"span",32),c(52),C(53,"stringLimit"),l()()(),u(54,je,2,0,"th",33),o(55,"th",34),c(56,"Last Sync"),l()()(),A(57,_n,4,1,"tbody",null,L),C(59,"async"),l(),o(60,"infinite-paginator",35),C(61,"async"),S("onNextPage",function(){_(e);let n=r();return d(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(e);let n=r();return d(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(e);let n=r();return d(n.infinitePagination.getRowCount(n.searchFilter))}),l()()()()()()}if(t&2){let e=r();m("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),m("ngIf",f(4,24,e.products$)),s(6),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),m("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),m("ngIf",f(45,26,e.products$)),s(5),m("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),m("src",e.selectedChannel==null?null:e.selectedChannel.Img,M),s(2),Z(" ",N(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),s(2),v(e.isShowReservedColumn?54:-1),s(3),W(f(59,31,e.products$)),s(3),m("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",f(61,33,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var Hn=(()=>{let p=class p{constructor(i,n,a,h,g,Q,ke,Ne){this.http=i,this.toastr=n,this.dialog=a,this.productService=h,this.authService=g,this.biggerPictureService=Q,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H(j),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,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}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let n=0,a;i.forEach(h=>{a=h.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
|
+
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(i=>i.ID==this.searchFilter.ChannelID)}onSearch(i){this.searchFilter.text=i,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(i){let n=this.productService.selectedVariantProduct(i);if(n.length>0){let a=n.map(g=>({ID:g.ID,Code:g.Code,Inventory:g.Inventory})),h={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",h).subscribe(g=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(g)})}}handlingUpdateStock(i){if(i[0]?.StatusProduct){let n=i[0].StatusProduct.Fail_list,a=i[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,n)}else this.toastr.error(i[0]?.Exception,"Error")}refreshInventory(i,n,a,h){let g={ChannelItemID:i,ChannelVariationID:n,ChannelID:a,VariantID:h};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(Q=>{this.toastr.success("Successfully updated","Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(i){i.Variants=i.Variants.map(n=>(n.Inventory>=0&&(n.selected=i.selected),n))}onCheckboxStateChange(i){i=i.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(i,n,a){this.dialog.open(Ve,{data:{Name:i.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:i.ChannelItemID}}).afterClosed().pipe(z(g=>D.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g,a)})}updateItemAfterDialog(i,n){let a={ID:i.ChannelID,ChannelItemID:i.ChannelItemID,ChannelVariantID:i.ChannelVariationID,NewQuantity:parseFloat(i.Inventory),VariantID:i.ID,SKU:i.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(h=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.handlingUpdateStock([h])})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=$.DIFFERENCE:this.searchFilter.filterModel=$.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}onZoomImage(i,n){this.biggerPictureService.openBiggerPicture(i,n)}};p.\u0275fac=function(n){return new(n||p)(T(re),T(le),T(ye),T(Te),T(ge),T(Pe),T(R),T(Ie))},p.\u0275cmp=Y({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([j,R]),q],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(n,a){n&1&&(u(0,dn,62,35,"mainpanel",2),C(1,"async")),n&2&&m("ngIf",f(1,1,a.loader$))},dependencies:[oe,J,ee,ne,te,ae,ie,be,we,xe,fe,Ce,he,de,pe,_e,se,ce,me,Ee,De,ue,Fe,Me,ve,Se],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}"]});let t=p;return t})();export{Hn as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,b as y}from"./chunk-7CEWM7GE.js";import{a as i}from"./chunk-
|
|
1
|
+
import{a as C,b as y}from"./chunk-7CEWM7GE.js";import{a as i}from"./chunk-QCFKCDKM.js";import"./chunk-YERME2YY.js";import"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import"./chunk-2UXFUEON.js";import{Ia as c,Nb as h,_a as d,aa as p,cd as v,ga as l,gd as r,ha as s,kb as u,lb as f,mb as a,zc as o}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var b=(()=>{let t=class t{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=l({type:t,selectors:[["app-inventory"]],standalone:!0,features:[h],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,M){n&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),f()()(),a(4,"router-outlet")),n&2&&(c(3),d("Tabs",M.inventoryTabs))},dependencies:[o,y,C,r,v],encapsulation:2});let e=t;return e})();var g=[{path:"",component:b,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-WQ26K26X.js").then(e=>e.MultiChannelComparison)},canActivate:[i],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-6OWGDOJP.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[i],data:{title:"Inventory Comparison"}}]}],E=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=s({type:t}),t.\u0275inj=p({imports:[o,r.forChild(g)]});let e=t;return e})();export{E as InventoryRoutingModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ce}from"./chunk-BRTVFFDI.js";import{a as oe}from"./chunk-662E5VTA.js";import{c as fe}from"./chunk-NNPT3RN6.js";import{a as ue,b as xe}from"./chunk-G6CZHXQI.js";import{c as de}from"./chunk-M4VGME5L.js";import{a as ge}from"./chunk-5WVUQE43.js";import{g as se}from"./chunk-AAIK6JQ3.js";import{g as ae}from"./chunk-IOH6ZWW2.js";import{d as me,g as pe}from"./chunk-PIDUM6XT.js";import{t as ce,u as _e}from"./chunk-43TMSPFC.js";import{b as ee,h as te,k as ne,u as ie}from"./chunk-F5YRASNU.js";import{e as re,f as le}from"./chunk-2UXFUEON.js";import{Eb as b,Fb as p,Gb as k,Ha as v,Hb as y,Ia as r,Ib as H,Ja as I,Jb as O,Kb as D,Lb as N,Nb as Z,Pb as T,V as L,Wb as $,Xb as R,Ya as s,Yb as K,Zb as w,_a as m,c as W,fb as P,ga as z,gb as E,ib as M,jb as V,kb as c,lb as _,mb as S,nb as x,oa as g,ob as f,pa as d,pb as U,pc as X,qb as C,rc as Y,sc as q,tb as h,uc as G,vb as a,yb as A,yc as J,za as B,zc as Q}from"./chunk-77JORVC2.js";var j=t=>[t],he=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=C();c(0,"mat-slide-toggle",14),h("toggleChange",function(){g(n);let e=a();return e.toggleStatus=!e.toggleStatus,d(e.onToggle())}),c(1,"small",15),p(2),_()()}if(t&2){let n=a();r(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Se(t,l){if(t&1){let n=C();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=a();return D(o.checkboxState,e)||(o.checkboxState=e),d(e)}),h("ngModelChange",function(){g(n);let e=a();return d(e.onCheckboxStateChange())}),_()()}if(t&2){let n=a();r(),O("ngModel",n.checkboxState)}}function ye(t,l){t&1&&(c(0,"th",11),p(1,"POS"),_())}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),S(4,"img",20),c(5,"div",21),p(6),$(7,"stringLimit"),_()()()(),f()),t&2){let n=l.$implicit;r(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),r(),m("src",n==null?null:n.Img,v),r(2),H(" ",K(7,4,n.Name,20),"",(n.Name==null?null:n.Name.length)>20?"...":""," ")}}function Fe(t,l){t&1&&U(0)}function Ie(t,l){if(t&1&&(x(0),s(1,Fe,1,0,"ng-container",34),f()),t&2){a();let n=b(7);r(),m("ngTemplateOutlet",n)}}function Pe(t,l){t&1&&U(0)}function Ee(t,l){if(t&1&&s(0,Pe,1,0,"ng-container",34),t&2){a(2);let n=b(7);m("ngTemplateOutlet",n)}}function Me(t,l){if(t&1&&s(0,Ee,1,1,"ng-template",12),t&2){let n=a(4);m("ngxPermissionsOnly",T(1,j,n.rolePriceEdit))}}function Ve(t,l){if(t&1){let n=C();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=a(4).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),h("ngModelChange",function(){g(n);let e=a(4).$implicit,o=a();return d(o.onCheckboxStateProduct(e.ID))}),_(),f()}if(t&2){let n=a(4).$implicit;r(),O("ngModel",n.selected)}}function ke(t,l){if(t&1&&s(0,Ve,2,1,"ng-container",22),t&2){let n=a(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Oe(t,l){if(t&1){let n=C();x(0),c(1,"img",36),h("click",function(e){g(n);let o=a(3).$implicit,u=a();return d(u.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),f()}if(t&2){let n=a(3).$implicit;r(),A("src",n==null?null:n.ThumbnailUrl,v)}}function De(t,l){t&1&&S(0,"img",37)}function Ne(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),s(3,Ie,2,1,"ng-container",31)(4,Me,1,3,"ng-template",null,0,w)(6,ke,1,1,"ng-template",null,1,w),c(8,"div",26),s(9,Oe,2,1,"ng-container",31)(10,De,1,0,"ng-template",null,2,w),_()()(),c(12,"td",32)(13,"div"),p(14),_(),c(15,"small",33),p(16),_()(),f()),t&2){let n=b(5),i=b(11),e=a(2).$implicit,o=a();r(),m("rowSpan",e==null?null:e.Variants.length),r(2),m("ngIf",o.table=="inventory")("ngIfElse",n),r(5),m("ngClass",T(9,Te,(e==null||e.Variants==null?null:e.Variants.length)<=1)),r(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",e==null?null:e.Variants.length),r(2),k(e==null?null:e.Name),r(2),y("(",e==null?null:e.Category,")")}}function $e(t,l){if(t&1){let n=C();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=a(2).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),_()}if(t&2){let n=a(2).$implicit;O("ngModel",n.selected)}}function Be(t,l){if(t&1&&(c(0,"td",38),s(1,$e,1,1,"input",39),_()),t&2){let n=a().$implicit,i=a(2);r(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Ue(t,l){if(t&1&&(c(0,"td",24),p(1),$(2,"number"),_()),t&2){let n=a().$implicit,i=a(2);r(),k(R(2,1,i.printPOS(n)))}}function Re(t,l){if(t&1){let n=C();x(0),c(1,"td",40),h("click",function(){g(n);let e=a().$implicit,o=a().$implicit,u=a().$implicit,F=a();return d(F.openTableDialog(u.Name,o,e.ID,u.ChannelItemID))}),c(2,"div",30)(3,"div",41),p(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),d(e==null?null:e.stopPropagation())}),S(7,"i",28),_()()(),f()}if(t&2){let n=l.$implicit,i=a(2).$implicit,e=a(2);r(),m("ngClass",T(5,be,e.printPOS(i)!=e.printItem(n))),r(3),y(" ",R(5,3,e.printItem(n))," "),r(2),m("href",n.Url,v)}}function je(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),p(3,"X"),_()()())}function We(t,l){if(t&1&&s(0,Re,8,7,"ng-container",31)(1,je,4,0,"ng-template",null,3,w),t&2){let n=l.$implicit,i=b(2),e=a().$implicit,o=a(2);m("ngIf",o.getItemFromChannel(e,n.ID))("ngIfElse",i)}}function Le(t,l){if(t&1&&(c(0,"tr"),s(1,Ne,17,11,"ng-container",22),c(2,"td",23),p(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),p(7),_(),c(8,"div",21)(9,"a",27),S(10,"i",28),_()()()(),s(11,Be,2,1,"ng-template",12)(12,Ue,3,3,"td",24),M(13,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=a(2);r(),m("ngIf",i==0),r(2),k(n==null?null:n.Model),r(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),r(),m("ngClass",T(8,he,n.Discontinued)),r(),y(" ",n.Code," "),r(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),r(2),m("ngxPermissionsOnly",T(10,j,e.rolePriceEdit)),r(),P(e.filter!=null&&e.filter.HiddenIPOSInventory?-1:12),r(),V(e.channel)}}function ze(t,l){if(t&1&&(c(0,"tbody"),M(1,Le,15,12,"tr",null,E),_()),t&2){let n=l.$implicit;r(),V(n.Variants)}}var ft=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new B,this.destroy$=new W,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(u=>(u.selected=o.selected,u)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(o=>o.ChannelID==e)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,u){this.dialog.open(Ce,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:u}}).afterClosed().pipe(L(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(I(me),I(ge),I(ae))},l.\u0275cmp=z({type:l,selectors:[["app-table"]],inputs:{filter:"filter",data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle"},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:18,vars:6,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),p(7,"Product"),_(),s(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),p(10,"Variant"),_(),c(11,"th",11),p(12,"SKU"),_(),s(13,Se,2,1,"ng-template",12)(14,ye,2,0,"th",11)(15,we,8,7,"ng-container",13),_()(),M(16,ze,3,0,"tbody",null,E),_()()),e&2&&(r(8),P(o.showProductToggle?8:-1),r(5),m("ngxPermissionsOnly",T(4,j,o.rolePriceEdit)),r(),P(o.filter!=null&&o.filter.HiddenIPOSInventory?-1:14),r(),m("ngForOf",o.channel),r(),V(o.data))},dependencies:[Q,X,Y,q,G,J,ie,ee,te,ne,xe,ue,pe,se,de,le,re,_e,ce,fe],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%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ft as a};
|
|
1
|
+
import{a as Ce}from"./chunk-Y2XXDDNX.js";import{a as oe}from"./chunk-662E5VTA.js";import{c as fe}from"./chunk-NNPT3RN6.js";import{a as ue,b as xe}from"./chunk-G6CZHXQI.js";import{c as de}from"./chunk-M4VGME5L.js";import{a as ge}from"./chunk-5WVUQE43.js";import{g as se}from"./chunk-AAIK6JQ3.js";import{g as ae}from"./chunk-YERME2YY.js";import{d as me,g as pe}from"./chunk-PIDUM6XT.js";import{t as ce,u as _e}from"./chunk-43TMSPFC.js";import{b as ee,h as te,k as ne,u as ie}from"./chunk-F5YRASNU.js";import{e as re,f as le}from"./chunk-2UXFUEON.js";import{Eb as b,Fb as p,Gb as k,Ha as v,Hb as y,Ia as r,Ib as H,Ja as I,Jb as O,Kb as D,Lb as N,Nb as Z,Pb as T,V as L,Wb as $,Xb as R,Ya as s,Yb as K,Zb as w,_a as m,c as W,fb as P,ga as z,gb as E,ib as M,jb as V,kb as c,lb as _,mb as S,nb as x,oa as g,ob as f,pa as d,pb as U,pc as X,qb as C,rc as Y,sc as q,tb as h,uc as G,vb as a,yb as A,yc as J,za as B,zc as Q}from"./chunk-77JORVC2.js";var j=t=>[t],he=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=C();c(0,"mat-slide-toggle",14),h("toggleChange",function(){g(n);let e=a();return e.toggleStatus=!e.toggleStatus,d(e.onToggle())}),c(1,"small",15),p(2),_()()}if(t&2){let n=a();r(2),y(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Se(t,l){if(t&1){let n=C();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=a();return D(o.checkboxState,e)||(o.checkboxState=e),d(e)}),h("ngModelChange",function(){g(n);let e=a();return d(e.onCheckboxStateChange())}),_()()}if(t&2){let n=a();r(),O("ngModel",n.checkboxState)}}function ye(t,l){t&1&&(c(0,"th",11),p(1,"POS"),_())}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),S(4,"img",20),c(5,"div",21),p(6),$(7,"stringLimit"),_()()()(),f()),t&2){let n=l.$implicit;r(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),r(),m("src",n==null?null:n.Img,v),r(2),H(" ",K(7,4,n.Name,20),"",(n.Name==null?null:n.Name.length)>20?"...":""," ")}}function Fe(t,l){t&1&&U(0)}function Ie(t,l){if(t&1&&(x(0),s(1,Fe,1,0,"ng-container",34),f()),t&2){a();let n=b(7);r(),m("ngTemplateOutlet",n)}}function Pe(t,l){t&1&&U(0)}function Ee(t,l){if(t&1&&s(0,Pe,1,0,"ng-container",34),t&2){a(2);let n=b(7);m("ngTemplateOutlet",n)}}function Me(t,l){if(t&1&&s(0,Ee,1,1,"ng-template",12),t&2){let n=a(4);m("ngxPermissionsOnly",T(1,j,n.rolePriceEdit))}}function Ve(t,l){if(t&1){let n=C();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=a(4).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),h("ngModelChange",function(){g(n);let e=a(4).$implicit,o=a();return d(o.onCheckboxStateProduct(e.ID))}),_(),f()}if(t&2){let n=a(4).$implicit;r(),O("ngModel",n.selected)}}function ke(t,l){if(t&1&&s(0,Ve,2,1,"ng-container",22),t&2){let n=a(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function Oe(t,l){if(t&1){let n=C();x(0),c(1,"img",36),h("click",function(e){g(n);let o=a(3).$implicit,u=a();return d(u.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),f()}if(t&2){let n=a(3).$implicit;r(),A("src",n==null?null:n.ThumbnailUrl,v)}}function De(t,l){t&1&&S(0,"img",37)}function Ne(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),s(3,Ie,2,1,"ng-container",31)(4,Me,1,3,"ng-template",null,0,w)(6,ke,1,1,"ng-template",null,1,w),c(8,"div",26),s(9,Oe,2,1,"ng-container",31)(10,De,1,0,"ng-template",null,2,w),_()()(),c(12,"td",32)(13,"div"),p(14),_(),c(15,"small",33),p(16),_()(),f()),t&2){let n=b(5),i=b(11),e=a(2).$implicit,o=a();r(),m("rowSpan",e==null?null:e.Variants.length),r(2),m("ngIf",o.table=="inventory")("ngIfElse",n),r(5),m("ngClass",T(9,Te,(e==null||e.Variants==null?null:e.Variants.length)<=1)),r(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",e==null?null:e.Variants.length),r(2),k(e==null?null:e.Name),r(2),y("(",e==null?null:e.Category,")")}}function $e(t,l){if(t&1){let n=C();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=a(2).$implicit;return D(o.selected,e)||(o.selected=e),d(e)}),_()}if(t&2){let n=a(2).$implicit;O("ngModel",n.selected)}}function Be(t,l){if(t&1&&(c(0,"td",38),s(1,$e,1,1,"input",39),_()),t&2){let n=a().$implicit,i=a(2);r(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Ue(t,l){if(t&1&&(c(0,"td",24),p(1),$(2,"number"),_()),t&2){let n=a().$implicit,i=a(2);r(),k(R(2,1,i.printPOS(n)))}}function Re(t,l){if(t&1){let n=C();x(0),c(1,"td",40),h("click",function(){g(n);let e=a().$implicit,o=a().$implicit,u=a().$implicit,F=a();return d(F.openTableDialog(u.Name,o,e.ID,u.ChannelItemID))}),c(2,"div",30)(3,"div",41),p(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),d(e==null?null:e.stopPropagation())}),S(7,"i",28),_()()(),f()}if(t&2){let n=l.$implicit,i=a(2).$implicit,e=a(2);r(),m("ngClass",T(5,be,e.printPOS(i)!=e.printItem(n))),r(3),y(" ",R(5,3,e.printItem(n))," "),r(2),m("href",n.Url,v)}}function je(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),p(3,"X"),_()()())}function We(t,l){if(t&1&&s(0,Re,8,7,"ng-container",31)(1,je,4,0,"ng-template",null,3,w),t&2){let n=l.$implicit,i=b(2),e=a().$implicit,o=a(2);m("ngIf",o.getItemFromChannel(e,n.ID))("ngIfElse",i)}}function Le(t,l){if(t&1&&(c(0,"tr"),s(1,Ne,17,11,"ng-container",22),c(2,"td",23),p(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),p(7),_(),c(8,"div",21)(9,"a",27),S(10,"i",28),_()()()(),s(11,Be,2,1,"ng-template",12)(12,Ue,3,3,"td",24),M(13,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=a(2);r(),m("ngIf",i==0),r(2),k(n==null?null:n.Model),r(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),r(),m("ngClass",T(8,he,n.Discontinued)),r(),y(" ",n.Code," "),r(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),r(2),m("ngxPermissionsOnly",T(10,j,e.rolePriceEdit)),r(),P(e.filter!=null&&e.filter.HiddenIPOSInventory?-1:12),r(),V(e.channel)}}function ze(t,l){if(t&1&&(c(0,"tbody"),M(1,Le,15,12,"tr",null,E),_()),t&2){let n=l.$implicit;r(),V(n.Variants)}}var ft=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new B,this.destroy$=new W,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(u=>(u.selected=o.selected,u)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(o=>o.ChannelID==e)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,u){this.dialog.open(Ce,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:u}}).afterClosed().pipe(L(this.destroy$)).subscribe(F=>{F!=null&&this.onSubmit.emit(F)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(I(me),I(ge),I(ae))},l.\u0275cmp=z({type:l,selectors:[["app-table"]],inputs:{filter:"filter",data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle"},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:18,vars:6,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),p(7,"Product"),_(),s(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),p(10,"Variant"),_(),c(11,"th",11),p(12,"SKU"),_(),s(13,Se,2,1,"ng-template",12)(14,ye,2,0,"th",11)(15,we,8,7,"ng-container",13),_()(),M(16,ze,3,0,"tbody",null,E),_()()),e&2&&(r(8),P(o.showProductToggle?8:-1),r(5),m("ngxPermissionsOnly",T(4,j,o.rolePriceEdit)),r(),P(o.filter!=null&&o.filter.HiddenIPOSInventory?-1:14),r(),m("ngForOf",o.channel),r(),V(o.data))},dependencies:[Q,X,Y,q,G,J,ie,ee,te,ne,xe,ue,pe,se,de,le,re,_e,ce,fe],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%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ft as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as M}from"./chunk-FX43R2N5.js";import{a as Ee}from"./chunk-LIS3LB3F.js";import{a as xe,b as fe,d as Se,e as Pe}from"./chunk-2Y4N4NSS.js";import{a as E}from"./chunk-BSBYMQ7J.js";import{a as Me,b as B,c as Ne}from"./chunk-Y2XXDDNX.js";import{a as ge}from"./chunk-662E5VTA.js";import{a as be,c as De}from"./chunk-NNPT3RN6.js";import{a as Ve,b as Te}from"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as Fe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as ue}from"./chunk-YERME2YY.js";import{b as oe,e as le}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as ye,k as Ie,l as we,m as ve}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{b as re,c as ce,h as se,k as _e,m as pe,u as me}from"./chunk-F5YRASNU.js";import{c as de,e as he,f as Ce}from"./chunk-2UXFUEON.js";import{B as W,Eb as H,Fb as d,Gb as L,Ha as V,Hb as T,Ia as r,Ib as J,Ja as f,Jb as y,Kb as I,Lb as w,Mb as Z,Nb as Q,Pb as b,Q as A,Wb as v,X as $,Xb as F,Ya as h,Yb as X,Zb as Y,_a as _,da as j,fb as S,ga as z,gb as N,ib as k,jb as R,kb as o,lb as c,mb as P,nb as G,oa as p,ob as K,pa as m,pc as ee,qb as x,sc as te,tb as u,vb as l,vc as ne,yb as q,yc as ie,zc as ae}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Le=i=>({"bg-gradient-warning":i}),Be=i=>({"ms-10":i});function Ue(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;r(),_("src",t==null?null:t.Img,V),r(),T(" ",t.Name," ")}}function Oe(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){p(t);let n=l().ngIf,a=l(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),o(3,"button",14),u("click",function(){p(t);let n=l(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=l(2);r(2),_("ngIf",e.productService.hasSelectionVariant(t))}}function Ae(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){p(t);let a=l().ngIf,g=l(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function $e(i,s){if(i&1){let t=x();o(0,"input",51),w("ngModelChange",function(n){p(t);let a=l(4).$implicit;return I(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){p(t);let n=l(4).$implicit,a=l(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=l(4).$implicit;y("ngModel",t.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let t=l(6);_("ngxPermissionsOnly",b(1,U,t.rolePriceEdit))}}function ze(i,s){if(i&1){let t=x();G(0),o(1,"img",52),u("click",function(n){p(t);let a=l(3).$implicit,g=l(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=l(3).$implicit;r(),q("src",t.ThumbnailUrl,V)}}function Ge(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=l(3).$implicit;r(),T("(",t.Category,")")}}function qe(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,je,1,3,null,26),o(3,"div",46),h(4,ze,2,1,"ng-container",47)(5,Ge,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let t=H(6),e=l(2).$implicit;_("rowSpan",e.Variants.length),r(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),r(),_("ngClass",b(8,Be,(e.Variants==null?null:e.Variants.length)<=1)),r(),_("ngIf",e.ThumbnailUrl)("ngIfElse",t),r(3),_("rowSpan",e.Variants.length),r(2),L(e.Name),r(),S(e.Category?10:-1)}}function He(i,s){if(i&1){let t=x();o(0,"input",56),w("ngModelChange",function(n){p(t);let a=l(2).$implicit;return I(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=l(2).$implicit;y("ngModel",t.selected)}}function Je(i,s){if(i&1&&(o(0,"td",54),h(1,He,1,1,"input",55),c()),i&2){let t=l().$implicit;r(),S(t.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=l().$implicit;r(),T(" ",F(2,1,t.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=l().$implicit,e=l(4);r(),_("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function Ye(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){p(t);let n=l().$implicit,a=l().$implicit,g=l(2).ngIf,C=l();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=l().$implicit;r(),T(" ",F(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function et(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,qe,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=p(t).$implicit,a=l(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=l(4);r(),S(e==0?1:-1),r(2),L(t.Model),r(2),_("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",b(12,Re,t.Discontinued)),r(),T(" ",t.Code," "),r(),_("ngxPermissionsOnly",b(14,U,n.rolePriceEdit)),r(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),r(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),r(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),r(),_("ngClass",b(16,Le,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),r(2),S(t.Channel.length>0?15:-1),r(2),_("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let t=s.$implicit;R(t.Variants)}}function nt(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),w("ngModelChange",function(n){p(t);let a=l(2);return I(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){p(t);let n=l(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){p(t);let n=l(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){p(t);let n=l(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(t);let n=l(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(t);let n=l(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=l(2);r(9),y("ngModel",e.toggleDifferentInventory),r(7),_("ngxPermissionsOnly",b(17,U,e.rolePriceEdit)),r(4),_("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(),_("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),r(2),J(" ",X(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),r(3),R(t),r(2),_("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",F(29,15,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let t=x();o(0,"mainpanel",2),w("textChange",function(n){p(t);let a=l();return I(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){p(t);let n=l();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),w("ngModelChange",function(n){p(t);let a=l();return I(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ue,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),w("ngModelChange",function(n){p(t);let a=l();return I(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),w("ngModelChange",function(n){p(t);let a=l();return I(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,We,7,1,"actions",9),v(16,"async"),h(17,nt,30,19,"content",9),v(18,"async"),c()}if(i&2){let t=l();_("headerTitle",t.pageTitle),y("text",t.searchFilter.text),r(5),_("clearable",!1)("items",t.channelOptions),y("ngModel",t.searchFilter.ChannelID),r(5),y("ngModel",t.searchFilter.PageNumber),r(4),y("ngModel",t.searchFilter.RowCount),r(),_("ngIf",F(16,9,t.data$)),r(2),_("ngIf",F(18,11,t.data$))}}var Ot=(()=>{let s=class s{constructor(e,n,a,g,C,D,O,ke){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=D,this.authService=O,this.mainPanelService=ke,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ge.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Me,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(D=>de.IsNotEmpty(D))).subscribe(D=>{this.updateItemAfterDialog(D,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${C.Name} to ${a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(le),f(oe),f(ye),f(be),f(Fe),f(M),f(ue),f(Ie))},s.\u0275cmp=z({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([B,M]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[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"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,it,19,13,"mainpanel",1),v(1,"async")),n&2&&_("ngIf",F(1,1,a.loader$))},dependencies:[ae,ee,te,ne,ie,ve,we,Pe,Se,xe,fe,me,ce,pe,re,se,_e,De,Ne,Ce,he,Te,Ve],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}"],changeDetection:0});let i=s;return i})();export{Ot as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ot}from"./chunk-DXJFMERC.js";import{a as Q,b as X,d as Y,e as Z}from"./chunk-2Y4N4NSS.js";import{b as rt}from"./chunk-G6CZHXQI.js";import{g as J}from"./chunk-
|
|
1
|
+
import{c as ot}from"./chunk-DXJFMERC.js";import{a as Q,b as X,d as Y,e as Z}from"./chunk-2Y4N4NSS.js";import{b as rt}from"./chunk-G6CZHXQI.js";import{g as J}from"./chunk-YERME2YY.js";import{b as H,e as A}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{l as it,m as nt}from"./chunk-PIDUM6XT.js";import{t as tt,u as et}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{h as z,k as G,u as $}from"./chunk-F5YRASNU.js";import{b as v,c as q}from"./chunk-2UXFUEON.js";import{Fb as l,Gb as u,Ha as P,Hb as j,Ia as c,Ja as h,Jb as y,Kb as L,Lb as M,Q as T,Wb as V,X as x,Xb as W,Ya as g,_a as m,aa as p,ga as E,gd as C,ha as d,kb as r,lb as a,mb as D,nb as U,oa as O,ob as F,pa as w,q as I,qb as K,rc as k,sc as R,tb as _,vb as f,vc as B,zc as S}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";function ct(n,e){if(n&1&&(r(0,"span",13),D(1,"img",14),a(),r(2,"span"),l(3),a()),n&2){let s=e.item;c(),m("src",s.Img,P)("alt",s.Name),c(2),j(" ",s.Name," ")}}function mt(n,e){if(n&1){let s=K();U(0),r(1,"ng-select",16),M("ngModelChange",function(i){O(s);let o=f().$implicit;return L(o.ProductSKU,i)||(o.ProductSKU=i),w(i)}),a(),F()}if(n&2){let s=e.ngIf,t=f().$implicit;c(),y("ngModel",t.ProductSKU),m("items",s)}}function pt(n,e){if(n&1&&(r(0,"tr")(1,"td"),l(2),a(),r(3,"td"),l(4),a(),r(5,"td"),l(6),a(),r(7,"td"),g(8,mt,2,2,"ng-container",15),V(9,"async"),a()()),n&2){let s=e.$implicit,t=f();c(2),u(s.Name),c(2),u(s.Service),c(2),u(s.TypeString),c(2),m("ngIf",W(9,4,t.logisticOptions$))}}var st=(()=>{let e=class e{constructor(t,i,o){this.http=t,this.toastr=i,this.authService=o,this.filter={ChannelID:""},this.logisticServiceOptions=[],this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[v.WooCommerce,v.Lazada,v.Shopify];this.channelOptions=this.channelOptions.map(i=>(t.forEach(o=>{i.TypeID===o&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(T(1),x(t=>{this.logisticServiceOptions=t}))}Validate(){for(let t of this.logisticServices)this.datasource.find(o=>o.ProductSKU==t.ProductSKU&&o.Name==t.Name)===void 0&&(t.IsChange=!0);return Promise.resolve(this.logisticServices)}submitLogistics(){this.Validate().then(t=>{this.http.post("/api/Logistic/Submit",this.logisticServices).subscribe(i=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.getLogisticService()})})}getLogisticService(){this.datasource=[],this.http.post("/api/Logistic/Get",this.filter).pipe(I(t=>t.map(i=>(i.ProductSKU=q.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i)))).subscribe(t=>{this.iniTitle(),this.logisticServices=t,this.datasource=structuredClone(t)})}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}};e.\u0275fac=function(i){return new(i||e)(h(A),h(H),h(J))},e.\u0275cmp=E({type:e,selectors:[["app-logistic"]],decls:28,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["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"],[2,"width","18px",3,"src","alt"],[4,"ngIf"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,o){i&1&&(r(0,"mainpanel",0),_("onSubmit",function(){return o.getLogisticService()}),r(1,"filters")(2,"div")(3,"label",1),l(4,"Select a Channel"),a(),r(5,"ng-select",2),M("ngModelChange",function(b){return L(o.filter.ChannelID,b)||(o.filter.ChannelID=b),b}),g(6,ct,4,3,"ng-template",3),a()()(),r(7,"actions")(8,"a",4),_("click",function(){return o.submitLogistics()}),l(9,"Submit"),a()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),l(19,"Logistic"),a(),r(20,"th"),l(21,"Service"),a(),r(22,"th"),l(23,"Type"),a(),r(24,"th"),l(25,"Logistic Service"),a()()(),r(26,"tbody"),g(27,pt,10,6,"tr",12),a()()()()()()()()),i&2&&(m("headerTitle","Logistic Courier - "+o.channelName)("hideSearchDropdown",!1),c(5),m("clearable",!1)("items",o.channelOptions),y("ngModel",o.filter.ChannelID),c(22),m("ngForOf",o.logisticServices))},dependencies:[k,R,z,G,it,Y,Q,X,tt,B]});let n=e;return n})();var dt=[{path:"",component:st}],lt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=d({type:e}),e.\u0275inj=p({imports:[S,C.forChild(dt)]});let n=e;return n})();var kt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=d({type:e}),e.\u0275inj=p({imports:[S,C,lt,$,nt,Z,rt,ot,et]});let n=e;return n})();export{kt as LogisticModule};
|