marketplacepos 5.51.0 → 5.51.2

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 (59) hide show
  1. package/Marketplace/{chunk-53B6D5OR.js → chunk-26E54WQH.js} +1 -1
  2. package/Marketplace/{chunk-AZEH7PMO.js → chunk-3KECTTUV.js} +1 -1
  3. package/Marketplace/{chunk-WEJBY3OB.js → chunk-4XA7JWTB.js} +1 -1
  4. package/Marketplace/{chunk-BLOGT3TL.js → chunk-575TS45M.js} +1 -1
  5. package/Marketplace/{chunk-ZMSM2NR7.js → chunk-75RVMUFO.js} +1 -1
  6. package/Marketplace/{chunk-36OIR6DM.js → chunk-AMQMYSQR.js} +1 -1
  7. package/Marketplace/{chunk-7E6JD2PT.js → chunk-APQWBZOM.js} +1 -1
  8. package/Marketplace/{chunk-EYYKWIXP.js → chunk-AVSAALDJ.js} +1 -1
  9. package/Marketplace/{chunk-AF6XAQPY.js → chunk-AVTQG66S.js} +1 -1
  10. package/Marketplace/{chunk-T62YFSKW.js → chunk-BKVIOCLH.js} +1 -1
  11. package/Marketplace/{chunk-IXNEMOFX.js → chunk-BZ7QY7N3.js} +1 -1
  12. package/Marketplace/{chunk-GD5I7ADU.js → chunk-CHCAQ4NV.js} +1 -1
  13. package/Marketplace/{chunk-Q5IVQP3E.js → chunk-DCMOITWM.js} +1 -1
  14. package/Marketplace/{chunk-VBVBTC2P.js → chunk-DOQD3RMB.js} +1 -1
  15. package/Marketplace/{chunk-YF7CCYHF.js → chunk-DV3BDHBL.js} +1 -1
  16. package/Marketplace/{chunk-OPCGCQMZ.js → chunk-DVJ7VXWL.js} +1 -1
  17. package/Marketplace/{chunk-XSOP2OTT.js → chunk-DW7R34MP.js} +1 -1
  18. package/Marketplace/{chunk-J4RDYEJC.js → chunk-EXKAFEQL.js} +1 -1
  19. package/Marketplace/{chunk-HT2MSA66.js → chunk-FQM4RKLX.js} +1 -1
  20. package/Marketplace/{chunk-EGJMTFNO.js → chunk-GYQHWDWX.js} +1 -1
  21. package/Marketplace/{chunk-SASGSPGQ.js → chunk-HO6XCGRR.js} +1 -1
  22. package/Marketplace/{chunk-HZTKN5RX.js → chunk-HPQDUJXF.js} +1 -1
  23. package/Marketplace/{chunk-E6W25RW5.js → chunk-ICY32GYN.js} +1 -1
  24. package/Marketplace/{chunk-ILFUI3MT.js → chunk-ILFG3IYB.js} +1 -1
  25. package/Marketplace/{chunk-4JCS7WPV.js → chunk-IUJ6UX3L.js} +1 -1
  26. package/Marketplace/{chunk-62YNPW6Q.js → chunk-J4552BMI.js} +1 -1
  27. package/Marketplace/{chunk-M5JNIPMS.js → chunk-JUN3HVEV.js} +1 -1
  28. package/Marketplace/{chunk-BKCKASH3.js → chunk-KHGTW7IV.js} +1 -1
  29. package/Marketplace/{chunk-364CDNZV.js → chunk-KVLHLMO4.js} +1 -1
  30. package/Marketplace/{chunk-5YQUGH5Z.js → chunk-LB276KSA.js} +1 -1
  31. package/Marketplace/{chunk-3Q6QZGLZ.js → chunk-MG7B4OWR.js} +1 -1
  32. package/Marketplace/{chunk-T3CN3WQD.js → chunk-MRWGPCR7.js} +1 -1
  33. package/Marketplace/{chunk-2PMJPSC4.js → chunk-N6VPSXF7.js} +2 -2
  34. package/Marketplace/{chunk-K2CHDL7K.js → chunk-NEB6AMMM.js} +1 -1
  35. package/Marketplace/{chunk-4ITXH35D.js → chunk-NKN7T3C3.js} +1 -1
  36. package/Marketplace/{chunk-C64L25TP.js → chunk-NMOQXVWS.js} +1 -1
  37. package/Marketplace/{chunk-7RIUHK6K.js → chunk-NUF326RW.js} +1 -1
  38. package/Marketplace/{chunk-SLQ42VND.js → chunk-NX3QFU4A.js} +1 -1
  39. package/Marketplace/{chunk-LWUMLKSO.js → chunk-OEUA6IL2.js} +1 -1
  40. package/Marketplace/{chunk-OJI34QN5.js → chunk-PGQYHHH3.js} +1 -1
  41. package/Marketplace/{chunk-6DGG765N.js → chunk-Q3Z7EEVP.js} +1 -1
  42. package/Marketplace/{chunk-ZMMMNVOU.js → chunk-QJ7SMXW4.js} +1 -1
  43. package/Marketplace/{chunk-LOVYZLSU.js → chunk-QLFVXMNJ.js} +1 -1
  44. package/Marketplace/{chunk-TLTFNFAB.js → chunk-QPELTSKE.js} +1 -1
  45. package/Marketplace/{chunk-ZXFWQ6VJ.js → chunk-QUIZLT5F.js} +1 -1
  46. package/Marketplace/{chunk-LCN52IJT.js → chunk-REDQ2L7Y.js} +1 -1
  47. package/Marketplace/{chunk-7QDKBMEA.js → chunk-SLCKHYT3.js} +1 -1
  48. package/Marketplace/{chunk-XAL6YLNQ.js → chunk-U4ARIHUF.js} +1 -1
  49. package/Marketplace/{chunk-A4X7F4MN.js → chunk-UHWLUO2C.js} +1 -1
  50. package/Marketplace/{chunk-R3BRUX7Z.js → chunk-UJAA73LE.js} +1 -1
  51. package/Marketplace/{chunk-EX4C4ZW4.js → chunk-UOFJCKS5.js} +1 -1
  52. package/Marketplace/{chunk-6IZWIEUD.js → chunk-VRD2D2BP.js} +1 -1
  53. package/Marketplace/{chunk-WH76SMZT.js → chunk-WZQRKTBN.js} +1 -1
  54. package/Marketplace/{chunk-BVW7WI5I.js → chunk-YFR3EI3B.js} +1 -1
  55. package/Marketplace/{chunk-OMY5ASFA.js → chunk-YMOSVDG5.js} +1 -1
  56. package/Marketplace/{chunk-25Q56ATV.js → chunk-YSYA7XCF.js} +1 -1
  57. package/Marketplace/index.html +2 -2
  58. package/Marketplace/{main-SOO5LINL.js → main-I5THR2C3.js} +1 -1
  59. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as zt}from"./chunk-E7LOFZQV.js";import"./chunk-YLQBIIZH.js";import{b as Xt}from"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import{a as Kt,b as Jt}from"./chunk-FH2KAM6J.js";import{a as Yt}from"./chunk-YKKHSYDW.js";import{a as Ht}from"./chunk-WTHYLNPX.js";import{a as ct,b as Gt,c as jt,d as mt,e as pt}from"./chunk-HZTKN5RX.js";import"./chunk-TQROQOXU.js";import{a as Wt}from"./chunk-IQGRGC3E.js";import{d as R,e as B}from"./chunk-BZWZ64N5.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import"./chunk-LCN52IJT.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Bt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as Rt}from"./chunk-UEXWQT5J.js";import{b as qt,c as Qt}from"./chunk-RPHZK33A.js";import"./chunk-3SCX7IMW.js";import"./chunk-JHSG3KRS.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as $t}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as Ct,c as h}from"./chunk-UPRDDI4K.js";import{A as et,B as $,c as tt,e as nt,h as L,i as W,l as st,m as Mt,n as Y,q as H,r as wt,s as X,t as Vt,u as Ut,v as Lt,z as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Dt,e as Z}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as A,w as S}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$ as Pt,$c as lt,Hb as x,K as At,M as Ft,Nc as f,Oa as D,Oc as at,Pc as q,Rc as Et,Sc as Nt,Tc as Ot,Z as z,_c as I,ac as C,ca as ht,cc as g,dc as w,ea as E,f as St,fc as V,gc as U,hc as d,ic as c,id as v,jc as s,jd as T,kc as _,ma as N,ob as p,ra as u,rc as j,tb as M,td as kt,ud as b,v as P,wc as F,ya as O,yc as l,za as k}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t})(J||{});var it=(function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t})(it||{});var ot=(function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t})(ot||{});var gt=class extends st{setValue(r,i){if(r instanceof Date){let n=Math.floor(r.getTime()/1e3);super.setValue(n,i)}else super.setValue(r,i)}},bt=(()=>{let r=class r{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(K)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(P(e=>this.setLabelToIndonesian(e)))}setLabelToIndonesian(n=[]){let e,a;return n=n.map(o=>(e=o?.multi_lang?.find(m=>m.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),o.name=e?.value?e?.value:o.name,o)),n}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{if(a=[],o.mandatory&&a.push(nt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new st(null),value:new st(null,a)});e.addControl(JSON.stringify(o.attribute_id),m)}else o?.attribute_info?.input_type==J.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?e.addControl(JSON.stringify(o.attribute_id),new gt(null,a)):e.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,a))}),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>{switch(o.attribute_info.input_type){case J.MULTI_COMBO_BOX:h.IsNotEmpty(e[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(m=>e[o.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):o.attribute_value_list=[];break;case J.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]?.value,e[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(e[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(m=>m.value_id==e[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,e){let a=[];if(h.IsNotEmpty(n)){let o={value_id:0,original_value_name:JSON.stringify(n)};h.IsNotEmpty(e)&&(o.value_unit=e),a=[o]}return a}setSelectedDateAttr(n){let e=[];return h.IsNotEmpty(n)&&(e=[{value_id:0,original_value_name:JSON.stringify(n)}]),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var yt=()=>[];function ne(t,r){t&1&&(c(0,"span",4),f(1,"*"),s())}function re(t,r){if(t&1&&_(0,"ng-select",5),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(4,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function ae(t,r){if(t&1&&_(0,"input",7),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function le(t,r){if(t&1&&(c(0,"option",14),f(1),s()),t&2){let i=r.$implicit;d("value",i),p(),at(i)}}function se(t,r){if(t&1&&(c(0,"div",9),_(1,"input",11),c(2,"select",12)(3,"option",13),f(4,"Unit"),s(),V(5,le,2,2,"option",14,w),s()()),t&2){let i=l(3).$implicit;d("formGroupName",i.attribute_id),p(),d("placeholder","Isi "+(i==null?null:i.name)),p(2),d("value",null),p(2),U(i==null||i.attribute_info==null?null:i.attribute_info.attribute_unit_list)}}function ce(t,r){if(t&1&&_(0,"input",10),t&2){let i=l(3).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function me(t,r){if(t&1&&C(0,se,7,3,"div",9)(1,ce,1,2,"input",10),t&2){let i=l(2).$implicit,n=l(2);g((i==null||i.attribute_info==null?null:i.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,r){if(t&1&&_(0,"datepicker",8),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)}}function de(t,r){if(t&1&&C(0,ae,1,2,"input",7)(1,me,2,1)(2,pe,1,1,"datepicker",8),t&2){let i,n=l().$implicit,e=l(2);g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===e.validationType.VALIDATOR_STRING_TYPE?0:i===e.validationType.VALIDATOR_FLOAT_TYPE?1:i===e.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ue(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function _e(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function fe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ne,2,0,"span",4),c(3,"span"),f(4),s()(),C(5,re,1,5,"ng-select",5)(6,de,3,1)(7,ue,1,4,"ng-select",6)(8,_e,1,4,"ng-select",6),s()),t&2){let i,n=r.$implicit,e=l(2);p(2),g(n.mandatory?2:-1),p(2),q(" ",n==null?null:n.name," "),p(),g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===e.inputType.MULTI_COMBO_BOX?5:i===e.inputType.FREE_TEXT_FILED?6:i===e.inputType.SINGLE_COMBO_BOX?7:8)}}function he(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,fe,9,3,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var Zt=(()=>{let r=class r{constructor(){this.formCategoryService=u(bt),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=new M,this.inputType=J,this.formatType=it,this.validationType=ot}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:n,channelId:e,channelType:this.channelType()}).pipe(E(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{e=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[I([bt]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,he,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,Ut,Lt,tt,Vt,L,W,H,X,wt,Ht,Qt,qt,S],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{--mat-icon-button-state-layer-size: 36px}"]});let t=r;return t})();var Q=(function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t})(Q||{});var vt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K),this.uploadProductService=u(pt)}getAttributes(n,e){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(At(o=>this.uploadProductService.selectedProduct$.pipe(P(m=>(o=this.mappingAttributeSalesProperty(o,m),o)))))}mappingAttributeSalesProperty(n,e){let a=0;return n.filter(o=>(o.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(e),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(n){let e=!1,a=[];return n.forEach(o=>{o.Variants&&a.push(o.Variants.length)}),e=a.some(o=>o>1),e}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{a=[],o.is_required&&a.push(nt.required),e.addControl(o.id,this.formBuilder.control(null,a))}),e.addControl("listingPlatform",this.formBuilder.control([Q.TIKTOK_SHOP,Q.TOKOPEDIA],[nt.required])),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.id)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(m=>e[o.id]?.includes(m.id)):o.values=o.values.filter(m=>m.id==e[o.id]):e[o.id]&&(o.values=[{id:null,name:e[o.id]}]),o)).filter(o=>o?.values?.length>0)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Ce(t,r){t&1&&(c(0,"small",5),f(1," Platform is required "),s())}function ge(t,r){t&1&&(c(0,"span",5),f(1,"*"),s())}function be(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ye(t,r){if(t&1&&_(0,"ng-select",7),t&2){let i=l().$implicit;d("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ve(t,r){if(t&1&&_(0,"input",8),t&2){let i=l().$implicit;d("formControlName",i.id)("placeholder",i==null?null:i.name)}}function Te(t,r){if(t&1&&(c(0,"small",5),f(1),s()),t&2){let i=l().$implicit;p(),q(" ",i==null?null:i.name," is mandatory ")}}function xe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ge,2,0,"span",5),c(3,"span"),f(4),s()(),C(5,be,1,4,"ng-select",6)(6,ye,1,3,"ng-select",7)(7,ve,1,2,"input",8),C(8,Te,2,1,"small",5),s()),t&2){let i=r.$implicit;p(2),g(i.is_required?2:-1),p(2),q(" ",i==null?null:i.name," "),p(),g(i.is_multiple_selection?5:i.values!==null&&i.values.length>0?6:7),p(3),g(i.is_required?8:-1)}}function Ie(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),f(5," Platform Options"),s()(),_(6,"ng-select",4),C(7,Ce,2,0,"small",5),s(),V(8,xe,9,4,"div",2,w),s()()),t&2){let i,n=l();d("formGroup",n.form),p(6),d("multiple",!0)("items",n.platformOptions)("clearable",!1),p(),g(!(n.form==null||(i=n.form.get("listingPlatform").errors)==null)&&i.required?7:-1),p(),U(r)}}var te=(()=>{let r=class r{constructor(){this.tiktokAttributeFormService=u(vt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=kt({alias:"onPlatformChanges"}),this.formSubscription=new St,this.attributesChanges=new M,this.platformOptions=[{label:"TikTok Shop",value:Q.TIKTOK_SHOP},{label:"Tokopedia",value:Q.TOKOPEDIA}]}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(e,n).pipe(P(a=>a.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),E(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.form.valueChanges.pipe(ht(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,e=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)}),this.form.get("listingPlatform").valueChanges.pipe(Pt(this.form.get("listingPlatform").value),ht(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[I([vt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ie,10,5,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,tt,L,W,H,X,et,S],encapsulation:2});let t=r;return t})();var Tt=(()=>{let r=class r{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(n,e){return this.woocommerceUploadService.getAttributes(n,e).pipe(P(a=>a.map(o=>({key:o.name,label:o.name}))))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var ee=(()=>{let r=class r{constructor(){this.wooAttributeFormService=u(Tt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=new M}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([Tt]),D],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(e,a){e&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),s(),c(4,"ng-select",3),v(5,"async"),F("change",function(m){return a.onSelectAttribute(m)}),s()()()),e&2&&(p(4),d("items",T(5,1,a.attributes$)))},dependencies:[A,et,B,R,$,S],encapsulation:2});let t=r;return t})();var xt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n,e){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(P(o=>o))}createFormGroup(n){let e=this.formBuilder.group({});return n.forEach(a=>{e.addControl(a.variant,this.formBuilder.control(null))}),e}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Se(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),f(2),s(),_(3,"ng-select",4),s()),t&2){let i=r.$implicit;p(2),q(" ",i==null?null:i.variant," "),p(),d("formControlName",i.variant)("items",i.values)("placeholder","Pilih "+(i==null?null:i.variant))}}function Ae(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,Se,4,4,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var ie=(()=>{let r=class r{constructor(){this.tokpedAttrFormService=u(xt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=new M}ngOnInit(){}ngOnChanges(n){let e=this.categoryId(),a=this.channelId();h.IsNotEmpty(e)&&h.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,e).pipe(E(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(e=>{n=this.tokpedAttrFormService.convertAttributes(e),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([xt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ae,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,L,W,H,X,S],encapsulation:2});let t=r;return t})();var It=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(E(a=>(a.Options.StatusOptions=a.Options.Status.map(o=>({id:o,name:o})),a)))}createFormGroup(n){let e=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(o=>{e.addControl(o,this.formBuilder.control(null))}),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Fe(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4," Brand "),s(),_(5,"input",4),s(),c(6,"div",5)(7,"div",3),f(8," Product Type "),s(),_(9,"input",6),s(),c(10,"div",5)(11,"div",3),f(12," Status "),s(),_(13,"ng-select",7),s()()()),t&2){let i=l();d("formGroup",i.form),p(13),d("items",r.Options.StatusOptions)}}var oe=(()=>{let r=class r{constructor(){this.channelId=b(void 0),this.attributesChanges=new M,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(E(e=>{this.form=this.shopifyFormService.createFormGroup(e),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([It]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,Fe,14,2,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,$,Y,tt,L,W,H,X,B,R,S],encapsulation:2});let t=r;return t})();function Pe(t,r){if(t&1&&(c(0,"div",6),_(1,"app-product-card",9),s()),t&2){let i=r.$implicit;p(),d("productId",i==null?null:i.ID)("title",i==null?null:i.Name)("image",i==null?null:i.ThumbnailUrl)("description",(i==null||i.Variants==null?null:i.Variants.length)>1?(i==null||i.Variants==null?null:i.Variants.length)+" Variants":null)("imageForZoom",i==null?null:i.ImageUrl)("code",i==null||i.Variants[0]==null?null:i.Variants[0].Code)("showFooter",!1)}}function Ee(t,r){if(t&1){let i=j();c(0,"mat-checkbox",21),Ot("ngModelChange",function(e){O(i);let a=l().$implicit;return Nt(a.selected,e)||(a.selected=e),k(e)}),F("ngModelChange",function(){let e=O(i),a=l(),o=a.$implicit,m=a.$index,y=l();return k(y.onSelectChannel(o,m,e))}),s()}if(t&2){let i=l().$implicit;Et("ngModel",i.selected)}}function Ne(t,r){if(t&1&&(c(0,"div",18),_(1,"input",22),s()),t&2){let i=l().$implicit,n=l();d("matTooltip",i.type==n.channelType.Shopify||i.type==n.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":i.type==n.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Oe(t,r){if(t&1){let i=j();c(0,"app-channel-category-select",23),F("selectedCategory",function(e){O(i);let a=l().$index,o=l();return k(o.onCategoryChange(a,e))}),s()}if(t&2){let i=l().$implicit,n=l();d("disabled",!i.selected||i.selected&&i.type==n.channelType.Lazada)("channelId",i.id)("channelType",i.type)("categoryId",i.categoryId)}}function ke(t,r){if(t&1){let i=j();c(0,"shopee-attribute-form",27),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)("channelType",i.type)}}function De(t,r){if(t&1){let i=j();c(0,"tiktok-attribute-form",28),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))})("onPlatformChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onPlatformChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Me(t,r){if(t&1){let i=j();c(0,"wooocommerce-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function we(t,r){if(t&1){let i=j();c(0,"tokopedia-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Ve(t,r){if(t&1&&(c(0,"div",20)(1,"div",24),C(2,ke,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),s()()),t&2){let i,n=l().$implicit,e=l();p(2),g((i=n.type)===e.channelType.Shopee?2:i===e.channelType.Tiktok?3:i===e.channelType.WooCommerce?4:i===e.channelType.Tokopedia?5:-1)}}function Ue(t,r){if(t&1){let i=j();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),F("attributesChanges",function(e){O(i);let a=l().$index,o=l();return k(o.onAttributesChange(a,e))}),s()()()}if(t&2){let i=l().$implicit;p(2),d("channelId",i.id)}}function Le(t,r){if(t&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),C(6,Ee,1,1,"mat-checkbox",14),v(7,"async"),s(),c(8,"div"),_(9,"app-channel-logo",15),s(),c(10,"div",16)(11,"span"),f(12),s()()()(),c(13,"div",12)(14,"div",17),C(15,Ne,2,1,"div",18)(16,Oe,1,4,"app-channel-category-select",19),s()()(),C(17,Ve,6,1,"div",20)(18,Ue,3,1,"div",20),s()()),t&2){let i,n=r.$implicit,e=l();p(6),g((i=T(7,8,e.defaultCategories$))?6:-1,i),p(3),d("typeId",n.type)("showChannelName",!1),p(),d("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),at(n.name),p(3),g(n.type==e.channelType.Shopify||n.type==e.channelType.Plugo||n.type==e.channelType.ShopifyV2?15:16),p(2),g(n.categoryId&&e.channelType.Lazada!=n.type&&n.selected?17:(e.channelType.Shopify==n.type||n.type==e.channelType.ShopifyV2)&&n.selected?18:-1)}}var en=(()=>{let r=class r{constructor(){this.toastr=u(Dt),this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ct,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(z(1))}onCategoryChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.categoryId=e,o.attributes=[]),o)))}onPlatformChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onAttributesChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.attributes=e),o)))}tiktokPlatformChanges(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onSelectChannel(n,e,a){this.channelProductUploads.update(o=>o.map((m,y)=>{if(y==e&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);m.categoryId=_t?.DefaultCategoryID}return y==e&&!n.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(n,e){return e.find(a=>a.ID===n)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(e=>e.type==Ct.Tiktok&&h.IsNotEmpty(e?.categoryId)?e.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["app-product-upload"]],features:[I([ct,Gt,jt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(e,a){if(e&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),F("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),s()(),c(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),s(),c(9,"div",5),V(10,Pe,2,7,"div",6,w),v(12,"async"),s(),c(13,"h3",7),f(14,"Channel To Upload"),s(),V(15,Le,19,10,"div",8,w),s()()()),e&2){let o;d("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("disabled",((o=a.channelProductUploads())==null?null:o.length)==0),p(8),U(T(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[A,Xt,Bt,Jt,Kt,Yt,et,L,Mt,Rt,$t,te,ee,ie,oe,Wt,zt,Zt,S],encapsulation:2});let t=r;return t})();export{en as ProductUploadComponent};
1
+ import{a as zt}from"./chunk-E7LOFZQV.js";import"./chunk-YLQBIIZH.js";import{b as Xt}from"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import{a as Kt,b as Jt}from"./chunk-FH2KAM6J.js";import{a as Yt}from"./chunk-YKKHSYDW.js";import{a as Ht}from"./chunk-WTHYLNPX.js";import{a as ct,b as Gt,c as jt,d as mt,e as pt}from"./chunk-HPQDUJXF.js";import"./chunk-TQROQOXU.js";import{a as Wt}from"./chunk-IQGRGC3E.js";import{d as R,e as B}from"./chunk-BZWZ64N5.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import"./chunk-REDQ2L7Y.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Bt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as Rt}from"./chunk-UEXWQT5J.js";import{b as qt,c as Qt}from"./chunk-RPHZK33A.js";import"./chunk-3SCX7IMW.js";import"./chunk-JHSG3KRS.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as $t}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as Ct,c as h}from"./chunk-UPRDDI4K.js";import{A as et,B as $,c as tt,e as nt,h as L,i as W,l as st,m as Mt,n as Y,q as H,r as wt,s as X,t as Vt,u as Ut,v as Lt,z as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Dt,e as Z}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as A,w as S}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$ as Pt,$c as lt,Hb as x,K as At,M as Ft,Nc as f,Oa as D,Oc as at,Pc as q,Rc as Et,Sc as Nt,Tc as Ot,Z as z,_c as I,ac as C,ca as ht,cc as g,dc as w,ea as E,f as St,fc as V,gc as U,hc as d,ic as c,id as v,jc as s,jd as T,kc as _,ma as N,ob as p,ra as u,rc as j,tb as M,td as kt,ud as b,v as P,wc as F,ya as O,yc as l,za as k}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t})(J||{});var it=(function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t})(it||{});var ot=(function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t})(ot||{});var gt=class extends st{setValue(r,i){if(r instanceof Date){let n=Math.floor(r.getTime()/1e3);super.setValue(n,i)}else super.setValue(r,i)}},bt=(()=>{let r=class r{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(K)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(P(e=>this.setLabelToIndonesian(e)))}setLabelToIndonesian(n=[]){let e,a;return n=n.map(o=>(e=o?.multi_lang?.find(m=>m.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),o.name=e?.value?e?.value:o.name,o)),n}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{if(a=[],o.mandatory&&a.push(nt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new st(null),value:new st(null,a)});e.addControl(JSON.stringify(o.attribute_id),m)}else o?.attribute_info?.input_type==J.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?e.addControl(JSON.stringify(o.attribute_id),new gt(null,a)):e.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,a))}),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>{switch(o.attribute_info.input_type){case J.MULTI_COMBO_BOX:h.IsNotEmpty(e[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(m=>e[o.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):o.attribute_value_list=[];break;case J.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]?.value,e[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(e[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(m=>m.value_id==e[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,e){let a=[];if(h.IsNotEmpty(n)){let o={value_id:0,original_value_name:JSON.stringify(n)};h.IsNotEmpty(e)&&(o.value_unit=e),a=[o]}return a}setSelectedDateAttr(n){let e=[];return h.IsNotEmpty(n)&&(e=[{value_id:0,original_value_name:JSON.stringify(n)}]),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var yt=()=>[];function ne(t,r){t&1&&(c(0,"span",4),f(1,"*"),s())}function re(t,r){if(t&1&&_(0,"ng-select",5),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(4,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function ae(t,r){if(t&1&&_(0,"input",7),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function le(t,r){if(t&1&&(c(0,"option",14),f(1),s()),t&2){let i=r.$implicit;d("value",i),p(),at(i)}}function se(t,r){if(t&1&&(c(0,"div",9),_(1,"input",11),c(2,"select",12)(3,"option",13),f(4,"Unit"),s(),V(5,le,2,2,"option",14,w),s()()),t&2){let i=l(3).$implicit;d("formGroupName",i.attribute_id),p(),d("placeholder","Isi "+(i==null?null:i.name)),p(2),d("value",null),p(2),U(i==null||i.attribute_info==null?null:i.attribute_info.attribute_unit_list)}}function ce(t,r){if(t&1&&_(0,"input",10),t&2){let i=l(3).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function me(t,r){if(t&1&&C(0,se,7,3,"div",9)(1,ce,1,2,"input",10),t&2){let i=l(2).$implicit,n=l(2);g((i==null||i.attribute_info==null?null:i.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,r){if(t&1&&_(0,"datepicker",8),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)}}function de(t,r){if(t&1&&C(0,ae,1,2,"input",7)(1,me,2,1)(2,pe,1,1,"datepicker",8),t&2){let i,n=l().$implicit,e=l(2);g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===e.validationType.VALIDATOR_STRING_TYPE?0:i===e.validationType.VALIDATOR_FLOAT_TYPE?1:i===e.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ue(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function _e(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function fe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ne,2,0,"span",4),c(3,"span"),f(4),s()(),C(5,re,1,5,"ng-select",5)(6,de,3,1)(7,ue,1,4,"ng-select",6)(8,_e,1,4,"ng-select",6),s()),t&2){let i,n=r.$implicit,e=l(2);p(2),g(n.mandatory?2:-1),p(2),q(" ",n==null?null:n.name," "),p(),g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===e.inputType.MULTI_COMBO_BOX?5:i===e.inputType.FREE_TEXT_FILED?6:i===e.inputType.SINGLE_COMBO_BOX?7:8)}}function he(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,fe,9,3,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var Zt=(()=>{let r=class r{constructor(){this.formCategoryService=u(bt),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=new M,this.inputType=J,this.formatType=it,this.validationType=ot}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:n,channelId:e,channelType:this.channelType()}).pipe(E(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{e=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[I([bt]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,he,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,Ut,Lt,tt,Vt,L,W,H,X,wt,Ht,Qt,qt,S],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{--mat-icon-button-state-layer-size: 36px}"]});let t=r;return t})();var Q=(function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t})(Q||{});var vt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K),this.uploadProductService=u(pt)}getAttributes(n,e){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(At(o=>this.uploadProductService.selectedProduct$.pipe(P(m=>(o=this.mappingAttributeSalesProperty(o,m),o)))))}mappingAttributeSalesProperty(n,e){let a=0;return n.filter(o=>(o.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(e),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(n){let e=!1,a=[];return n.forEach(o=>{o.Variants&&a.push(o.Variants.length)}),e=a.some(o=>o>1),e}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{a=[],o.is_required&&a.push(nt.required),e.addControl(o.id,this.formBuilder.control(null,a))}),e.addControl("listingPlatform",this.formBuilder.control([Q.TIKTOK_SHOP,Q.TOKOPEDIA],[nt.required])),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.id)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(m=>e[o.id]?.includes(m.id)):o.values=o.values.filter(m=>m.id==e[o.id]):e[o.id]&&(o.values=[{id:null,name:e[o.id]}]),o)).filter(o=>o?.values?.length>0)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Ce(t,r){t&1&&(c(0,"small",5),f(1," Platform is required "),s())}function ge(t,r){t&1&&(c(0,"span",5),f(1,"*"),s())}function be(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ye(t,r){if(t&1&&_(0,"ng-select",7),t&2){let i=l().$implicit;d("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ve(t,r){if(t&1&&_(0,"input",8),t&2){let i=l().$implicit;d("formControlName",i.id)("placeholder",i==null?null:i.name)}}function Te(t,r){if(t&1&&(c(0,"small",5),f(1),s()),t&2){let i=l().$implicit;p(),q(" ",i==null?null:i.name," is mandatory ")}}function xe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ge,2,0,"span",5),c(3,"span"),f(4),s()(),C(5,be,1,4,"ng-select",6)(6,ye,1,3,"ng-select",7)(7,ve,1,2,"input",8),C(8,Te,2,1,"small",5),s()),t&2){let i=r.$implicit;p(2),g(i.is_required?2:-1),p(2),q(" ",i==null?null:i.name," "),p(),g(i.is_multiple_selection?5:i.values!==null&&i.values.length>0?6:7),p(3),g(i.is_required?8:-1)}}function Ie(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),f(5," Platform Options"),s()(),_(6,"ng-select",4),C(7,Ce,2,0,"small",5),s(),V(8,xe,9,4,"div",2,w),s()()),t&2){let i,n=l();d("formGroup",n.form),p(6),d("multiple",!0)("items",n.platformOptions)("clearable",!1),p(),g(!(n.form==null||(i=n.form.get("listingPlatform").errors)==null)&&i.required?7:-1),p(),U(r)}}var te=(()=>{let r=class r{constructor(){this.tiktokAttributeFormService=u(vt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=kt({alias:"onPlatformChanges"}),this.formSubscription=new St,this.attributesChanges=new M,this.platformOptions=[{label:"TikTok Shop",value:Q.TIKTOK_SHOP},{label:"Tokopedia",value:Q.TOKOPEDIA}]}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(e,n).pipe(P(a=>a.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),E(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.form.valueChanges.pipe(ht(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,e=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)}),this.form.get("listingPlatform").valueChanges.pipe(Pt(this.form.get("listingPlatform").value),ht(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[I([vt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ie,10,5,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,tt,L,W,H,X,et,S],encapsulation:2});let t=r;return t})();var Tt=(()=>{let r=class r{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(n,e){return this.woocommerceUploadService.getAttributes(n,e).pipe(P(a=>a.map(o=>({key:o.name,label:o.name}))))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var ee=(()=>{let r=class r{constructor(){this.wooAttributeFormService=u(Tt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=new M}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([Tt]),D],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(e,a){e&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),s(),c(4,"ng-select",3),v(5,"async"),F("change",function(m){return a.onSelectAttribute(m)}),s()()()),e&2&&(p(4),d("items",T(5,1,a.attributes$)))},dependencies:[A,et,B,R,$,S],encapsulation:2});let t=r;return t})();var xt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n,e){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(P(o=>o))}createFormGroup(n){let e=this.formBuilder.group({});return n.forEach(a=>{e.addControl(a.variant,this.formBuilder.control(null))}),e}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Se(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),f(2),s(),_(3,"ng-select",4),s()),t&2){let i=r.$implicit;p(2),q(" ",i==null?null:i.variant," "),p(),d("formControlName",i.variant)("items",i.values)("placeholder","Pilih "+(i==null?null:i.variant))}}function Ae(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,Se,4,4,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var ie=(()=>{let r=class r{constructor(){this.tokpedAttrFormService=u(xt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=new M}ngOnInit(){}ngOnChanges(n){let e=this.categoryId(),a=this.channelId();h.IsNotEmpty(e)&&h.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,e).pipe(E(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(e=>{n=this.tokpedAttrFormService.convertAttributes(e),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([xt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ae,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,L,W,H,X,S],encapsulation:2});let t=r;return t})();var It=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(E(a=>(a.Options.StatusOptions=a.Options.Status.map(o=>({id:o,name:o})),a)))}createFormGroup(n){let e=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(o=>{e.addControl(o,this.formBuilder.control(null))}),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Fe(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4," Brand "),s(),_(5,"input",4),s(),c(6,"div",5)(7,"div",3),f(8," Product Type "),s(),_(9,"input",6),s(),c(10,"div",5)(11,"div",3),f(12," Status "),s(),_(13,"ng-select",7),s()()()),t&2){let i=l();d("formGroup",i.form),p(13),d("items",r.Options.StatusOptions)}}var oe=(()=>{let r=class r{constructor(){this.channelId=b(void 0),this.attributesChanges=new M,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(E(e=>{this.form=this.shopifyFormService.createFormGroup(e),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([It]),D],decls:2,vars:3,consts:[[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(e,a){if(e&1&&(C(0,Fe,14,2,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,$,Y,tt,L,W,H,X,B,R,S],encapsulation:2});let t=r;return t})();function Pe(t,r){if(t&1&&(c(0,"div",6),_(1,"app-product-card",9),s()),t&2){let i=r.$implicit;p(),d("productId",i==null?null:i.ID)("title",i==null?null:i.Name)("image",i==null?null:i.ThumbnailUrl)("description",(i==null||i.Variants==null?null:i.Variants.length)>1?(i==null||i.Variants==null?null:i.Variants.length)+" Variants":null)("imageForZoom",i==null?null:i.ImageUrl)("code",i==null||i.Variants[0]==null?null:i.Variants[0].Code)("showFooter",!1)}}function Ee(t,r){if(t&1){let i=j();c(0,"mat-checkbox",21),Ot("ngModelChange",function(e){O(i);let a=l().$implicit;return Nt(a.selected,e)||(a.selected=e),k(e)}),F("ngModelChange",function(){let e=O(i),a=l(),o=a.$implicit,m=a.$index,y=l();return k(y.onSelectChannel(o,m,e))}),s()}if(t&2){let i=l().$implicit;Et("ngModel",i.selected)}}function Ne(t,r){if(t&1&&(c(0,"div",18),_(1,"input",22),s()),t&2){let i=l().$implicit,n=l();d("matTooltip",i.type==n.channelType.Shopify||i.type==n.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":i.type==n.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Oe(t,r){if(t&1){let i=j();c(0,"app-channel-category-select",23),F("selectedCategory",function(e){O(i);let a=l().$index,o=l();return k(o.onCategoryChange(a,e))}),s()}if(t&2){let i=l().$implicit,n=l();d("disabled",!i.selected||i.selected&&i.type==n.channelType.Lazada)("channelId",i.id)("channelType",i.type)("categoryId",i.categoryId)}}function ke(t,r){if(t&1){let i=j();c(0,"shopee-attribute-form",27),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)("channelType",i.type)}}function De(t,r){if(t&1){let i=j();c(0,"tiktok-attribute-form",28),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))})("onPlatformChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onPlatformChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Me(t,r){if(t&1){let i=j();c(0,"wooocommerce-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function we(t,r){if(t&1){let i=j();c(0,"tokopedia-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Ve(t,r){if(t&1&&(c(0,"div",20)(1,"div",24),C(2,ke,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),s()()),t&2){let i,n=l().$implicit,e=l();p(2),g((i=n.type)===e.channelType.Shopee?2:i===e.channelType.Tiktok?3:i===e.channelType.WooCommerce?4:i===e.channelType.Tokopedia?5:-1)}}function Ue(t,r){if(t&1){let i=j();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),F("attributesChanges",function(e){O(i);let a=l().$index,o=l();return k(o.onAttributesChange(a,e))}),s()()()}if(t&2){let i=l().$implicit;p(2),d("channelId",i.id)}}function Le(t,r){if(t&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),C(6,Ee,1,1,"mat-checkbox",14),v(7,"async"),s(),c(8,"div"),_(9,"app-channel-logo",15),s(),c(10,"div",16)(11,"span"),f(12),s()()()(),c(13,"div",12)(14,"div",17),C(15,Ne,2,1,"div",18)(16,Oe,1,4,"app-channel-category-select",19),s()()(),C(17,Ve,6,1,"div",20)(18,Ue,3,1,"div",20),s()()),t&2){let i,n=r.$implicit,e=l();p(6),g((i=T(7,8,e.defaultCategories$))?6:-1,i),p(3),d("typeId",n.type)("showChannelName",!1),p(),d("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),at(n.name),p(3),g(n.type==e.channelType.Shopify||n.type==e.channelType.Plugo||n.type==e.channelType.ShopifyV2?15:16),p(2),g(n.categoryId&&e.channelType.Lazada!=n.type&&n.selected?17:(e.channelType.Shopify==n.type||n.type==e.channelType.ShopifyV2)&&n.selected?18:-1)}}var en=(()=>{let r=class r{constructor(){this.toastr=u(Dt),this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ct,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(z(1))}onCategoryChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.categoryId=e,o.attributes=[]),o)))}onPlatformChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onAttributesChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.attributes=e),o)))}tiktokPlatformChanges(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onSelectChannel(n,e,a){this.channelProductUploads.update(o=>o.map((m,y)=>{if(y==e&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);m.categoryId=_t?.DefaultCategoryID}return y==e&&!n.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(n,e){return e.find(a=>a.ID===n)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(e=>e.type==Ct.Tiktok&&h.IsNotEmpty(e?.categoryId)?e.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["app-product-upload"]],features:[I([ct,Gt,jt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(e,a){if(e&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),F("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),s()(),c(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),s(),c(9,"div",5),V(10,Pe,2,7,"div",6,w),v(12,"async"),s(),c(13,"h3",7),f(14,"Channel To Upload"),s(),V(15,Le,19,10,"div",8,w),s()()()),e&2){let o;d("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("disabled",((o=a.channelProductUploads())==null?null:o.length)==0),p(8),U(T(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[A,Xt,Bt,Jt,Kt,Yt,et,L,Mt,Rt,$t,te,ee,ie,oe,Wt,zt,Zt,S],encapsulation:2});let t=r;return t})();export{en as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as pe,b as se}from"./chunk-K5WSFDNA.js";import{a as ue}from"./chunk-VBVBTC2P.js";import{a as F}from"./chunk-L6CRWJ2O.js";import{a as ce}from"./chunk-PV4OJSZI.js";import{a as de}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as me}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ae}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as re}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as le}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as oe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as ne,c as $,h as ee,m as te,o as ie}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as Y,B as Z,w as Q,x as U,y as X}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as G,Hb as W,Ia as N,Mc as z,Nc as l,Oc as V,Pc as A,Rc as h,Sc as S,Tc as w,Uc as R,Vc as H,Wc as j,Z as L,_c as q,ac as x,ad as J,bc as B,cc as b,dc as D,fc as I,gc as k,hc as y,ic as i,id as _,jc as n,jd as f,kc as C,kd as K,ob as r,ra as O,rc as T,wc as E,ya as c,yc as g,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as M,b as P}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=t=>({"td-cell-hover":t});function Ce(t,m){if(t&1&&C(0,"variants-dropdown",26),t&2){let e=g().$implicit;y("variants",e==null?null:e.Variants)}}function ge(t,m){if(t&1&&C(0,"variant-with-image",27),t&2){let e=g().$implicit;y("variant",e==null?null:e.Variants[0])}}function he(t,m){if(t&1&&(i(0,"span"),l(1),n()),t&2){let e=g().$implicit;r(),A("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(t,m){t&1&&l(0," Awaiting Collection ")}function we(t,m){t&1&&l(0," Shipped ")}function ve(t,m){t&1&&l(0," Completed ")}function ye(t,m){t&1&&l(0," To Ship ")}function xe(t,m){t&1&&l(0," - ")}function be(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"div",23)(3,"div"),C(4,"order-link",24),n(),i(5,"small"),l(6),_(7,"date"),n(),C(8,"br"),i(9,"small"),C(10,"i",25),l(11),n()()(),i(12,"td"),x(13,Ce,1,1,"variants-dropdown",26)(14,ge,1,1,"variant-with-image",27),n(),i(15,"td"),l(16),_(17,"number"),n(),i(18,"td")(19,"div",23)(20,"div",28)(21,"span"),l(22),n(),x(23,he,2,1,"span"),n(),i(24,"small"),l(25),n()()(),i(26,"td"),x(27,Se,1,0),_(28,"lowercase"),_(29,"lowercase"),_(30,"lowercase"),_(31,"lowercase"),_(32,"lowercase"),_(33,"lowercase"),B(34,we,1,0)(35,ve,1,0)(36,ye,1,0)(37,xe,1,0),n()()),t&2){let e=m.$implicit;r(4),y("order",e),r(2),A(" ",K(7,11,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),A(" ",e.Customer," "),r(),z(J(28,fe,(e.Variants==null?null:e.Variants.length)>1)),r(),b((e.Variants==null?null:e.Variants.length)>1?13:14),r(3),V(f(17,14,e.Amount)),r(6),V(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?23:-1),r(2),A(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),r(2),b(f(28,16,e.Fulfillment)==="awaitingcollection"?27:f(29,18,e.Fulfillment)==="sent"&&f(30,20,e.Payment)==="unpaid"?34:f(31,22,e.Payment)==="paid"?35:f(32,24,e.Payment)==="unpaid"&&f(33,26,e.Fulfillment)==="unsent"?36:37)}}function Ae(t,m){if(t&1){let e=T();i(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Number"),n(),i(6,"th"),l(7,"Items"),n(),i(8,"th",21),l(9,"Amount"),n(),i(10,"th",21),l(11,"Fulfillment"),n(),i(12,"th",21),l(13,"Order Status"),n()()(),i(14,"tbody"),I(15,be,38,30,"tr",null,D),n()(),i(17,"app-custom-paginator",22),E("next",function(){c(e);let p=g();return u(p.initAllOrders())})("previous",function(){c(e);let p=g();return u(p.initAllOrders())}),n()()}if(t&2){let e=g(),d=j(0);r(15),k(d),r(2),y("filter",e.filter())("totaldata",d==null?null:d.length)}}function Te(t,m){t&1&&(i(0,"div",16),C(1,"app-empty-state"),n())}var Ke=(()=>{let m=class m{constructor(){this.orderService=O(F),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>P(M({},p),{From:d})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(L(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=W({type:m,selectors:[["app-all"]],features:[q([F])],decls:34,vars:12,consts:[["headerTitle","All Orders","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,a){if(p&1){let s=T();R(0),_(1,"async"),i(2,"mainpanel",0),E("onSubmit",function(){return c(s),u(a.initAllOrders())}),w("textChange",function(o){return c(s),S(a.filter().Number,o)||(a.filter().Number=o),u(o)}),i(3,"actions")(4,"a",1),C(5,"i",2),i(6,"span"),l(7,"Order Fulfillment Display"),n()()(),i(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),n(),i(12,"app-channel-options-v2",4),w("ngModelChange",function(o){return c(s),S(a.filter().ListChannelID,o)||(a.filter().ListChannelID=o),u(o)}),n()(),i(13,"div",5)(14,"label",3),l(15,"From/To"),n(),i(16,"div",6)(17,"datepicker",7),w("dateChange",function(o){return c(s),S(a.filter().From,o)||(a.filter().From=o),u(o)}),n()(),i(18,"div")(19,"datepicker",8),w("dateChange",function(o){return c(s),S(a.filter().To,o)||(a.filter().To=o),u(o)}),n()()(),i(20,"div",5)(21,"label",9),l(22,"Page Number"),n(),i(23,"input",10),w("ngModelChange",function(o){return c(s),S(a.filter().PageNumber,o)||(a.filter().PageNumber=o),u(o)}),n()(),i(24,"div",5)(25,"label",9),l(26,"Page Size"),n(),i(27,"input",11),w("ngModelChange",function(o){return c(s),S(a.filter().PageSize,o)||(a.filter().PageSize=o),u(o)}),n()()(),i(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ae,18,2,"div",15)(33,Te,2,0,"div",16),n()()()()()}if(p&2){let s=H(f(1,8,a.allOrders$)||G(11,_e));r(2),h("text",a.filter().Number),r(10),y("multiple",!0),h("ngModel",a.filter().ListChannelID),r(5),h("date",a.filter().From),r(2),h("date",a.filter().To),r(4),h("ngModel",a.filter().PageNumber),r(4),h("ngModel",a.filter().PageSize),r(5),b((s==null?null:s.length)>0?32:33)}},dependencies:[Z,re,ae,me,ne,$,ie,ee,te,pe,se,ce,le,oe,ue,de,Q,U,Y,X],encapsulation:2});let t=m;return t})();export{Ke as AllComponent};
1
+ import{a as pe,b as se}from"./chunk-K5WSFDNA.js";import{a as ue}from"./chunk-DOQD3RMB.js";import{a as F}from"./chunk-L6CRWJ2O.js";import{a as ce}from"./chunk-PV4OJSZI.js";import{a as de}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as me}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ae}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as re}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as le}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as oe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as ne,c as $,h as ee,m as te,o as ie}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as Y,B as Z,w as Q,x as U,y as X}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as G,Hb as W,Ia as N,Mc as z,Nc as l,Oc as V,Pc as A,Rc as h,Sc as S,Tc as w,Uc as R,Vc as H,Wc as j,Z as L,_c as q,ac as x,ad as J,bc as B,cc as b,dc as D,fc as I,gc as k,hc as y,ic as i,id as _,jc as n,jd as f,kc as C,kd as K,ob as r,ra as O,rc as T,wc as E,ya as c,yc as g,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as M,b as P}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=t=>({"td-cell-hover":t});function Ce(t,m){if(t&1&&C(0,"variants-dropdown",26),t&2){let e=g().$implicit;y("variants",e==null?null:e.Variants)}}function ge(t,m){if(t&1&&C(0,"variant-with-image",27),t&2){let e=g().$implicit;y("variant",e==null?null:e.Variants[0])}}function he(t,m){if(t&1&&(i(0,"span"),l(1),n()),t&2){let e=g().$implicit;r(),A("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(t,m){t&1&&l(0," Awaiting Collection ")}function we(t,m){t&1&&l(0," Shipped ")}function ve(t,m){t&1&&l(0," Completed ")}function ye(t,m){t&1&&l(0," To Ship ")}function xe(t,m){t&1&&l(0," - ")}function be(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"div",23)(3,"div"),C(4,"order-link",24),n(),i(5,"small"),l(6),_(7,"date"),n(),C(8,"br"),i(9,"small"),C(10,"i",25),l(11),n()()(),i(12,"td"),x(13,Ce,1,1,"variants-dropdown",26)(14,ge,1,1,"variant-with-image",27),n(),i(15,"td"),l(16),_(17,"number"),n(),i(18,"td")(19,"div",23)(20,"div",28)(21,"span"),l(22),n(),x(23,he,2,1,"span"),n(),i(24,"small"),l(25),n()()(),i(26,"td"),x(27,Se,1,0),_(28,"lowercase"),_(29,"lowercase"),_(30,"lowercase"),_(31,"lowercase"),_(32,"lowercase"),_(33,"lowercase"),B(34,we,1,0)(35,ve,1,0)(36,ye,1,0)(37,xe,1,0),n()()),t&2){let e=m.$implicit;r(4),y("order",e),r(2),A(" ",K(7,11,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),A(" ",e.Customer," "),r(),z(J(28,fe,(e.Variants==null?null:e.Variants.length)>1)),r(),b((e.Variants==null?null:e.Variants.length)>1?13:14),r(3),V(f(17,14,e.Amount)),r(6),V(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?23:-1),r(2),A(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),r(2),b(f(28,16,e.Fulfillment)==="awaitingcollection"?27:f(29,18,e.Fulfillment)==="sent"&&f(30,20,e.Payment)==="unpaid"?34:f(31,22,e.Payment)==="paid"?35:f(32,24,e.Payment)==="unpaid"&&f(33,26,e.Fulfillment)==="unsent"?36:37)}}function Ae(t,m){if(t&1){let e=T();i(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Number"),n(),i(6,"th"),l(7,"Items"),n(),i(8,"th",21),l(9,"Amount"),n(),i(10,"th",21),l(11,"Fulfillment"),n(),i(12,"th",21),l(13,"Order Status"),n()()(),i(14,"tbody"),I(15,be,38,30,"tr",null,D),n()(),i(17,"app-custom-paginator",22),E("next",function(){c(e);let p=g();return u(p.initAllOrders())})("previous",function(){c(e);let p=g();return u(p.initAllOrders())}),n()()}if(t&2){let e=g(),d=j(0);r(15),k(d),r(2),y("filter",e.filter())("totaldata",d==null?null:d.length)}}function Te(t,m){t&1&&(i(0,"div",16),C(1,"app-empty-state"),n())}var Ke=(()=>{let m=class m{constructor(){this.orderService=O(F),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>P(M({},p),{From:d})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(L(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=W({type:m,selectors:[["app-all"]],features:[q([F])],decls:34,vars:12,consts:[["headerTitle","All Orders","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,a){if(p&1){let s=T();R(0),_(1,"async"),i(2,"mainpanel",0),E("onSubmit",function(){return c(s),u(a.initAllOrders())}),w("textChange",function(o){return c(s),S(a.filter().Number,o)||(a.filter().Number=o),u(o)}),i(3,"actions")(4,"a",1),C(5,"i",2),i(6,"span"),l(7,"Order Fulfillment Display"),n()()(),i(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),n(),i(12,"app-channel-options-v2",4),w("ngModelChange",function(o){return c(s),S(a.filter().ListChannelID,o)||(a.filter().ListChannelID=o),u(o)}),n()(),i(13,"div",5)(14,"label",3),l(15,"From/To"),n(),i(16,"div",6)(17,"datepicker",7),w("dateChange",function(o){return c(s),S(a.filter().From,o)||(a.filter().From=o),u(o)}),n()(),i(18,"div")(19,"datepicker",8),w("dateChange",function(o){return c(s),S(a.filter().To,o)||(a.filter().To=o),u(o)}),n()()(),i(20,"div",5)(21,"label",9),l(22,"Page Number"),n(),i(23,"input",10),w("ngModelChange",function(o){return c(s),S(a.filter().PageNumber,o)||(a.filter().PageNumber=o),u(o)}),n()(),i(24,"div",5)(25,"label",9),l(26,"Page Size"),n(),i(27,"input",11),w("ngModelChange",function(o){return c(s),S(a.filter().PageSize,o)||(a.filter().PageSize=o),u(o)}),n()()(),i(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ae,18,2,"div",15)(33,Te,2,0,"div",16),n()()()()()}if(p&2){let s=H(f(1,8,a.allOrders$)||G(11,_e));r(2),h("text",a.filter().Number),r(10),y("multiple",!0),h("ngModel",a.filter().ListChannelID),r(5),h("date",a.filter().From),r(2),h("date",a.filter().To),r(4),h("ngModel",a.filter().PageNumber),r(4),h("ngModel",a.filter().PageSize),r(5),b((s==null?null:s.length)>0?32:33)}},dependencies:[Z,re,ae,me,ne,$,ie,ee,te,pe,se,ce,le,oe,ue,de,Q,U,Y,X],encapsulation:2});let t=m;return t})();export{Ke as AllComponent};
@@ -1 +1 @@
1
- import{a as $}from"./chunk-RUYX7KTP.js";import{a as Z}from"./chunk-TVEI5B2O.js";import{a as Y}from"./chunk-PV4OJSZI.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as U,b as J,d as Q}from"./chunk-BZWZ64N5.js";import{a as X}from"./chunk-27DIE2YS.js";import"./chunk-A6QXXKPR.js";import{b as K}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as V}from"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as q,c as z,h as G,m as H,o as j}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as B}from"./chunk-D6JH2KV4.js";import{e as O}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{y as A}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as W,Hb as L,Nb as R,Nc as l,Oc as _,Pc as S,Rc as g,Sc as u,Tc as c,ac as P,ad as D,cc as M,ec as N,fc as E,gc as x,hc as h,ic as i,id as F,jc as n,kc as C,kd as k,mb as v,ob as r,ra as f,rc as I,wc as y,ya as b,yc as w,za as T}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var ee=()=>["/menu/log/rawlog/detail"],te=o=>({ID:o});function ie(o,p){if(o&1&&(i(0,"span",17),C(1,"img",18),n(),l(2)),o&2){let a=p.item;r(),h("src",a.Img,v)("alt",a.Name),r(),S(" ",a.Name," ")}}function ne(o,p){if(o&1&&(i(0,"tr")(1,"td")(2,"a",23),l(3),F(4,"date"),n()(),i(5,"td"),l(6),n(),i(7,"td"),l(8),n(),i(9,"td"),l(10),n()()),o&2){let a=p.$implicit;r(2),h("routerLink",W(9,ee))("queryParams",D(10,te,a.id)),r(),S(" ",k(4,6,a.Created,"dd MMM yyyy HH:mm:ss")," "),r(3),_(a.type),r(2),_(a.number),r(2),_(a.message)}}function ae(o,p){if(o&1){let a=I();i(0,"div",15)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),l(5,"Date"),n(),i(6,"th"),l(7,"Type"),n(),i(8,"th"),l(9,"Number"),n(),i(10,"th"),l(11,"Message"),n()()(),i(12,"tbody"),E(13,ne,11,12,"tr",null,N),n()(),i(15,"mat-paginator",22),y("page",function(m){b(a);let e=w();return T(e.changePage(m))}),n()()}if(o&2){let a=w();r(13),x(a.Result),r(2),h("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function oe(o,p){o&1&&(i(0,"div",16),C(1,"app-empty-state"),n())}var be=(()=>{let p=class p{constructor(){this.http=f(B),this._RawLogService=f($),this.authService=f(V),this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(d={}){this.http.post("/api/OrdersLoader/Get",d).subscribe(m=>{this.filter=m.Filter,this.ActionTypeList=m.Options.ActionTypeList,this.Get()})}Get(d){this.filter.Number=d,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(m=>{this._RawLogService.Data=m.hits,this.Result=Array();for(let e of m.hits){let s={id:e._id,message:e._source.message,responseCode:e._source.log.responseCode,processTypeString:e._source.log.processType,type:e._source.log.type,number:e._source.log.number,Created:e._source["@timestamp_received"]};this.Result.push(s)}this.paginationTotal=m.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(d){this.filter.PageNumber=d.pageIndex+1,this.Get()}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=L({type:p,selectors:[["app-raw-log"]],decls:28,vars:9,consts:[["headerTitle","Channel Push Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(m,e){m&1&&(i(0,"mainpanel",0),c("textChange",function(t){return u(e.filter.Number,t)||(e.filter.Number=t),t}),y("onSubmit",function(t){return e.Get(t)}),i(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),n(),i(5,"ng-select",2),c("ngModelChange",function(t){return u(e.filter.ChannelID,t)||(e.filter.ChannelID=t),t}),R(6,ie,3,3,"ng-template",3),n()(),i(7,"div",4)(8,"label",5),l(9,"From/To"),n(),i(10,"div",6)(11,"datepicker",7),c("dateChange",function(t){return u(e.filter.From,t)||(e.filter.From=t),t}),n()(),i(12,"div")(13,"datepicker",8),c("dateChange",function(t){return u(e.filter.To,t)||(e.filter.To=t),t}),n()()(),i(14,"div",4)(15,"label",9),l(16,"Page Number"),n(),i(17,"input",10),c("ngModelChange",function(t){return u(e.filter.PageNumber,t)||(e.filter.PageNumber=t),t}),n()(),i(18,"div",4)(19,"label",9),l(20,"Page Size"),n(),i(21,"input",11),c("ngModelChange",function(t){return u(e.filter.RowCount,t)||(e.filter.RowCount=t),t}),n()()(),i(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),P(26,ae,16,3,"div",15)(27,oe,2,0,"div",16),n()()()()()),m&2&&(g("text",e.filter.Number),r(5),h("clearable",!0)("items",e.channelOptions),g("ngModel",e.filter.ChannelID),r(6),g("date",e.filter.From),r(2),g("date",e.filter.To),r(4),g("ngModel",e.filter.PageNumber),r(4),g("ngModel",e.filter.RowCount),r(5),M((e.Result==null?null:e.Result.length)>0?26:27))},dependencies:[K,Q,q,z,j,G,H,U,J,Y,O,Z,X,A],encapsulation:2});let o=p;return o})();export{be as RawLogComponent};
1
+ import{a as $}from"./chunk-RUYX7KTP.js";import{a as Z}from"./chunk-TVEI5B2O.js";import{a as Y}from"./chunk-PV4OJSZI.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as U,b as J,d as Q}from"./chunk-BZWZ64N5.js";import{a as X}from"./chunk-27DIE2YS.js";import"./chunk-A6QXXKPR.js";import{b as K}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as V}from"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as q,c as z,h as G,m as H,o as j}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as B}from"./chunk-D6JH2KV4.js";import{e as O}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{y as A}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as W,Hb as L,Nb as R,Nc as l,Oc as _,Pc as S,Rc as g,Sc as u,Tc as c,ac as P,ad as D,cc as M,ec as N,fc as E,gc as x,hc as h,ic as i,id as F,jc as n,kc as C,kd as k,mb as v,ob as r,ra as f,rc as I,wc as y,ya as b,yc as w,za as T}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var ee=()=>["/menu/log/rawlog/detail"],te=o=>({ID:o});function ie(o,p){if(o&1&&(i(0,"span",17),C(1,"img",18),n(),l(2)),o&2){let a=p.item;r(),h("src",a.Img,v)("alt",a.Name),r(),S(" ",a.Name," ")}}function ne(o,p){if(o&1&&(i(0,"tr")(1,"td")(2,"a",23),l(3),F(4,"date"),n()(),i(5,"td"),l(6),n(),i(7,"td"),l(8),n(),i(9,"td"),l(10),n()()),o&2){let a=p.$implicit;r(2),h("routerLink",W(9,ee))("queryParams",D(10,te,a.id)),r(),S(" ",k(4,6,a.Created,"dd MMM yyyy HH:mm:ss")," "),r(3),_(a.type),r(2),_(a.number),r(2),_(a.message)}}function ae(o,p){if(o&1){let a=I();i(0,"div",15)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),l(5,"Date"),n(),i(6,"th"),l(7,"Type"),n(),i(8,"th"),l(9,"Number"),n(),i(10,"th"),l(11,"Message"),n()()(),i(12,"tbody"),E(13,ne,11,12,"tr",null,N),n()(),i(15,"mat-paginator",22),y("page",function(m){b(a);let e=w();return T(e.changePage(m))}),n()()}if(o&2){let a=w();r(13),x(a.Result),r(2),h("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function oe(o,p){o&1&&(i(0,"div",16),C(1,"app-empty-state"),n())}var be=(()=>{let p=class p{constructor(){this.http=f(B),this._RawLogService=f($),this.authService=f(V),this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(d={}){this.http.post("/api/OrdersLoader/Get",d).subscribe(m=>{this.filter=m.Filter,this.ActionTypeList=m.Options.ActionTypeList,this.Get()})}Get(d){this.filter.Number=d,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(m=>{this._RawLogService.Data=m.hits,this.Result=Array();for(let e of m.hits){let s={id:e._id,message:e._source.message,responseCode:e._source.log.responseCode,processTypeString:e._source.log.processType,type:e._source.log.type,number:e._source.log.number,Created:e._source["@timestamp_received"]};this.Result.push(s)}this.paginationTotal=m.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(d){this.filter.PageNumber=d.pageIndex+1,this.Get()}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=L({type:p,selectors:[["app-raw-log"]],decls:28,vars:9,consts:[["headerTitle","Channel Push Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(m,e){m&1&&(i(0,"mainpanel",0),c("textChange",function(t){return u(e.filter.Number,t)||(e.filter.Number=t),t}),y("onSubmit",function(t){return e.Get(t)}),i(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),n(),i(5,"ng-select",2),c("ngModelChange",function(t){return u(e.filter.ChannelID,t)||(e.filter.ChannelID=t),t}),R(6,ie,3,3,"ng-template",3),n()(),i(7,"div",4)(8,"label",5),l(9,"From/To"),n(),i(10,"div",6)(11,"datepicker",7),c("dateChange",function(t){return u(e.filter.From,t)||(e.filter.From=t),t}),n()(),i(12,"div")(13,"datepicker",8),c("dateChange",function(t){return u(e.filter.To,t)||(e.filter.To=t),t}),n()()(),i(14,"div",4)(15,"label",9),l(16,"Page Number"),n(),i(17,"input",10),c("ngModelChange",function(t){return u(e.filter.PageNumber,t)||(e.filter.PageNumber=t),t}),n()(),i(18,"div",4)(19,"label",9),l(20,"Page Size"),n(),i(21,"input",11),c("ngModelChange",function(t){return u(e.filter.RowCount,t)||(e.filter.RowCount=t),t}),n()()(),i(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),P(26,ae,16,3,"div",15)(27,oe,2,0,"div",16),n()()()()()),m&2&&(g("text",e.filter.Number),r(5),h("clearable",!0)("items",e.channelOptions),g("ngModel",e.filter.ChannelID),r(6),g("date",e.filter.From),r(2),g("date",e.filter.To),r(4),g("ngModel",e.filter.PageNumber),r(4),g("ngModel",e.filter.RowCount),r(5),M((e.Result==null?null:e.Result.length)>0?26:27))},dependencies:[K,Q,q,z,j,G,H,U,J,Y,O,Z,X,A],encapsulation:2});let o=p;return o})();export{be as RawLogComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-TQROQOXU.js";import{a as x}from"./chunk-LCN52IJT.js";import{h as E}from"./chunk-62YNPW6Q.js";import{a as T}from"./chunk-AGBJEXIM.js";import{b as i,c as g}from"./chunk-UPRDDI4K.js";import{b as D,e as d}from"./chunk-D6JH2KV4.js";import{d as w}from"./chunk-UB3ZV5NW.js";import{B as U,G as C,Ia as j,J as l,g as A,ma as s,q as u,ra as p,v as I}from"./chunk-OHGMB7HJ.js";var H=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var R=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var V=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var z=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var y=class{};var v=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var N=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var O=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post(T.UploadPlugoProduct,t).pipe(l(e=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(E),this.productService=p(x),this.shoppeUploadService=p(H),this.tiktokUploadService=p(R),this.lazadaUploadService=p(V),this.tokopediaUploadService=p(G),this.wooUploadService=p(z),this.shopifyUploadService=p(N),this.plugoUploadService=p(O),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(w),this.httpService=p(d),this._selectedProduct=new A(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return j(t.map(r=>{let c=new y;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==i.Shopify||r.type==i.ShopifyV2||r.type==i.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(I(r=>{let c=[];return r.filter(f=>g.IsNotEmpty(f)).forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],f=[],S=[],k=[],P=[],b=[];t.forEach(n=>{switch(n.ChannelType){case i.Shopee:r.push(n);break;case i.Tiktok:e.push(n);break;case i.Lazada:c.push(n);break;case i.Tokopedia:f.push(n);break;case i.WooCommerce:S.push(n);break;case i.Shopify:k.push(n);break;case i.ShopifyV2:P.push(n);break;case i.Plugo:b.push(n);break}});let h=[];return[{type:i.Shopee,data:r},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:k},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:b}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case i.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case i.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:h.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:h.push(this.shopifyUploadService.uploadProduct(k));break;case i.ShopifyV2:h.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:h.push(this.plugoUploadService.uploadProduct(b));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new v;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==i.Shopify||r.type==i.ShopifyV2?delete c.CategoryID:c.CategoryID=r.categoryId,c=this.generateAttributeHttpRequest(r,c),e.push(c)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let r;switch(t){case i.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:r=e;break;case i.Shopify:r=e;break;case i.ShopifyV2:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();export{H as a,R as b,V as c,z as d,Bt as e};
1
+ import{a as F}from"./chunk-TQROQOXU.js";import{a as x}from"./chunk-REDQ2L7Y.js";import{h as E}from"./chunk-J4552BMI.js";import{a as T}from"./chunk-AGBJEXIM.js";import{b as i,c as g}from"./chunk-UPRDDI4K.js";import{b as D,e as d}from"./chunk-D6JH2KV4.js";import{d as w}from"./chunk-UB3ZV5NW.js";import{B as U,G as C,Ia as j,J as l,g as A,ma as s,q as u,ra as p,v as I}from"./chunk-OHGMB7HJ.js";var H=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var R=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var V=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var z=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var y=class{};var v=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var N=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var O=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post(T.UploadPlugoProduct,t).pipe(l(e=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(E),this.productService=p(x),this.shoppeUploadService=p(H),this.tiktokUploadService=p(R),this.lazadaUploadService=p(V),this.tokopediaUploadService=p(G),this.wooUploadService=p(z),this.shopifyUploadService=p(N),this.plugoUploadService=p(O),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(w),this.httpService=p(d),this._selectedProduct=new A(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return j(t.map(r=>{let c=new y;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==i.Shopify||r.type==i.ShopifyV2||r.type==i.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(I(r=>{let c=[];return r.filter(f=>g.IsNotEmpty(f)).forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],f=[],S=[],k=[],P=[],b=[];t.forEach(n=>{switch(n.ChannelType){case i.Shopee:r.push(n);break;case i.Tiktok:e.push(n);break;case i.Lazada:c.push(n);break;case i.Tokopedia:f.push(n);break;case i.WooCommerce:S.push(n);break;case i.Shopify:k.push(n);break;case i.ShopifyV2:P.push(n);break;case i.Plugo:b.push(n);break}});let h=[];return[{type:i.Shopee,data:r},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:k},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:b}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case i.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case i.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:h.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:h.push(this.shopifyUploadService.uploadProduct(k));break;case i.ShopifyV2:h.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:h.push(this.plugoUploadService.uploadProduct(b));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new v;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==i.Shopify||r.type==i.ShopifyV2?delete c.CategoryID:c.CategoryID=r.categoryId,c=this.generateAttributeHttpRequest(r,c),e.push(c)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let r;switch(t){case i.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:r=e;break;case i.Shopify:r=e;break;case i.ShopifyV2:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();export{H as a,R as b,V as c,z as d,Bt as e};
@@ -1 +1 @@
1
- import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-QJASIA27.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-GD5I7ADU.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-IXNEMOFX.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-XSOP2OTT.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-ZMSM2NR7.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-EGJMTFNO.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-EYYKWIXP.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-A4X7F4MN.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-36OIR6DM.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"log/detail",loadComponent(){return import("./chunk-5NWJOQN5.js").then(t=>t.DownloadOrderDetailComponent)},title:"Download Log Detail"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
1
+ import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-QJASIA27.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-CHCAQ4NV.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-BZ7QY7N3.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-DW7R34MP.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-75RVMUFO.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-GYQHWDWX.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-AVSAALDJ.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-UHWLUO2C.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-AMQMYSQR.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"log/detail",loadComponent(){return import("./chunk-5NWJOQN5.js").then(t=>t.DownloadOrderDetailComponent)},title:"Download Log Detail"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as J}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as I}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as H,c as R,h as j,m as F}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as W}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B,w as k,z as P}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as x,Ia as h,Nc as i,Oc as V,Rc as f,Sc as C,Tc as b,Uc as O,Vc as D,Wc as _,Z as S,ac as M,cc as N,hc as g,ic as e,id as v,jc as t,jd as y,kc as L,ob as d,ra as E,rc as T,wc as w,ya as p,yc as A,za as m}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function Y(r,l){if(r&1&&(e(0,"pre",21),i(1),v(2,"json"),t()),r&2){A();let U=_(25);d(),V(y(2,1,U))}}function q(r,l){r&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ae=(()=>{let l=class l{constructor(){this.httpService=E(W),this.selectedChannel=h(null),this.orderNumber=h(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(I.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(S(1))}copyToClipboard(c){if(!c)return;let s=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(s),alert("Copied to clipboard!")}};l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=x({type:l,selectors:[["app-escrow-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(s,n){if(s&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),w("click",function(){return p(a),m(n.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),b("ngModelChange",function(o){return p(a),C(n.selectedChannel,o)||(n.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),b("ngModelChange",function(o){return p(a),C(n.orderNumber,o)||(n.orderNumber=o),m(o)}),t()()()()(),O(25),v(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),w("click",function(){p(a);let o=_(25);return m(n.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,Y,3,3,"pre",21)(39,q,2,0,"p",22),t()()()()()()()()()}if(s&2){g("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),f("ngModel",n.selectedChannel),d(8),f("ngModel",n.orderNumber),d();let a=D(y(26,6,n.escrowLog$));d(8),g("disabled",!a),d(5),N(a?38:39)}},dependencies:[B,H,R,j,F,J,G,k,P],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]});let r=l;return r})();export{ae as EscrowApiComponent};
1
+ import{a as G}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as J}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as I}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as H,c as R,h as j,m as F}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as W}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B,w as k,z as P}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as x,Ia as h,Nc as i,Oc as V,Rc as f,Sc as C,Tc as b,Uc as O,Vc as D,Wc as _,Z as S,ac as M,cc as N,hc as g,ic as e,id as v,jc as t,jd as y,kc as L,ob as d,ra as E,rc as T,wc as w,ya as p,yc as A,za as m}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function Y(r,l){if(r&1&&(e(0,"pre",21),i(1),v(2,"json"),t()),r&2){A();let U=_(25);d(),V(y(2,1,U))}}function q(r,l){r&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ae=(()=>{let l=class l{constructor(){this.httpService=E(W),this.selectedChannel=h(null),this.orderNumber=h(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(I.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(S(1))}copyToClipboard(c){if(!c)return;let s=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(s),alert("Copied to clipboard!")}};l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=x({type:l,selectors:[["app-escrow-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(s,n){if(s&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),w("click",function(){return p(a),m(n.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),b("ngModelChange",function(o){return p(a),C(n.selectedChannel,o)||(n.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),b("ngModelChange",function(o){return p(a),C(n.orderNumber,o)||(n.orderNumber=o),m(o)}),t()()()()(),O(25),v(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),w("click",function(){p(a);let o=_(25);return m(n.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,Y,3,3,"pre",21)(39,q,2,0,"p",22),t()()()()()()()()()}if(s&2){g("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),f("ngModel",n.selectedChannel),d(8),f("ngModel",n.orderNumber),d();let a=D(y(26,6,n.escrowLog$));d(8),g("disabled",!a),d(5),N(a?38:39)}},dependencies:[B,H,R,j,F,J,G,k,P],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]});let r=l;return r})();export{ae as EscrowApiComponent};
@@ -1,4 +1,4 @@
1
- import{a as ye}from"./chunk-YKKHSYDW.js";import{a as de,b as he}from"./chunk-Z3PLQ27X.js";import"./chunk-VG66LDXQ.js";import{e as me}from"./chunk-HZTKN5RX.js";import"./chunk-TQROQOXU.js";import{a as ge}from"./chunk-IQGRGC3E.js";import{c as Ce,d as be}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import{a as W}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import"./chunk-BZWZ64N5.js";import{a as xe}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import{a as ce}from"./chunk-GNXSEYJF.js";import{a as ue}from"./chunk-7KG3DC5J.js";import{a as fe}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import{a as pe}from"./chunk-LCN52IJT.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import{a as re}from"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import{e as le}from"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import{a as at}from"./chunk-3NCMRK7E.js";import{a as ne}from"./chunk-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import{g as st}from"./chunk-C4MTEDSW.js";import{b as L,c as ae,d as Ct,e as $}from"./chunk-JMRRXRKO.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as oe,h as ie}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{P as _t,Q as Qt,ha as H,la as qt,ma as ft,ua as Kt}from"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as it}from"./chunk-ZSUWHVKX.js";import{h as Jt}from"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as Wt}from"./chunk-AGBJEXIM.js";import{b as Ht,c as $t}from"./chunk-NB2H6KA7.js";import{b as ut,c as g}from"./chunk-UPRDDI4K.js";import{A as ee,c as Yt,h as Xt,m as te}from"./chunk-6UM4NHOR.js";import{a as Rt}from"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as zt,e as Gt}from"./chunk-D6JH2KV4.js";import{b as jt,d as ot}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as mt,q as Dt,s as Bt,t as Nt,v as At}from"./chunk-CGSMHTKB.js";import{c as ht,d as gt,f as et,g as Lt,i as nt,k as Ut,m as Zt}from"./chunk-XBIHN6D3.js";import{$c as Ft,Aa as w,Ab as Tt,Bc as Q,Dc as q,Ec as K,Fd as tt,G as F,Gd as j,Hb as I,Ia as M,Lb as k,Lc as Y,Mb as wt,Mc as T,Nb as P,Nc as b,Oc as U,Pa as V,Pc as O,Rc as Z,Sc as z,Tc as X,_b as S,_c as G,aa as ct,ac as f,ad as E,bd as Mt,cc as C,dd as kt,ec as It,fc as Pt,gc as Ot,hc as l,ic as c,jc as d,kc as u,lb as vt,lc as D,ld as Et,ma as bt,mc as B,nc as N,ob as r,oc as A,pa as yt,pc as R,pd as Vt,qc as pt,ra as h,rc as v,sc as J,tb as dt,ub as St,wc as x,ya as p,yc as a,za as m}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var Oe=["data-p-icon","exclamation-triangle"],ve=(()=>{class e extends at{pathId;onInit(){this.pathId="url(#"+L()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=V(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["","data-p-icon","exclamation-triangle"]],features:[k],attrs:Oe,decls:7,vars:2,consts:[["d","M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z","fill","currentColor"],["d","M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z","fill","currentColor"],["d","M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(w(),D(0,"g"),N(1,"path",0)(2,"path",1)(3,"path",2),B(),D(4,"defs")(5,"clipPath",3),N(6,"rect",4),B()()),o&2&&(S("clip-path",n.pathId),r(5),J("id",n.pathId))},encapsulation:2})}return e})();var Fe=["data-p-icon","info-circle"],Se=(()=>{class e extends at{pathId;onInit(){this.pathId="url(#"+L()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=V(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["","data-p-icon","info-circle"]],features:[k],attrs:Fe,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(w(),D(0,"g"),N(1,"path",0),B(),D(2,"defs")(3,"clipPath",1),N(4,"rect",2),B()()),o&2&&(S("clip-path",n.pathId),r(3),J("id",n.pathId))},encapsulation:2})}return e})();var Te=`
1
+ import{a as ye}from"./chunk-YKKHSYDW.js";import{a as de,b as he}from"./chunk-Z3PLQ27X.js";import"./chunk-VG66LDXQ.js";import{e as me}from"./chunk-HPQDUJXF.js";import"./chunk-TQROQOXU.js";import{a as ge}from"./chunk-IQGRGC3E.js";import{c as Ce,d as be}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import{a as W}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import"./chunk-BZWZ64N5.js";import{a as xe}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import{a as ce}from"./chunk-GNXSEYJF.js";import{a as ue}from"./chunk-7KG3DC5J.js";import{a as fe}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import{a as pe}from"./chunk-REDQ2L7Y.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import{a as re}from"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import{e as le}from"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import{a as at}from"./chunk-3NCMRK7E.js";import{a as ne}from"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import{g as st}from"./chunk-C4MTEDSW.js";import{b as L,c as ae,d as Ct,e as $}from"./chunk-JMRRXRKO.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as oe,h as ie}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{P as _t,Q as Qt,ha as H,la as qt,ma as ft,ua as Kt}from"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as it}from"./chunk-ZSUWHVKX.js";import{h as Jt}from"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as Wt}from"./chunk-AGBJEXIM.js";import{b as Ht,c as $t}from"./chunk-NB2H6KA7.js";import{b as ut,c as g}from"./chunk-UPRDDI4K.js";import{A as ee,c as Yt,h as Xt,m as te}from"./chunk-6UM4NHOR.js";import{a as Rt}from"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as zt,e as Gt}from"./chunk-D6JH2KV4.js";import{b as jt,d as ot}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as mt,q as Dt,s as Bt,t as Nt,v as At}from"./chunk-CGSMHTKB.js";import{c as ht,d as gt,f as et,g as Lt,i as nt,k as Ut,m as Zt}from"./chunk-XBIHN6D3.js";import{$c as Ft,Aa as w,Ab as Tt,Bc as Q,Dc as q,Ec as K,Fd as tt,G as F,Gd as j,Hb as I,Ia as M,Lb as k,Lc as Y,Mb as wt,Mc as T,Nb as P,Nc as b,Oc as U,Pa as V,Pc as O,Rc as Z,Sc as z,Tc as X,_b as S,_c as G,aa as ct,ac as f,ad as E,bd as Mt,cc as C,dd as kt,ec as It,fc as Pt,gc as Ot,hc as l,ic as c,jc as d,kc as u,lb as vt,lc as D,ld as Et,ma as bt,mc as B,nc as N,ob as r,oc as A,pa as yt,pc as R,pd as Vt,qc as pt,ra as h,rc as v,sc as J,tb as dt,ub as St,wc as x,ya as p,yc as a,za as m}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var Oe=["data-p-icon","exclamation-triangle"],ve=(()=>{class e extends at{pathId;onInit(){this.pathId="url(#"+L()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=V(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["","data-p-icon","exclamation-triangle"]],features:[k],attrs:Oe,decls:7,vars:2,consts:[["d","M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z","fill","currentColor"],["d","M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z","fill","currentColor"],["d","M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(w(),D(0,"g"),N(1,"path",0)(2,"path",1)(3,"path",2),B(),D(4,"defs")(5,"clipPath",3),N(6,"rect",4),B()()),o&2&&(S("clip-path",n.pathId),r(5),J("id",n.pathId))},encapsulation:2})}return e})();var Fe=["data-p-icon","info-circle"],Se=(()=>{class e extends at{pathId;onInit(){this.pathId="url(#"+L()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=V(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["","data-p-icon","info-circle"]],features:[k],attrs:Fe,decls:5,vars:2,consts:[["fill-rule","evenodd","clip-rule","evenodd","d","M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(o,n){o&1&&(w(),D(0,"g"),N(1,"path",0),B(),D(2,"defs")(3,"clipPath",1),N(4,"rect",2),B()()),o&2&&(S("clip-path",n.pathId),r(3),J("id",n.pathId))},encapsulation:2})}return e})();var Te=`
2
2
  .p-toast {
3
3
  width: dt('toast.width');
4
4
  white-space: pre-line;
@@ -1,4 +1,4 @@
1
- import{a as nt}from"./chunk-X2CTSYKS.js";import{a as ee}from"./chunk-QXRG5XYP.js";import{a as rt}from"./chunk-NB2H6KA7.js";import{b as we,c as te}from"./chunk-UPRDDI4K.js";import{b as Qe}from"./chunk-RQUCYFCB.js";import{a as Ge,b as fe,c as Ze,d as Je,e as ge,f as Xe,g as me,h as Ye,i as J,j as ye,k as x}from"./chunk-RXLMJGUY.js";import{e as et}from"./chunk-D6JH2KV4.js";import{d as tt}from"./chunk-UB3ZV5NW.js";import{D as qe,E as Ve}from"./chunk-CGSMHTKB.js";import{Da as Ue,F as Ne,G as Fe,Ib as z,Ma as ze,O as le,S as Le,T as $e,Wa as K,Z as ue,aa as O,ba as de,c as m,ea as he,f as je,ga as We,ha as He,j as Oe,k as Be,ma as D,n as G,na as H,o as Q,p as B,pa as P,q as Z,qa as g,ra as M,ub as U,v as _,va as pe,w as Me,xa as Ke,zd as L}from"./chunk-OHGMB7HJ.js";import{b as w}from"./chunk-WFMAM73Y.js";import{a as ce,i as k}from"./chunk-66YHNWRR.js";var ot={production:!0,version:"5.51.0",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 it=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let r=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof r=="string"&&(r=[r]),r||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),i=JSON.parse(window.atob(n)),l=e.split(".")[1].replace("-","+").replace("_","/"),c=JSON.parse(window.atob(l));return c.header=i,c}catch{return!1}}};o.\u0275fac=function(r){return new(r||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac,providedIn:"root"});let t=o;return t})();var Tt="firebase",Ct="11.10.0";J(Tt,Ct,"app");var q=new We("ANGULARFIRE2_VERSION");var st=(t,o)=>{let s=o?[o]:Ye(),e=[];return s.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{e.includes(i)||e.push(i)})}),e},Ae=(function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t})(Ae||{}),Mr=L()&&typeof Zone<"u"?Ae.WARN:Ae.SILENT;var re=class{zone;delegate;constructor(o,s=Be){this.zone=o,this.delegate=s}now(){return this.delegate.now()}schedule(o,s,e){let r=this.zone,n=function(i){r?r.runGuarded(()=>{o.apply(this,[i])}):o.apply(this,[i])};return this.delegate.schedule(n,s,e)}},ve=(()=>{class t{outsideAngular;insideAngular;constructor(){let s=M(U);this.outsideAngular=s.runOutsideAngular(()=>new re(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=s.run(()=>new re(typeof Zone>"u"?void 0:Zone.current,Oe))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Pt="firebase",xt="11.10.0";x.registerVersion(Pt,xt,"app-compat");var Rt=["ngOnDestroy"],ct=(t,o,s,e={})=>new Proxy(t,{get:(r,n)=>s.runOutsideAngular(()=>{if(t[n])return e?.spy?.get&&e.spy.get(n,t[n]),t[n];if(Rt.indexOf(n)>-1)return()=>{};let i=o.toPromise().then(a=>{let l=a?.[n];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>s.run(()=>c)):s.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(u=>{let f=u?.(...c);return e?.spy?.apply&&e.spy.apply(n,c,f),f})})})});var ne=class{constructor(o){return o}},oe=new P("angularfire2.app.options"),ie=new P("angularfire2.app.name");function ke(t,o,s){let e=typeof s=="string"&&s||"[DEFAULT]",r=typeof s=="object"&&s||{};r.name=r.name||e;let i=x.apps.filter(a=>a&&a.name===r.name)[0]||o.runOutsideAngular(()=>x.initializeApp(t,r));try{if(JSON.stringify(t)!==JSON.stringify(i.options)){let a=!!module.hot;_t("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ne(i)}var _t=(t,...o)=>{L()&&typeof console<"u"&&console[t](...o)},jt={provide:ne,useFactory:ke,deps:[oe,U,[new ze,ie]]},zr=(()=>{class t{static initializeApp(s,e){return{ngModule:t,providers:[{provide:oe,useValue:s},{provide:ie,useValue:e}]}}constructor(s){x.registerVersion("angularfire",q.full,"core"),x.registerVersion("angularfire",q.full,"app-compat"),x.registerVersion("angular",He.full,s.toString())}static \u0275fac=function(e){return new(e||t)(g(K))};static \u0275mod=z({type:t});static \u0275inj=H({providers:[jt]})}return t})();function lt(t,o,s,e,r){let[,n,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===t)||[];if(n)return Ot(r,i)||(at("error",`${o} was already initialized on the ${s} Firebase App with different settings.${Bt?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:r,was:i})),n;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([t,a,r]),a}}function Ot(t,o){try{return t.toString()===o.toString()}catch{return t===o}}var Bt=typeof module<"u"&&!!module.hot,at=(t,...o)=>{L()&&typeof console<"u"&&console[t](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var Mt=new Map,Nt={activated:!1,tokenObservers:[]},Ft={initialized:!1,enabled:!1};function R(t){return Mt.get(t)||Object.assign({},Nt)}function pt(){return Ft}var Lt="https://content-firebaseappcheck.googleapis.com/v1";var $t="exchangeDebugToken",ut={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},nn=1440*60*1e3;var Ee=class{constructor(o,s,e,r,n){if(this.operation=o,this.retryPolicy=s,this.getWaitDuration=e,this.lowerBound=r,this.upperBound=n,this.pending=null,this.nextErrorWaitInterval=r,r>n)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(o){return k(this,null,function*(){this.stop();try{this.pending=new fe,this.pending.promise.catch(s=>{}),yield Wt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new fe,this.pending.promise.catch(s=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(s){this.retryPolicy(s)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let s=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),s}}};function Wt(t){return new Promise(o=>{setTimeout(o,t)})}var Ht={"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.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Je("appCheck","AppCheck",Ht);function ft(t){if(!R(t).activated)throw N.create("use-before-activation",{appName:t.name})}function gt(e,r){return k(this,arguments,function*({url:t,body:o},s){let n={"Content-Type":"application/json"},i=s.getImmediate({optional:!0});if(i){let h=yield i.getHeartbeatsHeader();h&&(n["X-Firebase-Client"]=h)}let a={method:"POST",body:JSON.stringify(o),headers:n},l;try{l=yield fetch(t,a)}catch(h){throw N.create("fetch-network-error",{originalErrorMessage:h?.message})}if(l.status!==200)throw N.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(h){throw N.create("fetch-parse-error",{originalErrorMessage:h?.message})}let u=c.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let f=Number(u[1])*1e3,d=Date.now();return{token:c.token,expireTimeMillis:d+f,issuedAtTimeMillis:d}})}function mt(t,o){let{projectId:s,appId:e,apiKey:r}=t.options;return{url:`${Lt}/projects/${s}/apps/${e}:${$t}?key=${r}`,body:{debug_token:o}}}var Kt="firebase-app-check-database",Ut=1,Ie="firebase-app-check-store";var se=null;function zt(){return se||(se=new Promise((t,o)=>{try{let s=indexedDB.open(Kt,Ut);s.onsuccess=e=>{t(e.target.result)},s.onerror=e=>{var r;o(N.create("storage-open",{originalErrorMessage:(r=e.target.error)===null||r===void 0?void 0:r.message}))},s.onupgradeneeded=e=>{let r=e.target.result;switch(e.oldVersion){case 0:r.createObjectStore(Ie,{keyPath:"compositeKey"})}}}catch(s){o(N.create("storage-open",{originalErrorMessage:s?.message}))}}),se)}function qt(t,o){return Vt(Gt(t),o)}function Vt(t,o){return k(this,null,function*(){let e=(yield zt()).transaction(Ie,"readwrite"),n=e.objectStore(Ie).put({compositeKey:t,value:o});return new Promise((i,a)=>{n.onsuccess=l=>{i()},e.onerror=l=>{var c;a(N.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Gt(t){return`${t.options.appId}-${t.name}`}var X=new Xe("@firebase/app-check");function be(t,o){return Ze()?qt(t,o).catch(s=>{X.warn(`Failed to write token to IndexedDB. Error: ${s}`)}):Promise.resolve()}function yt(){return pt().enabled}function wt(){return k(this,null,function*(){let t=pt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
1
+ import{a as nt}from"./chunk-X2CTSYKS.js";import{a as ee}from"./chunk-QXRG5XYP.js";import{a as rt}from"./chunk-NB2H6KA7.js";import{b as we,c as te}from"./chunk-UPRDDI4K.js";import{b as Qe}from"./chunk-RQUCYFCB.js";import{a as Ge,b as fe,c as Ze,d as Je,e as ge,f as Xe,g as me,h as Ye,i as J,j as ye,k as x}from"./chunk-RXLMJGUY.js";import{e as et}from"./chunk-D6JH2KV4.js";import{d as tt}from"./chunk-UB3ZV5NW.js";import{D as qe,E as Ve}from"./chunk-CGSMHTKB.js";import{Da as Ue,F as Ne,G as Fe,Ib as z,Ma as ze,O as le,S as Le,T as $e,Wa as K,Z as ue,aa as O,ba as de,c as m,ea as he,f as je,ga as We,ha as He,j as Oe,k as Be,ma as D,n as G,na as H,o as Q,p as B,pa as P,q as Z,qa as g,ra as M,ub as U,v as _,va as pe,w as Me,xa as Ke,zd as L}from"./chunk-OHGMB7HJ.js";import{b as w}from"./chunk-WFMAM73Y.js";import{a as ce,i as k}from"./chunk-66YHNWRR.js";var ot={production:!0,version:"5.51.2",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 it=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let r=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof r=="string"&&(r=[r]),r||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),i=JSON.parse(window.atob(n)),l=e.split(".")[1].replace("-","+").replace("_","/"),c=JSON.parse(window.atob(l));return c.header=i,c}catch{return!1}}};o.\u0275fac=function(r){return new(r||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac,providedIn:"root"});let t=o;return t})();var Tt="firebase",Ct="11.10.0";J(Tt,Ct,"app");var q=new We("ANGULARFIRE2_VERSION");var st=(t,o)=>{let s=o?[o]:Ye(),e=[];return s.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{e.includes(i)||e.push(i)})}),e},Ae=(function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t})(Ae||{}),Mr=L()&&typeof Zone<"u"?Ae.WARN:Ae.SILENT;var re=class{zone;delegate;constructor(o,s=Be){this.zone=o,this.delegate=s}now(){return this.delegate.now()}schedule(o,s,e){let r=this.zone,n=function(i){r?r.runGuarded(()=>{o.apply(this,[i])}):o.apply(this,[i])};return this.delegate.schedule(n,s,e)}},ve=(()=>{class t{outsideAngular;insideAngular;constructor(){let s=M(U);this.outsideAngular=s.runOutsideAngular(()=>new re(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=s.run(()=>new re(typeof Zone>"u"?void 0:Zone.current,Oe))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Pt="firebase",xt="11.10.0";x.registerVersion(Pt,xt,"app-compat");var Rt=["ngOnDestroy"],ct=(t,o,s,e={})=>new Proxy(t,{get:(r,n)=>s.runOutsideAngular(()=>{if(t[n])return e?.spy?.get&&e.spy.get(n,t[n]),t[n];if(Rt.indexOf(n)>-1)return()=>{};let i=o.toPromise().then(a=>{let l=a?.[n];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>s.run(()=>c)):s.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(u=>{let f=u?.(...c);return e?.spy?.apply&&e.spy.apply(n,c,f),f})})})});var ne=class{constructor(o){return o}},oe=new P("angularfire2.app.options"),ie=new P("angularfire2.app.name");function ke(t,o,s){let e=typeof s=="string"&&s||"[DEFAULT]",r=typeof s=="object"&&s||{};r.name=r.name||e;let i=x.apps.filter(a=>a&&a.name===r.name)[0]||o.runOutsideAngular(()=>x.initializeApp(t,r));try{if(JSON.stringify(t)!==JSON.stringify(i.options)){let a=!!module.hot;_t("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ne(i)}var _t=(t,...o)=>{L()&&typeof console<"u"&&console[t](...o)},jt={provide:ne,useFactory:ke,deps:[oe,U,[new ze,ie]]},zr=(()=>{class t{static initializeApp(s,e){return{ngModule:t,providers:[{provide:oe,useValue:s},{provide:ie,useValue:e}]}}constructor(s){x.registerVersion("angularfire",q.full,"core"),x.registerVersion("angularfire",q.full,"app-compat"),x.registerVersion("angular",He.full,s.toString())}static \u0275fac=function(e){return new(e||t)(g(K))};static \u0275mod=z({type:t});static \u0275inj=H({providers:[jt]})}return t})();function lt(t,o,s,e,r){let[,n,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===t)||[];if(n)return Ot(r,i)||(at("error",`${o} was already initialized on the ${s} Firebase App with different settings.${Bt?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:r,was:i})),n;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([t,a,r]),a}}function Ot(t,o){try{return t.toString()===o.toString()}catch{return t===o}}var Bt=typeof module<"u"&&!!module.hot,at=(t,...o)=>{L()&&typeof console<"u"&&console[t](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var Mt=new Map,Nt={activated:!1,tokenObservers:[]},Ft={initialized:!1,enabled:!1};function R(t){return Mt.get(t)||Object.assign({},Nt)}function pt(){return Ft}var Lt="https://content-firebaseappcheck.googleapis.com/v1";var $t="exchangeDebugToken",ut={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},nn=1440*60*1e3;var Ee=class{constructor(o,s,e,r,n){if(this.operation=o,this.retryPolicy=s,this.getWaitDuration=e,this.lowerBound=r,this.upperBound=n,this.pending=null,this.nextErrorWaitInterval=r,r>n)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(o){return k(this,null,function*(){this.stop();try{this.pending=new fe,this.pending.promise.catch(s=>{}),yield Wt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new fe,this.pending.promise.catch(s=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(s){this.retryPolicy(s)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let s=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),s}}};function Wt(t){return new Promise(o=>{setTimeout(o,t)})}var Ht={"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.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Je("appCheck","AppCheck",Ht);function ft(t){if(!R(t).activated)throw N.create("use-before-activation",{appName:t.name})}function gt(e,r){return k(this,arguments,function*({url:t,body:o},s){let n={"Content-Type":"application/json"},i=s.getImmediate({optional:!0});if(i){let h=yield i.getHeartbeatsHeader();h&&(n["X-Firebase-Client"]=h)}let a={method:"POST",body:JSON.stringify(o),headers:n},l;try{l=yield fetch(t,a)}catch(h){throw N.create("fetch-network-error",{originalErrorMessage:h?.message})}if(l.status!==200)throw N.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(h){throw N.create("fetch-parse-error",{originalErrorMessage:h?.message})}let u=c.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let f=Number(u[1])*1e3,d=Date.now();return{token:c.token,expireTimeMillis:d+f,issuedAtTimeMillis:d}})}function mt(t,o){let{projectId:s,appId:e,apiKey:r}=t.options;return{url:`${Lt}/projects/${s}/apps/${e}:${$t}?key=${r}`,body:{debug_token:o}}}var Kt="firebase-app-check-database",Ut=1,Ie="firebase-app-check-store";var se=null;function zt(){return se||(se=new Promise((t,o)=>{try{let s=indexedDB.open(Kt,Ut);s.onsuccess=e=>{t(e.target.result)},s.onerror=e=>{var r;o(N.create("storage-open",{originalErrorMessage:(r=e.target.error)===null||r===void 0?void 0:r.message}))},s.onupgradeneeded=e=>{let r=e.target.result;switch(e.oldVersion){case 0:r.createObjectStore(Ie,{keyPath:"compositeKey"})}}}catch(s){o(N.create("storage-open",{originalErrorMessage:s?.message}))}}),se)}function qt(t,o){return Vt(Gt(t),o)}function Vt(t,o){return k(this,null,function*(){let e=(yield zt()).transaction(Ie,"readwrite"),n=e.objectStore(Ie).put({compositeKey:t,value:o});return new Promise((i,a)=>{n.onsuccess=l=>{i()},e.onerror=l=>{var c;a(N.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Gt(t){return`${t.options.appId}-${t.name}`}var X=new Xe("@firebase/app-check");function be(t,o){return Ze()?qt(t,o).catch(s=>{X.warn(`Failed to write token to IndexedDB. Error: ${s}`)}):Promise.resolve()}function yt(){return pt().enabled}function wt(){return k(this,null,function*(){let t=pt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Zt={error:"UNKNOWN_ERROR"};function Jt(t){return Ge.encodeString(JSON.stringify(t),!1)}function Te(t,o=!1,s=!1){return k(this,null,function*(){let e=t.app;ft(e);let r=R(e),n=r.token,i;if(n&&!Y(n)&&(r.token=void 0,n=void 0),!n){let c=yield r.cachedTokenPromise;c&&(Y(c)?n=c:yield be(e,void 0))}if(!o&&n&&Y(n))return{token:n.token};let a=!1;if(yt())try{r.exchangeTokenPromise||(r.exchangeTokenPromise=gt(mt(e,yield wt()),t.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),a=!0);let c=yield r.exchangeTokenPromise;return yield be(e,c),r.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?X.warn(c.message):s&&X.error(c),Se(c)}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),a=!0),n=yield R(e).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?X.warn(c.message):s&&X.error(c),i=c}let l;return n?i?Y(n)?l={token:n.token,internalError:i}:l=Se(i):(l={token:n.token},r.token=n,yield be(e,n)):l=Se(i),a&&er(e,l),l})}function Xt(t){return k(this,null,function*(){let o=t.app;ft(o);let{provider:s}=R(o);if(yt()){let e=yield wt(),{token:r}=yield gt(mt(o,e),t.heartbeatServiceProvider);return{token:r}}else{let{token:e}=yield s.getToken();return{token:e}}})}function Yt(t,o,s,e){let{app:r}=t,n=R(r),i={next:s,error:e,type:o};if(n.tokenObservers=[...n.tokenObservers,i],n.token&&Y(n.token)){let a=n.token;Promise.resolve().then(()=>{s({token:a.token}),dt(t)}).catch(()=>{})}n.cachedTokenPromise.then(()=>dt(t))}function At(t,o){let s=R(t),e=s.tokenObservers.filter(r=>r.next!==o);e.length===0&&s.tokenRefresher&&s.tokenRefresher.isRunning()&&s.tokenRefresher.stop(),s.tokenObservers=e}function dt(t){let{app:o}=t,s=R(o),e=s.tokenRefresher;e||(e=Qt(t),s.tokenRefresher=e),!e.isRunning()&&s.isTokenAutoRefreshEnabled&&e.start()}function Qt(t){let{app:o}=t;return new Ee(()=>k(null,null,function*(){let s=R(o),e;if(s.token?e=yield Te(t,!0):e=yield Te(t),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let s=R(o);if(s.token){let e=s.token.issuedAtTimeMillis+(s.token.expireTimeMillis-s.token.issuedAtTimeMillis)*.5+3e5,r=s.token.expireTimeMillis-300*1e3;return e=Math.min(e,r),Math.max(0,e-Date.now())}else return 0},ut.RETRIAL_MIN_WAIT,ut.RETRIAL_MAX_WAIT)}function er(t,o){let s=R(t).tokenObservers;for(let e of s)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function Y(t){return t.expireTimeMillis-Date.now()>0}function Se(t){return{token:Jt(Zt),error:t}}var Ce=class{constructor(o,s){this.app=o,this.heartbeatServiceProvider=s}_delete(){let{tokenObservers:o}=R(this.app);for(let s of o)At(this.app,s.next);return Promise.resolve()}};function tr(t,o){return new Ce(t,o)}function rr(t){return{getToken:o=>Te(t,o),getLimitedUseToken:()=>Xt(t),addTokenListener:o=>Yt(t,"INTERNAL",o),removeTokenListener:o=>At(t.app,o)}}var nr="@firebase/app-check",or="0.10.1";var ir="app-check",ht="app-check-internal";function sr(){me(new ge(ir,t=>{let o=t.getProvider("app").getImmediate(),s=t.getProvider("heartbeat");return tr(o,s)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,o,s)=>{t.getProvider(ht).initialize()})),me(new ge(ht,t=>{let o=t.getProvider("app-check").getImmediate();return rr(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),J(nr,or)}sr();var ar="app-check";var ae=class{constructor(){return st(ar)}};var cr=["localhost","0.0.0.0","127.0.0.1"],An=typeof window<"u"&&cr.includes(window.location.hostname);var ur=new P("angularfire2.auth.use-emulator"),dr=new P("angularfire2.auth.settings"),hr=new P("angularfire2.auth.tenant-id"),pr=new P("angularfire2.auth.langugage-code"),fr=new P("angularfire2.auth.use-device-language"),gr=new P("angularfire.auth.persistence"),mr=(t,o,s,e,r,n,i,a)=>lt(`${t.name}.auth`,"AngularFireAuth",t.name,()=>{let l=o.runOutsideAngular(()=>t.auth());if(s&&l.useEmulator(...s),e&&(l.tenantId=e),l.languageCode=r,n&&l.useDeviceLanguage(),i)for(let[c,u]of Object.entries(i))l.settings[c]=u;return a&&l.setPersistence(a),l},[s,e,r,n,i,a]),De=(()=>{class t{injector=M(pe);authState;idToken;user;idTokenResult;credential;constructor(s,e,r,n,i,a,l,c,u,f,d,h){let p=new je,y=Z(void 0).pipe(G(i.outsideAngular),O(()=>n.runOutsideAngular(()=>import("./chunk-XRLXIT7I.js"))),_(()=>ke(s,n,e)),_(T=>mr(T,n,a,c,u,f,l,d)),ue({bufferSize:1,refCount:!1}));if(Ve(r))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=Z(null);else{y.pipe($e()).subscribe();let T=y.pipe(O(I=>I.getRedirectResult().then(j=>j,()=>null)),Qe(this.injector),ue({bufferSize:1,refCount:!1})),W=y.pipe(O(I=>new m(j=>({unsubscribe:n.runOutsideAngular(()=>I.onAuthStateChanged(F=>j.next(F),F=>j.error(F),()=>j.complete()))})))),V=y.pipe(O(I=>new m(j=>({unsubscribe:n.runOutsideAngular(()=>I.onIdTokenChanged(F=>j.next(F),F=>j.error(F),()=>j.complete()))}))));this.authState=T.pipe(de(W),Q(i.outsideAngular),G(i.insideAngular)),this.user=T.pipe(de(V),Q(i.outsideAngular),G(i.insideAngular)),this.idToken=this.user.pipe(O(I=>I?B(I.getIdToken()):Z(null))),this.idTokenResult=this.user.pipe(O(I=>I?B(I.getIdTokenResult()):Z(null))),this.credential=Ne(T,p,this.authState.pipe(Fe(I=>!I))).pipe(_(I=>I?.user?I:null),Q(i.outsideAngular),G(i.insideAngular))}return ct(this,y,n,{spy:{apply:(T,W,V)=>{(T.startsWith("signIn")||T.startsWith("createUser"))&&V.then(I=>p.next(I))}}})}static \u0275fac=function(e){return new(e||t)(g(oe),g(ie,8),g(K),g(U),g(ve),g(ur,8),g(dr,8),g(hr,8),g(pr,8),g(fr,8),g(gr,8),g(ae,8))};static \u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"any"})}return t})(),Bn=(()=>{class t{constructor(){x.registerVersion("angularfire",q.full,"auth-compat")}static \u0275fac=function(e){return new(e||t)};static \u0275mod=z({type:t});static \u0275inj=H({providers:[De]})}return t})();var b=(function(t){return t.readonly="readonly",t.readwrite="readwrite",t})(b||{}),vt=new P(null),kt=new P("Indexed DB"),wr=new P("Server Indexed DB");function Ar(t,o){return t.objectStoreNames.contains(o)}function C(t,o,s){if(!t){s("You need to use the openDatabase function to create a database before you query it!");return}Ar(t,o)||s(`objectStore does not exists: ${o}`)}function S(t,o){let s=t.transaction(o.storeName,o.dbMode);return s.onerror=o.error,s.onabort=o.abort,s}function E(t,o,s,e){return{storeName:o,dbMode:t,error:r=>{s(r)},abort:r=>{s(r)}}}var xe=[];function A(t,o,s,e){return new Promise((r,n)=>{t||n("IndexedDB not available");let i=t.open(o,s),a;i.onsuccess=()=>{a=i.result,xe.push(a),r(a)},i.onerror=()=>{n(`IndexedDB error: ${i.error}`)},typeof e=="function"&&(i.onupgradeneeded=l=>{e(l,a)})})}function Pe(t,o,s,e,r){return k(this,null,function*(){return new Promise((n,i)=>{if(!t)return;let a=t.open(o,s);a.onupgradeneeded=l=>k(null,null,function*(){let c=l.target.result,u=e.map(d=>k(null,null,function*(){if(!c.objectStoreNames.contains(d.store)){let h=c.createObjectStore(d.store,d.storeConfig);for(let p of d.storeSchema)h.createIndex(p.name,p.keypath,p.options)}}));yield Promise.all(u);let f=r&&r();if(f){let d=Object.keys(f).map(h=>parseInt(h,10)).filter(h=>h>l.oldVersion).sort((h,p)=>h-p);for(let h of d)f[h](c,a.transaction)}c.close(),n()}),a.onsuccess=l=>{l.target.result.close(),n()},a.onerror=l=>{i(l)}})})}function vr(t,o,s){if(!t||!o||!s)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new m(e=>{try{let r=o+1,n=indexedDB.open(t,r);n.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(s),a.close(),console.log("onupgradeneeded"),e.next(),e.complete()},n.onerror=i=>e.error(i)}catch(r){e.error(r)}})}function kr(t){return new Promise((o,s)=>{if(!t){s(new Error("No database to close"));return}try{t.close(),o()}catch(e){s(`Error closing database: ${e}`)}})}function v(){return function(t,o,s){let e=s.value;return s.value=function(...r){let n=e.apply(this,r);return n instanceof m?n.pipe(Le(()=>k(this,null,function*(){let i=xe.map(a=>k(this,null,function*(){yield kr(a)}));yield Promise.all(i),xe.length=0}))):n},s}}var _e=(()=>{let o=class o{constructor(e,r){this.dbConfigs=e,this.indexedDB=r,this.defaultDatabaseName=null,Object.values(this.dbConfigs).forEach((n,i,a)=>this.instanciateConfig(n,a.length===1))}instanciateConfig(e,r){return k(this,null,function*(){if(!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if((e.isDefault??!1)&&this.defaultDatabaseName)throw new Error("NgxIndexedDB: Only one database can be set as default");((e.isDefault??!1)&&!this.defaultDatabaseName||r)&&(this.defaultDatabaseName=e.name,this.selectedDb=e.name),yield Pe(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),A(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(L()&&(console.warn(`
4
4
  Your DB Config doesn't match the most recent version of the DB with name ${e.name}, please update it