marketplacepos 3.16.3 → 3.16.6

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 (28) hide show
  1. package/Marketplace/{chunk-KMIJYZWR.js → chunk-37QWNWHJ.js} +1 -1
  2. package/Marketplace/{chunk-AEA453K7.js → chunk-6A746Q2N.js} +1 -1
  3. package/Marketplace/{chunk-GGCXGP3I.js → chunk-AYFY7HHL.js} +1 -1
  4. package/Marketplace/{chunk-JBT2QHON.js → chunk-C3R6SGRH.js} +1 -1
  5. package/Marketplace/{chunk-XNZXKVHI.js → chunk-CK442KU6.js} +1 -1
  6. package/Marketplace/{chunk-KDEIULW7.js → chunk-D6UTGFEO.js} +1 -1
  7. package/Marketplace/{chunk-IRQKY4CE.js → chunk-DIQW3R2I.js} +1 -1
  8. package/Marketplace/{chunk-6MXP6XVM.js → chunk-LMYVXZ5O.js} +1 -1
  9. package/Marketplace/{chunk-N7BCDU3X.js → chunk-MPMNVKBU.js} +1 -1
  10. package/Marketplace/{chunk-3FADAJBD.js → chunk-QICAMN6U.js} +1 -1
  11. package/Marketplace/{chunk-Q3PU3YBD.js → chunk-QNHIAAV3.js} +1 -1
  12. package/Marketplace/{chunk-45HUQD7V.js → chunk-QVST77FV.js} +1 -1
  13. package/Marketplace/{chunk-HTD4ZOG5.js → chunk-S7B6P7NY.js} +1 -1
  14. package/Marketplace/{chunk-P74VD2YF.js → chunk-U4SY5KAM.js} +1 -1
  15. package/Marketplace/{chunk-UYGZ7SP4.js → chunk-UUHH36QD.js} +1 -1
  16. package/Marketplace/{chunk-OFWCX47E.js → chunk-VBPSLPVJ.js} +1 -1
  17. package/Marketplace/{chunk-SZEDQTEX.js → chunk-WF6PBLOY.js} +1 -1
  18. package/Marketplace/{chunk-5MT3KUSR.js → chunk-WMPI2QPB.js} +1 -1
  19. package/Marketplace/{chunk-VKPJF7Y6.js → chunk-XC5VDAOP.js} +1 -1
  20. package/Marketplace/{chunk-MA4BUBUL.js → chunk-XWZXILH3.js} +1 -1
  21. package/Marketplace/{chunk-HMGGITJC.js → chunk-YMCXD2IY.js} +1 -1
  22. package/Marketplace/{chunk-U6K6ELJH.js → chunk-YNMFFEF3.js} +1 -1
  23. package/Marketplace/{chunk-CX6LM3WN.js → chunk-YP423ZQ6.js} +1 -1
  24. package/Marketplace/{chunk-ZPAK5MJ6.js → chunk-YWLE67TM.js} +1 -1
  25. package/Marketplace/{chunk-K76K7XC4.js → chunk-ZEOMHDTX.js} +1 -1
  26. package/Marketplace/index.html +2 -2
  27. package/Marketplace/{main-V54J4AKA.js → main-E4M7FNAV.js} +1 -1
  28. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- import{a as xt,c as Ft}from"./chunk-3LNROKGQ.js";import"./chunk-F4FACWQU.js";import{a as Tt}from"./chunk-INOCIPFW.js";import{a as It,b as St}from"./chunk-HPCPVA6F.js";import{a as at,b as lt}from"./chunk-3HQCLIMJ.js";import{a as he,b as st,c as dt,d as ge,e as ut}from"./chunk-XNZXKVHI.js";import{a as gt,b as Ct,c as ye,d as bt,e as yt,j as ae}from"./chunk-ITTQVZJZ.js";import{b as vt}from"./chunk-UUI7T7NV.js";import{b as ht,c as be}from"./chunk-OURZMROU.js";import{a as ft}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import{b as _t,c as Ce}from"./chunk-A3ZMDUMP.js";import{a as ct,b as mt,f as pt,g as _e}from"./chunk-X54LLODL.js";import{d as H,e as W}from"./chunk-DDUQ3IZU.js";import"./chunk-N7BCDU3X.js";import{e as re}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as ot,n as rt}from"./chunk-SG42JTLJ.js";import{t as it,u as nt}from"./chunk-BZ7SMYI7.js";import{M as et,N as ue,O as tt,P as fe}from"./chunk-DRY23ALE.js";import{A as oe,B as Y,a as Xe,c as se,e as de,h as j,i as z,l as ke,m as ze,n as J,q as Q,r as Je,s as q,t as Qe,u as qe,v as Ze,z as Z}from"./chunk-VFLG2BDB.js";import{b as Ke,c as g}from"./chunk-T4MH7AFK.js";import{$ as N,$a as p,$b as T,Dc as I,H as Le,Hb as Ee,Ia as m,Ib as h,Ja as X,Jb as ne,Kb as K,Mb as je,Nb as Ye,Ob as He,Pb as F,Q as ie,Qb as U,Rb as pe,V as $e,X as L,Za as _,_a as Re,_b as S,aa as ce,ab as Ae,c as Ue,d as Be,da as f,ga as x,gb as k,ha as me,hb as $,jb as R,jc as We,kb as G,lb as s,mb as l,na as O,nb as u,oa as C,ob as D,pa as b,pb as V,q as B,rb as M,ub as y,wb as c,wc as A,xa as Fe,za as w,zb as Ge,zc as E}from"./chunk-IH2NT4RC.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 Me=(()=>{let i=class i{constructor(){this.shopeeUploadService=f(he),this.formBuilder=f(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,r;return o=o.map(a=>(t=a?.multi_lang?.find(d=>d.language=="id"),a.attribute_value_list=a?.attribute_value_list?.map(d=>(r=d?.multi_lang?.find(v=>v.language=="id"),d.name=r?.value,d)),a.name=t?.value?t?.value:a.name,a)),o}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{if(r=[],a.mandatory&&r.push(de.required),a?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&a?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new ke(null),value:new ke(null,r)});t.addControl(JSON.stringify(a.attribute_id),d)}else t.addControl(JSON.stringify(a.attribute_id),this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>{switch(a.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(a.attribute_value_list)?a.attribute_value_list=a.attribute_value_list.filter(d=>t[a.attribute_id]==d.value_id):a.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:a.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?a.attribute_value_list=this.setSelectedQuantitativeAttr(t[a.attribute_id]?.value,t[a.attribute_id]?.unit):g.IsNotEmpty(t[a.attribute_id])&&(a.attribute_value_list=[{value_id:0,name:t[a.attribute_id]}]);break;default:a.attribute_value_list=a.attribute_value_list.filter(d=>d.value_id==t[a.attribute_id])}return a}).filter(a=>a?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let r=[];return g.IsNotEmpty(o)&&(r=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),r}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var ve=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Be({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 Bt=["class","component ts"];function Lt(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())}),u(1,"i",4),l()}}function $t(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())}),u(1,"i",6),l()}}function Rt(e,i){if(e&1&&(D(0),_(1,Lt,2,0,"button",1)(2,$t,2,0,"button",2),V()),e&2){let n=i.ngIf;m(),p("ngIf",!n.hideBtnToday),m(),p("ngIf",!n.hideBtnClear)}}var Et=(()=>{let i=class i{constructor(o,t,r,a,d){this._datePicker=o,this._calendar=t,this._dateAdapter=r,this.calendarService=a,this._destroyed=new Ue,t.stateChanges.pipe($e(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(ye),X(Ct),X(ue),X(ve),X(We))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[O],attrs:Bt,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,r){t&1&&(s(0,"mat-calendar-header"),_(1,Rt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(m(),p("ngIf",T(2,1,r.calendarConfig$)))},dependencies:[A,_t,gt,E],encapsulation:2});let e=i;return e})(),kt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be]});let e=i;return e})();function Gt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();p("show",n.placeholder),m(2),ne(n.placeholder)}}var jt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{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=Et,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new w,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(ve))},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:Tt,deps:[et]},{provide:tt,useValue:jt},{provide:Xe,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,r){if(t&1){let a=M();s(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(a),b(r.change(v.value))})("click",function(){C(a);let v=Ee(5);return b(v.open())}),l(),u(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(a),b(r.onOpenDatepicker())})("closed",function(){return C(a),b(r.onCloseDatepicker())}),l()()}if(t&2){let a=Ee(5);Ae("width",r.width||100,"%"),p("disabled",r.disabled)("appearance",r.appearance),m(),p("ngIf",r.isFloatingLabel&&r.placeholder),m(),Ge("placeholder",r.placeholder||""),p("matDatepicker",a)("min",r.minDateValidation)("max",r.maxDateValidation)("value",r.date==r.minDate?null:r.date)("disabled",r.disabled)("readonly",r.readOnly),Re("data-cy",r.data_cy),m(),Ae("display",r.displayToggle?"unset":"none"),p("for",a),m(),p("calendarHeaderComponent",r.headerComponent)}},dependencies:[A,ye,bt,yt,pt,ct,mt,ht],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{a as xt,c as Ft}from"./chunk-3LNROKGQ.js";import"./chunk-F4FACWQU.js";import{a as Tt}from"./chunk-INOCIPFW.js";import{a as It,b as St}from"./chunk-HPCPVA6F.js";import{a as at,b as lt}from"./chunk-3HQCLIMJ.js";import{a as he,b as st,c as dt,d as ge,e as ut}from"./chunk-CK442KU6.js";import{a as gt,b as Ct,c as ye,d as bt,e as yt,j as ae}from"./chunk-ITTQVZJZ.js";import{b as vt}from"./chunk-UUI7T7NV.js";import{b as ht,c as be}from"./chunk-OURZMROU.js";import{a as ft}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import{b as _t,c as Ce}from"./chunk-A3ZMDUMP.js";import{a as ct,b as mt,f as pt,g as _e}from"./chunk-X54LLODL.js";import{d as H,e as W}from"./chunk-DDUQ3IZU.js";import"./chunk-MPMNVKBU.js";import{e as re}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as ot,n as rt}from"./chunk-SG42JTLJ.js";import{t as it,u as nt}from"./chunk-BZ7SMYI7.js";import{M as et,N as ue,O as tt,P as fe}from"./chunk-DRY23ALE.js";import{A as oe,B as Y,a as Xe,c as se,e as de,h as j,i as z,l as ke,m as ze,n as J,q as Q,r as Je,s as q,t as Qe,u as qe,v as Ze,z as Z}from"./chunk-VFLG2BDB.js";import{b as Ke,c as g}from"./chunk-T4MH7AFK.js";import{$ as N,$a as p,$b as T,Dc as I,H as Le,Hb as Ee,Ia as m,Ib as h,Ja as X,Jb as ne,Kb as K,Mb as je,Nb as Ye,Ob as He,Pb as F,Q as ie,Qb as U,Rb as pe,V as $e,X as L,Za as _,_a as Re,_b as S,aa as ce,ab as Ae,c as Ue,d as Be,da as f,ga as x,gb as k,ha as me,hb as $,jb as R,jc as We,kb as G,lb as s,mb as l,na as O,nb as u,oa as C,ob as D,pa as b,pb as V,q as B,rb as M,ub as y,wb as c,wc as A,xa as Fe,za as w,zb as Ge,zc as E}from"./chunk-IH2NT4RC.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 Me=(()=>{let i=class i{constructor(){this.shopeeUploadService=f(he),this.formBuilder=f(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,r;return o=o.map(a=>(t=a?.multi_lang?.find(d=>d.language=="id"),a.attribute_value_list=a?.attribute_value_list?.map(d=>(r=d?.multi_lang?.find(v=>v.language=="id"),d.name=r?.value,d)),a.name=t?.value?t?.value:a.name,a)),o}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{if(r=[],a.mandatory&&r.push(de.required),a?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&a?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new ke(null),value:new ke(null,r)});t.addControl(JSON.stringify(a.attribute_id),d)}else t.addControl(JSON.stringify(a.attribute_id),this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>{switch(a.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(a.attribute_value_list)?a.attribute_value_list=a.attribute_value_list.filter(d=>t[a.attribute_id]==d.value_id):a.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:a.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?a.attribute_value_list=this.setSelectedQuantitativeAttr(t[a.attribute_id]?.value,t[a.attribute_id]?.unit):g.IsNotEmpty(t[a.attribute_id])&&(a.attribute_value_list=[{value_id:0,name:t[a.attribute_id]}]);break;default:a.attribute_value_list=a.attribute_value_list.filter(d=>d.value_id==t[a.attribute_id])}return a}).filter(a=>a?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let r=[];return g.IsNotEmpty(o)&&(r=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),r}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var ve=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Be({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 Bt=["class","component ts"];function Lt(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())}),u(1,"i",4),l()}}function $t(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())}),u(1,"i",6),l()}}function Rt(e,i){if(e&1&&(D(0),_(1,Lt,2,0,"button",1)(2,$t,2,0,"button",2),V()),e&2){let n=i.ngIf;m(),p("ngIf",!n.hideBtnToday),m(),p("ngIf",!n.hideBtnClear)}}var Et=(()=>{let i=class i{constructor(o,t,r,a,d){this._datePicker=o,this._calendar=t,this._dateAdapter=r,this.calendarService=a,this._destroyed=new Ue,t.stateChanges.pipe($e(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(ye),X(Ct),X(ue),X(ve),X(We))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[O],attrs:Bt,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,r){t&1&&(s(0,"mat-calendar-header"),_(1,Rt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(m(),p("ngIf",T(2,1,r.calendarConfig$)))},dependencies:[A,_t,gt,E],encapsulation:2});let e=i;return e})(),kt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be]});let e=i;return e})();function Gt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();p("show",n.placeholder),m(2),ne(n.placeholder)}}var jt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{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=Et,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new w,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(ve))},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:Tt,deps:[et]},{provide:tt,useValue:jt},{provide:Xe,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,r){if(t&1){let a=M();s(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(a),b(r.change(v.value))})("click",function(){C(a);let v=Ee(5);return b(v.open())}),l(),u(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(a),b(r.onOpenDatepicker())})("closed",function(){return C(a),b(r.onCloseDatepicker())}),l()()}if(t&2){let a=Ee(5);Ae("width",r.width||100,"%"),p("disabled",r.disabled)("appearance",r.appearance),m(),p("ngIf",r.isFloatingLabel&&r.placeholder),m(),Ge("placeholder",r.placeholder||""),p("matDatepicker",a)("min",r.minDateValidation)("max",r.maxDateValidation)("value",r.date==r.minDate?null:r.date)("disabled",r.disabled)("readonly",r.readOnly),Re("data-cy",r.data_cy),m(),Ae("display",r.displayToggle?"unset":"none"),p("for",a),m(),p("calendarHeaderComponent",r.headerComponent)}},dependencies:[A,ye,bt,yt,pt,ct,mt,ht],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})(),Pt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be,kt]});let e=i;return e})();var Pe=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}(Pe||{});var Ne=()=>[];function Ht(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function Wt(e,i){if(e&1&&u(0,"ng-select",6),e&2){let n=c().$implicit;p("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(4,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function Xt(e,i){if(e&1&&u(0,"input",8),e&2){let n=c(2).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function zt(e,i){if(e&1&&(s(0,"option",15),h(1),l()),e&2){let n=i.$implicit;p("value",n),m(),ne(n)}}function Jt(e,i){if(e&1&&(s(0,"div",10),u(1,"input",12),s(2,"select",13)(3,"option",14),h(4,"Unit"),l(),R(5,zt,2,2,"option",15,$),l()()),e&2){let n=c(3).$implicit;p("formGroupName",n.attribute_id),m(),p("placeholder","Isi "+(n==null?null:n.name)),m(2),p("value",null),m(2),G(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function Qt(e,i){if(e&1&&u(0,"input",11),e&2){let n=c(3).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function qt(e,i){if(e&1&&_(0,Jt,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 Zt(e,i){if(e&1&&u(0,"datepicker",9),e&2){let n=c(2).$implicit;p("formControlName",n.attribute_id)}}function Kt(e,i){if(e&1&&_(0,Xt,1,2,"input",8)(1,qt,2,1)(2,Zt,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 ei(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(3,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function ti(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(3,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function ii(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,Ht,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,Wt,1,5,"ng-select",6)(6,Kt,3,1)(7,ei,1,4,"ng-select",7)(8,ti,1,4,"ng-select",7),l()),e&2){let n,o=i.$implicit,t=c(2);m(2),k(o.mandatory?2:-1),m(2),K(" ",o==null?null:o.name," "),m(),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 ni(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ii,9,3,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Nt=(()=>{let i=class i{constructor(){this.formCategoryService=f(Me),this.attributesChanges=new w,this.inputType=ee,this.formatType=le,this.validationType=Pe}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(r=>{t=this.formCategoryService.getFilteredAttributes(o,r),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([Me]),O,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,r){t&1&&(_(0,ni,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,qe,Ze,se,Qe,j,z,Q,q,Je,vt,Pt,Mt],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=f(re),this.formBuilder=f(Z)}getAttributes(o,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(a=>(a=this.mappingAttributeSalesProperty(a),a)))}mappingAttributeSalesProperty(o){let t=0;return o.filter(r=>(r.type=="SALES_PROPERTY"&&(t+=1),t>1?(t=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{r=[],a.is_required&&r.push(de.required),t.addControl(a.id,this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.id)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>(a.is_multiple_selection?a.values=a.values.filter(d=>t[a.id]?.includes(d.id)):a.values=a.values.filter(d=>d.id==t[a.id]),a)).filter(a=>a?.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 oi(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function ri(e,i){if(e&1&&u(0,"ng-select",6),e&2){let n=c().$implicit;p("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ai(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,i){if(e&1&&(s(0,"small",5),h(1),l()),e&2){let n=c().$implicit;m(),K(" ",n==null?null:n.name," is mandatory ")}}function ci(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,oi,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,2,1,"small",5),l()),e&2){let n=i.$implicit;m(2),k(n.is_required?2:-1),m(2),K(" ",n==null?null:n.name," "),m(),k(n.is_multiple_selection?5:6),m(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,ci,8,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Ot=(()=>{let i=class i{constructor(){this.tiktokAttributeFormService=f(Oe),this.attributesChanges=new w}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(r=>{t=this.tiktokAttributeFormService.getFilteredAttributes(o,r),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]),O,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,r){t&1&&(_(0,mi,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q,oe]});let e=i;return e})();var we=(()=>{let i=class i{constructor(){this.woocommerceUploadService=f(ge)}getAttributes(o,t){return this.woocommerceUploadService.getAttributes(o,t).pipe(B(r=>r.map(a=>({key:a.name,label:a.name}))))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var wt=(()=>{let i=class i{constructor(){this.wooAttributeFormService=f(we),this.channelId=Fe(),this.categoryId=Fe(),this.attributesChanges=new w}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([we]),O,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,r){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 r.onSelectAttribute(d)}),l()()()),t&2&&(m(4),p("items",T(5,1,r.attributes$)))},dependencies:[I,E,oe,W,H,Y]});let e=i;return e})();var De=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(a=>a))}createFormGroup(o){let t=this.formBuilder.group({});return o.forEach(r=>{t.addControl(r.variant,this.formBuilder.control(null))}),t}convertAttributes(o={}){return Object.values(o).filter(r=>r!==null).map(r=>JSON.stringify(r))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function pi(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),h(2),l(),u(3,"ng-select",5),l()),e&2){let n=i.$implicit;m(2),K(" ",n==null?null:n.variant," "),m(),p("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function si(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,pi,4,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Dt=(()=>{let i=class i{constructor(){this.tokpedAttrFormService=f(De),this.attributesChanges=new w}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([De]),O,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,r){t&1&&(_(0,si,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q]});let e=i;return e})();var Ve=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:o}]).pipe(L(r=>(r.Options.StatusOptions=r.Options.Status.map(a=>({id:a,name:a})),r)))}createFormGroup(o){let t=this.formBuilder.group({});return Object.keys(o.Attribute).forEach(a=>{t.addControl(a,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 di(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),h(5," Brand "),l(),u(6,"input",5),l(),s(7,"div",6)(8,"div",4),h(9," Product Type "),l(),u(10,"input",7),l(),s(11,"div",6)(12,"div",4),h(13," Status "),l(),u(14,"ng-select",8),l()()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(13),p("items",n.Options.StatusOptions)}}var Vt=(()=>{let i=class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=f(Ve)}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(Le(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([Ve]),O,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,r){t&1&&(_(0,di,15,2,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,Y,J,se,j,z,Q,q,W,H]});let e=i;return e})();function ui(e,i){if(e&1&&(s(0,"div",6),u(1,"app-product-card",9),l()),e&2){let n=i.$implicit;m(),p("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 fi(e,i){if(e&1){let n=M();D(0),s(1,"mat-checkbox",21),He("ngModelChange",function(t){C(n);let r=c().$implicit;return Ye(r.selected,t)||(r.selected=t),b(t)}),y("ngModelChange",function(){let t=C(n).ngIf,r=c(),a=r.$implicit,d=r.$index,v=c();return b(v.onSelectChannel(a,d,t))}),l(),V()}if(e&2){let n=c().$implicit;m(),je("ngModel",n.selected)}}function _i(e,i){e&1&&(s(0,"div",18),u(1,"input",22),l())}function hi(e,i){if(e&1){let n=M();s(0,"app-channel-category-select",23),y("selectedCategory",function(t){C(n);let r=c().$index,a=c();return b(a.onCategoryChange(r,t))}),l()}if(e&2){let n=c().$implicit,o=c();p("disabled",!n.selected||n.selected&&n.type==o.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function gi(e,i){if(e&1){let n=M();s(0,"shopee-attribute-form",27),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function Ci(e,i){if(e&1){let n=M();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function bi(e,i){if(e&1){let n=M();s(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,i){if(e&1){let n=M();s(0,"tokopedia-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,i){if(e&1&&(s(0,"div",20)(1,"div",24),_(2,gi,1,3,"shopee-attribute-form",25)(3,Ci,1,2,"tiktok-attribute-form",26)(4,bi,1,2,"wooocommerce-attribute-form",26)(5,yi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,o=c().$implicit,t=c();m(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 xi(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 r=c().$index,a=c();return b(a.onAttributesChange(r,t))}),l()()()}if(e&2){let n=c().$implicit;m(2),p("channelId",n.id)}}function Ii(e,i){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,fi,2,1,"ng-container",14),S(7,"async"),l(),s(8,"div"),u(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),h(12),l()()()(),s(13,"div",12)(14,"div",17),_(15,_i,2,0,"div",18)(16,hi,1,4,"app-channel-category-select",19),l()()(),_(17,vi,6,1,"div",20)(18,xi,3,1,"div",20),l()()),e&2){let n=i.$implicit,o=c();m(6),p("ngIf",T(7,7,o.defaultCategories$)),m(3),p("typeId",n.type),m(),p("matTooltip",n.name)("matTooltipShowDelay",2500),m(2),ne(n.name),m(3),k(n.type==o.channelType.Shopify?15:16),m(2),k(n.categoryId&&o.channelType.Lazada!=n.type&&n.selected?17:o.channelType.Shopify==n.type&&n.selected?18:-1)}}var yr=(()=>{let i=class i{constructor(){this.uploadProductService=f(ut),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ke,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ie(1))}onCategoryChange(o,t){this.channelProductUploads.update(r=>r.map((a,d)=>(d==o&&(a.categoryId=t,a.attributes=[]),a)))}onAttributesChange(o,t){this.channelProductUploads.update(r=>r.map((a,d)=>(d==o&&(a.attributes=t),a)))}onSelectChannel(o,t,r){this.channelProductUploads.update(a=>a.map((d,v)=>{if(v==t&&o.selected){let Se=this.findCategoryByChannelId(o.id,r);d.categoryId=Se?.DefaultCategoryID}return v==t&&!o.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(o,t){return t.find(r=>r.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,st,dt,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"],[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,r){if(t&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return r.onUploadProduct()}),u(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,ui,2,7,"div",6,$),S(12,"async"),l(),s(13,"h3",7),h(14,"Channel To Upload"),l(),R(15,Ii,19,9,"div",8,$),l()()()),t&2){let a;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((a=r.channelProductUploads())==null?null:a.length)==0),m(8),G(T(12,3,r.selectedProducts$)),m(5),G(r.channelProductUploads())}},dependencies:[I,A,E,xt,rt,ot,St,It,lt,at,oe,j,ze,nt,it,Nt,Ot,wt,Dt,Vt,ft,Ft],encapsulation:2});let e=i;return e})();export{yr as ProductUploadComponent};
@@ -1,4 +1,4 @@
1
- import{a as E}from"./chunk-UUI7T7NV.js";import{g as j}from"./chunk-N7BCDU3X.js";import{b as S,e as n}from"./chunk-SUL6ZUGT.js";import{b as s,c as g}from"./chunk-T4MH7AFK.js";import{$ as l,B as I,E as u,Ua as U,Wc as w,d as P,da as c,n as d,q as A,w as C}from"./chunk-IH2NT4RC.js";var D=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/shopee/AddProduct",o).pipe(u(e=>d(null)))}generateAttribute(o){return o.map(t=>({attribute_id:t.attribute_id,attribute_value_list:t.attribute_value_list.map(e=>({value_id:e.value_id,name:e.name}))})),o}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var R=(()=>{let r=class r{constructor(){this.httpService=c(n)}getCategories(o){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tiktok/AddProduct",o).pipe(u(e=>d(null)))}generateAttribute(o){let t;return o.map(e=>(e.type=="PRODUCT_PROPERTY"?t={id:e.id,name:e.name,type:e.type,values:e.values}:t={id:e.id,name:e.values[0].id,type:e.type},t))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var H=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/lazada/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var T=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/woo/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var y=class{};var b=class{};var F=(()=>{let r=class r{constructor(){this.httpService=c(n)}getCategories(o){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tokopedia/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var x=(()=>{let r=class r{constructor(){this.toastrService=c(S)}showToastrUploadMultiple(o){let t=[],e=[],a=this.getResponseList(o);if(o.filter(p=>g.IsNotEmpty(p)).forEach(p=>{typeof p?.Response=="string"?e=[...e,a.length>1?this.setHtmlli(p.Response):this.setHtmlli(p.Response,!1)]:(p?.Response?.Success_list.forEach(f=>{t=[...t,a.length>1?this.setHtmlli(`
1
+ import{a as E}from"./chunk-UUI7T7NV.js";import{g as j}from"./chunk-MPMNVKBU.js";import{b as S,e as n}from"./chunk-SUL6ZUGT.js";import{b as s,c as g}from"./chunk-T4MH7AFK.js";import{$ as l,B as I,E as u,Ua as U,Wc as w,d as P,da as c,n as d,q as A,w as C}from"./chunk-IH2NT4RC.js";var D=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/shopee/AddProduct",o).pipe(u(e=>d(null)))}generateAttribute(o){return o.map(t=>({attribute_id:t.attribute_id,attribute_value_list:t.attribute_value_list.map(e=>({value_id:e.value_id,name:e.name}))})),o}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var R=(()=>{let r=class r{constructor(){this.httpService=c(n)}getCategories(o){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tiktok/AddProduct",o).pipe(u(e=>d(null)))}generateAttribute(o){let t;return o.map(e=>(e.type=="PRODUCT_PROPERTY"?t={id:e.id,name:e.name,type:e.type,values:e.values}:t={id:e.id,name:e.values[0].id,type:e.type},t))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var H=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/lazada/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var T=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/woo/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var y=class{};var b=class{};var F=(()=>{let r=class r{constructor(){this.httpService=c(n)}getCategories(o){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tokopedia/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var x=(()=>{let r=class r{constructor(){this.toastrService=c(S)}showToastrUploadMultiple(o){let t=[],e=[],a=this.getResponseList(o);if(o.filter(p=>g.IsNotEmpty(p)).forEach(p=>{typeof p?.Response=="string"?e=[...e,a.length>1?this.setHtmlli(p.Response):this.setHtmlli(p.Response,!1)]:(p?.Response?.Success_list.forEach(f=>{t=[...t,a.length>1?this.setHtmlli(`
2
2
  <div>
3
3
  Product ${f.Name} was <div class="d-inline fw-bold">successfully</div> uploaded to ${p.Channel}
4
4
  </div>
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-CZYGGOZL.js";import{a as Q}from"./chunk-XHAXYWZ7.js";import{a as Ve,b as De,c as $}from"./chunk-WWRX4VCC.js";import"./chunk-BVIRHZTZ.js";import{b as Ee}from"./chunk-YXUEYLE5.js";import{a as Me}from"./chunk-T3POIC5F.js";import{a as Pe,b as Fe}from"./chunk-V6PMZ6DL.js";import{a as be}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Te}from"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{a as ge,b as Ce,d as he,e as xe}from"./chunk-DDUQ3IZU.js";import{g as ue}from"./chunk-N7BCDU3X.js";import{b as ce,e as _e}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as ve,l as ye,m as Ie,n as we}from"./chunk-SG42JTLJ.js";import{t as fe,u as Se}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as me,b as ae,c as le,h as re,m as se,o as pe}from"./chunk-VFLG2BDB.js";import{c as D,f as de}from"./chunk-T4MH7AFK.js";import{$a as c,$b as S,Ac as ne,B as z,Cc as ie,Dc as oe,Ha as F,Hb as O,Ia as s,Ib as m,Ja as T,Jb as V,Kb as P,Mb as I,Nb as w,Ob as b,Pb as Z,Q as G,Qb as q,Sb as k,X as B,Za as u,_b as C,ac as N,bc as U,da as H,ga as Y,gb as y,hb as L,jb as A,kb as W,lb as a,mb as r,nb as x,oa as _,ob as M,pa as d,pb as E,rb as v,tc as X,ub as f,vc as J,wb as l,wc as ee,zb as K,zc as te}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var Re=n=>({"text-decoration-line-through":n}),Be=n=>({"ms-10":n}),Le=n=>({"bg-gradient-warning":n});function Ae(n,p){if(n&1){let e=v();a(0,"button",39),f("click",function(){_(e);let t=l().ngIf,o=l(2);return d(o.updateStock(t))}),x(1,"i",40),m(2," Update "),r()}}function We(n,p){if(n&1){let e=v();a(0,"div"),u(1,Ae,3,0,"button",36),a(2,"button",37),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),x(3,"i",38),a(4,"span"),m(5,"Export"),r()()()}if(n&2){let e=p.ngIf,i=l(2);s(),c("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(n,p){if(n&1&&(a(0,"span",41),x(1,"img",42),r(),m(2)),n&2){let e=p.item;s(),c("src",e==null?null:e.Img,F),s(),P(" ",e.Name," ")}}function Ue(n,p){n&1&&(a(0,"div",43)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function $e(n,p){if(n&1){let e=v();a(0,"th")(1,"input",44),b("ngModelChange",function(t){_(e);let o=l(2);return w(o.checkboxState,t)||(o.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,o=l(2);return d(o.onCheckboxStateChange(t))}),r()()}if(n&2){let e=l(2);s(),I("ngModel",e.checkboxState)}}function Qe(n,p){n&1&&(a(0,"th",33),m(1," Reserved "),r())}function je(n,p){}function ze(n,p){if(n&1){let e=v();a(0,"input",63),b("ngModelChange",function(t){_(e);let o=l(3).$implicit;return w(o.selected,t)||(o.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,o=l(2);return d(o.onCheckboxStateProduct(t))}),r()}if(n&2){let e=l(3).$implicit;I("ngModel",e.selected)}}function Ge(n,p){if(n&1){let e=v();a(0,"img",64),f("click",function(t){_(e);let o=l(3).$implicit,h=l(2);return d(h.onZoomImage(t,o==null?null:o.ImageUrl))}),r()}if(n&2){let e=l(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,F)}}function He(n,p){n&1&&x(0,"img",60)}function Ye(n,p){if(n&1&&(x(0,"br"),a(1,"div",65),x(2,"i",66),a(3,"small"),m(4),r()()),n&2){let e=l(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(n,p){if(n&1&&(a(0,"td",56)(1,"div",15),u(2,ze,1,1,"input",57),a(3,"div",58),u(4,Ge,1,1,"img",59)(5,He,1,0,"img",60),r()()(),a(6,"td",61)(7,"span",62),m(8),r(),u(9,Ye,5,1),r()),n&2){let e=l(2).$implicit,i=l(2);c("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),c("ngClass",k(7,Be,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),c("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(n,p){if(n&1){let e=v();a(0,"input",44),b("ngModelChange",function(t){_(e);let o=l(2).$implicit;return w(o.selected,t)||(o.selected=t),d(t)}),r()}if(n&2){let e=l(2).$implicit;I("ngModel",e.selected)}}function qe(n,p){if(n&1&&u(0,Ze,1,1,"input",50),n&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Xe(n,p){if(n&1){let e=v();a(0,"input",44),b("ngModelChange",function(t){_(e);let o=l().$implicit;return w(o.selected,t)||(o.selected=t),d(t)}),r()}if(n&2){let e=l().$implicit;I("ngModel",e.selected)}}function Je(n,p){n&1&&(a(0,"div",67),m(1," Not Found "),r())}function et(n,p){if(n&1&&(a(0,"div")(1,"span",68),m(2),C(3,"number"),r(),m(4," => "),a(5,"span",69),m(6),C(7,"number"),r()()),n&2){let e=l().$implicit;s(2),P(" ",S(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(S(7,4,e==null?null:e.Inventory))}}function tt(n,p){if(n&1&&(m(0),C(1,"number")),n&2){let e=l().$implicit;P(" ",S(1,1,e==null?null:e.Inventory)," ")}}function nt(n,p){if(n&1&&(M(0),a(1,"div",70)(2,"a",71),x(3,"i",72),r()(),E()),n&2){let e=l().$implicit,i=l(3);s(2),c("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F)}}function it(n,p){if(n&1){let e=v();a(0,"span",77),f("click",function(){let t=_(e).ngIf,o=l(2).$implicit,h=l().$implicit,g=l(2);return d(g.openTableDialog(h,o,t))}),m(1),C(2,"number"),r()}if(n&2){let e=l(2).$implicit;s(),P(" ",S(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function ot(n,p){if(n&1){let e=v();a(0,"td",73)(1,"div",51)(2,"div"),u(3,it,3,3,"span",74),C(4,"async"),r(),a(5,"div",70)(6,"a",71),x(7,"i",72),r()(),a(8,"div",70)(9,"span",75),f("click",function(){_(e);let t=l().$implicit,o=l(3);return d(o.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",76),r()()()()}if(n&2){let e=l().$implicit,i=l(3);c("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),c("ngIf",S(4,3,i.products$)),s(3),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,F)}}function at(n,p){if(n&1&&(M(0),a(1,"span",78),m(2),C(3,"number"),r(),E()),n&2){let e=l(2).$implicit;s(2),P(" (",S(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function lt(n,p){n&1&&m(0," - ")}function rt(n,p){if(n&1&&(M(0),a(1,"td",47),u(2,at,4,3,"ng-container",55)(3,lt,1,0,"ng-template",null,1,U),r(),E()),n&2){let e=O(4),i=l().$implicit;s(2),c("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function st(n,p){n&1&&(M(0),m(1," - "),E())}function pt(n,p){if(n&1&&(a(0,"span",79),C(1,"date"),m(2),C(3,"date"),r()),n&2){let e=l().$implicit;c("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(n,p){if(n&1&&(a(0,"tr"),u(1,Ke,10,9),a(2,"td",46),m(3),r(),a(4,"td",47)(5,"span",48),m(6),r()(),a(7,"td",49),u(8,qe,1,1)(9,Xe,1,1,"input",50),r(),a(10,"td")(11,"div",51),u(12,Je,2,0,"div",52)(13,et,8,6,"div")(14,tt,2,3)(15,nt,4,1,"ng-container",5),r()(),u(16,ot,11,7,"td",53)(17,rt,5,2,"ng-container",5),a(18,"td",54),u(19,st,2,0,"ng-container",55)(20,pt,4,8,"ng-template",null,0,U),r()()),n&2){let e=p.$implicit,i=p.index,t=O(21),o=l(3);s(),y(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),c("matTooltip",e.Discontinued?o.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),c("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),c("ngIf",(e==null?null:e.I)!=null),s(),c("ngIf",e==null?null:e.Channel),s(),c("ngIf",o.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==o.minDate)("ngIfElse",t)}}function ct(n,p){if(n&1&&(a(0,"tbody"),A(1,je,0,0,null,null,L),u(3,mt,22,16,"tr",45),r()),n&2){let e=p.$implicit;s(),W(e.Variants),s(2),c("ngForOf",e.Variants)}}function _t(n,p){if(n&1){let e=v();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let o=l();return d(o.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),C(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),m(8,"Channel"),r(),a(9,"ng-select",7),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),d(t)}),u(10,Oe,3,2,"ng-template",8),r()(),a(11,"div",9)(12,"label",10),m(13,"PageNumber"),r(),a(14,"input",11),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),d(t)}),r()(),a(15,"div",9)(16,"label",12),m(17,"Page Size"),r(),a(18,"input",13),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),d(t)}),r()(),a(19,"div",9)(20,"label",14),m(21,"Quantity From - To"),r(),a(22,"div",15)(23,"input",16),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.QuantityFrom,t)||(o.searchFilter.QuantityFrom=t),d(t)}),r(),m(24," - "),a(25,"input",17),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.QuantityTo,t)||(o.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),a(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),m(35," Product "),x(36,"br"),a(37,"mat-slide-toggle",25),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(38,"small",14),m(39,"FILTER DIFFERENT INVENTORY"),r()()(),a(40,"th",26),m(41,"Variant"),r(),a(42,"th",27),m(43,"SKU"),r(),u(44,$e,2,1,"th",5),C(45,"async"),a(46,"th",28),m(47,"POS"),r(),a(48,"th",29)(49,"div",30),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),x(50,"img",31),a(51,"span",32),m(52),C(53,"stringLimit"),r()()(),u(54,Qe,2,0,"th",33),a(55,"th",34),m(56,"Last Sync"),r()()(),A(57,ct,4,1,"tbody",null,L),C(59,"async"),r(),a(60,"infinite-paginator",35),C(61,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(n&2){let e=l();c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",S(4,23,e.products$)),s(6),c("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",S(45,25,e.products$)),s(5),c("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),c("src",e.selectedChannel==null?null:e.selectedChannel.Img,F),s(2),P(" ",N(53,27,e.selectedChannel==null?null:e.selectedChannel.Name,13)," "),s(2),y(e.isShowReservedColumn?54:-1),s(3),W(S(59,30,e.products$)),s(3),c("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",S(61,32,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var Ht=(()=>{let p=class p{constructor(i,t,o,h,g,j,ke,Ne){this.http=i,this.toastr=t,this.dialog=o,this.productService=h,this.authService=g,this.biggerPictureService=j,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H($),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let t=0,o;i.forEach(h=>{o=h.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),o&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as R}from"./chunk-CZYGGOZL.js";import{a as Q}from"./chunk-XHAXYWZ7.js";import{a as Ve,b as De,c as $}from"./chunk-WWRX4VCC.js";import"./chunk-BVIRHZTZ.js";import{b as Ee}from"./chunk-YXUEYLE5.js";import{a as Me}from"./chunk-T3POIC5F.js";import{a as Pe,b as Fe}from"./chunk-V6PMZ6DL.js";import{a as be}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Te}from"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{a as ge,b as Ce,d as he,e as xe}from"./chunk-DDUQ3IZU.js";import{g as ue}from"./chunk-MPMNVKBU.js";import{b as ce,e as _e}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as ve,l as ye,m as Ie,n as we}from"./chunk-SG42JTLJ.js";import{t as fe,u as Se}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as me,b as ae,c as le,h as re,m as se,o as pe}from"./chunk-VFLG2BDB.js";import{c as D,f as de}from"./chunk-T4MH7AFK.js";import{$a as c,$b as S,Ac as ne,B as z,Cc as ie,Dc as oe,Ha as F,Hb as O,Ia as s,Ib as m,Ja as T,Jb as V,Kb as P,Mb as I,Nb as w,Ob as b,Pb as Z,Q as G,Qb as q,Sb as k,X as B,Za as u,_b as C,ac as N,bc as U,da as H,ga as Y,gb as y,hb as L,jb as A,kb as W,lb as a,mb as r,nb as x,oa as _,ob as M,pa as d,pb as E,rb as v,tc as X,ub as f,vc as J,wb as l,wc as ee,zb as K,zc as te}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var Re=n=>({"text-decoration-line-through":n}),Be=n=>({"ms-10":n}),Le=n=>({"bg-gradient-warning":n});function Ae(n,p){if(n&1){let e=v();a(0,"button",39),f("click",function(){_(e);let t=l().ngIf,o=l(2);return d(o.updateStock(t))}),x(1,"i",40),m(2," Update "),r()}}function We(n,p){if(n&1){let e=v();a(0,"div"),u(1,Ae,3,0,"button",36),a(2,"button",37),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),x(3,"i",38),a(4,"span"),m(5,"Export"),r()()()}if(n&2){let e=p.ngIf,i=l(2);s(),c("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(n,p){if(n&1&&(a(0,"span",41),x(1,"img",42),r(),m(2)),n&2){let e=p.item;s(),c("src",e==null?null:e.Img,F),s(),P(" ",e.Name," ")}}function Ue(n,p){n&1&&(a(0,"div",43)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function $e(n,p){if(n&1){let e=v();a(0,"th")(1,"input",44),b("ngModelChange",function(t){_(e);let o=l(2);return w(o.checkboxState,t)||(o.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,o=l(2);return d(o.onCheckboxStateChange(t))}),r()()}if(n&2){let e=l(2);s(),I("ngModel",e.checkboxState)}}function Qe(n,p){n&1&&(a(0,"th",33),m(1," Reserved "),r())}function je(n,p){}function ze(n,p){if(n&1){let e=v();a(0,"input",63),b("ngModelChange",function(t){_(e);let o=l(3).$implicit;return w(o.selected,t)||(o.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,o=l(2);return d(o.onCheckboxStateProduct(t))}),r()}if(n&2){let e=l(3).$implicit;I("ngModel",e.selected)}}function Ge(n,p){if(n&1){let e=v();a(0,"img",64),f("click",function(t){_(e);let o=l(3).$implicit,h=l(2);return d(h.onZoomImage(t,o==null?null:o.ImageUrl))}),r()}if(n&2){let e=l(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,F)}}function He(n,p){n&1&&x(0,"img",60)}function Ye(n,p){if(n&1&&(x(0,"br"),a(1,"div",65),x(2,"i",66),a(3,"small"),m(4),r()()),n&2){let e=l(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(n,p){if(n&1&&(a(0,"td",56)(1,"div",15),u(2,ze,1,1,"input",57),a(3,"div",58),u(4,Ge,1,1,"img",59)(5,He,1,0,"img",60),r()()(),a(6,"td",61)(7,"span",62),m(8),r(),u(9,Ye,5,1),r()),n&2){let e=l(2).$implicit,i=l(2);c("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),c("ngClass",k(7,Be,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),c("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(n,p){if(n&1){let e=v();a(0,"input",44),b("ngModelChange",function(t){_(e);let o=l(2).$implicit;return w(o.selected,t)||(o.selected=t),d(t)}),r()}if(n&2){let e=l(2).$implicit;I("ngModel",e.selected)}}function qe(n,p){if(n&1&&u(0,Ze,1,1,"input",50),n&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Xe(n,p){if(n&1){let e=v();a(0,"input",44),b("ngModelChange",function(t){_(e);let o=l().$implicit;return w(o.selected,t)||(o.selected=t),d(t)}),r()}if(n&2){let e=l().$implicit;I("ngModel",e.selected)}}function Je(n,p){n&1&&(a(0,"div",67),m(1," Not Found "),r())}function et(n,p){if(n&1&&(a(0,"div")(1,"span",68),m(2),C(3,"number"),r(),m(4," => "),a(5,"span",69),m(6),C(7,"number"),r()()),n&2){let e=l().$implicit;s(2),P(" ",S(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(S(7,4,e==null?null:e.Inventory))}}function tt(n,p){if(n&1&&(m(0),C(1,"number")),n&2){let e=l().$implicit;P(" ",S(1,1,e==null?null:e.Inventory)," ")}}function nt(n,p){if(n&1&&(M(0),a(1,"div",70)(2,"a",71),x(3,"i",72),r()(),E()),n&2){let e=l().$implicit,i=l(3);s(2),c("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F)}}function it(n,p){if(n&1){let e=v();a(0,"span",77),f("click",function(){let t=_(e).ngIf,o=l(2).$implicit,h=l().$implicit,g=l(2);return d(g.openTableDialog(h,o,t))}),m(1),C(2,"number"),r()}if(n&2){let e=l(2).$implicit;s(),P(" ",S(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function ot(n,p){if(n&1){let e=v();a(0,"td",73)(1,"div",51)(2,"div"),u(3,it,3,3,"span",74),C(4,"async"),r(),a(5,"div",70)(6,"a",71),x(7,"i",72),r()(),a(8,"div",70)(9,"span",75),f("click",function(){_(e);let t=l().$implicit,o=l(3);return d(o.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",76),r()()()()}if(n&2){let e=l().$implicit,i=l(3);c("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),c("ngIf",S(4,3,i.products$)),s(3),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,F)}}function at(n,p){if(n&1&&(M(0),a(1,"span",78),m(2),C(3,"number"),r(),E()),n&2){let e=l(2).$implicit;s(2),P(" (",S(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function lt(n,p){n&1&&m(0," - ")}function rt(n,p){if(n&1&&(M(0),a(1,"td",47),u(2,at,4,3,"ng-container",55)(3,lt,1,0,"ng-template",null,1,U),r(),E()),n&2){let e=O(4),i=l().$implicit;s(2),c("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function st(n,p){n&1&&(M(0),m(1," - "),E())}function pt(n,p){if(n&1&&(a(0,"span",79),C(1,"date"),m(2),C(3,"date"),r()),n&2){let e=l().$implicit;c("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(n,p){if(n&1&&(a(0,"tr"),u(1,Ke,10,9),a(2,"td",46),m(3),r(),a(4,"td",47)(5,"span",48),m(6),r()(),a(7,"td",49),u(8,qe,1,1)(9,Xe,1,1,"input",50),r(),a(10,"td")(11,"div",51),u(12,Je,2,0,"div",52)(13,et,8,6,"div")(14,tt,2,3)(15,nt,4,1,"ng-container",5),r()(),u(16,ot,11,7,"td",53)(17,rt,5,2,"ng-container",5),a(18,"td",54),u(19,st,2,0,"ng-container",55)(20,pt,4,8,"ng-template",null,0,U),r()()),n&2){let e=p.$implicit,i=p.index,t=O(21),o=l(3);s(),y(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),c("matTooltip",e.Discontinued?o.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),c("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),c("ngIf",(e==null?null:e.I)!=null),s(),c("ngIf",e==null?null:e.Channel),s(),c("ngIf",o.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==o.minDate)("ngIfElse",t)}}function ct(n,p){if(n&1&&(a(0,"tbody"),A(1,je,0,0,null,null,L),u(3,mt,22,16,"tr",45),r()),n&2){let e=p.$implicit;s(),W(e.Variants),s(2),c("ngForOf",e.Variants)}}function _t(n,p){if(n&1){let e=v();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let o=l();return d(o.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),C(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),m(8,"Channel"),r(),a(9,"ng-select",7),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),d(t)}),u(10,Oe,3,2,"ng-template",8),r()(),a(11,"div",9)(12,"label",10),m(13,"PageNumber"),r(),a(14,"input",11),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),d(t)}),r()(),a(15,"div",9)(16,"label",12),m(17,"Page Size"),r(),a(18,"input",13),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),d(t)}),r()(),a(19,"div",9)(20,"label",14),m(21,"Quantity From - To"),r(),a(22,"div",15)(23,"input",16),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.QuantityFrom,t)||(o.searchFilter.QuantityFrom=t),d(t)}),r(),m(24," - "),a(25,"input",17),b("ngModelChange",function(t){_(e);let o=l();return w(o.searchFilter.QuantityTo,t)||(o.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),a(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),m(35," Product "),x(36,"br"),a(37,"mat-slide-toggle",25),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(38,"small",14),m(39,"FILTER DIFFERENT INVENTORY"),r()()(),a(40,"th",26),m(41,"Variant"),r(),a(42,"th",27),m(43,"SKU"),r(),u(44,$e,2,1,"th",5),C(45,"async"),a(46,"th",28),m(47,"POS"),r(),a(48,"th",29)(49,"div",30),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),x(50,"img",31),a(51,"span",32),m(52),C(53,"stringLimit"),r()()(),u(54,Qe,2,0,"th",33),a(55,"th",34),m(56,"Last Sync"),r()()(),A(57,ct,4,1,"tbody",null,L),C(59,"async"),r(),a(60,"infinite-paginator",35),C(61,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(n&2){let e=l();c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",S(4,23,e.products$)),s(6),c("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",S(45,25,e.products$)),s(5),c("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),c("src",e.selectedChannel==null?null:e.selectedChannel.Img,F),s(2),P(" ",N(53,27,e.selectedChannel==null?null:e.selectedChannel.Name,13)," "),s(2),y(e.isShowReservedColumn?54:-1),s(3),W(S(59,30,e.products$)),s(3),c("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",S(61,32,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var Ht=(()=>{let p=class p{constructor(i,t,o,h,g,j,ke,Ne){this.http=i,this.toastr=t,this.dialog=o,this.productService=h,this.authService=g,this.biggerPictureService=j,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H($),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let t=0,o;i.forEach(h=>{o=h.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),o&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(i=>i.ID==this.searchFilter.ChannelID)}onSearch(i){this.searchFilter.text=i,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(i){let t=this.productService.selectedVariantProduct(i);if(t.length>0){let o=t.map(g=>({ID:g.ID,Code:g.Code,Inventory:g.Inventory})),h={ListChannelID:[this.searchFilter.ChannelID],List:o};this.http.post("/api/Inventory/UpdateChannel",h).subscribe(g=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(g)})}}handlingUpdateStock(i){if(i[0]?.StatusProduct){let t=i[0].StatusProduct.Fail_list,o=i[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",o,t)}else this.toastr.error(i[0]?.Exception,"Error")}refreshInventory(i,t,o,h){let g={ChannelItemID:i,ChannelVariationID:t,ChannelID:o,VariantID:h};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(j=>{this.toastr.success("Successfully updated","Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(i){i.Variants=i.Variants.map(t=>(t.Inventory>=0&&(t.selected=i.selected),t))}onCheckboxStateChange(i){i=i.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=this.checkboxState,o)),t))}openTableDialog(i,t,o){this.dialog.open(Ve,{data:{Name:i.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:i.ChannelItemID}}).afterClosed().pipe(z(g=>D.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g,o)})}updateItemAfterDialog(i,t){let o={ID:i.ChannelID,ChannelItemID:i.ChannelItemID,ChannelVariantID:i.ChannelVariationID,NewQuantity:parseFloat(i.Inventory),VariantID:i.ID,SKU:i.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(h=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.handlingUpdateStock([h])})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=Q.DIFFERENCE:this.searchFilter.filterModel=Q.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}};p.\u0275fac=function(t){return new(t||p)(T(_e),T(ce),T(ve),T(be),T(ue),T(Te),T(R),T(ye))},p.\u0275cmp=Y({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[Z([$,R]),q],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,o){t&1&&(u(0,_t,62,34,"mainpanel",2),C(1,"async")),t&2&&c("ngIf",S(1,1,o.loader$))},dependencies:[oe,X,J,ee,te,ie,ne,we,Ie,xe,he,ge,Ce,me,le,pe,ae,re,se,Me,De,de,Fe,Pe,Se,fe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let n=p;return n})();export{Ht as SingleChannelComparisonComponent};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-AKI6ACKF.js";import{a as P}from"./chunk-ZCPPEAJQ.js";import{a as C}from"./chunk-6JF7HXB4.js";import{b as O}from"./chunk-AXDEQQNM.js";import"./chunk-CHZBEIYE.js";import{c as M}from"./chunk-KSTCUPYX.js";import{a as m}from"./chunk-CX6LM3WN.js";import{a as h}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import"./chunk-A3ZMDUMP.js";import"./chunk-X54LLODL.js";import{e as s}from"./chunk-DDUQ3IZU.js";import"./chunk-N7BCDU3X.js";import"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-SG42JTLJ.js";import{u as f}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as g}from"./chunk-VFLG2BDB.js";import"./chunk-T4MH7AFK.js";import{Dc as i,Vc as l,Zc as a,aa as e,ga as d,ha as r,nb as c}from"./chunk-IH2NT4RC.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-UYGZ7SP4.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-ZPAK5MJ6.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-JBT2QHON.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-AKI6ACKF.js";import{a as P}from"./chunk-ZCPPEAJQ.js";import{a as C}from"./chunk-6JF7HXB4.js";import{b as O}from"./chunk-AXDEQQNM.js";import"./chunk-CHZBEIYE.js";import{c as M}from"./chunk-KSTCUPYX.js";import{a as m}from"./chunk-YP423ZQ6.js";import{a as h}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import"./chunk-A3ZMDUMP.js";import"./chunk-X54LLODL.js";import{e as s}from"./chunk-DDUQ3IZU.js";import"./chunk-MPMNVKBU.js";import"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-SG42JTLJ.js";import{u as f}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as g}from"./chunk-VFLG2BDB.js";import"./chunk-T4MH7AFK.js";import{Dc as i,Vc as l,Zc as a,aa as e,ga as d,ha as r,nb as c}from"./chunk-IH2NT4RC.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-UUHH36QD.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-YWLE67TM.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-C3R6SGRH.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 +1 @@
1
- import"./chunk-K76K7XC4.js";import{a as Oe}from"./chunk-VS2ZOTGT.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ve,c as X}from"./chunk-WWRX4VCC.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Me}from"./chunk-EVDAHZS7.js";import{a as Ie}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-YXUEYLE5.js";import{a as Te}from"./chunk-T3POIC5F.js";import"./chunk-V6PMZ6DL.js";import"./chunk-HPCPVA6F.js";import{a as we}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Se,b as ve,c as ye}from"./chunk-KSTCUPYX.js";import{a as Fe}from"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{g as fe}from"./chunk-N7BCDU3X.js";import{b as ue,e as ge}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as xe,m as Pe,n as be}from"./chunk-SG42JTLJ.js";import{t as j,u as W}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A,b as de,h as L,m as U}from"./chunk-VFLG2BDB.js";import{c as J,e as he,f as Ce}from"./chunk-T4MH7AFK.js";import{$a as s,$b as w,B as G,Cc as pe,Dc as $,Ha as T,Hb as z,Ia as l,Ib as p,Ja as P,Jb as oe,Kb as x,Mb as V,Nb as N,Ob as k,Pb as re,Q as q,Qb as B,Sb as F,Tb as ae,X as Y,Za as g,_b as S,ac as le,bc as H,cb as te,da as Q,ga as D,gb as ne,hb as E,jb as M,kb as O,lb as a,mb as c,nb as b,oa as C,ob as v,pa as f,pb as y,q as Z,rb as I,tc as ce,ub as h,vc as R,wb as m,wc as se,za as ee,zb as ie,zc as me}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var Ae=(t,r)=>({color:t,"font-weight":r});function je(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(ae(7,Ae,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),x("",i.Value," ")}}var Ne=(()=>{let r=class r{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(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],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(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,je,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,ye,Se,ve,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--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}"]});let t=r;return t})();var ke=t=>[t],We=t=>({"text-decoration-line-through":t}),Ke=t=>({"border-bottom":t}),Ge=t=>({"bg-gradient-warning":t});function ze(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function He(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),b(1,"i",26),p(2," Update "),c()}}function Je(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,He,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Xe(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),b(2,"img",28),a(3,"div",29),p(4),S(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),x(" ",le(5,3,i.Name,20)," ")}}function Ze(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function qe(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function Qe(t,r){t&1&&b(0,"img",46)}function et(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),x("(",i==null?null:i.Category,")")}}function tt(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,Qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,et,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,Ke,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function nt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function it(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),S(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),S(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),b(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),x(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ge,i.Price!=i.PriceExpected)),l(3),x(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function ot(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function rt(t,r){if(t&1&&(v(0),g(1,it,11,10,"ng-container",48)(2,ot,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function at(t,r){if(t&1&&(a(0,"tr"),g(1,tt,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),b(10,"i",38),c()()()(),g(11,nt,2,1,"ng-template",19)(12,rt,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),x(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,We,i.Discontinued)),l(),x(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function lt(t,r){if(t&1&&(a(0,"tbody"),M(1,at,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function ct(t,r){if(t&1&&(v(0),M(1,lt,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Zt=(()=>{let r=class r{constructor(o,e,n,d,_,u,Be){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.paginationService=Be,this.infinitePagination=Q(X),this.searchFilter=new Ie,this.checkboxState=!1,this.rolePriceEdit=_e.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.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,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()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.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(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(P(ge),P(ue),P(xe),P(we),P(fe),P(Fe),P(Me))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[re([X]),B],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"],[2,"height","46px"],[1,"mb-3"],["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(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,ze,5,2,"ng-container",3),S(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,Je,3,1,"ng-container",3),S(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),b(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),b(20,"th",14),M(21,Xe,6,6,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Ze,2,1,"ng-template",19),M(32,qe,7,0,null,null,E),c()(),g(34,ct,3,0,"ng-container",3),S(35,"async"),c(),a(36,"infinite-paginator",20),S(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,ce,R,se,me,pe,be,Pe,A,de,L,U,Ve,Ne,W,j,Te,Ce,he],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}"]});let t=r;return t})();export{Zt as CustomChannelPriceComponent};
1
+ import"./chunk-ZEOMHDTX.js";import{a as Oe}from"./chunk-VS2ZOTGT.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ve,c as X}from"./chunk-WWRX4VCC.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Me}from"./chunk-EVDAHZS7.js";import{a as Ie}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-YXUEYLE5.js";import{a as Te}from"./chunk-T3POIC5F.js";import"./chunk-V6PMZ6DL.js";import"./chunk-HPCPVA6F.js";import{a as we}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Se,b as ve,c as ye}from"./chunk-KSTCUPYX.js";import{a as Fe}from"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{g as fe}from"./chunk-MPMNVKBU.js";import{b as ue,e as ge}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as xe,m as Pe,n as be}from"./chunk-SG42JTLJ.js";import{t as j,u as W}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A,b as de,h as L,m as U}from"./chunk-VFLG2BDB.js";import{c as J,e as he,f as Ce}from"./chunk-T4MH7AFK.js";import{$a as s,$b as w,B as G,Cc as pe,Dc as $,Ha as T,Hb as z,Ia as l,Ib as p,Ja as P,Jb as oe,Kb as x,Mb as V,Nb as N,Ob as k,Pb as re,Q as q,Qb as B,Sb as F,Tb as ae,X as Y,Za as g,_b as S,ac as le,bc as H,cb as te,da as Q,ga as D,gb as ne,hb as E,jb as M,kb as O,lb as a,mb as c,nb as b,oa as C,ob as v,pa as f,pb as y,q as Z,rb as I,tc as ce,ub as h,vc as R,wb as m,wc as se,za as ee,zb as ie,zc as me}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var Ae=(t,r)=>({color:t,"font-weight":r});function je(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(ae(7,Ae,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),x("",i.Value," ")}}var Ne=(()=>{let r=class r{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(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],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(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,je,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,ye,Se,ve,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--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}"]});let t=r;return t})();var ke=t=>[t],We=t=>({"text-decoration-line-through":t}),Ke=t=>({"border-bottom":t}),Ge=t=>({"bg-gradient-warning":t});function ze(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function He(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),b(1,"i",26),p(2," Update "),c()}}function Je(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,He,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Xe(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),b(2,"img",28),a(3,"div",29),p(4),S(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),x(" ",le(5,3,i.Name,20)," ")}}function Ze(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function qe(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function Qe(t,r){t&1&&b(0,"img",46)}function et(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),x("(",i==null?null:i.Category,")")}}function tt(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,Qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,et,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,Ke,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function nt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function it(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),S(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),S(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),b(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),x(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ge,i.Price!=i.PriceExpected)),l(3),x(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function ot(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function rt(t,r){if(t&1&&(v(0),g(1,it,11,10,"ng-container",48)(2,ot,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function at(t,r){if(t&1&&(a(0,"tr"),g(1,tt,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),b(10,"i",38),c()()()(),g(11,nt,2,1,"ng-template",19)(12,rt,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),x(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,We,i.Discontinued)),l(),x(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function lt(t,r){if(t&1&&(a(0,"tbody"),M(1,at,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function ct(t,r){if(t&1&&(v(0),M(1,lt,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Zt=(()=>{let r=class r{constructor(o,e,n,d,_,u,Be){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.paginationService=Be,this.infinitePagination=Q(X),this.searchFilter=new Ie,this.checkboxState=!1,this.rolePriceEdit=_e.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.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,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()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.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(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(P(ge),P(ue),P(xe),P(we),P(fe),P(Fe),P(Me))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[re([X]),B],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"],[2,"height","46px"],[1,"mb-3"],["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(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,ze,5,2,"ng-container",3),S(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,Je,3,1,"ng-container",3),S(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),b(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),b(20,"th",14),M(21,Xe,6,6,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Ze,2,1,"ng-template",19),M(32,qe,7,0,null,null,E),c()(),g(34,ct,3,0,"ng-container",3),S(35,"async"),c(),a(36,"infinite-paginator",20),S(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,ce,R,se,me,pe,be,Pe,A,de,L,U,Ve,Ne,W,j,Te,Ce,he],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}"]});let t=r;return t})();export{Zt as CustomChannelPriceComponent};
@@ -1,4 +1,4 @@
1
- import{e as Ke}from"./chunk-SUL6ZUGT.js";import{a as Fe,b as ue,c as Le,d as He,e as de,f as $e,g as he,h as We,i as q,j as pe,k as E}from"./chunk-KCDL7SWP.js";import{b as le,c as z,d as Ue}from"./chunk-T4MH7AFK.js";import{$ as b,A as Pe,B as De,Ca as H,Dc as Oe,Ec as Me,Fc as Be,I as ie,N as _e,Pa as $,Q as se,T as _,U as ae,Wc as Ne,X as U,aa as F,b as g,ba as y,c as X,ca as h,cc as Re,dc as je,ea as xe,g as Ee,h as Te,ha as L,ic as ce,k as M,l as N,m as x,n as K,q as P,r as Ce}from"./chunk-IH2NT4RC.js";import{a as oe,i as I}from"./chunk-GNOSNGXM.js";var ze={production:!0,version:"3.16.3",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var pt="firebase",ft="10.12.1";q(pt,ft,"app");var G=new Re("ANGULARFIRE2_VERSION");var gt=(r,i)=>{let t=i?[i]:We(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},V=class{constructor(){return gt(mt)}},mt="app-check";function fe(){}var Y=class{zone;delegate;constructor(i,t=Te){this.zone=i,this.delegate=t}now(){return this.delegate.now()}schedule(i,t,e){let n=this.zone,o=function(s){n.runGuarded(()=>{i.apply(this,[s])})};return this.delegate.schedule(o,t,e)}},ge=class{zone;task=null;constructor(i){this.zone=i}call(i,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",fe,{},fe,fe)),t.pipe(U({next:e,complete:e,error:e})).subscribe(i).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},qe=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Y(Zone.current)),this.insideAngular=t.run(()=>new Y(Zone.current,Ee)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h($))};static \u0275prov=b({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function At(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
1
+ import{e as Ke}from"./chunk-SUL6ZUGT.js";import{a as Fe,b as ue,c as Le,d as He,e as de,f as $e,g as he,h as We,i as q,j as pe,k as E}from"./chunk-KCDL7SWP.js";import{b as le,c as z,d as Ue}from"./chunk-T4MH7AFK.js";import{$ as b,A as Pe,B as De,Ca as H,Dc as Oe,Ec as Me,Fc as Be,I as ie,N as _e,Pa as $,Q as se,T as _,U as ae,Wc as Ne,X as U,aa as F,b as g,ba as y,c as X,ca as h,cc as Re,dc as je,ea as xe,g as Ee,h as Te,ha as L,ic as ce,k as M,l as N,m as x,n as K,q as P,r as Ce}from"./chunk-IH2NT4RC.js";import{a as oe,i as I}from"./chunk-GNOSNGXM.js";var ze={production:!0,version:"3.16.6",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var pt="firebase",ft="10.12.1";q(pt,ft,"app");var G=new Re("ANGULARFIRE2_VERSION");var gt=(r,i)=>{let t=i?[i]:We(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},V=class{constructor(){return gt(mt)}},mt="app-check";function fe(){}var Y=class{zone;delegate;constructor(i,t=Te){this.zone=i,this.delegate=t}now(){return this.delegate.now()}schedule(i,t,e){let n=this.zone,o=function(s){n.runGuarded(()=>{i.apply(this,[s])})};return this.delegate.schedule(o,t,e)}},ge=class{zone;task=null;constructor(i){this.zone=i}call(i,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",fe,{},fe,fe)),t.pipe(U({next:e,complete:e,error:e})).subscribe(i).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},qe=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Y(Zone.current)),this.insideAngular=t.run(()=>new Y(Zone.current,Ee)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h($))};static \u0275prov=b({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function At(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
2
2
  provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return r}function Ve(r){return wt(At())(r)}function wt(r){return function(t){return t=t.lift(new ge(r.ngZone)),t.pipe(N(r.outsideAngular),M(r.insideAngular))}}var Ge=(()=>{let i=class i{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let o=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(o)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var bt=new Map,St={activated:!1,tokenObservers:[]},It={initialized:!1,enabled:!1};function T(r){return bt.get(r)||Object.assign({},St)}function Qe(){return It}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Et="exchangeDebugToken",Je={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Ao=24*60*60*1e3;var Ae=class{constructor(i,t,e,n,o){if(this.operation=i,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(i){return I(this,null,function*(){this.stop();try{this.pending=new ue,this.pending.promise.catch(t=>{}),yield Tt(this.getNextRun(i)),this.pending.resolve(),yield this.pending.promise,this.pending=new ue,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(i){if(i)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function Tt(r){return new Promise(i=>{setTimeout(i,r)})}var Ct={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},R=new He("appCheck","AppCheck",Ct);function et(r){if(!T(r).activated)throw R.create("use-before-activation",{appName:r.name})}function tt(e,n){return I(this,arguments,function*({url:r,body:i},t){let o={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(i),headers:o},c;try{c=yield fetch(r,a)}catch(f){throw R.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw R.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw R.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw R.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function nt(r,i){let{projectId:t,appId:e,apiKey:n}=r.options;return{url:`${yt}/projects/${t}/apps/${e}:${Et}?key=${n}`,body:{debug_token:i}}}var Pt="firebase-app-check-database",Dt=1,we="firebase-app-check-store";var Q=null;function _t(){return Q||(Q=new Promise((r,i)=>{try{let t=indexedDB.open(Pt,Dt);t.onsuccess=e=>{r(e.target.result)},t.onerror=e=>{var n;i(R.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(we,{keyPath:"compositeKey"})}}}catch(t){i(R.create("storage-open",{originalErrorMessage:t?.message}))}}),Q)}function xt(r,i){return Rt(jt(r),i)}function Rt(r,i){return I(this,null,function*(){let e=(yield _t()).transaction(we,"readwrite"),o=e.objectStore(we).put({compositeKey:r,value:i});return new Promise((s,a)=>{o.onsuccess=c=>{s()},e.onerror=c=>{var l;a(R.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function jt(r){return`${r.options.appId}-${r.name}`}var ke=new $e("@firebase/app-check");function me(r,i){return Le()?xt(r,i).catch(t=>{ke.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function rt(){return Qe().enabled}function ot(){return I(this,null,function*(){let r=Qe();if(r.enabled&&r.token)return r.token.promise;throw Error(`
3
3
  Can't get debug token in production mode.
4
4
  `)})}var Ot={error:"UNKNOWN_ERROR"};function Mt(r){return Fe.encodeString(JSON.stringify(r),!1)}function ve(r,i=!1){return I(this,null,function*(){let t=r.app;et(t);let e=T(t),n=e.token,o;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield me(t,void 0))}if(!i&&n&&J(n))return{token:n.token};let s=!1;if(rt()){e.exchangeTokenPromise||(e.exchangeTokenPromise=tt(nt(t,yield ot()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield me(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield T(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ke.warn(c.message):ke.error(c),o=c}let a;return n?o?J(n)?a={token:n.token,internalError:o}:a=Xe(o):(a={token:n.token},e.token=n,yield me(t,n)):a=Xe(o),s&&Lt(t,a),a})}function Bt(r){return I(this,null,function*(){let i=r.app;et(i);let{provider:t}=T(i);if(rt()){let e=yield ot(),{token:n}=yield tt(nt(i,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Nt(r,i,t,e){let{app:n}=r,o=T(n),s={next:t,error:e,type:i};if(o.tokenObservers=[...o.tokenObservers,s],o.token&&J(o.token)){let a=o.token;Promise.resolve().then(()=>{t({token:a.token}),Ze(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Ze(r))}function it(r,i){let t=T(r),e=t.tokenObservers.filter(n=>n.next!==i);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Ze(r){let{app:i}=r,t=T(i),e=t.tokenRefresher;e||(e=Ft(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function Ft(r){let{app:i}=r;return new Ae(()=>I(this,null,function*(){let t=T(i),e;if(t.token?e=yield ve(r,!0):e=yield ve(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=T(i);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Je.RETRIAL_MIN_WAIT,Je.RETRIAL_MAX_WAIT)}function Lt(r,i){let t=T(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&i.error!=null?e.error(i.error):e.next(i)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Xe(r){return{token:Mt(Ot),error:r}}var be=class{constructor(i,t){this.app=i,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:i}=T(this.app);for(let t of i)it(this.app,t.next);return Promise.resolve()}};function Ht(r,i){return new be(r,i)}function $t(r){return{getToken:i=>ve(r,i),getLimitedUseToken:()=>Bt(r),addTokenListener:i=>Nt(r,"INTERNAL",i),removeTokenListener:i=>it(r.app,i)}}var Wt="@firebase/app-check",Kt="0.8.4";var Ut="app-check",Ye="app-check-internal";function zt(){he(new de(Ut,r=>{let i=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return Ht(i,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,i,t)=>{r.getProvider(Ye).initialize()})),he(new de(Ye,r=>{let i=r.getProvider("app-check").getImmediate();return $t(i)},"PUBLIC").setInstantiationMode("EXPLICIT")),q(Wt,Kt)}zt();var qt=["localhost","0.0.0.0","127.0.0.1"],Do=typeof window<"u"&&qt.includes(window.location.hostname);var Gt="firebase",Jt="10.12.1";E.registerVersion(Gt,Jt,"app-compat");var Zt=["ngOnDestroy"],at=(r,i,t,e={})=>new Proxy(r,{get:(n,o)=>t.runOutsideAngular(()=>{if(r[o])return e?.spy?.get&&e.spy.get(o,r[o]),r[o];if(Zt.indexOf(o)>-1)return()=>{};let s=i.toPromise().then(a=>{let c=a?.[o];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(o,l,u),u})})})});var ee=class{constructor(i){return i}},te=new y("angularfire2.app.options"),ne=new y("angularfire2.app.name");function Se(r,i,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=E.apps.filter(a=>a&&a.name===n.name)[0]||i.runOutsideAngular(()=>E.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(s.options)){let a=!!module.hot;Xt("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ee(s)}var Xt=(r,...i)=>{ce()&&typeof console<"u"&&console[r](...i)},Yt={provide:ee,useFactory:Se,deps:[te,$,[new xe,ne]]},Ho=(()=>{class r{static initializeApp(t,e){return{ngModule:r,providers:[{provide:te,useValue:t},{provide:ne,useValue:e}]}}constructor(t){E.registerVersion("angularfire",G.full,"core"),E.registerVersion("angularfire",G.full,"app-compat"),E.registerVersion("angular",je.full,t.toString())}static \u0275fac=function(e){return new(e||r)(h(H))};static \u0275mod=L({type:r});static \u0275inj=F({providers:[Yt]})}return r})();function ct(r,i,t,e,n){let[,o,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return Qt(n,s)||(st("error",`${i} was already initialized on the ${t} Firebase App with different settings.${en?" You may need to reload as Firebase is not HMR aware.":""}`),st("warn",{is:n,was:s})),o;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function Qt(r,i){try{return r.toString()===i.toString()}catch{return r===i}}var en=typeof module<"u"&&!!module.hot,st=(r,...i)=>{ce()&&typeof console<"u"&&console[r](...i)};globalThis.\u0275AngularfireInstanceCache||=[];var tn=new y("angularfire2.auth.use-emulator"),nn=new y("angularfire2.auth.settings"),rn=new y("angularfire2.auth.tenant-id"),on=new y("angularfire2.auth.langugage-code"),sn=new y("angularfire2.auth.use-device-language"),an=new y("angularfire.auth.persistence"),cn=(r,i,t,e,n,o,s,a)=>ct(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=i.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,o&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,o,s,a]),Ie=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,o,s,a,c,l,d,u,p,f){let W=new X,j=K(void 0).pipe(M(s.outsideAngular),_(()=>o.runOutsideAngular(()=>import("./chunk-F4WIW6HA.js"))),P(()=>Se(t,o,e)),P(C=>cn(C,o,a,l,d,u,c,p)),se({bufferSize:1,refCount:!1}));if(Be(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{j.pipe(_e()).subscribe();let C=j.pipe(_(A=>A.getRedirectResult().then(D=>D,()=>null)),Ve,se({bufferSize:1,refCount:!1})),Z=j.pipe(_(A=>new g(D=>({unsubscribe:o.runOutsideAngular(()=>A.onAuthStateChanged(O=>D.next(O),O=>D.error(O),()=>D.complete()))})))),re=j.pipe(_(A=>new g(D=>({unsubscribe:o.runOutsideAngular(()=>A.onIdTokenChanged(O=>D.next(O),O=>D.error(O),()=>D.complete()))}))));this.authState=C.pipe(ae(Z),N(s.outsideAngular),M(s.insideAngular)),this.user=C.pipe(ae(re),N(s.outsideAngular),M(s.insideAngular)),this.idToken=this.user.pipe(_(A=>A?x(A.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(_(A=>A?x(A.getIdTokenResult()):K(null))),this.credential=Pe(C,W,this.authState.pipe(De(A=>!A))).pipe(P(A=>A?.user?A:null),N(s.outsideAngular),M(s.insideAngular))}return at(this,j,o,{spy:{apply:(C,Z,re)=>{(C.startsWith("signIn")||C.startsWith("createUser"))&&re.then(A=>W.next(A))}}})}static \u0275fac=function(e){return new(e||r)(h(te),h(ne,8),h(H),h($),h(qe),h(tn,8),h(nn,8),h(rn,8),h(on,8),h(sn,8),h(an,8),h(V,8))};static \u0275prov=b({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ti=(()=>{class r{constructor(){E.registerVersion("angularfire",G.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=L({type:r});static \u0275inj=F({providers:[Ie]})}return r})();function m(r,i,t,e){return new Promise((n,o)=>{r||o("IndexedDB not available");let s=r.open(i,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{o(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function lt(r,i,t,e,n){if(!r)return;let o=r.open(i,t);o.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,o.transaction)}),a.close()},o.onsuccess=s=>{s.target.result.close()}}function un(r,i,t){if(!r||!i||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=i+1,o=indexedDB.open(r,n);o.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},o.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function dn(r,i){return r.objectStoreNames.contains(i)}function S(r,i,t){r||t("You need to use the openDatabase function to create a database before you query it!"),dn(r,i)||t(`objectStore does not exists: ${i}`)}function k(r,i){let t=r.transaction(i.storeName,i.dbMode);return t.onerror=i.error,t.onabort=i.abort,t}function v(r,i,t,e){return{storeName:i,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var w=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(w||{}),ut=new y(null),ye=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Me(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,lt(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];lt(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=k(s,v(w.readwrite,t,d=>o.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(s=>o.error(s))})}bulkAdd(t,e){let n=new Promise((o,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=k(a,v(w.readwrite,t,o,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let j=W?l.add(u,W):l.add(u);j.onsuccess=C=>{let Z=C.target.result;p(Z)}}));o(Promise.all(d))}).catch(a=>s(a))});return x(n)}bulkDelete(t,e){let n=e.map(o=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=k(c,v(w.readwrite,t,a,s));l.objectStore(t).delete(o),l.oncomplete=()=>{this.getAll(t).pipe(ie(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return x(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let c=k(o,v(w.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(o=>n.error(o))})}bulkGet(t,e){let n=e.map(o=>this.getByKey(t,o));return new g(o=>{Ce(n).subscribe(s=>{o.next(s),o.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(w.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(o=>n.error(o))})}getByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(w.readonly,t,o.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,c=>e.error(c));let a=k(n,v(w.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(w.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>I(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(w.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(ie(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,c=>n.error(c));let s=k(o,v(w.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(o=>n.error(o))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{S(n,t,a=>e.error(a));let o=k(n,v(w.readwrite,t,a=>e.error(a)));o.objectStore(t).clear(),o.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>I(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=o=>t.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let a=k(o,v(w.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(t,e,n,o=w.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>{s.error(p)});let u=k(a,v(o,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(w.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let o=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{S(a,t,p=>s.error(p));let u=k(a,v(w.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(o),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{S(o,t,l=>n.error(l));let c=k(o,v(w.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(t,e,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{S(s,t,u=>o.error(u));let d=k(s,v(w.readonly,t,o.error)).objectStore(t).index(e).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(s=>o.error(s))})}deleteObjectStore(t){return un(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(ut),h(H))},r.\u0275prov=b({token:r,factory:r.\u0275fac}),r})(),li=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[ye,{provide:ut,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=L({type:r}),r.\u0275inj=F({imports:[[Oe]]}),r})();var dt=(()=>{let i=class i{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let o=this.getKey(n);return this.db.add(this.DATABASE,e,o).pipe(P(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case le.Lazada:n="Lazada";break;case le.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};i.\u0275fac=function(n){return new(n||i)(h(ye))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var ht=(()=>{let i=class i{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=oe(oe({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return z.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();var Si=(()=>{let i=class i{constructor(e,n,o,s,a,c,l){this.httpService=e,this.tokenDecodeService=n,this.afAuth=o,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.channels=[]}login(e){return this.httpService.post("/api/token/Login",e).pipe(U(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(ze.news).pipe(P(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let o=new pe;return o.setCustomParameters({prompt:"select_account"}),x(this.afAuth.signInWithPopup(o)).pipe(P(s=>s.credential),P(s=>s.idToken),_(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),U(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,o){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:o})),localStorage.setItem("channels",JSON.stringify(e.Channels)),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if(z.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){let e=JSON.parse(JSON.stringify(this.channels));if(this.channels.length===0){let n=localStorage.getItem("channels");n?(this.channels=JSON.parse(n),e=JSON.parse(JSON.stringify(this.channels))):(this.channels=[],e=[])}return e=this.setChannelLogo(e),e}setChannelLogo(e){return e=e.map(n=>(n.Img=z.getChannelLogoByTypeId(n.TypeID),n)),e}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let o=new Date(e.Token.expiredAt);return n<o?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.channels=[],localStorage.removeItem("channels"),localStorage.removeItem("user"),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};i.\u0275fac=function(n){return new(n||i)(h(Ke),h(Ge),h(Ie),h(Ue),h(dt),h(Ne),h(ht))},i.\u0275prov=b({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})();export{ze as a,Ge as b,Ho as c,ti as d,li as e,dt as f,Si as g};