marketplacepos 5.50.2 → 5.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/3rdpartylicenses.txt +26 -26
- package/Marketplace/{chunk-BGJEGBP5.js → chunk-25Q56ATV.js} +1 -1
- package/Marketplace/{chunk-4NT5VNJW.js → chunk-2PMJPSC4.js} +2 -2
- package/Marketplace/{chunk-VFZ76Z6T.js → chunk-364CDNZV.js} +1 -1
- package/Marketplace/{chunk-JUWHPFPW.js → chunk-36OIR6DM.js} +1 -1
- package/Marketplace/{chunk-TLCH5ENB.js → chunk-3Q6QZGLZ.js} +1 -1
- package/Marketplace/{chunk-B5BQZD66.js → chunk-4ITXH35D.js} +1 -1
- package/Marketplace/{chunk-EDGT4W2Q.js → chunk-4JCS7WPV.js} +1 -1
- package/Marketplace/{chunk-RNJHJCHP.js → chunk-53B6D5OR.js} +1 -1
- package/Marketplace/chunk-5NWJOQN5.js +1 -0
- package/Marketplace/{chunk-LQUMSCFQ.js → chunk-5YQUGH5Z.js} +1 -1
- package/Marketplace/{chunk-7K6U3ABQ.js → chunk-62YNPW6Q.js} +1 -1
- package/Marketplace/{chunk-YBRWFONB.js → chunk-6DGG765N.js} +1 -1
- package/Marketplace/{chunk-7AJN7ECH.js → chunk-6IZWIEUD.js} +1 -1
- package/Marketplace/{chunk-SS4PLPBF.js → chunk-7E6JD2PT.js} +1 -1
- package/Marketplace/{chunk-5NJAMQES.js → chunk-7QDKBMEA.js} +1 -1
- package/Marketplace/{chunk-TH27YE6R.js → chunk-7RIUHK6K.js} +1 -1
- package/Marketplace/{chunk-ELAPYSP6.js → chunk-A4X7F4MN.js} +1 -1
- package/Marketplace/{chunk-ZLNNQRTE.js → chunk-AF6XAQPY.js} +1 -1
- package/Marketplace/{chunk-7XA3VQEB.js → chunk-AZEH7PMO.js} +1 -1
- package/Marketplace/{chunk-GD6ZN56B.js → chunk-BKCKASH3.js} +1 -1
- package/Marketplace/{chunk-3TK5BYAY.js → chunk-BLOGT3TL.js} +1 -1
- package/Marketplace/{chunk-ZD5PSX3I.js → chunk-BVW7WI5I.js} +1 -1
- package/Marketplace/{chunk-QSW7O4GN.js → chunk-C64L25TP.js} +1 -1
- package/Marketplace/chunk-E6W25RW5.js +1 -0
- package/Marketplace/{chunk-DYTXOFIM.js → chunk-EGJMTFNO.js} +1 -1
- package/Marketplace/{chunk-YYKWI27U.js → chunk-EX4C4ZW4.js} +1 -1
- package/Marketplace/{chunk-PRM7MTFP.js → chunk-EYYKWIXP.js} +1 -1
- package/Marketplace/{chunk-U7FIZHGC.js → chunk-GD5I7ADU.js} +1 -1
- package/Marketplace/{chunk-2UKRRVAM.js → chunk-HT2MSA66.js} +1 -1
- package/Marketplace/{chunk-G3KVHCET.js → chunk-HZTKN5RX.js} +1 -1
- package/Marketplace/{chunk-OWLZQ5WE.js → chunk-ILFUI3MT.js} +1 -1
- package/Marketplace/{chunk-F24YPKYG.js → chunk-IXNEMOFX.js} +1 -1
- package/Marketplace/chunk-J4RDYEJC.js +1 -0
- package/Marketplace/{chunk-QB7PXKAO.js → chunk-K2CHDL7K.js} +1 -1
- package/Marketplace/{chunk-WCX3T6LK.js → chunk-LCN52IJT.js} +1 -1
- package/Marketplace/{chunk-GRVGKVD6.js → chunk-LOVYZLSU.js} +1 -1
- package/Marketplace/{chunk-CHGAMAQX.js → chunk-LWUMLKSO.js} +1 -1
- package/Marketplace/{chunk-EU324R5S.js → chunk-M5JNIPMS.js} +1 -1
- package/Marketplace/{chunk-OUYOKQ57.js → chunk-OJI34QN5.js} +1 -1
- package/Marketplace/{chunk-FUBZ75C7.js → chunk-OMY5ASFA.js} +1 -1
- package/Marketplace/{chunk-KA2HPWPG.js → chunk-OPCGCQMZ.js} +1 -1
- package/Marketplace/{chunk-A4UF2QH6.js → chunk-Q5IVQP3E.js} +1 -1
- package/Marketplace/{chunk-XF4A775R.js → chunk-R3BRUX7Z.js} +1 -1
- package/Marketplace/{chunk-PQM7IB5J.js → chunk-SASGSPGQ.js} +1 -1
- package/Marketplace/{chunk-XCJ5XRFI.js → chunk-SLQ42VND.js} +1 -1
- package/Marketplace/chunk-T3CN3WQD.js +1 -0
- package/Marketplace/{chunk-TG7XOXCH.js → chunk-T62YFSKW.js} +1 -1
- package/Marketplace/{chunk-KUPGF23P.js → chunk-TLTFNFAB.js} +1 -1
- package/Marketplace/{chunk-TVFILHVN.js → chunk-VBVBTC2P.js} +1 -1
- package/Marketplace/chunk-WEJBY3OB.js +1 -0
- package/Marketplace/{chunk-TUJBAZ5Q.js → chunk-WH76SMZT.js} +1 -1
- package/Marketplace/{chunk-2DZHA445.js → chunk-XAL6YLNQ.js} +1 -1
- package/Marketplace/{chunk-6LXQMIYX.js → chunk-XSOP2OTT.js} +1 -1
- package/Marketplace/{chunk-EKYPWTJN.js → chunk-YF7CCYHF.js} +1 -1
- package/Marketplace/{chunk-YQKEWN54.js → chunk-ZMMMNVOU.js} +1 -1
- package/Marketplace/{chunk-WXXGLR46.js → chunk-ZMSM2NR7.js} +1 -1
- package/Marketplace/{chunk-WG34QKGX.js → chunk-ZXFWQ6VJ.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-G6GGJLGW.js → main-SOO5LINL.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-42GDFAAQ.js +0 -1
- package/Marketplace/chunk-CZICXKFA.js +0 -1
- package/Marketplace/chunk-DQXBBV26.js +0 -1
- package/Marketplace/chunk-UQ7PDZO3.js +0 -1
- /package/Marketplace/{chunk-FDGH6XKK.js → chunk-CIVDQKQZ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-
|
|
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 K}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as H,c as R,h as O,m as j,p as F}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as U}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as N,w as W,z as D}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as V,Ia as w,Nc as l,Oc as A,Rc as g,Sc as C,Tc as y,Uc as L,Vc as T,Wc as b,Z as k,ac as S,cc as x,hc as _,ic as i,id as P,jc as t,jd as B,kc as E,ob as c,ra as I,rc as v,wc as M,ya as m,yc as h,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function Y(n,a){if(n&1){let p=v();i(0,"input",30),y("ngModelChange",function(o){m(p);let e=h();return C(e.sku,o)||(e.sku=o),u(o)}),t()}if(n&2){let p=h();g("ngModel",p.sku)}}function q(n,a){if(n&1){let p=v();i(0,"input",31),y("ngModelChange",function(o){m(p);let e=h();return C(e.itemId,o)||(e.itemId=o),u(o)}),t()}if(n&2){let p=h();g("ngModel",p.itemId)}}function z(n,a){if(n&1&&(i(0,"pre",28),l(1),P(2,"json"),t()),n&2){h();let p=b(35);c(),A(B(2,1,p))}}function Q(n,a){n&1&&(i(0,"p",29),l(1," Your data will be shown here once it's available "),t())}var pe=(()=>{let a=class a{constructor(){this.httpService=I(U),this.selectedChannel=w(null),this.sku=w(null),this.itemId=w(null),this.searchBy="sku"}initProductLog(){let d={ChannelID:this.selectedChannel()};this.searchBy==="sku"?d.SKU=this.sku():d.ItemID=this.itemId(),this.productLog$=this.httpService.post(K.GetProductApiLog,d).pipe(k(1))}copyToClipboard(d){if(!d)return;let o=typeof d=="string"?d:JSON.stringify(d,null,2);navigator.clipboard.writeText(o),alert("Copied to clipboard!")}};a.\u0275fac=function(o){return new(o||a)},a.\u0275cmp=V({type:a,selectors:[["app-product-api"]],decls:50,vars:14,consts:[["headerTitle","Origin Product 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"],[1,"mb-2"],[1,"form-check","form-check-inline"],["type","radio","name","searchBy","id","searchBySku",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchBySku",1,"form-check-label"],["type","radio","name","searchBy","id","searchByItemId",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchByItemId",1,"form-check-label"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"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","productLogText"],[1,"text-center","my-12","text-muted"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"]],template:function(o,e){if(o&1){let s=v();i(0,"mainpanel",0)(1,"actions")(2,"button",1),M("click",function(){return m(s),u(e.initProductLog())}),E(3,"i",2),l(4," Search "),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),l(12,"Channel"),t(),i(13,"p",8),l(14," View logs related to Product API Detail "),t()(),i(15,"div",9)(16,"app-channel-options-v2",10),y("ngModelChange",function(r){return m(s),C(e.selectedChannel,r)||(e.selectedChannel=r),u(r)}),t()()(),i(17,"div",11)(18,"div",7)(19,"h6"),l(20,"Product Code / SKU"),t(),i(21,"p",8),l(22," Product SKU or Code from Channel Product "),t()(),i(23,"div",9)(24,"div",12)(25,"div",13)(26,"input",14),y("ngModelChange",function(r){return m(s),C(e.searchBy,r)||(e.searchBy=r),u(r)}),t(),i(27,"label",15),l(28,"Search by SKU"),t()(),i(29,"div",13)(30,"input",16),y("ngModelChange",function(r){return m(s),C(e.searchBy,r)||(e.searchBy=r),u(r)}),t(),i(31,"label",17),l(32,"Search by ItemID"),t()()(),S(33,Y,1,1,"input",18),S(34,q,1,1,"input",19),t()()()(),L(35),P(36,"async"),i(37,"div",20)(38,"div",21)(39,"div",22)(40,"div",23)(41,"h5"),l(42,"Response"),t(),i(43,"button",24),M("click",function(){m(s);let r=b(35);return u(e.copyToClipboard(r))}),l(44," Copy "),t()(),i(45,"div",25)(46,"div",26)(47,"div",27),S(48,z,3,3,"pre",28)(49,Q,2,0,"p",29),t()()()()()()()()()}if(o&2){_("hideSearchBox",!0)("hideSearchDropdown",!0),c(16),g("ngModel",e.selectedChannel),c(10),g("ngModel",e.searchBy),_("value","sku"),c(4),g("ngModel",e.searchBy),_("value","itemid"),c(3),x(e.searchBy==="sku"?33:-1),c(),x(e.searchBy==="itemid"?34:-1),c();let s=T(B(36,11,e.productLog$));c(8),_("disabled",!s),c(5),x(s?48:49)}},dependencies:[N,H,R,F,O,j,J,G,W,D],encapsulation:2});let n=a;return n})();export{pe as ProductApiComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-CUSAKJLC.js";import"./chunk-4VNQYYVV.js";import{a as n}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-CUSAKJLC.js";import"./chunk-4VNQYYVV.js";import{a as n}from"./chunk-WH76SMZT.js";import{a as d,b as m}from"./chunk-75IM3UUA.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./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"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{c as u}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as c,hc as l,ic as p,jc as s,kc as i,ob as r}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var h=(()=>{let o=class o{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"},{Title:"Scan Job",Url:"/menu/products/status/notification",Description:"Scan results for each channel, including product counts and synchronization status"}]}};o.\u0275fac=function(a){return new(a||o)},o.\u0275cmp=c({type:o,selectors:[["app-status"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"]],template:function(a,f){a&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),s()()(),i(4,"router-outlet")),a&2&&(r(3),l("Tabs",f.productTabs))},dependencies:[m,d,u],encapsulation:2});let t=o;return t})();var U=[{component:h,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",loadComponent(){return import("./chunk-AF6XAQPY.js").then(t=>t.InPosComponent)},canActivate:[n,e],data:{title:"Products in POS"}},{path:"sold-in-channel",loadComponent(){return import("./chunk-4JCS7WPV.js").then(t=>t.SoldInChannelComponent)},canActivate:[n,e],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",loadComponent(){return import("./chunk-364CDNZV.js").then(t=>t.NotInChannelComponent)},canActivate:[n,e],data:{title:"Products not in Channel"}},{path:"not-in-pos",loadComponent(){return import("./chunk-T62YFSKW.js").then(t=>t.NotInPosComponent)},canActivate:[n,e],data:{title:"Products not in POS"}},{path:"duplicate-sku",loadComponent(){return import("./chunk-53B6D5OR.js").then(t=>t.DuplicateSkuComponent)},canActivate:[n,e],data:{title:"Duplicate Sku in Channel"}},{path:"duplicate-sku/table",loadComponent(){return import("./chunk-7E6JD2PT.js").then(t=>t.DuplicateSkuV2Component)},canActivate:[n,e],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",loadComponent(){return import("./chunk-C64L25TP.js").then(t=>t.ChannelStatisticComponent)},canActivate:[n,e],data:{title:"Channel Statistic"}},{path:"notification",loadComponent(){return import("./chunk-ZMMMNVOU.js").then(t=>t.NotificationComponent)},canActivate:[n,e],data:{title:"Notification"}},{path:"notificationV2",loadComponent(){return import("./chunk-4ITXH35D.js").then(t=>t.NotificationV2Component)},canActivate:[n,e],data:{title:"Notification"}},{path:"notificationV2/detailV2",loadComponent(){return import("./chunk-2WQLSGW3.js").then(t=>t.DetailComponent)},canActivate:[n,e],data:{title:"Notification Detail"}},{path:"notification/detail",loadComponent(){return import("./chunk-OPCGCQMZ.js").then(t=>t.DetailComponent)},canActivate:[n,e],data:{title:"Notification Detail"}}]}];export{U as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import{a as et}from"./chunk-27DIE2YS.js";import{a as tt}from"./chunk-
|
|
1
|
+
import{a as Z}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import{a as et}from"./chunk-27DIE2YS.js";import{a as tt}from"./chunk-LCN52IJT.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-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as X}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as W}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"./chunk-JTKEMQZT.js";import{c as Q}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as K}from"./chunk-ZSUWHVKX.js";import{h as J}from"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import{b as Y,c as G}from"./chunk-NB2H6KA7.js";import{c as T}from"./chunk-UPRDDI4K.js";import"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as H}from"./chunk-D6JH2KV4.js";import{e as z}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as U,w as q,y as R}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as D,G as P,Hb as O,Nb as L,Nc as c,Oc as N,Pc as _,ac as w,ad as g,bc as $,ca as b,cc as I,ec as B,f as E,fc as A,gc as F,hc as u,ic as o,id as h,jc as r,jd as S,kc as m,kd as j,mb as k,ob as s,oc as M,pc as V,ra as C,rc as y,wc as v,ya as f,yc as p,za as x}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var it=()=>["/menu/products/status/sold-in-channel"],nt=e=>({ID:e}),ot=()=>["/menu/products/status/not-in-pos"],rt=e=>[e];function at(e,a){if(e&1&&c(0),e&2){let i=p().$implicit;_(" ",i.Count," ")}}function ct(e,a){if(e&1){let i=y();o(0,"span",23),v("click",function(){f(i);let t=p().$implicit,l=p(2);return x(l.getLiveProductCount(t.ID,t))}),m(1,"i",24),r()}}function lt(e,a){if(e&1){let i=y();M(0),o(1,"button",25),v("click",function(){f(i);let t=p().$implicit,l=p(2);return x(l.onScanChannel(t))}),m(2,"i",26),c(3," Scan "),r(),V()}}function st(e,a){if(e&1){let i=y();o(0,"tr")(1,"td"),m(2,"img",14),o(3,"span",15),c(4),r()(),o(5,"td",16),w(6,at,1,1)(7,ct,2,0,"span",17),r(),o(8,"td",16)(9,"a",18),c(10),h(11,"number"),r()(),o(12,"td",16)(13,"a",18),c(14),h(15,"number"),r()(),o(16,"td"),c(17),h(18,"date"),r(),o(19,"td")(20,"div",19),L(21,lt,4,0,"ng-container",20),o(22,"button",21),v("click",function(){let t=f(i).$implicit,l=p(2);return x(l.onClearCache(t.ID))}),m(23,"i",22),c(24," Clear "),r()()()()}if(e&2){let i=a.$implicit,n=p(2);s(2),u("src",n.getChannelLogo(i.TypeID),k),s(2),N(i.Name),s(2),I(i.Count!==void 0?6:7),s(3),u("routerLink",D(18,it))("queryParams",g(19,nt,i.ID)),s(),_(" ",S(11,11,i.SoldInChannel)," "),s(3),u("routerLink",D(21,ot))("queryParams",g(22,nt,i.ID)),s(),_(" ",S(15,13,i.NotInPOS)," "),s(3),_(" ",i.LastSync?j(18,15,i.LastSync,"dd MMM yyyy HH:mm"):"Never"," "),s(4),u("ngxPermissionsOnly",g(24,rt,n.scanProductRole))}}function pt(e,a){if(e&1&&(o(0,"div",4)(1,"table",6)(2,"thead",7)(3,"tr",8)(4,"th"),c(5,"Channel"),r(),o(6,"th",9),c(7," Live Product "),r(),o(8,"th",10),c(9," Sold In Channel "),r(),o(10,"th",11),c(11," Product Not in POS "),r(),o(12,"th",12),c(13,"Last Sync"),r(),m(14,"th",13),r()(),o(15,"tbody"),A(16,st,25,26,"tr",null,B),h(18,"async"),r()()()),e&2){let i,n=p();s(16),F((i=S(18,0,n.channels$))==null?null:i.Data)}}function dt(e,a){e&1&&(o(0,"div",5),m(1,"app-empty-state"),r())}var kt=(()=>{let a=class a{constructor(){this.productService=C(tt),this.toastr=C(H),this.dialog=C(W),this.authService=C(J),this.scanProductRole=K.ProductScan;let n=this.authService;this.destroy$=new E,this.channelOptions=n.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(n,t){this.productService.getTotalProductLive(n).pipe(b(this.destroy$)).subscribe(l=>{t.Count=l.Count})}onScanChannel(n){this.dialog.open(Z,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:n.ID},disabledChannelOption:!0}}).afterClosed().pipe(P(t=>T.IsNotEmpty(t))).subscribe(t=>{this.scanAllProduct(n.ID,t)})}scanAllProduct(n,t){let l=this.productService.findChannelById(n,this.channelOptions);this.productService.scanAll(t.ChannelID,t.ScanFull,t.UpdatedProduct,t.Async).pipe(P(d=>d)).subscribe(d=>{t.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(d,l,!t.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(n){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(n).pipe(b(this.destroy$)).subscribe(l=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(n){return T.getChannelLogoByTypeId(n)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=O({type:a,selectors:[["app-channel-statistic"]],decls:8,vars:5,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngxPermissionsOnly"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"]],template:function(t,l){if(t&1&&(o(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),w(5,pt,19,2,"div",4),h(6,"async"),$(7,dt,2,0,"div",5),r()()()()()),t&2){let d;u("hideSearchBox",!0)("hideSearchDropdown",!0),s(5),I(((d=S(6,3,l.channels$))==null||d.Data==null?null:d.Data.length)>0?5:7)}},dependencies:[X,Q,z,G,Y,et,q,U,R],encapsulation:2});let e=a;return e})();export{kt as ChannelStatisticComponent};
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
import{a as pe,b as se}from"./chunk-K5WSFDNA.js";import{a as ue}from"./chunk-
|
|
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 +1 @@
|
|
|
1
|
-
import{a as re,b as pe}from"./chunk-TVEI5B2O.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as ne,b as ie,d as ae,e as oe}from"./chunk-BZWZ64N5.js";import{a as le}from"./chunk-27DIE2YS.js";import{b as te}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JRCXHF2X.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.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 X}from"./chunk-
|
|
1
|
+
import{a as re,b as pe}from"./chunk-TVEI5B2O.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as ne,b as ie,d as ae,e as oe}from"./chunk-BZWZ64N5.js";import{a as le}from"./chunk-27DIE2YS.js";import{b as te}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JRCXHF2X.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.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 X}from"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{c as K}from"./chunk-UPRDDI4K.js";import{A as ee,h as Y,m as Z}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as Q}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as G,w as k,y as H,z as U}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as B,Nb as P,Nc as s,Oc as f,Pc as y,Rc as z,Sc as A,Tc as V,Z as D,_c as J,aa as M,ac as R,bc as T,cc as $,dc as F,fc as j,g as L,gc as O,hc as h,ic as a,id as c,jc as o,jd as d,kc as u,kd as W,ma as w,mb as S,ob as p,ra as g,rc as q,v as I,wc as v,ya as E,yc as x,za as N}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{let t=class t{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(M(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=_(_({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=w({token:t,factory:t.\u0275fac});let i=t;return i})();function se(i,t){if(i&1&&(a(0,"span",10),u(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,S)("alt",l.Name),p(),y(" ",l.Name," ")}}function ce(i,t){if(i&1&&(a(0,"tr")(1,"td"),u(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td")(6,"span",18),s(7),c(8,"json"),o()(),a(9,"td"),s(10),c(11,"json"),o(),a(12,"td"),s(13),c(14,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,S),p(2),y(" ",l.ChannelName," "),p(3),f(d(8,5,l.Request)),p(3),f(d(11,7,l.Response)),p(3),f(W(14,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function de(i,t){if(i&1){let l=q();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),j(13,ce,15,12,"tr",null,F),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),v("page",function(e){E(l);let r=x();return N(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=x();p(13),O((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function he(i,t){i&1&&(a(0,"div",9),u(1,"app-empty-state"),o())}var je=(()=>{let t=class t{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=K.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=B({type:t,selectors:[["app-channel-log"]],features:[J([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),V("ngModelChange",function(C){return A(r.channelID,C)||(r.channelID=C),C}),P(7,se,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),R(12,de,21,13,"div",8),c(13,"async"),T(14,he,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),z("ngModel",r.channelID),p(6),$(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[G,te,le,pe,re,oe,ae,ne,ie,ee,Y,Z,k,U,H],encapsulation:2});let i=t;return i})();export{je as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le}from"./chunk-
|
|
1
|
+
import{a as le}from"./chunk-VBVBTC2P.js";import{a as M}from"./chunk-L6CRWJ2O.js";import{a as ae}from"./chunk-PV4OJSZI.js";import{a as re}from"./chunk-YKKHSYDW.js";import{a as ne}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as ie}from"./chunk-ZZYFVEJO.js";import{a as te}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 ee}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as $}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 Z}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 Y,c as K,h as Q,m as U,o as X}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 G,B as J,w as j,y as q}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as D,Ia as W,Nc as a,Oc as w,Rc as C,Sc as f,Tc as g,Uc as k,Vc as A,Wc as z,Z as P,_c as H,ac as F,cc as N,dc as L,fc as B,gc as I,hc as h,ic as e,id as b,jc as t,jd as E,kc as y,kd as R,ob as r,ra as O,rc as v,wc as x,ya as u,yc as S,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as T,b as V}from"./chunk-66YHNWRR.js";function oe(d,m){if(d&1&&(e(0,"tr")(1,"td"),a(2),t(),e(3,"td"),y(4,"order-link",26),t(),e(5,"td"),a(6),t(),e(7,"td"),a(8),b(9,"number"),t(),e(10,"td"),a(11),b(12,"date"),t(),e(13,"td"),y(14,"app-channel-logo",27),t()()),d&2){let o=m.$implicit;r(2),w(o.Outlet),r(2),h("order",o),r(2),w(o.Customer),r(2),w(E(9,6,o.Amount)),r(3),w(R(12,8,o.Created,"dd MMM yyyy HH:mm")),r(3),h("typeId",o==null?null:o.TypeID)}}function de(d,m){if(d&1){let o=v();e(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),t(),e(6,"th",21),a(7,"Order number"),t(),e(8,"th"),a(9,"Customer"),t(),e(10,"th",22),a(11,"Amount"),t(),e(12,"th",23),a(13," Created On "),t(),e(14,"th",24),a(15,"Channel"),t()()(),e(16,"tbody"),B(17,oe,15,11,"tr",null,L),t()(),e(19,"app-custom-paginator",25),x("next",function(){u(o);let p=S();return c(p.initCancelledOrders())})("previous",function(){u(o);let p=S();return c(p.initCancelledOrders())}),t()()}if(d&2){let o=S(),l=z(0);r(17),I(l),r(2),h("filter",o.filter())("totaldata",l==null?null:l.length)("paginationTotal",l==null?null:l.length)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}function me(d,m){d&1&&(e(0,"div",16),y(1,"app-empty-state"),t())}var Pe=(()=>{let m=class m{constructor(){this.orderService=O(M),this.filter=W({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:l=>{this.initFromDate(l)},error:l=>{console.error("Error fetching default date:",l),this.initFromDate(null)}})}initFromDate(l){this.filter.update(p=>V(T({},p),{From:l})),this.initCancelledOrders()}initCancelledOrders(){this.cancelledOrders$=this.orderService.getCancelledOrders(this.filter()).pipe(P(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=D({type:m,selectors:[["app-cancelled"]],features:[H([M])],decls:34,vars:11,consts:[["headerTitle","Cancelled","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-regular","fa-tv","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","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"],[3,"order"],[3,"typeId"]],template:function(p,n){if(p&1){let s=v();k(0),b(1,"async"),e(2,"mainpanel",0),x("onSubmit",function(){return u(s),c(n.initCancelledOrders())}),g("textChange",function(i){return u(s),f(n.filter().Number,i)||(n.filter().Number=i),c(i)}),e(3,"actions")(4,"a",1),y(5,"i",2),e(6,"span"),a(7,"Order Fulfillment Display"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),g("ngModelChange",function(i){return u(s),f(n.filter().ListChannelID,i)||(n.filter().ListChannelID=i),c(i)}),t()(),e(13,"div",5)(14,"label",3),a(15,"From/To"),t(),e(16,"div",6)(17,"datepicker",7),g("dateChange",function(i){return u(s),f(n.filter().From,i)||(n.filter().From=i),c(i)}),t()(),e(18,"div")(19,"datepicker",8),g("dateChange",function(i){return u(s),f(n.filter().To,i)||(n.filter().To=i),c(i)}),t()()(),e(20,"div",5)(21,"label",9),a(22,"Page Number"),t(),e(23,"input",10),g("ngModelChange",function(i){return u(s),f(n.filter().PageNumber,i)||(n.filter().PageNumber=i),c(i)}),t()(),e(24,"div",5)(25,"label",9),a(26,"Page Size"),t(),e(27,"input",11),g("ngModelChange",function(i){return u(s),f(n.filter().PageSize,i)||(n.filter().PageSize=i),c(i)}),t()()(),e(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),F(32,de,20,5,"div",15)(33,me,2,0,"div",16),t()()()()()}if(p&2){let s=A(E(1,8,n.cancelledOrders$));r(2),C("text",n.filter().Number),r(10),h("multiple",!0),C("ngModel",n.filter().ListChannelID),r(5),C("date",n.filter().From),r(2),C("date",n.filter().To),r(4),C("ngModel",n.filter().PageNumber),r(4),C("ngModel",n.filter().PageSize),r(5),N((s==null?null:s.length)>0?32:33)}},dependencies:[J,ee,te,ie,Y,K,X,Q,U,ae,$,Z,le,re,ne,j,G,q],encapsulation:2});let d=m;return d})();export{Pe as CancelledComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ve,b as xe}from"./chunk-RIIIECQH.js";import{a as ge}from"./chunk-JWDQVXQP.js";import{a as Ce,b as Se}from"./chunk-K5WSFDNA.js";import{a as be}from"./chunk-TVFILHVN.js";import{a as N}from"./chunk-L6CRWJ2O.js";import{a as ye}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as fe}from"./chunk-WG34QKGX.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as he}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}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 ue}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ce}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 pe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-7K6U3ABQ.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ne}from"./chunk-UPRDDI4K.js";import{A as me,b as re,c as le,h as ae,m as se,o as de}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as oe}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as te,B as ie,w as $,y as ee}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as K,Cc as H,Dc as Q,Ec as j,Hb as D,Ia as P,Mc as q,Nc as d,Oc as w,Pc as M,Rc as C,Sc as S,Tc as y,Uc as U,Vc as G,Wc as F,Z as I,_c as J,ac as v,ad as X,cc as x,dc as B,ea as k,fc as A,gc as z,hc as f,ic as t,id as V,jc as n,jd as O,kc as h,kd as Y,mb as W,ob as a,pd as Z,ra as E,rc as T,wc as g,ya as p,yc as u,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as R,b as L}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=l=>({"td-cell-hover":l});function Ve(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(l,m){if(l&1&&h(0,"variants-dropdown",38),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Ee(l,m){if(l&1&&h(0,"variant-with-image",39),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Oe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),M("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(l,m){if(l&1){let e=T();t(0,"div",41)(1,"button",45),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",46),n()()}}function Fe(l,m){if(l&1){let e=T();t(0,"button",47),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Ne(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),V(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),V(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),d(23),n()()(),t(24,"td"),v(25,Re,1,1,"variants-dropdown",38)(26,Ee,1,1,"variant-with-image",39),n(),t(27,"td",40),d(28),V(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),d(35),n(),v(36,Oe,2,1,"span"),n(),t(37,"small"),d(38),n()(),v(39,Pe,3,0,"div",41),n()(),t(40,"td",41),v(41,Fe,2,0,"button",44),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),M(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(5),M(" ",e.Customer," "),a(),q(X(25,Me,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?25:26),a(3),w(O(29,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),a(2),M(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?41:-1)}}function Le(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th"),d(10,"Items"),n(),t(11,"th",26),d(12,"Amount"),n(),t(13,"th",27),d(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),A(17,Ne,42,27,"tr",null,B),n()(),t(19,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(17),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function Ie(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var st=(()=>{let m=class m{constructor(){this.toastr=E(oe),this.orderService=E(N),this.fulfillmentService=E(ve),this.channelType=ne,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(R({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>R(R({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(Te,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["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-regular","fa-tv","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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),V(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Ve,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Le,20,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,we));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,ue,_e,he,me,le,de,re,ae,se,Ce,Se,ye,be,ce,pe,xe,fe,$,te,ee,ge],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{st as ReadyToShipComponent};
|
|
1
|
+
import{a as ve,b as xe}from"./chunk-RIIIECQH.js";import{a as ge}from"./chunk-JWDQVXQP.js";import{a as Ce,b as Se}from"./chunk-K5WSFDNA.js";import{a as be}from"./chunk-VBVBTC2P.js";import{a as N}from"./chunk-L6CRWJ2O.js";import{a as ye}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as fe}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as he}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}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 ue}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ce}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 pe}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{b as ne}from"./chunk-UPRDDI4K.js";import{A as me,b as re,c as le,h as ae,m as se,o as de}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as oe}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as te,B as ie,w as $,y as ee}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as K,Cc as H,Dc as Q,Ec as j,Hb as D,Ia as P,Mc as q,Nc as d,Oc as w,Pc as M,Rc as C,Sc as S,Tc as y,Uc as U,Vc as G,Wc as F,Z as I,_c as J,ac as v,ad as X,cc as x,dc as B,ea as k,fc as A,gc as z,hc as f,ic as t,id as V,jc as n,jd as O,kc as h,kd as Y,mb as W,ob as a,pd as Z,ra as E,rc as T,wc as g,ya as p,yc as u,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as R,b as L}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=l=>({"td-cell-hover":l});function Ve(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(l,m){if(l&1&&h(0,"variants-dropdown",38),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Ee(l,m){if(l&1&&h(0,"variant-with-image",39),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Oe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),M("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(l,m){if(l&1){let e=T();t(0,"div",41)(1,"button",45),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",46),n()()}}function Fe(l,m){if(l&1){let e=T();t(0,"button",47),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Ne(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),V(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),V(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),d(23),n()()(),t(24,"td"),v(25,Re,1,1,"variants-dropdown",38)(26,Ee,1,1,"variant-with-image",39),n(),t(27,"td",40),d(28),V(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),d(35),n(),v(36,Oe,2,1,"span"),n(),t(37,"small"),d(38),n()(),v(39,Pe,3,0,"div",41),n()(),t(40,"td",41),v(41,Fe,2,0,"button",44),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),M(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(5),M(" ",e.Customer," "),a(),q(X(25,Me,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?25:26),a(3),w(O(29,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),a(2),M(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?41:-1)}}function Le(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th"),d(10,"Items"),n(),t(11,"th",26),d(12,"Amount"),n(),t(13,"th",27),d(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),A(17,Ne,42,27,"tr",null,B),n()(),t(19,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(17),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function Ie(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var st=(()=>{let m=class m{constructor(){this.toastr=E(oe),this.orderService=E(N),this.fulfillmentService=E(ve),this.channelType=ne,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(R({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>R(R({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(Te,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["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-regular","fa-tv","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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),V(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Ve,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Le,20,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,we));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,ue,_e,he,me,le,de,re,ae,se,Ce,Se,ye,be,ce,pe,xe,fe,$,te,ee,ge],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{st as ReadyToShipComponent};
|
|
@@ -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-G3KVHCET.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-WCX3T6LK.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-GD6ZN56B.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-7K6U3ABQ.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-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 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-TQROQOXU.js";import{a as x}from"./chunk-
|
|
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};
|