marketplacepos 5.39.0 → 5.39.1
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-MOB6IFKN.js → chunk-442MJMVZ.js} +1 -1
- package/Marketplace/{chunk-77UUIQNO.js → chunk-5CKKN23B.js} +1 -1
- package/Marketplace/{chunk-VZWPT6DU.js → chunk-6FO6O7IT.js} +1 -1
- package/Marketplace/{chunk-BQNAQJC7.js → chunk-76ERIVLL.js} +1 -1
- package/Marketplace/{chunk-I47XS4UX.js → chunk-APY2ZWAO.js} +1 -1
- package/Marketplace/{chunk-CVD4FTNV.js → chunk-BSEHSLHL.js} +1 -1
- package/Marketplace/{chunk-IJISBCWA.js → chunk-CHKLW55N.js} +1 -1
- package/Marketplace/{chunk-QR5SOM5D.js → chunk-DMCE7JJF.js} +1 -1
- package/Marketplace/{chunk-JCXJTUHA.js → chunk-ENV3F6VW.js} +1 -1
- package/Marketplace/{chunk-WM2EYHMP.js → chunk-GAPNAYPO.js} +1 -1
- package/Marketplace/{chunk-NG547COR.js → chunk-GJJTQXNT.js} +1 -1
- package/Marketplace/{chunk-N7MU7WUP.js → chunk-HQNQCJFL.js} +1 -1
- package/Marketplace/{chunk-FPN6SADB.js → chunk-K4STIRVT.js} +1 -1
- package/Marketplace/{chunk-3HNY24KA.js → chunk-LCSWOCPG.js} +1 -1
- package/Marketplace/{chunk-M6FBD36V.js → chunk-M5NCO3YR.js} +1 -1
- package/Marketplace/{chunk-LFMXHJYP.js → chunk-NSHUAEBA.js} +1 -1
- package/Marketplace/{chunk-DXZ6MABM.js → chunk-OD3TAMEJ.js} +1 -1
- package/Marketplace/{chunk-QSXSGKOB.js → chunk-OGADDKTE.js} +1 -1
- package/Marketplace/{chunk-TI5WNVPB.js → chunk-OZT36TE3.js} +1 -1
- package/Marketplace/{chunk-5NNUNFQO.js → chunk-PLU3WKLF.js} +1 -1
- package/Marketplace/{chunk-BT7A2SMC.js → chunk-PXKKB2KJ.js} +2 -2
- package/Marketplace/{chunk-TVH232DW.js → chunk-Q2O2Y7F6.js} +2 -2
- package/Marketplace/{chunk-IYWXW25F.js → chunk-QB3SYHGX.js} +1 -1
- package/Marketplace/{chunk-SYOKYZLY.js → chunk-QTILJC62.js} +1 -1
- package/Marketplace/{chunk-6ED3HFL7.js → chunk-SGBN2HBE.js} +1 -1
- package/Marketplace/{chunk-TPZEWOIR.js → chunk-TT6L7YYF.js} +1 -1
- package/Marketplace/{chunk-COASPFAK.js → chunk-U3Y2HUHZ.js} +1 -1
- package/Marketplace/{chunk-3JAUWUZS.js → chunk-UVO36TPT.js} +1 -1
- package/Marketplace/{chunk-2R6AG2TN.js → chunk-WH7VVHBB.js} +1 -1
- package/Marketplace/{chunk-B46JIPFY.js → chunk-X4INZHBA.js} +1 -1
- package/Marketplace/{chunk-5PJKMKKR.js → chunk-XQKQSYK4.js} +1 -1
- package/Marketplace/{chunk-LF7VSVHW.js → chunk-XVNYBFR3.js} +1 -1
- package/Marketplace/{chunk-4QTONH3S.js → chunk-ZOYE3ORO.js} +1 -1
- package/Marketplace/{chunk-LVIS3W6J.js → chunk-ZR4RUBYY.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-JQIG3S6Q.js → main-H37BJDGT.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-IYYVZ6B6.js";import{b as ie}from"./chunk-RVYGL22E.js";import{a as ee,b as te}from"./chunk-OE2JYQHN.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-IYYVZ6B6.js";import{b as ie}from"./chunk-RVYGL22E.js";import{a as ee,b as te}from"./chunk-OE2JYQHN.js";import{a as X}from"./chunk-76ERIVLL.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as Q}from"./chunk-OGADDKTE.js";import{e as J}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{l as Y,m as Z}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as G,h as z,m as K,y as q}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-GPEVUTDI.js";import{Dc as v,Eb as C,Ec as p,Fb as k,Fc as B,Gc as L,Ic as O,Jc as F,Ka as M,Kb as m,Kc as R,Oc as P,Qc as w,Wb as l,gc as n,hc as i,ic as c,ja as I,jc as f,ka as T,kc as _,mc as S,nb as N,oa as U,qb as a,rc as y,sc as d,wb as D,ya as g,za as h}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,ee,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
|
|
2
2
|
https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(t){this.stepperState=t.selectedStep.state}onSubmit(t){let o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(t=>(t.Name=t?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${t.ID}" target="_blank">
|
|
3
3
|
${t?.Name}
|
|
4
4
|
</a>`:"-",t))}onNewStepperState(t){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(o){return new(o||e)(D(E),D(Q))}}static{this.\u0275cmp=C({type:e,selectors:[["app-by-url"]],standalone:!1,features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(o,r){if(o&1){let u=S();n(0,"mainpanel",1)(1,"actions"),m(2,xe,4,0,"ng-container",2)(3,be,3,0,"ng-container",2)(4,Ee,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),i(),n(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(fe){return g(u),h(r.onStepperChange(fe))}),n(12,"mat-step",7),m(13,Ie,3,0,"ng-template",8)(14,Te,16,0,"ng-template",9),i(),n(15,"mat-step",10),m(16,Ue,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),i(),n(18,"mat-step",11),m(19,Ne,3,0,"ng-template",8)(20,ke,2,2,"ng-template",9),i(),m(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Oe,2,0,"ng-template",14),i()()()()()()}o&2&&(l("hideSearchBox",!0)("hideSearchDropdown",!0),a(2),l("ngIf",r.stepperState=="FINISH"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(),l("ngIf",r.stepperState=="GUIDE"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(5),l("selectedIndex",1),a(2),l("editable",r.stepperState!="FINISH")("completed",!0),a(3),l("editable",r.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,Y,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as pt}from"./chunk-TI5WNVPB.js";import{a as Ct}from"./chunk-LEHTNMIE.js";import{a as mt,b as ct}from"./chunk-GHQH62TZ.js";import{c as ft}from"./chunk-Q72ZXPDP.js";import{f as ht}from"./chunk-Q2OEJFVT.js";import{b as D,c as P,i as E,j as k}from"./chunk-BIQHA7UA.js";import{r as O}from"./chunk-TMFFA26Y.js";import{h as dt,m as st}from"./chunk-DPLEMBB4.js";import{b as s,c as f}from"./chunk-PXB4YEY3.js";import{G as rt,d as W,f as B,g as K,j as ot,m as lt}from"./chunk-GPEVUTDI.js";import{Dc as it,Eb as T,Ec as r,Fc as u,Gc as y,Ic as V,Jc as N,Kb as g,Kc as U,Qa as Z,Qc as R,Vb as j,Wb as d,Z as Q,Zc as I,_c as x,ad as at,bc as z,cc as tt,ec as et,fc as nt,gc as a,hc as l,ic as _,jc as G,kc as H,mc as F,ob as b,pa as X,qb as o,rc as S,sc as h,v as q,wb as C,ya as A,za as L}from"./chunk-T5ONJF63.js";function Mt(e,p){if(e&1&&(a(0,"mat-option",10)(1,"div",11),_(2,"img",12),a(3,"span"),r(4),l()()()),e&2){let t=p.$implicit;d("value",t.ID)("disabled",t.disabled),o(),d("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),d("src",t.Img,b),o(2),u(t.Name)}}function bt(e,p){if(e&1){let t=F();a(0,"div",13)(1,"label",14),r(2,"Scan Type"),l(),a(3,"mat-radio-group",15),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.ScanFull,i)||(m.filter.ScanFull=i),L(i)}),a(4,"mat-radio-button",16),r(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),r(7," Active "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.ScanFull),o(),d("value",!0),o(2),d("value",!1)}}function Tt(e,p){e&1&&(a(0,"span"),r(1,"Never"),l())}function It(e,p){if(e&1&&(a(0,"span"),r(1),I(2,"async"),l()),e&2){let t=h(2);o(),u(x(2,1,t.lastSync$))}}function xt(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3)(2,"span",18),r(3,"Last Scan:"),l(),g(4,Tt,2,0,"span"),I(5,"async"),g(6,It,3,3,"span"),l(),a(7,"mat-radio-group",19),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.UpdatedProduct,i)||(m.filter.UpdatedProduct=i),L(i)}),a(8,"mat-radio-button",20),r(9," Scan All Products "),l(),a(10,"mat-radio-button",21),r(11),l()()()}if(e&2){let t=h();o(4),z(x(5,6,t.lastSync$)==null?4:6),o(3),V("ngModel",t.filter.UpdatedProduct),o(),d("value",!1),o(2),d("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),o(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ot(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3),r(2," Scan Option "),l(),a(3,"mat-radio-group",22),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.Async,i)||(m.filter.Async=i),L(i)}),a(4,"mat-radio-button",23),r(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),r(7," Synchronous (Wait until Complete) "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.Async),o(),d("value",!0),o(2),d("value",!1)}}var Xt=(()=>{class e{constructor(t,n,i){this.dialogRef=t,this.data=n,this.router=i,this.channelService=X(pt),this.channelType=s,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==s.Tiktok||t.TypeID==s.Tokopedia||t.TypeID==s.Lazada||t.TypeID==s.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(q(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),Q(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==s.Shopee||this.selectedChannel.TypeID==s.Tiktok||this.selectedChannel.TypeID==s.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=s.WooCommerce&&this.selectedChannel?.TypeID!=s.KalCare&&this.selectedChannel?.TypeID!=s.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(i=>i.ID==t)),n}submit(){this.selectedChannel.TypeID==s.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||e)(C(D),C(P),C(rt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-scan-dialog"]],standalone:!1,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(n,i){n&1&&(a(0,"modal-material",0),S("onOk",function(){return i.submit()})("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),r(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),U("ngModelChange",function(c){return N(i.filter.ChannelID,c)||(i.filter.ChannelID=c),c}),S("ngModelChange",function(c){return i.onSelectChannel(c)}),g(7,Mt,5,5,"mat-option",6),l()(),g(8,bt,8,3,"div",7)(9,xt,12,8,"div",8)(10,Ot,8,3,"div",9),l()()()),n&2&&(d("dynamicValidated",i.isNotEmpty(i.filter.ChannelID))("config",i.modalConfig),o(6),d("disabled",i.disabledChannelOption),V("ngModel",i.filter.ChannelID),o(),d("ngForOf",i.channelOptions),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)),o(),z(i.hasScanUpdate&&i.selectedChannel?9:-1),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)))},dependencies:[B,K,dt,st,mt,ct,ht,Ct,ft,O,k,ot],encapsulation:2})}}return e})();var v=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(v||{});var Dt=e=>({"is-disabled":e});function Pt(e,p){if(e&1&&(G(0),a(1,"tr")(2,"td",11),r(3),l(),a(4,"td",11),r(5),l(),a(6,"td",12)(7,"p",13),r(8,"Product Not in Channel!"),l()()(),H()),e&2){let t=h().$implicit;o(3),y(" ",t==null?null:t.Model,""),o(2),y(" ",t==null?null:t.Code,"")}}function Et(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Model,"")}}function kt(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Code,"")}}function wt(e,p){if(e&1&&(a(0,"tr"),g(1,Et,2,2,"td",14)(2,kt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),l(),a(7,"div",18),r(8),l()()(),a(9,"td",11),r(10),I(11,"number"),l(),a(12,"td",19),r(13),I(14,"number"),l(),a(15,"td",19)(16,"a",20),_(17,"i",21),a(18,"span",22),r(19,"Edit"),l()()()()),e&2){let t=p.$implicit,n=p.index,i=h(3);o(),d("ngIf",n==0),o(),d("ngIf",n==0),o(3),d("href",t.Url,b)("title",t.Title),o(),d("src",i.getChannelLogo(t.TypeID),b),o(),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),o(),y(" ",t.Name," "),o(2),u(x(11,12,t.Price)),o(3),u(x(14,14,t.Inventory)),o(3),d("href",i.getHyperlinkSellerCenter(t),b)("ngClass",R(16,Dt,t.TypeID==i.channelType.KalCare))("matTooltip",t.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(e,p){if(e&1&&g(0,wt,20,18,"tr",9),e&2){let t=h().$implicit;d("ngForOf",t==null?null:t.Channel)}}function Nt(e,p){if(e&1&&(G(0),g(1,Pt,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,at),H()),e&2){let t=p.$implicit,n=it(3);o(),d("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var le=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.channelType=s,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case s.Shopee:n=`${v.Shoope}/portal/product/${t.ChannelItemID}`;break;case s.Tiktok:n=`${v.Tiktok}/product/edit/${t.ChannelItemID}`;break;case s.Tokopedia:n=`${v.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case s.WooCommerce:n=`${v.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case s.Lazada:n=`${v.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variant"]],standalone:!1,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(n,i){n&1&&(a(0,"modal-material",1),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),r(6," VARIANT "),a(7,"sup"),_(8,"i",6),l()(),a(9,"th",5),r(10,"SKU"),l(),a(11,"th",5),r(12," PRODUCT "),a(13,"sup"),_(14,"i",7),l()(),a(15,"th",5),r(16,"PRICE"),l(),a(17,"th",8),r(18,"INVENTORY"),l(),_(19,"th",5),l()(),a(20,"tbody"),g(21,Nt,4,2,"ng-container",9),l()()()()),n&2&&(d("config",i.modalConfig),o(21),d("ngForOf",i.variants))},dependencies:[W,B,K,O,k,lt],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}"]})}}return e})();var Ut=e=>({"bg-gradient-warning":e});function At(e,p){if(e&1&&(a(0,"tr",5)(1,"td"),r(2),l(),a(3,"td",6),r(4),l()()),e&2){let t=p.$implicit;d("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),d("ngClass",R(4,Ut,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var fe=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=Z([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},i=[],m=t.filter(c=>f.IsEmpty(c.ChannelVariationSKU));t.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,M,J)=>{n[c.ChannelVariationSKU]=J.filter(w=>w.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(n).forEach(c=>{n[c].length>1&&(n[c]=n[c].map((M,J,w)=>{let Y=`SKU ${M.ChannelVariationSKU} is duplicated with variant`;return w.forEach(($,vt)=>{$.Name!==M.Name&&(Y+=` ${w.length>2?$.Name+(vt!==w.length-1?",":""):$.Name}`)}),M.duplicateMessage=Y,M.isDuplicate=!0,M})),i.push(...n[c])}),i.push(...m),this.variants.set(i)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),r(6,"Variant"),l(),a(7,"th",4),r(8,"SKU"),l()()(),a(9,"tbody"),et(10,At,5,6,"tr",5,tt),l()()()()),n&2&&(d("config",i.modalConfig),o(10),nt(i.variants()))},dependencies:[W,O,k],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}"]})}}return e})();export{Xt as a,le as b,fe as c};
|
|
1
|
+
import{a as pt}from"./chunk-OZT36TE3.js";import{a as Ct}from"./chunk-LEHTNMIE.js";import{a as mt,b as ct}from"./chunk-GHQH62TZ.js";import{c as ft}from"./chunk-Q72ZXPDP.js";import{f as ht}from"./chunk-Q2OEJFVT.js";import{b as D,c as P,i as E,j as k}from"./chunk-BIQHA7UA.js";import{r as O}from"./chunk-TMFFA26Y.js";import{h as dt,m as st}from"./chunk-DPLEMBB4.js";import{b as s,c as f}from"./chunk-PXB4YEY3.js";import{G as rt,d as W,f as B,g as K,j as ot,m as lt}from"./chunk-GPEVUTDI.js";import{Dc as it,Eb as T,Ec as r,Fc as u,Gc as y,Ic as V,Jc as N,Kb as g,Kc as U,Qa as Z,Qc as R,Vb as j,Wb as d,Z as Q,Zc as I,_c as x,ad as at,bc as z,cc as tt,ec as et,fc as nt,gc as a,hc as l,ic as _,jc as G,kc as H,mc as F,ob as b,pa as X,qb as o,rc as S,sc as h,v as q,wb as C,ya as A,za as L}from"./chunk-T5ONJF63.js";function Mt(e,p){if(e&1&&(a(0,"mat-option",10)(1,"div",11),_(2,"img",12),a(3,"span"),r(4),l()()()),e&2){let t=p.$implicit;d("value",t.ID)("disabled",t.disabled),o(),d("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),d("src",t.Img,b),o(2),u(t.Name)}}function bt(e,p){if(e&1){let t=F();a(0,"div",13)(1,"label",14),r(2,"Scan Type"),l(),a(3,"mat-radio-group",15),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.ScanFull,i)||(m.filter.ScanFull=i),L(i)}),a(4,"mat-radio-button",16),r(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),r(7," Active "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.ScanFull),o(),d("value",!0),o(2),d("value",!1)}}function Tt(e,p){e&1&&(a(0,"span"),r(1,"Never"),l())}function It(e,p){if(e&1&&(a(0,"span"),r(1),I(2,"async"),l()),e&2){let t=h(2);o(),u(x(2,1,t.lastSync$))}}function xt(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3)(2,"span",18),r(3,"Last Scan:"),l(),g(4,Tt,2,0,"span"),I(5,"async"),g(6,It,3,3,"span"),l(),a(7,"mat-radio-group",19),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.UpdatedProduct,i)||(m.filter.UpdatedProduct=i),L(i)}),a(8,"mat-radio-button",20),r(9," Scan All Products "),l(),a(10,"mat-radio-button",21),r(11),l()()()}if(e&2){let t=h();o(4),z(x(5,6,t.lastSync$)==null?4:6),o(3),V("ngModel",t.filter.UpdatedProduct),o(),d("value",!1),o(2),d("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),o(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ot(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3),r(2," Scan Option "),l(),a(3,"mat-radio-group",22),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.Async,i)||(m.filter.Async=i),L(i)}),a(4,"mat-radio-button",23),r(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),r(7," Synchronous (Wait until Complete) "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.Async),o(),d("value",!0),o(2),d("value",!1)}}var Xt=(()=>{class e{constructor(t,n,i){this.dialogRef=t,this.data=n,this.router=i,this.channelService=X(pt),this.channelType=s,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==s.Tiktok||t.TypeID==s.Tokopedia||t.TypeID==s.Lazada||t.TypeID==s.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(q(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),Q(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==s.Shopee||this.selectedChannel.TypeID==s.Tiktok||this.selectedChannel.TypeID==s.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=s.WooCommerce&&this.selectedChannel?.TypeID!=s.KalCare&&this.selectedChannel?.TypeID!=s.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(i=>i.ID==t)),n}submit(){this.selectedChannel.TypeID==s.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||e)(C(D),C(P),C(rt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-scan-dialog"]],standalone:!1,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(n,i){n&1&&(a(0,"modal-material",0),S("onOk",function(){return i.submit()})("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),r(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),U("ngModelChange",function(c){return N(i.filter.ChannelID,c)||(i.filter.ChannelID=c),c}),S("ngModelChange",function(c){return i.onSelectChannel(c)}),g(7,Mt,5,5,"mat-option",6),l()(),g(8,bt,8,3,"div",7)(9,xt,12,8,"div",8)(10,Ot,8,3,"div",9),l()()()),n&2&&(d("dynamicValidated",i.isNotEmpty(i.filter.ChannelID))("config",i.modalConfig),o(6),d("disabled",i.disabledChannelOption),V("ngModel",i.filter.ChannelID),o(),d("ngForOf",i.channelOptions),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)),o(),z(i.hasScanUpdate&&i.selectedChannel?9:-1),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)))},dependencies:[B,K,dt,st,mt,ct,ht,Ct,ft,O,k,ot],encapsulation:2})}}return e})();var v=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(v||{});var Dt=e=>({"is-disabled":e});function Pt(e,p){if(e&1&&(G(0),a(1,"tr")(2,"td",11),r(3),l(),a(4,"td",11),r(5),l(),a(6,"td",12)(7,"p",13),r(8,"Product Not in Channel!"),l()()(),H()),e&2){let t=h().$implicit;o(3),y(" ",t==null?null:t.Model,""),o(2),y(" ",t==null?null:t.Code,"")}}function Et(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Model,"")}}function kt(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Code,"")}}function wt(e,p){if(e&1&&(a(0,"tr"),g(1,Et,2,2,"td",14)(2,kt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),l(),a(7,"div",18),r(8),l()()(),a(9,"td",11),r(10),I(11,"number"),l(),a(12,"td",19),r(13),I(14,"number"),l(),a(15,"td",19)(16,"a",20),_(17,"i",21),a(18,"span",22),r(19,"Edit"),l()()()()),e&2){let t=p.$implicit,n=p.index,i=h(3);o(),d("ngIf",n==0),o(),d("ngIf",n==0),o(3),d("href",t.Url,b)("title",t.Title),o(),d("src",i.getChannelLogo(t.TypeID),b),o(),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),o(),y(" ",t.Name," "),o(2),u(x(11,12,t.Price)),o(3),u(x(14,14,t.Inventory)),o(3),d("href",i.getHyperlinkSellerCenter(t),b)("ngClass",R(16,Dt,t.TypeID==i.channelType.KalCare))("matTooltip",t.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(e,p){if(e&1&&g(0,wt,20,18,"tr",9),e&2){let t=h().$implicit;d("ngForOf",t==null?null:t.Channel)}}function Nt(e,p){if(e&1&&(G(0),g(1,Pt,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,at),H()),e&2){let t=p.$implicit,n=it(3);o(),d("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var le=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.channelType=s,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case s.Shopee:n=`${v.Shoope}/portal/product/${t.ChannelItemID}`;break;case s.Tiktok:n=`${v.Tiktok}/product/edit/${t.ChannelItemID}`;break;case s.Tokopedia:n=`${v.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case s.WooCommerce:n=`${v.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case s.Lazada:n=`${v.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variant"]],standalone:!1,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(n,i){n&1&&(a(0,"modal-material",1),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),r(6," VARIANT "),a(7,"sup"),_(8,"i",6),l()(),a(9,"th",5),r(10,"SKU"),l(),a(11,"th",5),r(12," PRODUCT "),a(13,"sup"),_(14,"i",7),l()(),a(15,"th",5),r(16,"PRICE"),l(),a(17,"th",8),r(18,"INVENTORY"),l(),_(19,"th",5),l()(),a(20,"tbody"),g(21,Nt,4,2,"ng-container",9),l()()()()),n&2&&(d("config",i.modalConfig),o(21),d("ngForOf",i.variants))},dependencies:[W,B,K,O,k,lt],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}"]})}}return e})();var Ut=e=>({"bg-gradient-warning":e});function At(e,p){if(e&1&&(a(0,"tr",5)(1,"td"),r(2),l(),a(3,"td",6),r(4),l()()),e&2){let t=p.$implicit;d("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),d("ngClass",R(4,Ut,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var fe=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=Z([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},i=[],m=t.filter(c=>f.IsEmpty(c.ChannelVariationSKU));t.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,M,J)=>{n[c.ChannelVariationSKU]=J.filter(w=>w.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(n).forEach(c=>{n[c].length>1&&(n[c]=n[c].map((M,J,w)=>{let Y=`SKU ${M.ChannelVariationSKU} is duplicated with variant`;return w.forEach(($,vt)=>{$.Name!==M.Name&&(Y+=` ${w.length>2?$.Name+(vt!==w.length-1?",":""):$.Name}`)}),M.duplicateMessage=Y,M.isDuplicate=!0,M})),i.push(...n[c])}),i.push(...m),this.variants.set(i)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),r(6,"Variant"),l(),a(7,"th",4),r(8,"SKU"),l()()(),a(9,"tbody"),et(10,At,5,6,"tr",5,tt),l()()()()),n&2&&(d("config",i.modalConfig),o(10),nt(i.variants()))},dependencies:[W,O,k],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}"]})}}return e})();export{Xt as a,le as b,fe as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-UBMI3NQH.js";import{a as P}from"./chunk-J3P46Z53.js";import{a as M}from"./chunk-4ASUM4N5.js";import{b as h}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import{c as f}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-UBMI3NQH.js";import{a as P}from"./chunk-J3P46Z53.js";import{a as M}from"./chunk-4ASUM4N5.js";import{b as h}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import{c as f}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a}from"./chunk-76ERIVLL.js";import{a as C}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as u}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-OGADDKTE.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as g}from"./chunk-BIQHA7UA.js";import{s}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as l}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as c,J as i,n as r}from"./chunk-GPEVUTDI.js";import{Eb as p,Fb as e,ic as d,ka as n}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var x=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,y){o&1&&d(0,"router-outlet")},dependencies:[c],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var w=[{path:"",component:x,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-ZOYE3ORO.js").then(t=>t.StatusModule),canActivate:[a]},{path:"download",loadChildren:()=>import("./chunk-442MJMVZ.js").then(t=>t.DownloadModule),canActivate:[a]},{path:"upload",loadComponent:()=>import("./chunk-APY2ZWAO.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a]}]}],_=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(w)]})}}return t})();var V=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,l,i,_,s,g,u,h,M,f,C,P,O]})}}return t})();export{V as ProductModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./chunk-
|
|
1
|
+
import{j as l}from"./chunk-OGADDKTE.js";import{b as c}from"./chunk-BUFEIJAI.js";import{G as a}from"./chunk-GPEVUTDI.js";import{ja as n,oa as r}from"./chunk-T5ONJF63.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Qt}from"./chunk-TB6SAKPJ.js";import{a as Xt,b as Jt}from"./chunk-3NDNZO2L.js";import"./chunk-PUJ4JVT2.js";import{b as Wt}from"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import{a as Yt,b as Ht}from"./chunk-OLSC6KHB.js";import"./chunk-GBD4FIF3.js";import{a as $t,b as Lt}from"./chunk-COBHWPGI.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-5NNUNFQO.js";import"./chunk-LLZSSV5A.js";import"./chunk-CRC6ZWYT.js";import"./chunk-CLKCSTGQ.js";import{a as jt}from"./chunk-7TWBIV3T.js";import"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{d as L,e as R}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-QSXSGKOB.js";import{e as et}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{l as Ut,m as Vt}from"./chunk-BIQHA7UA.js";import{r as Mt,s as Dt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-DPLEMBB4.js";import{b as wt,c as h}from"./chunk-PXB4YEY3.js";import{g as U,j as T,n as S}from"./chunk-GPEVUTDI.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Na as _t,Oc as x,Pc as at,Wb as m,Z,Zc as b,_c as y,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
|
|
1
|
+
import{b as Qt}from"./chunk-TB6SAKPJ.js";import{a as Xt,b as Jt}from"./chunk-3NDNZO2L.js";import"./chunk-PUJ4JVT2.js";import{b as Wt}from"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import{a as Yt,b as Ht}from"./chunk-OLSC6KHB.js";import"./chunk-GBD4FIF3.js";import{a as $t,b as Lt}from"./chunk-COBHWPGI.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-PLU3WKLF.js";import"./chunk-LLZSSV5A.js";import"./chunk-CRC6ZWYT.js";import"./chunk-CLKCSTGQ.js";import{a as jt}from"./chunk-7TWBIV3T.js";import"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{d as L,e as R}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-OGADDKTE.js";import{e as et}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{l as Ut,m as Vt}from"./chunk-BIQHA7UA.js";import{r as Mt,s as Dt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-DPLEMBB4.js";import{b as wt,c as h}from"./chunk-PXB4YEY3.js";import{g as U,j as T,n as S}from"./chunk-GPEVUTDI.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Na as _t,Oc as x,Pc as at,Wb as m,Z,Zc as b,_c as y,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-ZD5LURJS.js";import{b as ae}from"./chunk-COBHWPGI.js";import{a as le,b as re}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import"./chunk-CH2MLZU7.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as X}from"./chunk-
|
|
1
|
+
import{a as oe}from"./chunk-ZD5LURJS.js";import{b as ae}from"./chunk-COBHWPGI.js";import{a as le,b as re}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import"./chunk-CH2MLZU7.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as X}from"./chunk-OGADDKTE.js";import{e as Q}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{l as ne,m as ie}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as H,m as U,y as G}from"./chunk-DPLEMBB4.js";import{c as K}from"./chunk-PXB4YEY3.js";import{j as V,k as J,l as W,n as k}from"./chunk-GPEVUTDI.js";import{$c as A,Eb as P,Ec as p,Fc as C,Gc as y,Ic as j,Jc as O,Kb as u,Kc as q,Oc as z,Wb as d,Z as M,Zc as m,_c as c,aa as D,bc as R,cc as B,ec as T,fc as $,g as L,gc as i,hc as a,ic as f,ja as w,mc as F,ob as S,pa as g,qb as l,rc as v,sc as x,v as I,ya as E,za as N}from"./chunk-T5ONJF63.js";import{a as _}from"./chunk-K2H6WANG.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A,b as F,d as U,e as W}from"./chunk-6IAGGRZN.js";import{j as k}from"./chunk-
|
|
1
|
+
import{a as A,b as F,d as U,e as W}from"./chunk-6IAGGRZN.js";import{j as k}from"./chunk-OGADDKTE.js";import{a as D,h as V,m as I,y as L}from"./chunk-DPLEMBB4.js";import{n as E}from"./chunk-GPEVUTDI.js";import{Eb as M,Ec as p,Gc as f,Ic as O,Jc as T,Kb as u,Kc as N,Na as d,Oc as w,Wb as s,bc as y,gc as a,hc as o,ic as h,mc as x,ob as g,pa as S,qb as r,rc as C,sc as _,ya as v,za as b}from"./chunk-T5ONJF63.js";function z(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o()),t&2){let e=m.item;r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," ")}}function P(t,m){if(t&1){let e=x();a(0,"span",6),C("click",function(){v(e);let n=_(),c=n.item,l=n.clear;return b(l(c))}),p(1,"x"),o()}}function j(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o(),u(4,P,2,0,"span",5)),t&2){let e=m.item,i=_();r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," "),r(),y(i.clearable()?4:-1)}}var Y=(()=>{class t{constructor(){this.authService=S(k),this.multiple=d(!1),this.clearable=d(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[w([{provide:D,multi:!0,useExisting:t}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,n){i&1&&(a(0,"ng-select",0),N("ngModelChange",function(l){return T(n.selectedChannels,l)||(n.selectedChannels=l),l}),C("ngModelChange",function(l){return n.onChannelChange(l)}),u(1,z,4,2,"ng-template",1)(2,j,5,3,"ng-template",2),o()),i&2&&(s("clearable",n.clearable())("items",n.options),O("ngModel",n.selectedChannels),s("multiple",n.multiple()))},dependencies:[E,W,U,A,F,L,V,I],encapsulation:2})}}return t})();export{Y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ke}from"./chunk-IJISBCWA.js";import{a as De}from"./chunk-YR2WEZDG.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-6ZH6QZJ7.js";import{a as ue}from"./chunk-BVIRHZTZ.js";import{a as Te}from"./chunk-PPDHTO44.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-TGOIGCN3.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import"./chunk-7TWBIV3T.js";import{a as Fe}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Me}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as xe}from"./chunk-QSXSGKOB.js";import{b as he,e as ge}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Pe,l as be,m as Se}from"./chunk-BIQHA7UA.js";import{r as A,s as j}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as _e,h as R,m as L,y as $}from"./chunk-DPLEMBB4.js";import{c as U,e as Ce,f as fe}from"./chunk-PXB4YEY3.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-GPEVUTDI.js";import{$c as ce,Dc as z,Eb as N,Ec as p,Fc as re,G as K,Gc as f,Ic as D,Jc as O,Ka as ee,Kb as u,Kc as V,Oc as ae,Qa as te,Qc as w,Rc as le,Wb as s,Z as G,Zb as ne,Zc as b,_c as y,ad as H,bc as ie,cc as M,ea as Y,ec as E,fc as T,gc as o,hc as a,ic as P,jc as S,kc as v,mc as I,ob as F,pa as Q,qb as r,rc as h,sc as m,v as q,vc as oe,wb as x,ya as g,za as C}from"./chunk-T5ONJF63.js";import{a as X,b as Z}from"./chunk-K2H6WANG.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{qt as CustomChannelPriceComponent};
|
|
1
|
+
import{a as ke}from"./chunk-CHKLW55N.js";import{a as De}from"./chunk-YR2WEZDG.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-6ZH6QZJ7.js";import{a as ue}from"./chunk-BVIRHZTZ.js";import{a as Te}from"./chunk-PPDHTO44.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-TGOIGCN3.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import"./chunk-7TWBIV3T.js";import{a as Fe}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Me}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as xe}from"./chunk-OGADDKTE.js";import{b as he,e as ge}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Pe,l as be,m as Se}from"./chunk-BIQHA7UA.js";import{r as A,s as j}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as _e,h as R,m as L,y as $}from"./chunk-DPLEMBB4.js";import{c as U,e as Ce,f as fe}from"./chunk-PXB4YEY3.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-GPEVUTDI.js";import{$c as ce,Dc as z,Eb as N,Ec as p,Fc as re,G as K,Gc as f,Ic as D,Jc as O,Ka as ee,Kb as u,Kc as V,Oc as ae,Qa as te,Qc as w,Rc as le,Wb as s,Z as G,Zb as ne,Zc as b,_c as y,ad as H,bc as ie,cc as M,ea as Y,ec as E,fc as T,gc as o,hc as a,ic as P,jc as S,kc as v,mc as I,ob as F,pa as Q,qb as r,rc as h,sc as m,v as q,vc as oe,wb as x,ya as g,za as C}from"./chunk-T5ONJF63.js";import{a as X,b as Z}from"./chunk-K2H6WANG.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{qt as CustomChannelPriceComponent};
|