marketplacepos 3.20.2 → 3.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/Marketplace/{chunk-KEXSSIIK.js → chunk-22G3JR6W.js} +1 -1
  2. package/Marketplace/{chunk-OIA7AZAI.js → chunk-27TUGWVJ.js} +1 -1
  3. package/Marketplace/{chunk-U5DEYVH7.js → chunk-3MQV6JYA.js} +1 -1
  4. package/Marketplace/{chunk-FFIAPQXG.js → chunk-5V62VWDN.js} +1 -1
  5. package/Marketplace/{chunk-B3K6UPYZ.js → chunk-5YIYZ4W4.js} +1 -1
  6. package/Marketplace/{chunk-Q23T3Z7A.js → chunk-6GQBIOOG.js} +1 -1
  7. package/Marketplace/{chunk-L4ATAUYG.js → chunk-7JYGGXZV.js} +1 -1
  8. package/Marketplace/{chunk-6H5OBDRE.js → chunk-AD73Q5SO.js} +1 -1
  9. package/Marketplace/{chunk-IVZDLO4P.js → chunk-BBOSAJFJ.js} +1 -1
  10. package/Marketplace/{chunk-7EZF73IF.js → chunk-BM43VVCJ.js} +1 -1
  11. package/Marketplace/{chunk-VILOHPQ6.js → chunk-CGXLDXLG.js} +1 -1
  12. package/Marketplace/{chunk-ZAOCXN54.js → chunk-EISQDLOC.js} +1 -1
  13. package/Marketplace/{chunk-BYRNKZQX.js → chunk-GD4X6JLM.js} +1 -1
  14. package/Marketplace/{chunk-5XE7MWPC.js → chunk-JGTROTZK.js} +1 -1
  15. package/Marketplace/{chunk-SF2LKH4I.js → chunk-KZMQ7HFA.js} +1 -1
  16. package/Marketplace/{chunk-HVK6UHD7.js → chunk-LC5PAP2Y.js} +1 -1
  17. package/Marketplace/{chunk-V2PRX7LN.js → chunk-NCTBDQQS.js} +1 -1
  18. package/Marketplace/{chunk-WW4N3RLW.js → chunk-OUXYRPIM.js} +1 -1
  19. package/Marketplace/{chunk-ZXG5LQIM.js → chunk-RZNPMBKU.js} +1 -1
  20. package/Marketplace/{chunk-6YZD2TWT.js → chunk-S5BOKQAK.js} +1 -1
  21. package/Marketplace/{chunk-JTEGS3G3.js → chunk-SAUHZIYY.js} +1 -1
  22. package/Marketplace/{chunk-4M3J5VEB.js → chunk-UV6746MK.js} +1 -1
  23. package/Marketplace/{chunk-KR4YVARF.js → chunk-W2JPMZ3K.js} +1 -1
  24. package/Marketplace/{chunk-INVASEX2.js → chunk-WGQYJ7SC.js} +1 -1
  25. package/Marketplace/{chunk-RDU7O5EX.js → chunk-XFEGVCTK.js} +1 -1
  26. package/Marketplace/{chunk-RAHG2R2I.js → chunk-XOLDVKQQ.js} +1 -1
  27. package/Marketplace/{chunk-HIY4OVL6.js → chunk-XP5UAEOH.js} +1 -1
  28. package/Marketplace/{chunk-YRVCHKBA.js → chunk-YCBSVDJN.js} +1 -1
  29. package/Marketplace/index.html +2 -2
  30. package/Marketplace/{main-FLF2PVF5.js → main-FD6XFGYK.js} +1 -1
  31. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import{b as At}from"./chunk-OTR5MBON.js";import{a as Ft}from"./chunk-CJILX5R7.js";import{b as It}from"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as St,b as Tt}from"./chunk-C6QIBOCB.js";import{a as ct,b as pt}from"./chunk-47PEHCOU.js";import{a as he,b as ut,c as ft,d as ge,e as Ce}from"./chunk-RAHG2R2I.js";import{a as Ct,b as bt,c as ve,d as yt,e as vt,j as ae}from"./chunk-KZ6AD6KW.js";import"./chunk-BZPMSXEO.js";import{b as xt}from"./chunk-7VKIP3Z6.js";import{b as gt,c as ye}from"./chunk-DYLT6RRK.js";import{a as _t}from"./chunk-D6L7HUOY.js";import{b as ht,c as be}from"./chunk-BTY6PS53.js";import"./chunk-D76K4RZ7.js";import{a as mt,b as st,f as dt,g as _e}from"./chunk-EIBGI6U2.js";import{d as H,e as W}from"./chunk-PYD2YWAN.js";import"./chunk-6H5OBDRE.js";import{e as re}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as at,n as lt}from"./chunk-4CEFDQPI.js";import{t as ot,u as rt}from"./chunk-2SC3HO66.js";import{M as it,N as ue,O as nt,P as fe}from"./chunk-DQIP7MCZ.js";import{a as Je,c as se,e as de,h as j,i as z,l as Me,m as Qe,n as J,p as Q,q as qe,r as q,s as Ze,t as Ke,u as et,x as Z,y as oe,z as Y}from"./chunk-2E5AKA74.js";import{b as tt,c as g}from"./chunk-FTHTFVHH.js";import{$ as N,$a as je,Ab as Ye,Bc as E,F as $e,Fc as I,H as Re,Ib as ke,Ja as p,Jb as h,Ka as X,Kb as ne,Lb as K,Nb as He,Ob as We,Pb as Xe,Q as ie,Qb as F,Rb as U,Sb as me,V as Ge,X as L,_a as _,aa as ce,ab as m,ac as S,bb as Ee,bc as T,c as Be,d as Le,da as u,ga as x,ha as pe,hb as k,ib as $,kb as R,lb as G,lc as ze,mb as s,na as w,nb as l,oa as C,ob as f,pa as b,pb as D,q as B,qb as V,sb as M,vb as y,xa as Ae,xb as c,yc as A,za as O}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var ee=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}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Pe=(()=>{let i=class i{constructor(){this.shopeeUploadService=u(he),this.formBuilder=u(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,a;return o=o.map(r=>(t=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(v=>v.language=="id"),d.name=a?.value,d)),r.name=t?.value?t?.value:r.name,r)),o}createFormGroup(o){let t=this.formBuilder.group({}),a=[];return o.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new Me(null),value:new Me(null,a)});t.addControl(JSON.stringify(r.attribute_id),d)}else t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(o,t){let a=JSON.parse(JSON.stringify(o)),r=Object.keys(t),d=a.filter(v=>r.findIndex(Fe=>parseInt(Fe)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(r=>{switch(r.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(r.attribute_value_list)?r.attribute_value_list=r.attribute_value_list.filter(d=>t[r.attribute_id]==d.value_id):r.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:r.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):g.IsNotEmpty(t[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:t[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let a=[];return g.IsNotEmpty(o)&&(a=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),a}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var xe=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Lt=["class","component ts"];function $t(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),f(1,"i",4),l()}}function Rt(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),f(1,"i",6),l()}}function Gt(e,i){if(e&1&&(D(0),_(1,$t,2,0,"button",1)(2,Rt,2,0,"button",2),V()),e&2){let n=i.ngIf;p(),m("ngIf",!n.hideBtnToday),p(),m("ngIf",!n.hideBtnClear)}}var kt=(()=>{let i=class i{constructor(o,t,a,r,d){this._datePicker=o,this._calendar=t,this._dateAdapter=a,this.calendarService=r,this._destroyed=new Be,t.stateChanges.pipe(Ge(this._destroyed)).subscribe(v=>d.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ve),X(bt),X(ue),X(xe),X(ze))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[w],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){t&1&&(s(0,"mat-calendar-header"),_(1,Gt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(p(),m("ngIf",T(2,1,a.calendarConfig$)))},dependencies:[A,ht,Ct,E],encapsulation:2});let e=i;return e})(),Mt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=pe({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,be,fe,ae,_e,ye]});let e=i;return e})();function jt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();m("show",n.placeholder),p(2),ne(n.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new O,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(xe))},i.\u0275cmp=x({type:i,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[F([{provide:ue,useClass:Ft,deps:[it]},{provide:nt,useValue:Yt},{provide:Je,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,a){if(t&1){let r=M();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(r),b(a.change(v.value))})("click",function(){C(r);let v=ke(5);return b(v.open())}),l(),f(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(r),b(a.onOpenDatepicker())})("closed",function(){return C(r),b(a.onCloseDatepicker())}),l()()}if(t&2){let r=ke(5);Ee("width",a.width||100,"%"),m("disabled",a.disabled)("appearance",a.appearance),p(),m("ngIf",a.isFloatingLabel&&a.placeholder),p(),Ye("placeholder",a.placeholder||""),m("matDatepicker",r)("min",a.minDateValidation)("max",a.maxDateValidation)("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly),je("data-cy",a.data_cy),p(),Ee("display",a.displayToggle?"unset":"none"),m("for",r),p(),m("calendarHeaderComponent",a.headerComponent)}},dependencies:[A,ve,yt,vt,dt,mt,st,gt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
1
+ import{b as At}from"./chunk-OTR5MBON.js";import{a as Ft}from"./chunk-CJILX5R7.js";import{b as It}from"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as St,b as Tt}from"./chunk-C6QIBOCB.js";import{a as ct,b as pt}from"./chunk-47PEHCOU.js";import{a as he,b as ut,c as ft,d as ge,e as Ce}from"./chunk-XOLDVKQQ.js";import{a as Ct,b as bt,c as ve,d as yt,e as vt,j as ae}from"./chunk-KZ6AD6KW.js";import"./chunk-BZPMSXEO.js";import{b as xt}from"./chunk-7VKIP3Z6.js";import{b as gt,c as ye}from"./chunk-DYLT6RRK.js";import{a as _t}from"./chunk-D6L7HUOY.js";import{b as ht,c as be}from"./chunk-BTY6PS53.js";import"./chunk-D76K4RZ7.js";import{a as mt,b as st,f as dt,g as _e}from"./chunk-EIBGI6U2.js";import{d as H,e as W}from"./chunk-PYD2YWAN.js";import"./chunk-AD73Q5SO.js";import{e as re}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as at,n as lt}from"./chunk-4CEFDQPI.js";import{t as ot,u as rt}from"./chunk-2SC3HO66.js";import{M as it,N as ue,O as nt,P as fe}from"./chunk-DQIP7MCZ.js";import{a as Je,c as se,e as de,h as j,i as z,l as Me,m as Qe,n as J,p as Q,q as qe,r as q,s as Ze,t as Ke,u as et,x as Z,y as oe,z as Y}from"./chunk-2E5AKA74.js";import{b as tt,c as g}from"./chunk-FTHTFVHH.js";import{$ as N,$a as je,Ab as Ye,Bc as E,F as $e,Fc as I,H as Re,Ib as ke,Ja as p,Jb as h,Ka as X,Kb as ne,Lb as K,Nb as He,Ob as We,Pb as Xe,Q as ie,Qb as F,Rb as U,Sb as me,V as Ge,X as L,_a as _,aa as ce,ab as m,ac as S,bb as Ee,bc as T,c as Be,d as Le,da as u,ga as x,ha as pe,hb as k,ib as $,kb as R,lb as G,lc as ze,mb as s,na as w,nb as l,oa as C,ob as f,pa as b,pb as D,q as B,qb as V,sb as M,vb as y,xa as Ae,xb as c,yc as A,za as O}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var ee=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}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Pe=(()=>{let i=class i{constructor(){this.shopeeUploadService=u(he),this.formBuilder=u(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,a;return o=o.map(r=>(t=r?.multi_lang?.find(d=>d.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(d=>(a=d?.multi_lang?.find(v=>v.language=="id"),d.name=a?.value,d)),r.name=t?.value?t?.value:r.name,r)),o}createFormGroup(o){let t=this.formBuilder.group({}),a=[];return o.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new Me(null),value:new Me(null,a)});t.addControl(JSON.stringify(r.attribute_id),d)}else t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(o,t){let a=JSON.parse(JSON.stringify(o)),r=Object.keys(t),d=a.filter(v=>r.findIndex(Fe=>parseInt(Fe)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(r=>{switch(r.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(r.attribute_value_list)?r.attribute_value_list=r.attribute_value_list.filter(d=>t[r.attribute_id]==d.value_id):r.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:r.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):g.IsNotEmpty(t[r.attribute_id])&&(r.attribute_value_list=[{value_id:0,name:t[r.attribute_id]}]);break;default:r.attribute_value_list=r.attribute_value_list.filter(d=>d.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let a=[];return g.IsNotEmpty(o)&&(a=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),a}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var xe=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Lt=["class","component ts"];function $t(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),f(1,"i",4),l()}}function Rt(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),f(1,"i",6),l()}}function Gt(e,i){if(e&1&&(D(0),_(1,$t,2,0,"button",1)(2,Rt,2,0,"button",2),V()),e&2){let n=i.ngIf;p(),m("ngIf",!n.hideBtnToday),p(),m("ngIf",!n.hideBtnClear)}}var kt=(()=>{let i=class i{constructor(o,t,a,r,d){this._datePicker=o,this._calendar=t,this._dateAdapter=a,this.calendarService=r,this._destroyed=new Be,t.stateChanges.pipe(Ge(this._destroyed)).subscribe(v=>d.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ve),X(bt),X(ue),X(xe),X(ze))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[w],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){t&1&&(s(0,"mat-calendar-header"),_(1,Gt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(p(),m("ngIf",T(2,1,a.calendarConfig$)))},dependencies:[A,ht,Ct,E],encapsulation:2});let e=i;return e})(),Mt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=pe({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,be,fe,ae,_e,ye]});let e=i;return e})();function jt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();m("show",n.placeholder),p(2),ne(n.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new O,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(xe))},i.\u0275cmp=x({type:i,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[F([{provide:ue,useClass:Ft,deps:[it]},{provide:nt,useValue:Yt},{provide:Je,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,a){if(t&1){let r=M();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(r),b(a.change(v.value))})("click",function(){C(r);let v=ke(5);return b(v.open())}),l(),f(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(r),b(a.onOpenDatepicker())})("closed",function(){return C(r),b(a.onCloseDatepicker())}),l()()}if(t&2){let r=ke(5);Ee("width",a.width||100,"%"),m("disabled",a.disabled)("appearance",a.appearance),p(),m("ngIf",a.isFloatingLabel&&a.placeholder),p(),Ye("placeholder",a.placeholder||""),m("matDatepicker",r)("min",a.minDateValidation)("max",a.maxDateValidation)("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly),je("data-cy",a.data_cy),p(),Ee("display",a.displayToggle?"unset":"none"),m("for",r),p(),m("calendarHeaderComponent",a.headerComponent)}},dependencies:[A,ve,yt,vt,dt,mt,st,gt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
2
2
  `],encapsulation:2});let e=i;return e})(),Nt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=pe({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,be,fe,ae,_e,ye,Mt]});let e=i;return e})();var Ne=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}(Ne||{});var we=()=>[];function Wt(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function Xt(e,i){if(e&1&&f(0,"ng-select",6),e&2){let n=c().$implicit;m("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:me(4,we))("placeholder","Pilih "+(n==null?null:n.name))}}function zt(e,i){if(e&1&&f(0,"input",8),e&2){let n=c(2).$implicit;m("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function Jt(e,i){if(e&1&&(s(0,"option",15),h(1),l()),e&2){let n=i.$implicit;m("value",n),p(),ne(n)}}function Qt(e,i){if(e&1&&(s(0,"div",10),f(1,"input",12),s(2,"select",13)(3,"option",14),h(4,"Unit"),l(),R(5,Jt,2,2,"option",15,$),l()()),e&2){let n=c(3).$implicit;m("formGroupName",n.attribute_id),p(),m("placeholder","Isi "+(n==null?null:n.name)),p(2),m("value",null),p(2),G(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function qt(e,i){if(e&1&&f(0,"input",11),e&2){let n=c(3).$implicit;m("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function Zt(e,i){if(e&1&&_(0,Qt,7,3,"div",10)(1,qt,1,2,"input",11),e&2){let n=c(2).$implicit,o=c(2);k((n==null||n.attribute_info==null?null:n.attribute_info.format_type)==o.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function Kt(e,i){if(e&1&&f(0,"datepicker",9),e&2){let n=c(2).$implicit;m("formControlName",n.attribute_id)}}function ei(e,i){if(e&1&&_(0,zt,1,2,"input",8)(1,Zt,2,1)(2,Kt,1,1,"datepicker",9),e&2){let n,o=c().$implicit,t=c(2);k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_validation_type)===t.validationType.VALIDATOR_STRING_TYPE?0:n===t.validationType.VALIDATOR_FLOAT_TYPE?1:n===t.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ti(e,i){if(e&1&&f(0,"ng-select",7),e&2){let n=c().$implicit;m("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:me(3,we))("placeholder","Pilih "+(n==null?null:n.name))}}function ii(e,i){if(e&1&&f(0,"ng-select",7),e&2){let n=c().$implicit;m("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:me(3,we))("placeholder","Pilih "+(n==null?null:n.name))}}function ni(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,Wt,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,Xt,1,5,"ng-select",6)(6,ei,3,1)(7,ti,1,4,"ng-select",7)(8,ii,1,4,"ng-select",7),l()),e&2){let n,o=i.$implicit,t=c(2);p(2),k(o.mandatory?2:-1),p(2),K(" ",o==null?null:o.name," "),p(),k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_type)===t.inputType.MULTI_COMBO_BOX?5:n===t.inputType.FREE_TEXT_FILED?6:n===t.inputType.SINGLE_COMBO_BOX?7:8)}}function oi(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ni,9,3,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(2),G(n)}}var wt=(()=>{let i=class i{constructor(){this.formCategoryService=u(Pe),this.attributesChanges=new O,this.inputType=ee,this.formatType=le,this.validationType=Ne}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(L(o=>{this.form=this.formCategoryService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{t=this.formCategoryService.getFilteredAttributes(o,a),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Pe]),w,U],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(t,a){t&1&&(_(0,oi,5,1,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,W,H,Y,J,Ke,et,se,Ze,j,z,Q,q,qe,xt,Nt,Pt],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}"]});let e=i;return e})();var Oe=(()=>{let i=class i{constructor(){this.httpService=u(re),this.formBuilder=u(Z),this.uploadProductService=u(Ce)}getAttributes(o,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe($e(r=>this.uploadProductService.selectedProduct$.pipe(B(d=>(r=this.mappingAttributeSalesProperty(r,d),r)))))}mappingAttributeSalesProperty(o,t){let a=0;return o.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(t),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(o){let t=!1,a=[];return o.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),t=a.some(r=>r>1),t}createFormGroup(o){let t=this.formBuilder.group({}),a=[];return o.forEach(r=>{a=[],r.is_required&&a.push(de.required),t.addControl(r.id,this.formBuilder.control(null,a))}),t}getFilteredAttributes(o,t){let a=JSON.parse(JSON.stringify(o)),r=Object.keys(t),d=a.filter(v=>r.findIndex(Fe=>parseInt(Fe)==v.id)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(r=>(r.is_multiple_selection?r.values=r.values.filter(d=>t[r.id]?.includes(d.id)):r.values=r.values.filter(d=>d.id==t[r.id]),r)).filter(r=>r?.values?.length>0)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function ri(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function ai(e,i){if(e&1&&f(0,"ng-select",6),e&2){let n=c().$implicit;m("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,i){if(e&1&&f(0,"ng-select",7),e&2){let n=c().$implicit;m("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ci(e,i){if(e&1&&(s(0,"small",5),h(1),l()),e&2){let n=c().$implicit;p(),K(" ",n==null?null:n.name," is mandatory ")}}function pi(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,ri,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,ai,1,4,"ng-select",6)(6,li,1,3,"ng-select",7)(7,ci,2,1,"small",5),l()),e&2){let n=i.$implicit;p(2),k(n.is_required?2:-1),p(2),K(" ",n==null?null:n.name," "),p(),k(n.is_multiple_selection?5:6),p(2),k(n.is_required?7:-1)}}function mi(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,pi,8,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(2),G(n)}}var Ot=(()=>{let i=class i{constructor(){this.tiktokAttributeFormService=u(Oe),this.attributesChanges=new O}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(B(o=>o.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(t.values)||t.values?.length==0)))),L(o=>{this.form=this.tiktokAttributeFormService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{t=this.tiktokAttributeFormService.getFilteredAttributes(o,a),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Oe]),w,U],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"]],template:function(t,a){t&1&&(_(0,mi,5,1,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q,oe]});let e=i;return e})();var De=(()=>{let i=class i{constructor(){this.woocommerceUploadService=u(ge)}getAttributes(o,t){return this.woocommerceUploadService.getAttributes(o,t).pipe(B(a=>a.map(r=>({key:r.name,label:r.name}))))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var Dt=(()=>{let i=class i{constructor(){this.wooAttributeFormService=u(De),this.channelId=Ae(),this.categoryId=Ae(),this.attributesChanges=new O}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(o){this.attributesChanges.emit([o.key])}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([De]),w,U],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(t,a){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),h(3,"Atribut"),l(),s(4,"ng-select",3),S(5,"async"),y("change",function(d){return a.onSelectAttribute(d)}),l()()()),t&2&&(p(4),m("items",T(5,1,a.attributes$)))},dependencies:[I,E,oe,W,H,Y]});let e=i;return e})();var Ve=(()=>{let i=class i{constructor(){this.httpService=u(re),this.formBuilder=u(Z)}getAttributes(o,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(r=>r))}createFormGroup(o){let t=this.formBuilder.group({});return o.forEach(a=>{t.addControl(a.variant,this.formBuilder.control(null))}),t}convertAttributes(o={}){return Object.values(o).filter(a=>a!==null).map(a=>JSON.stringify(a))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function si(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),h(2),l(),f(3,"ng-select",5),l()),e&2){let n=i.$implicit;p(2),K(" ",n==null?null:n.variant," "),p(),m("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function di(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,si,4,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(2),G(n)}}var Vt=(()=>{let i=class i{constructor(){this.tokpedAttrFormService=u(Ve),this.attributesChanges=new O}ngOnInit(){}ngOnChanges(o){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(L(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let o=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{o=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(o)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Ve]),w,U],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(t,a){t&1&&(_(0,di,5,1,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q]});let e=i;return e})();var Ue=(()=>{let i=class i{constructor(){this.httpService=u(re),this.formBuilder=u(Z)}getAttributes(o){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:o}]).pipe(L(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(o){let t=this.formBuilder.group({});return Object.keys(o.Attribute).forEach(r=>{t.addControl(r,this.formBuilder.control(null))}),t}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function ui(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),h(5," Brand "),l(),f(6,"input",5),l(),s(7,"div",6)(8,"div",4),h(9," Product Type "),l(),f(10,"input",7),l(),s(11,"div",6)(12,"div",4),h(13," Status "),l(),f(14,"ng-select",8),l()()(),V()),e&2){let n=i.ngIf,o=c();p(),m("formGroup",o.form),p(13),m("items",n.Options.StatusOptions)}}var Ut=(()=>{let i=class i{constructor(){this.attributesChanges=new O,this.shopifyFormService=u(Ue)}ngOnChanges(o){o.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(L(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Re(500)).subscribe(o=>{this.attributesChanges.emit([o])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Ue]),w,U],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(t,a){t&1&&(_(0,ui,15,2,"ng-container",0),S(1,"async")),t&2&&m("ngIf",T(1,1,a.attributes$))},dependencies:[I,A,E,Y,J,se,j,z,Q,q,W,H]});let e=i;return e})();function fi(e,i){if(e&1&&(s(0,"div",6),f(1,"app-product-card",9),l()),e&2){let n=i.$implicit;p(),m("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("imageForZoom",n==null?null:n.ImageUrl)("code",n==null||n.Variants[0]==null?null:n.Variants[0].Code)("showFooter",!1)}}function _i(e,i){if(e&1){let n=M();D(0),s(1,"mat-checkbox",21),Xe("ngModelChange",function(t){C(n);let a=c().$implicit;return We(a.selected,t)||(a.selected=t),b(t)}),y("ngModelChange",function(){let t=C(n).ngIf,a=c(),r=a.$implicit,d=a.$index,v=c();return b(v.onSelectChannel(r,d,t))}),l(),V()}if(e&2){let n=c().$implicit;p(),He("ngModel",n.selected)}}function hi(e,i){e&1&&(s(0,"div",18),f(1,"input",22),l())}function gi(e,i){if(e&1){let n=M();s(0,"app-channel-category-select",23),y("selectedCategory",function(t){C(n);let a=c().$index,r=c();return b(r.onCategoryChange(a,t))}),l()}if(e&2){let n=c().$implicit,o=c();m("disabled",!n.selected||n.selected&&n.type==o.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function Ci(e,i){if(e&1){let n=M();s(0,"shopee-attribute-form",27),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function bi(e,i){if(e&1){let n=M();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,i){if(e&1){let n=M();s(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,i){if(e&1){let n=M();s(0,"tokopedia-attribute-form",28),y("attributesChanges",function(t){C(n);let a=c(2).$index,r=c();return b(r.onAttributesChange(a,t))}),l()}if(e&2){let n=c(2).$implicit;m("categoryId",n.categoryId)("channelId",n.id)}}function xi(e,i){if(e&1&&(s(0,"div",20)(1,"div",24),_(2,Ci,1,3,"shopee-attribute-form",25)(3,bi,1,2,"tiktok-attribute-form",26)(4,yi,1,2,"wooocommerce-attribute-form",26)(5,vi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,o=c().$implicit,t=c();p(2),k((n=o.type)===t.channelType.Shopee?2:n===t.channelType.Tiktok?3:n===t.channelType.WooCommerce?4:n===t.channelType.Tokopedia?5:-1)}}function Ii(e,i){if(e&1){let n=M();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),y("attributesChanges",function(t){C(n);let a=c().$index,r=c();return b(r.onAttributesChange(a,t))}),l()()()}if(e&2){let n=c().$implicit;p(2),m("channelId",n.id)}}function Si(e,i){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,_i,2,1,"ng-container",14),S(7,"async"),l(),s(8,"div"),f(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),h(12),l()()()(),s(13,"div",12)(14,"div",17),_(15,hi,2,0,"div",18)(16,gi,1,4,"app-channel-category-select",19),l()()(),_(17,xi,6,1,"div",20)(18,Ii,3,1,"div",20),l()()),e&2){let n=i.$implicit,o=c();p(6),m("ngIf",T(7,8,o.defaultCategories$)),p(3),m("typeId",n.type)("showChannelName",!1),p(),m("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),ne(n.name),p(3),k(n.type==o.channelType.Shopify?15:16),p(2),k(n.categoryId&&o.channelType.Lazada!=n.type&&n.selected?17:o.channelType.Shopify==n.type&&n.selected?18:-1)}}var xr=(()=>{let i=class i{constructor(){this.uploadProductService=u(Ce),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=tt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ie(1))}onCategoryChange(o,t){this.channelProductUploads.update(a=>a.map((r,d)=>(d==o&&(r.categoryId=t,r.attributes=[]),r)))}onAttributesChange(o,t){this.channelProductUploads.update(a=>a.map((r,d)=>(d==o&&(r.attributes=t),r)))}onSelectChannel(o,t,a){this.channelProductUploads.update(r=>r.map((d,v)=>{if(v==t&&o.selected){let Te=this.findCategoryByChannelId(o.id,a);d.categoryId=Te?.DefaultCategoryID}return v==t&&!o.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(o,t){return t.find(a=>a.ID===o)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["app-product-upload"]],standalone:!0,features:[F([he,ut,ft,ge]),U],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"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[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(t,a){if(t&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return a.onUploadProduct()}),f(3,"i",2),h(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),h(8,"Product To Upload"),l(),s(9,"div",5),R(10,fi,2,7,"div",6,$),S(12,"async"),l(),s(13,"h3",7),h(14,"Channel To Upload"),l(),R(15,Si,19,10,"div",8,$),l()()()),t&2){let r;m("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),m("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),p(8),G(T(12,3,a.selectedProducts$)),p(5),G(a.channelProductUploads())}},dependencies:[I,A,E,It,lt,at,Tt,St,pt,ct,oe,j,Qe,rt,ot,wt,Ot,Dt,Vt,Ut,_t,At],encapsulation:2});let e=i;return e})();export{xr as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-WTMUHE4V.js";import{a as P}from"./chunk-6UDYSYXW.js";import{a as C}from"./chunk-VBCIYCOF.js";import{b as O}from"./chunk-MKJON4UM.js";import"./chunk-WKSTGJK5.js";import{c as M}from"./chunk-GQG2K3LS.js";import{a as m}from"./chunk-7EZF73IF.js";import{a as h}from"./chunk-D6L7HUOY.js";import"./chunk-BTY6PS53.js";import"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{e as s}from"./chunk-PYD2YWAN.js";import"./chunk-6H5OBDRE.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-4CEFDQPI.js";import{u as f}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{y as g}from"./chunk-2E5AKA74.js";import"./chunk-FTHTFVHH.js";import{$c as a,Fc as i,Xc as l,aa as e,ga as d,ha as r,ob as c}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],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}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-L4ATAUYG.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-4M3J5VEB.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-BYRNKZQX.js").then(o=>o.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[m]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,a.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,a,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
1
+ import{a as b}from"./chunk-WTMUHE4V.js";import{a as P}from"./chunk-6UDYSYXW.js";import{a as C}from"./chunk-VBCIYCOF.js";import{b as O}from"./chunk-MKJON4UM.js";import"./chunk-WKSTGJK5.js";import{c as M}from"./chunk-GQG2K3LS.js";import{a as m}from"./chunk-BM43VVCJ.js";import{a as h}from"./chunk-D6L7HUOY.js";import"./chunk-BTY6PS53.js";import"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{e as s}from"./chunk-PYD2YWAN.js";import"./chunk-AD73Q5SO.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-4CEFDQPI.js";import{u as f}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{y as g}from"./chunk-2E5AKA74.js";import"./chunk-FTHTFVHH.js";import{$c as a,Fc as i,Xc as l,aa as e,ga as d,ha as r,ob as c}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],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}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-7JYGGXZV.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-UV6746MK.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-GD4X6JLM.js").then(o=>o.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[m]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,a.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,a,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
@@ -1,4 +1,4 @@
1
- import{a as ee}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-YVTEU2IF.js";import{a as ht}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-33L2SBIN.js";import{a as se}from"./chunk-BGWVHGAY.js";import{b as Rt}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-L4BFVIW5.js";import"./chunk-GNY5TY3R.js";import{a as Dt,b as Et}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import{i as qt}from"./chunk-2FRMUOJY.js";import{a as Jt,b as Kt}from"./chunk-C6QIBOCB.js";import{a as me,b as Tt}from"./chunk-47PEHCOU.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-KZ6AD6KW.js";import{a as Ot}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Q}from"./chunk-WTMUHE4V.js";import{b as Wt}from"./chunk-MKJON4UM.js";import{b as Mt}from"./chunk-WKSTGJK5.js";import{a as Pt,b as It,c as Nt}from"./chunk-GQG2K3LS.js";import{a as ge}from"./chunk-7EZF73IF.js";import"./chunk-BTY6PS53.js";import"./chunk-EIBGI6U2.js";import{a as re,b as oe,c as gt,d as X,e as _t}from"./chunk-PYD2YWAN.js";import{f as ce,g as Z}from"./chunk-6H5OBDRE.js";import{b as Te,e as A}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{b as Ct,d as De,e as yt,f as wt,g as xt,m as Y,n as bt}from"./chunk-4CEFDQPI.js";import{t as ft,u as St}from"./chunk-2SC3HO66.js";import{P as ut}from"./chunk-DQIP7MCZ.js";import{b as He,c as $,h as z,m as G,o as ae,y as Ue}from"./chunk-2E5AKA74.js";import{b as N,c as M}from"./chunk-FTHTFVHH.js";import{$ as fe,$c as je,Ab as mt,B as at,Bb as st,Bc as ve,Cc as F,Ec as K,Fc as Se,Ha as V,Ib as O,Ja as p,Jb as m,Ka as v,Kb as S,Lb as T,Nb as w,Ob as x,Pb as b,Q as ye,Qb as dt,Rb as We,Sb as J,T as rt,Tb as Be,Ub as ie,Va as pt,Wc as Ge,X as be,Xc as ct,Zc as ne,_a as u,aa as Ae,ab as d,ac as P,bc as k,ca as de,cc as R,dc as U,ga as L,ha as Re,hb as Qe,mb as n,na as ot,nb as r,oa as g,ob as C,pa as _,pb as D,q as j,qa as Ze,qb as E,ra as Xe,sb as I,vb as y,vc as ze,w as nt,xb as c,xc as W,yc as B,za as lt}from"./chunk-ZIZWZZ4E.js";import{a as tt,b as it}from"./chunk-GNOSNGXM.js";var Qt=(()=>{let l=class l{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[ht.downloadOrder]}]}ngOnInit(){}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=L({type:l,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,i){t&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),r()()(),C(4,"router-outlet")),t&2&&(p(3),d("Tabs",i.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Dt,ct]});let a=l;return a})();var ei=(()=>{let l=class l{constructor(){}convertToCSV(e,t){let i;if(typeof e=="string")i=e;else{var h=typeof e=="object"?e:JSON.parse(e);i=this.transformToCSVStringFormat(h)}this.downloadCSV(i,t)}transformToCSVStringFormat(e){if(!e||!e.length)return;let t=",",i=Object.keys(e[0]);return e.map(f=>i.map(s=>{let q=f[s]===null||f[s]===void 0?"":f[s];return q=q instanceof Date?q.toLocaleString():q.toString().replace(/"/g,'""'),q.search(/("|,|\n)/g)>=0&&(q=`"${q}"`),q}).join(t)).join(`
1
+ import{a as ee}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-YVTEU2IF.js";import{a as ht}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-33L2SBIN.js";import{a as se}from"./chunk-BGWVHGAY.js";import{b as Rt}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-L4BFVIW5.js";import"./chunk-GNY5TY3R.js";import{a as Dt,b as Et}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import{i as qt}from"./chunk-2FRMUOJY.js";import{a as Jt,b as Kt}from"./chunk-C6QIBOCB.js";import{a as me,b as Tt}from"./chunk-47PEHCOU.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-KZ6AD6KW.js";import{a as Ot}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Q}from"./chunk-WTMUHE4V.js";import{b as Wt}from"./chunk-MKJON4UM.js";import{b as Mt}from"./chunk-WKSTGJK5.js";import{a as Pt,b as It,c as Nt}from"./chunk-GQG2K3LS.js";import{a as ge}from"./chunk-BM43VVCJ.js";import"./chunk-BTY6PS53.js";import"./chunk-EIBGI6U2.js";import{a as re,b as oe,c as gt,d as X,e as _t}from"./chunk-PYD2YWAN.js";import{f as ce,g as Z}from"./chunk-AD73Q5SO.js";import{b as Te,e as A}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{b as Ct,d as De,e as yt,f as wt,g as xt,m as Y,n as bt}from"./chunk-4CEFDQPI.js";import{t as ft,u as St}from"./chunk-2SC3HO66.js";import{P as ut}from"./chunk-DQIP7MCZ.js";import{b as He,c as $,h as z,m as G,o as ae,y as Ue}from"./chunk-2E5AKA74.js";import{b as N,c as M}from"./chunk-FTHTFVHH.js";import{$ as fe,$c as je,Ab as mt,B as at,Bb as st,Bc as ve,Cc as F,Ec as K,Fc as Se,Ha as V,Ib as O,Ja as p,Jb as m,Ka as v,Kb as S,Lb as T,Nb as w,Ob as x,Pb as b,Q as ye,Qb as dt,Rb as We,Sb as J,T as rt,Tb as Be,Ub as ie,Va as pt,Wc as Ge,X as be,Xc as ct,Zc as ne,_a as u,aa as Ae,ab as d,ac as P,bc as k,ca as de,cc as R,dc as U,ga as L,ha as Re,hb as Qe,mb as n,na as ot,nb as r,oa as g,ob as C,pa as _,pb as D,q as j,qa as Ze,qb as E,ra as Xe,sb as I,vb as y,vc as ze,w as nt,xb as c,xc as W,yc as B,za as lt}from"./chunk-ZIZWZZ4E.js";import{a as tt,b as it}from"./chunk-GNOSNGXM.js";var Qt=(()=>{let l=class l{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[ht.downloadOrder]}]}ngOnInit(){}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=L({type:l,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,i){t&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),r()()(),C(4,"router-outlet")),t&2&&(p(3),d("Tabs",i.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Dt,ct]});let a=l;return a})();var ei=(()=>{let l=class l{constructor(){}convertToCSV(e,t){let i;if(typeof e=="string")i=e;else{var h=typeof e=="object"?e:JSON.parse(e);i=this.transformToCSVStringFormat(h)}this.downloadCSV(i,t)}transformToCSVStringFormat(e){if(!e||!e.length)return;let t=",",i=Object.keys(e[0]);return e.map(f=>i.map(s=>{let q=f[s]===null||f[s]===void 0?"":f[s];return q=q instanceof Date?q.toLocaleString():q.toString().replace(/"/g,'""'),q.search(/("|,|\n)/g)>=0&&(q=`"${q}"`),q}).join(t)).join(`
2
2
  `)}downloadCSV(e,t){var i=new Blob([e],{type:"text/csv;charset=utf8;"}),h=document.createElement("a");h.setAttribute("href",window.URL.createObjectURL(i)),h.setAttribute("download",t),document.body.appendChild(h),h.click(),document.body.removeChild(h)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=fe({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Ee=(()=>{let l=class l{constructor(e,t){this.http=e,this.exportService=t}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(e){return this.http.post("/api/orders/GetNewOrder",e).pipe(j(t=>t.Data))}getTotalNewOrders(e,t,i){let h={ListChannelID:e,From:t,To:i};return this.http.post("/api/orders/GetCountNewOrder",h).pipe(j(f=>f.Count))}exportOrders(e,t){return this.http.post("api/Orders/ExportOrder",e).pipe(be(i=>{this.exportService.convertToCSV(i,t)}))}};l.\u0275fac=function(t){return new(t||l)(de(A),de(ei))},l.\u0275prov=fe({token:l,factory:l.\u0275fac});let a=l;return a})();var Ye=(()=>{let l=class l{constructor(e,t){this.http=e,this.toastr=t}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(be(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(e){let t=e.filter(h=>h.Status==!1),i=e.filter(h=>h.Status==!0);if(t.length==0&&i.length>0){let h=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(h,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let h=`<ol>
3
3
  ${this.generateSuccessMessage(i)}
4
4
  ${this.generateErrorMessage(t)}