marketplacepos 5.48.0 → 5.48.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/3rdpartylicenses.txt +26 -26
- package/Marketplace/{chunk-222IOSGU.js → chunk-2F4DTZCZ.js} +1 -1
- package/Marketplace/{chunk-3LU2SFN4.js → chunk-2IASUYTM.js} +1 -1
- package/Marketplace/chunk-2USFVKEX.js +1 -0
- package/Marketplace/chunk-36U7D4LI.js +1 -0
- package/Marketplace/chunk-3JYZF65T.js +1 -0
- package/Marketplace/chunk-3K2EKA5O.js +1 -0
- package/Marketplace/{chunk-ZV7EHPNJ.js → chunk-3L7Y6LG6.js} +1 -1
- package/Marketplace/chunk-4JDI3AL5.js +1 -0
- package/Marketplace/{chunk-5YBWBAQS.js → chunk-4YCSITNV.js} +1 -1
- package/Marketplace/{chunk-55BTWXFX.js → chunk-5BSPSA4O.js} +1 -1
- package/Marketplace/chunk-5CHTDUME.js +1 -0
- package/Marketplace/chunk-5KYN6Y7M.js +1 -0
- package/Marketplace/{chunk-56BH43Y7.js → chunk-5X2E3W32.js} +1 -1
- package/Marketplace/{chunk-WW7F6LSG.js → chunk-5X2L45XK.js} +1 -1
- package/Marketplace/chunk-6EORXONU.js +4 -0
- package/Marketplace/{chunk-34UF36YY.js → chunk-6OIMOM7S.js} +1 -1
- package/Marketplace/{chunk-J2BPOHP6.js → chunk-6OJQRHIZ.js} +1 -1
- package/Marketplace/{chunk-ZAUKG4R6.js → chunk-6PW6S7MI.js} +1 -1
- package/Marketplace/chunk-6XDT56RT.js +2 -0
- package/Marketplace/{chunk-JOKDW6WD.js → chunk-7DT7FQ2T.js} +1 -1
- package/Marketplace/{chunk-KKB4B7FU.js → chunk-7GY4O2UX.js} +3 -3
- package/Marketplace/chunk-7SB4C4PT.js +1 -0
- package/Marketplace/chunk-A7PUMY67.js +1 -0
- package/Marketplace/chunk-ADKAX3OO.js +1 -0
- package/Marketplace/chunk-AEVLZ7NS.js +1 -0
- package/Marketplace/{chunk-NECWUPZQ.js → chunk-AFIF6VRM.js} +1 -1
- package/Marketplace/chunk-AGBJEXIM.js +1 -0
- package/Marketplace/chunk-ALPG22RQ.js +1 -0
- package/Marketplace/{chunk-DRTRU4DB.js → chunk-B6F5PDL5.js} +1 -1
- package/Marketplace/{chunk-HERBJRWM.js → chunk-BXYXVBXP.js} +1 -1
- package/Marketplace/{chunk-KWNXPX2M.js → chunk-C6JHPCLF.js} +1 -1
- package/Marketplace/{chunk-B4QCGMST.js → chunk-C7N6EI73.js} +1 -1
- package/Marketplace/{chunk-PQEXTCFW.js → chunk-CAZ7U2IL.js} +10 -10
- package/Marketplace/chunk-CBU473N2.js +1 -0
- package/Marketplace/{chunk-UNGNRJ2B.js → chunk-CLQGGKN6.js} +1 -1
- package/Marketplace/chunk-CT6UFONR.js +1 -0
- package/Marketplace/{chunk-IO2TWJDO.js → chunk-DAUML5UD.js} +1 -1
- package/Marketplace/chunk-DH5CXAEM.js +1 -0
- package/Marketplace/chunk-DHPNXR6E.js +1 -0
- package/Marketplace/chunk-DTAHV4GM.js +1 -0
- package/Marketplace/{chunk-MQXW3UAW.js → chunk-DXYMG6QK.js} +1 -1
- package/Marketplace/chunk-E3EBAWLJ.js +1 -0
- package/Marketplace/chunk-E66QUDQF.js +1 -0
- package/Marketplace/chunk-E6ZWL77N.js +1 -0
- package/Marketplace/chunk-EDEZ3JLR.js +4 -0
- package/Marketplace/{chunk-OROFEDQN.js → chunk-FCEXPGTK.js} +1 -1
- package/Marketplace/chunk-FCFCTT5A.js +1 -0
- package/Marketplace/chunk-FHER4TFY.js +1 -0
- package/Marketplace/{chunk-VZSHSSQZ.js → chunk-FKGKMEDE.js} +1 -1
- package/Marketplace/chunk-FRZCC6KZ.js +1 -0
- package/Marketplace/chunk-GG3MDS4C.js +1 -0
- package/Marketplace/{chunk-ONU4O7N2.js → chunk-GPHNPV7O.js} +1 -1
- package/Marketplace/{chunk-J7FL3VT4.js → chunk-GURSK3ZV.js} +1 -1
- package/Marketplace/{chunk-N3WBRUNI.js → chunk-GVI6GJHY.js} +1 -1
- package/Marketplace/chunk-GX6JPDQ5.js +1 -0
- package/Marketplace/chunk-H7GV5SNI.js +5 -0
- package/Marketplace/{chunk-S32PEKW5.js → chunk-HKHNRMPT.js} +1 -1
- package/Marketplace/{chunk-5O33CV4F.js → chunk-I723PUUO.js} +1 -1
- package/Marketplace/{chunk-PGR6BEOA.js → chunk-I7C6W3RB.js} +1 -1
- package/Marketplace/{chunk-R6SCDZGW.js → chunk-IDH7MCR3.js} +1 -1
- package/Marketplace/chunk-ILW6ZFFV.js +1 -0
- package/Marketplace/chunk-J6BQDYXO.js +1 -0
- package/Marketplace/{chunk-TCWEUEBR.js → chunk-J6CZKQ53.js} +1 -1
- package/Marketplace/chunk-JBEKD57G.js +1 -0
- package/Marketplace/{chunk-G6P2UZU4.js → chunk-JW7NES7L.js} +1 -1
- package/Marketplace/{chunk-O4HOLA7Y.js → chunk-KSVJCX2D.js} +1 -1
- package/Marketplace/chunk-KVDREHOE.js +1 -0
- package/Marketplace/chunk-KZSTYKIP.js +1 -0
- package/Marketplace/{chunk-76CPUGUB.js → chunk-L76NLJD7.js} +2 -2
- package/Marketplace/{chunk-XBDQR2BA.js → chunk-LABF6W37.js} +1 -1
- package/Marketplace/{chunk-MAMCOUZ6.js → chunk-M2BYW5SR.js} +1 -1
- package/Marketplace/{chunk-P6TDS7UT.js → chunk-M65Z55OS.js} +1 -1
- package/Marketplace/chunk-MKADKY44.js +2 -0
- package/Marketplace/{chunk-NYJPPKGX.js → chunk-NCKPMA6Q.js} +1 -1
- package/Marketplace/{chunk-TDCMI7YC.js → chunk-O2YF5VGD.js} +1 -1
- package/Marketplace/chunk-O4EO3YBL.js +1 -0
- package/Marketplace/{chunk-Y6WFE3L2.js → chunk-OBF4XVU7.js} +1 -1
- package/Marketplace/chunk-PDCVMSLL.js +1 -0
- package/Marketplace/chunk-PLLHTY6O.js +15 -0
- package/Marketplace/chunk-PMVDQ2OP.js +1 -0
- package/Marketplace/chunk-PZKN5FIT.js +1 -0
- package/Marketplace/chunk-Q4TAOZ73.js +1 -0
- package/Marketplace/chunk-QCV5XC3U.js +266 -0
- package/Marketplace/{chunk-GV3NEJJ6.js → chunk-QFSA7CU4.js} +1 -1
- package/Marketplace/{chunk-XUBQATMN.js → chunk-R2XT5M5F.js} +1 -1
- package/Marketplace/chunk-RCBY7EIY.js +1 -0
- package/Marketplace/{chunk-J5BZDPXE.js → chunk-RQQWNLDZ.js} +1 -1
- package/Marketplace/chunk-S5R6MCNP.js +5 -0
- package/Marketplace/{chunk-RJFFTIAO.js → chunk-S7CKRTJV.js} +1 -1
- package/Marketplace/{chunk-PZB3GQWT.js → chunk-SHUYFOQI.js} +1 -1
- package/Marketplace/{chunk-SILAIDPV.js → chunk-STYL7ETF.js} +1 -1
- package/Marketplace/{chunk-E7FHMF3J.js → chunk-SZVL42NR.js} +1 -1
- package/Marketplace/chunk-T7HRAMHR.js +1 -0
- package/Marketplace/chunk-TIIGDXIJ.js +2 -0
- package/Marketplace/{chunk-CEXUETT6.js → chunk-TJYYRHZZ.js} +1 -1
- package/Marketplace/{chunk-DYQ3BWPB.js → chunk-TXOZULMZ.js} +1 -1
- package/Marketplace/chunk-TYQY4WPY.js +1 -0
- package/Marketplace/chunk-UBTALPOC.js +2 -0
- package/Marketplace/{chunk-6XT3JSG5.js → chunk-UCEZJNIL.js} +1 -1
- package/Marketplace/chunk-VWX2IX64.js +1 -0
- package/Marketplace/{chunk-W7YZT7CH.js → chunk-VYQD3A3M.js} +1 -1
- package/Marketplace/{chunk-37NOSLQL.js → chunk-WHHW4IZT.js} +1 -1
- package/Marketplace/{chunk-74JHI4MS.js → chunk-WNUTNP6I.js} +1 -1
- package/Marketplace/{chunk-DQOO5YZC.js → chunk-WRK3ZHRX.js} +1 -1
- package/Marketplace/chunk-X6COQADC.js +1 -0
- package/Marketplace/{chunk-7Y2L4CNS.js → chunk-XDBH7EGC.js} +1 -1
- package/Marketplace/chunk-XK4RP5MQ.js +1 -0
- package/Marketplace/{chunk-3I2V337G.js → chunk-XLIPGDSC.js} +1 -1
- package/Marketplace/chunk-Y77WYZ6Y.js +5 -0
- package/Marketplace/{chunk-NLSVMXR7.js → chunk-ZKIO2ZQ6.js} +1 -1
- package/Marketplace/chunk-ZME22WYI.js +1 -0
- package/Marketplace/{chunk-A7YRNCQP.js → chunk-ZTHO6JJM.js} +1 -1
- package/Marketplace/chunk-ZUL6ZHSW.js +1 -0
- package/Marketplace/{chunk-UW3UCIOY.js → chunk-ZW2TMVZP.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-YJKBQ3LW.js +1 -0
- package/Marketplace/{styles-3SQUCHWS.css → styles-ANCVZJP7.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-2FSRCK7Y.js +0 -1
- package/Marketplace/chunk-2LCP6ZFH.js +0 -1
- package/Marketplace/chunk-3YDWTOSL.js +0 -1
- package/Marketplace/chunk-44URQXRM.js +0 -1
- package/Marketplace/chunk-465DKI6M.js +0 -1
- package/Marketplace/chunk-46IROEMV.js +0 -2
- package/Marketplace/chunk-4R746B4G.js +0 -1
- package/Marketplace/chunk-573EEV7X.js +0 -1
- package/Marketplace/chunk-5S7ONNKP.js +0 -1
- package/Marketplace/chunk-6ZEQRKBC.js +0 -1
- package/Marketplace/chunk-7HVOZWYY.js +0 -1
- package/Marketplace/chunk-7U32FNM2.js +0 -2
- package/Marketplace/chunk-7VRLCSNB.js +0 -1
- package/Marketplace/chunk-AL5RTE5M.js +0 -1
- package/Marketplace/chunk-AXC6LM6T.js +0 -1
- package/Marketplace/chunk-BHGEKKCM.js +0 -1
- package/Marketplace/chunk-BLHKSSK6.js +0 -1
- package/Marketplace/chunk-BXOHTPGP.js +0 -1
- package/Marketplace/chunk-CNTLG54D.js +0 -1
- package/Marketplace/chunk-DLXWO2XC.js +0 -1
- package/Marketplace/chunk-DPQMNLFO.js +0 -1
- package/Marketplace/chunk-E5JZCOHZ.js +0 -1
- package/Marketplace/chunk-EMLE4JDW.js +0 -1
- package/Marketplace/chunk-FFTZPZOW.js +0 -5
- package/Marketplace/chunk-FHZNWINZ.js +0 -1
- package/Marketplace/chunk-GLMM3CVD.js +0 -1
- package/Marketplace/chunk-GQCDEPDY.js +0 -1
- package/Marketplace/chunk-GZLXMT7F.js +0 -1
- package/Marketplace/chunk-HG4R6CUP.js +0 -1
- package/Marketplace/chunk-HU7LMMZJ.js +0 -1
- package/Marketplace/chunk-I3IA6MAD.js +0 -1
- package/Marketplace/chunk-IZZQQW5G.js +0 -5
- package/Marketplace/chunk-JLVWTKDH.js +0 -1
- package/Marketplace/chunk-JUO4RKIH.js +0 -1
- package/Marketplace/chunk-L2GMXVN6.js +0 -1
- package/Marketplace/chunk-M7U5T2ZP.js +0 -1
- package/Marketplace/chunk-MEER4VNV.js +0 -1
- package/Marketplace/chunk-N26QQL77.js +0 -1
- package/Marketplace/chunk-NOIKC7TF.js +0 -1
- package/Marketplace/chunk-ODQVHQPB.js +0 -15
- package/Marketplace/chunk-PE7QBBA6.js +0 -1
- package/Marketplace/chunk-PNUEO4J2.js +0 -1
- package/Marketplace/chunk-PS43OK3J.js +0 -1
- package/Marketplace/chunk-SNSROU6N.js +0 -1
- package/Marketplace/chunk-SUTHLGCO.js +0 -266
- package/Marketplace/chunk-TUJHFVOP.js +0 -1
- package/Marketplace/chunk-UI5ITL7Z.js +0 -4
- package/Marketplace/chunk-XFIUNEOU.js +0 -1
- package/Marketplace/chunk-XW2CGM4G.js +0 -5
- package/Marketplace/chunk-YJTPDV4D.js +0 -1
- package/Marketplace/chunk-YKEAAH3N.js +0 -2
- package/Marketplace/chunk-YTUPRTC2.js +0 -1
- package/Marketplace/chunk-ZS465QKM.js +0 -2
- package/Marketplace/main-NBCLYU5Y.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as jt}from"./chunk-EYT2YJGK.js";import{a as Ht,b as Ie}from"./chunk-RNWHARPK.js";import{c as we,d as De,e as Pe}from"./chunk-6KWG6O5L.js";import{a as zt}from"./chunk-HK5FXZE4.js";import{a as _e}from"./chunk-A6QXXKPR.js";import{a as Rt,b as rt}from"./chunk-M4ZE35XK.js";import{a as $t,g as st}from"./chunk-L7WZ6U4T.js";import{b as Ft,c as Kt,d as it,e as nt,f as ot}from"./chunk-LOWGZOML.js";import{A as Pt,B as Ye,E as Ot,I as Et,K as Lt,Q as Je,T as N,X as et,Y as tt,ca as Vt,g as Xe,ja as Nt,m as wt,oa as Bt,q as Dt,ra as At,sa as xe,u as ge,v as fe}from"./chunk-5PMKN6PM.js";import{a as T}from"./chunk-YJTPDV4D.js";import{e as Me}from"./chunk-OXWPYJNB.js";import{c as Qe,d as We,f as de,i as he}from"./chunk-XBIHN6D3.js";import{b as f,c as qe}from"./chunk-BLHKSSK6.js";import{b as Oe,c as Ee,d as Tt,e as Le,f as Ve,g as Mt,h as Fe}from"./chunk-UI5ITL7Z.js";import{A as F,h as Se,m as Te}from"./chunk-L3W6SG2T.js";import{v as kt,w as St}from"./chunk-SILAIDPV.js";import{G as Ct,I as Ze,e as vt,f as Ge,g as Ue,h as yt,j as ke,m as w,n as ue}from"./chunk-LNJUGHOX.js";import{$b as J,$c as xt,Ac as ve,Bc as H,Cc as P,Dc as O,Fd as R,G as X,Gb as k,Gd as Q,Ha as x,Hb as ft,Hc as ye,Jc as ze,Kb as Re,Kc as Ce,Lc as I,Mb as v,Mc as d,Nc as D,Oa as dt,Oc as re,Qa as ht,Qc as ae,Rc as le,Sc as ce,Yb as je,Zb as M,Zc as He,_c as pe,aa as $,ad as It,bc as ee,cc as te,ec as ie,fc as ne,gc as l,hc as c,hd as G,ic as m,jc as y,jd as U,kb as $e,kd as me,la as mt,lb as _t,ma as E,na as ut,nb as p,nc as oe,oc as se,od as Z,pa as Ae,pd as bt,qc as S,ra as b,sb as L,sd as q,td as V,v as W,vc as g,xa as h,xc as a,ya as _,yb as gt,za as Ke,zb as Y}from"./chunk-ZYJ6LAJ3.js";import{a as j,b as z}from"./chunk-66YHNWRR.js";var Gt=(()=>{let s=class s{constructor(){this.httpService=b(Me)}getShippingOptions(t,i){return this.httpService.post(T.GetShopeeShippingOptions,{OrderNumber:t,ShopID:i})}pickupOrder(t){return this.httpService.post(T.ShopeeSelectShipping,t)}pickupMultipleOrders(t){return this.httpService.post(T.ShopeeSelectMultipleShipping,t)}dropOffOrder(t,i){let n={OrderNumber:t,ShopID:i,dropoff:{}};return this.httpService.post(T.ShopeeSelectShipping,n)}dropOffMultipleOrders(t){return this.httpService.post(T.ShopeeSelectMultipleShipping,t)}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();var Ut=(()=>{let s=class s{constructor(){this.httpService=b(Me)}getShippingOptions(t,i){return this.httpService.post(T.GetTiktokShippingOptions,{OrderNumber:t,ShopID:i}).pipe(W(n=>this.formatDatePickUpOptions(n)))}pickupOrder(t){return this.httpService.post(T.TiktokSelectShipping,t)}pickupMultipleOrders(t){return this.httpService.post(T.TiktokSelectMultipleShipping,t)}dropOffOrder(t,i){let n={handover_method:"DROP_OFF",PackageID:t,ShopID:i};return this.httpService.post(T.TiktokSelectShipping,n)}dropOffMultipleOrders(t){return this.httpService.post(T.TiktokSelectMultipleShipping,t)}formatDatePickUpOptions(t){return t?.Options?.pickup_slots&&(t.Options.pickup_slots=t?.Options?.pickup_slots.map(i=>{let n=qe.convertTimestampToDate(i.start_time),r=qe.convertTimestampToDate(i.end_time);return i.start_date=n,i.end_date=r,i})),t}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();function ii(o,s){if(o&1){let e=S();c(0,"div",10),g("click",function(){h(e);let i=a();return _(i.onSelectDelivery("DROP_OFF"))}),c(1,"div",11),y(2,"i",12),c(3,"h3",13),d(4,"Drop off"),m()(),c(5,"p",14),d(6," You can drop off your package at the nearest shipping counter in your city. "),m()()}if(o&2){let e=a();ze("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function ni(o,s){if(o&1){let e=S();c(0,"div",10),g("click",function(){h(e);let i=a();return _(i.onSelectDelivery("PICK_UP"))}),c(1,"div",11),y(2,"i",15),c(3,"h3",16),d(4,"Pick up"),m()(),c(5,"p",17),d(6," The courier will collect the package from your address. "),m()()}if(o&2){let e=a();ze("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var at=(()=>{let s=class s{constructor(){this.data=b(Ee),this.dialogRef=b(Oe),this.selectedDelivery=x("DROP_OFF"),this.showPickup=x(!0),this.showDropOff=x(!0),this.initOptionsCondition()}onSelectDelivery(t){this.selectedDelivery.set(t)}initOptionsCondition(){switch(this.data.channelType){case f.Shopee:break;case f.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),d(4,"Delivery Order"),m(),c(5,"div",3),d(6,"Your selected order(s) will be set to"),m()(),c(7,"div")(8,"i",4),g("click",function(){return n.onClose()}),m()()()(),c(9,"mat-dialog-content",5)(10,"div",6),J(11,ii,7,4,"div",7),J(12,ni,7,4,"div",7),m(),c(13,"div",8)(14,"button",9),g("click",function(){return n.onConfirm()}),d(15," OK "),m()()()),i&2&&(p(11),ee(n.showPickup()?11:-1),p(),ee(n.showDropOff()?12:-1))},dependencies:[w,Fe,Le,Ve],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]});let o=s;return o})();function ri(o,s){if(o&1&&(c(0,"ng-option",3),d(1),m()),o&2){let e=s.$implicit;l("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),p(),D(e==null?null:e.address)}}function ai(o,s){if(o&1&&(c(0,"ng-option",6)(1,"span",7),d(2),G(3,"date"),m(),c(4,"span"),d(5),m()()),o&2){let e=s.$implicit;l("value",e==null?null:e.pickup_time_id),p(2),D(U(3,3,e==null?null:e.date,"d MMMM")),p(3),D(e==null?null:e.time_text)}}var qt=(()=>{let s=class s{constructor(){this.shippingOptions=V(),this.onFormChanges=q(),this.addressList=Z(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=x(null),this.timeOptions=x(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=x(null)}onAddressChange(t){let i=this.addressList().find(n=>n.address_id===t);this.timeOptions.set(this.convertTimestampToDate(i?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(t){return t.map(i=>{let n=new Date(i.date*1e3);return z(j({},i),{date:n})})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"label",1),d(2,"Address"),m(),c(3,"ng-select",2),ce("ngModelChange",function(u){return le(n.selectedShipping,u)||(n.selectedShipping=u),u}),g("ngModelChange",function(u){return n.onAddressChange(u),n.onValueChanges()}),ie(4,ri,2,3,"ng-option",3,te),m()(),c(6,"div",0)(7,"label",4),d(8,"Date"),m(),c(9,"ng-select",5),ce("ngModelChange",function(u){return le(n.pickupTime,u)||(n.pickupTime=u),u}),g("ngModelChange",function(){return n.onValueChanges()}),ie(10,ai,6,6,"ng-option",6,te),m()()),i&2&&(p(3),l("clearable",!1),ae("ngModel",n.selectedShipping),p(),ne(n.addressList()),p(5),l("clearable",!1),ae("ngModel",n.pickupTime),p(),ne(n.timeOptions()))},dependencies:[w,Pe,De,we,F,Se,Te,St,kt,ke],encapsulation:2});let o=s;return o})();function li(o,s){if(o&1&&(c(0,"ng-option",3)(1,"span",4),d(2),G(3,"date"),m(),c(4,"span"),d(5),G(6,"date"),m(),c(7,"span",5),d(8,"-"),m(),c(9,"span"),d(10),G(11,"date"),m()()),o&2){let e=s.$implicit,t=s.$index;l("value",t),p(2),D(U(3,4,e==null?null:e.start_date,"d MMMM")),p(3),D(U(6,7,e==null?null:e.start_date,"HH:mm")),p(5),D(U(11,10,e==null?null:e.end_date,"HH:mm"))}}var Qt=(()=>{let s=class s{constructor(){this.shippingOptions=V(),this.onFormChanges=q(),this.timeOptions=Z(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=x(null)}onValueChanges(){let t=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:t?.start_time,end_time:t?.end_time})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"label",1),d(2,"Time"),m(),c(3,"ng-select",2),ce("ngModelChange",function(u){return le(n.selectedTimeIndex,u)||(n.selectedTimeIndex=u),u}),g("ngModelChange",function(){return n.onValueChanges()}),ie(4,li,12,13,"ng-option",3,te),m()()),i&2&&(p(3),l("clearable",!1),ae("ngModel",n.selectedTimeIndex),p(),ne(n.timeOptions()))},dependencies:[w,Pe,De,we,F,Se,Te,ke],encapsulation:2});let o=s;return o})();function ci(o,s){if(o&1){let e=S();c(0,"shopee-pickup",10),g("onFormChanges",function(i){h(e);let n=a();return _(n.onFormChanges(i))}),m()}if(o&2){let e=a();l("shippingOptions",e.dialogData.shippingOptions)}}function pi(o,s){if(o&1){let e=S();c(0,"tiktok-pickup",10),g("onFormChanges",function(i){h(e);let n=a();return _(n.onFormChanges(i))}),m()}if(o&2){let e=a();l("shippingOptions",e.dialogData.shippingOptions)}}var lt=(()=>{let s=class s{constructor(){this.dialogRef=b(Oe),this.dialogData=b(Ee),this.shippingOptions=x(this.dialogData.shippingOptions),this.channelType=x(this.dialogData.channelType),this.order=x(this.dialogData.order),this.channelTypeEnum=f,this.pickupData=x(null)}onFormChanges(t){this.pickupData.set(t)}onClose(){this.dialogRef.close()}onSave(){let t=this.generatePickupData();this.dialogRef.close(t)}generatePickupData(){let t=this.dialogData.multipleOrder??!1;switch(this.channelType()){case f.Shopee:return t?{pickup:this.pickupData()}:{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case f.Tiktok:return t?{pickup_slot:this.pickupData(),handover_method:"PICKUP"}:{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(i,n){if(i&1&&(c(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),d(4,"Set Pickup"),m(),c(5,"div",2)(6,"div",3),d(7,"Shipping Method"),m(),c(8,"div",3),d(9),m()()(),c(10,"div")(11,"i",4),g("click",function(){return n.onClose()}),m()()()(),c(12,"mat-dialog-content",5),J(13,ci,1,1,"shopee-pickup",6)(14,pi,1,1,"tiktok-pickup",6),m(),c(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),g("click",function(){return n.onClose()}),d(18," Cancel "),m(),c(19,"button",9),g("click",function(){return n.onSave()}),d(20," Ok "),m()()()),i&2){let r,u;p(9),re(" ",!((r=n.order())==null||r.LogisticService==null)&&r.LogisticService.Name?(r=n.order())==null||r.LogisticService==null?null:r.LogisticService.Name:"-"," "),p(4),ee((u=n.channelType())===n.channelTypeEnum.Shopee?13:u===n.channelTypeEnum.Tiktok?14:-1)}},dependencies:[w,Fe,Le,Mt,Ve,F,qt,Qt],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 7 Pro";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']});let o=s;return o})();var Jn=(()=>{let s=class s{constructor(){this.shopeeShippingService=b(Gt),this.tiktokShippingService=b(Ut),this.dialog=b(Tt)}setFulfillmentOrder(t){return this.getShippingOptions(t.Number,t.ShopID,t.MarketType).pipe($(i=>this.dialog.open(at,{height:"400px",width:"530px",data:{options:i,channelType:t.MarketType}}).afterClosed().pipe(X(n=>_e.IsNotEmpty(n)),W(n=>({type:n,order:t,options:i})),$(n=>n.type=="PICK_UP"?this.onPickupOrder(n.order,n.options):this.onDropOffOrder(n.order,n.options)))))}onPickupOrder(t,i){return this.dialog.open(lt,{width:"530px",data:{order:t,shippingOptions:i,channelType:t.MarketType,multipleOrder:!1},disableClose:!0}).afterClosed().pipe(X(n=>_e.IsNotEmpty(n)),$(n=>this.pickupOrder(t,n)))}pickupOrder(t,i){switch(t.MarketType){case f.Shopee:return this.shopeeShippingService.pickupOrder(i);case f.Tiktok:return this.tiktokShippingService.pickupOrder(i)}}onDropOffOrder(t,i){switch(t.MarketType){case f.Shopee:return this.shopeeShippingService.dropOffOrder(t.Number,t.ShopID);case f.Tiktok:let n=i?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(n,t.ShopID)}}setFulfillmentMultipleOrders(t){let i=t[0];return this.getShippingOptions(i.Number,i.ShopID,i.MarketType).pipe($(n=>this.dialog.open(at,{height:"400px",width:"530px",data:{options:n,channelType:i.MarketType}}).afterClosed().pipe(X(r=>_e.IsNotEmpty(r)),W(r=>({type:r,orders:t,options:n})))),$(n=>n.type=="PICK_UP"?this.openDialogPickupMultipleOrders(n.orders,n.options):this.dropOffMultipleOrder(n.orders,n.options)))}openDialogPickupMultipleOrders(t,i){let n=t[0];return this.dialog.open(lt,{width:"530px",data:{order:n,shippingOptions:i,channelType:n.MarketType,multipleOrder:!0},disableClose:!0}).afterClosed().pipe(X(r=>_e.IsNotEmpty(r)),$(r=>this.pickupMultipleOrder(t,r)))}pickupMultipleOrder(t,i){let n=t[0],r=this.generateMultiplePickupData(t,i);switch(n.MarketType){case f.Shopee:return this.shopeeShippingService.pickupOrder(r);case f.Tiktok:return this.tiktokShippingService.pickupOrder(r)}}generateMultiplePickupData(t,i){switch(t[0].MarketType){case f.Shopee:let n=t.map(u=>({OrderNumber:u.Number,ShopID:u.ShopID}));return i.List=n,i;case f.Tiktok:let r=t.map(u=>({PackageID:u.Number,ShopID:u.ShopID}));return i.List=r,i}}dropOffMultipleOrder(t,i){switch(t[0].MarketType){case f.Shopee:let r=this.generateMultipleDropOffData(t);return this.shopeeShippingService.dropOffMultipleOrders(r);case f.Tiktok:let u=i?.Form?.information?.PackageID,C=this.generateMultipleDropOffData(t,u);return this.tiktokShippingService.dropOffMultipleOrders(C)}}generateMultipleDropOffData(t,i){switch(t[0].MarketType){case f.Shopee:return t.map(C=>({OrderNumber:C.Number,ShopID:C.ShopID}));case f.Tiktok:return{List:t.map(C=>({PackageID:i,ShopID:C.ShopID})),handover_method:"DROP_OFF"}}}getShippingOptions(t,i,n){switch(n){case f.Shopee:return this.getShopeeShippingOptions(t,i);case f.Tiktok:return this.getTiktokShippingOptions(t,i)}}getShopeeShippingOptions(t,i){return this.shopeeShippingService.getShippingOptions(t,i)}getTiktokShippingOptions(t,i){return this.tiktokShippingService.getShippingOptions(t,i)}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();var Wt=`
|
|
1
|
+
import{a as jt}from"./chunk-EYT2YJGK.js";import{a as Ht,b as Ie}from"./chunk-RNWHARPK.js";import{c as we,d as De,e as Pe}from"./chunk-6KWG6O5L.js";import{a as zt}from"./chunk-HK5FXZE4.js";import{a as _e}from"./chunk-A6QXXKPR.js";import{a as Rt,b as rt}from"./chunk-M4ZE35XK.js";import{a as $t,g as st}from"./chunk-L7WZ6U4T.js";import{b as Ft,c as Kt,d as it,e as nt,f as ot}from"./chunk-LOWGZOML.js";import{A as Pt,B as Ye,E as Ot,I as Et,K as Lt,Q as Je,T as F,X as et,Y as tt,ca as Vt,g as Xe,ja as Nt,m as wt,oa as Bt,q as Dt,ra as At,sa as xe,u as ge,v as fe}from"./chunk-5PMKN6PM.js";import{a as T}from"./chunk-AGBJEXIM.js";import{e as Me}from"./chunk-OXWPYJNB.js";import{c as Qe,d as We,f as de,i as he}from"./chunk-XBIHN6D3.js";import{b as f,c as qe}from"./chunk-JBEKD57G.js";import{b as Oe,c as Ee,d as Tt,e as Le,f as Ve,g as Mt,h as Fe}from"./chunk-EDEZ3JLR.js";import{A as V,h as Se,m as Te}from"./chunk-L3W6SG2T.js";import{v as kt,w as St}from"./chunk-STYL7ETF.js";import{G as Ct,I as Ze,e as vt,f as Ge,g as Ue,h as yt,j as ke,m as R,n as ue}from"./chunk-LNJUGHOX.js";import{$b as J,$c as xt,Ac as ve,Bc as H,Cc as D,Dc as P,Fd as $,G as X,Gb as k,Gd as Q,Ha as x,Hb as ft,Hc as ye,Jc as ze,Kb as Re,Kc as Ce,Lc as I,Mb as v,Mc as d,Nc as w,Oa as dt,Oc as re,Qa as ht,Qc as ae,Rc as le,Sc as ce,Yb as je,Zb as M,Zc as He,_c as pe,aa as K,ad as It,bc as ee,cc as te,ec as ie,fc as ne,gc as l,hc as c,hd as G,ic as m,jc as y,jd as U,kb as $e,kd as me,la as mt,lb as _t,ma as O,na as ut,nb as p,nc as oe,oc as se,od as Z,pa as Ae,pd as bt,qc as S,ra as b,sb as E,sd as q,td as L,v as W,vc as g,xa as h,xc as a,ya as _,yb as gt,za as Ke,zb as Y}from"./chunk-ZYJ6LAJ3.js";import{a as j,b as z}from"./chunk-66YHNWRR.js";var Gt=(()=>{let s=class s{constructor(){this.httpService=b(Me)}getShippingOptions(t,i){return this.httpService.post(T.GetShopeeShippingOptions,{OrderNumber:t,ShopID:i})}pickupOrder(t){return this.httpService.post(T.ShopeeSelectShipping,t)}pickupMultipleOrders(t){return this.httpService.post(T.ShopeeSelectMultipleShipping,t)}dropOffOrder(t,i){let n={OrderNumber:t,ShopID:i,dropoff:{}};return this.httpService.post(T.ShopeeSelectShipping,n)}dropOffMultipleOrders(t){return this.httpService.post(T.ShopeeSelectMultipleShipping,t)}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();var Ut=(()=>{let s=class s{constructor(){this.httpService=b(Me)}getShippingOptions(t,i){return this.httpService.post(T.GetTiktokShippingOptions,{OrderNumber:t,ShopID:i}).pipe(W(n=>this.formatDatePickUpOptions(n)))}pickupOrder(t){return this.httpService.post(T.TiktokSelectShipping,t)}pickupMultipleOrders(t){return this.httpService.post(T.TiktokSelectMultipleShipping,t)}dropOffOrder(t,i){let n={handover_method:"DROP_OFF",PackageID:t,ShopID:i};return this.httpService.post(T.TiktokSelectShipping,n)}dropOffMultipleOrders(t){return this.httpService.post(T.TiktokSelectMultipleShipping,t)}formatDatePickUpOptions(t){return t?.Options?.pickup_slots&&(t.Options.pickup_slots=t?.Options?.pickup_slots.map(i=>{let n=qe.convertTimestampToDate(i.start_time),r=qe.convertTimestampToDate(i.end_time);return i.start_date=n,i.end_date=r,i})),t}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();function ii(o,s){if(o&1){let e=S();c(0,"div",10),g("click",function(){h(e);let i=a();return _(i.onSelectDelivery("DROP_OFF"))}),c(1,"div",11),y(2,"i",12),c(3,"h3",13),d(4,"Drop off"),m()(),c(5,"p",14),d(6," You can drop off your package at the nearest shipping counter in your city. "),m()()}if(o&2){let e=a();ze("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function ni(o,s){if(o&1){let e=S();c(0,"div",10),g("click",function(){h(e);let i=a();return _(i.onSelectDelivery("PICK_UP"))}),c(1,"div",11),y(2,"i",15),c(3,"h3",16),d(4,"Pick up"),m()(),c(5,"p",17),d(6," The courier will collect the package from your address. "),m()()}if(o&2){let e=a();ze("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var at=(()=>{let s=class s{constructor(){this.data=b(Ee),this.dialogRef=b(Oe),this.selectedDelivery=x("DROP_OFF"),this.showPickup=x(!0),this.showDropOff=x(!0),this.initOptionsCondition()}onSelectDelivery(t){this.selectedDelivery.set(t)}initOptionsCondition(){switch(this.data.channelType){case f.Shopee:break;case f.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),d(4,"Delivery Order"),m(),c(5,"div",3),d(6,"Your selected order(s) will be set to"),m()(),c(7,"div")(8,"i",4),g("click",function(){return n.onClose()}),m()()()(),c(9,"mat-dialog-content",5)(10,"div",6),J(11,ii,7,4,"div",7),J(12,ni,7,4,"div",7),m(),c(13,"div",8)(14,"button",9),g("click",function(){return n.onConfirm()}),d(15," OK "),m()()()),i&2&&(p(11),ee(n.showPickup()?11:-1),p(),ee(n.showDropOff()?12:-1))},dependencies:[Fe,Le,Ve],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]});let o=s;return o})();function ri(o,s){if(o&1&&(c(0,"ng-option",3),d(1),m()),o&2){let e=s.$implicit;l("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),p(),w(e==null?null:e.address)}}function ai(o,s){if(o&1&&(c(0,"ng-option",6)(1,"span",7),d(2),G(3,"date"),m(),c(4,"span"),d(5),m()()),o&2){let e=s.$implicit;l("value",e==null?null:e.pickup_time_id),p(2),w(U(3,3,e==null?null:e.date,"d MMMM")),p(3),w(e==null?null:e.time_text)}}var qt=(()=>{let s=class s{constructor(){this.shippingOptions=L(),this.onFormChanges=q(),this.addressList=Z(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=x(null),this.timeOptions=x(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=x(null)}onAddressChange(t){let i=this.addressList().find(n=>n.address_id===t);this.timeOptions.set(this.convertTimestampToDate(i?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(t){return t.map(i=>{let n=new Date(i.date*1e3);return z(j({},i),{date:n})})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"label",1),d(2,"Address"),m(),c(3,"ng-select",2),ce("ngModelChange",function(u){return le(n.selectedShipping,u)||(n.selectedShipping=u),u}),g("ngModelChange",function(u){return n.onAddressChange(u),n.onValueChanges()}),ie(4,ri,2,3,"ng-option",3,te),m()(),c(6,"div",0)(7,"label",4),d(8,"Date"),m(),c(9,"ng-select",5),ce("ngModelChange",function(u){return le(n.pickupTime,u)||(n.pickupTime=u),u}),g("ngModelChange",function(){return n.onValueChanges()}),ie(10,ai,6,6,"ng-option",6,te),m()()),i&2&&(p(3),l("clearable",!1),ae("ngModel",n.selectedShipping),p(),ne(n.addressList()),p(5),l("clearable",!1),ae("ngModel",n.pickupTime),p(),ne(n.timeOptions()))},dependencies:[R,Pe,De,we,V,Se,Te,St,kt,ke],encapsulation:2});let o=s;return o})();function li(o,s){if(o&1&&(c(0,"ng-option",3)(1,"span",4),d(2),G(3,"date"),m(),c(4,"span"),d(5),G(6,"date"),m(),c(7,"span",5),d(8,"-"),m(),c(9,"span"),d(10),G(11,"date"),m()()),o&2){let e=s.$implicit,t=s.$index;l("value",t),p(2),w(U(3,4,e==null?null:e.start_date,"d MMMM")),p(3),w(U(6,7,e==null?null:e.start_date,"HH:mm")),p(5),w(U(11,10,e==null?null:e.end_date,"HH:mm"))}}var Qt=(()=>{let s=class s{constructor(){this.shippingOptions=L(),this.onFormChanges=q(),this.timeOptions=Z(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=x(null)}onValueChanges(){let t=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:t?.start_time,end_time:t?.end_time})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(i,n){i&1&&(c(0,"div",0)(1,"label",1),d(2,"Time"),m(),c(3,"ng-select",2),ce("ngModelChange",function(u){return le(n.selectedTimeIndex,u)||(n.selectedTimeIndex=u),u}),g("ngModelChange",function(){return n.onValueChanges()}),ie(4,li,12,13,"ng-option",3,te),m()()),i&2&&(p(3),l("clearable",!1),ae("ngModel",n.selectedTimeIndex),p(),ne(n.timeOptions()))},dependencies:[R,Pe,De,we,V,Se,Te,ke],encapsulation:2});let o=s;return o})();function ci(o,s){if(o&1){let e=S();c(0,"shopee-pickup",10),g("onFormChanges",function(i){h(e);let n=a();return _(n.onFormChanges(i))}),m()}if(o&2){let e=a();l("shippingOptions",e.dialogData.shippingOptions)}}function pi(o,s){if(o&1){let e=S();c(0,"tiktok-pickup",10),g("onFormChanges",function(i){h(e);let n=a();return _(n.onFormChanges(i))}),m()}if(o&2){let e=a();l("shippingOptions",e.dialogData.shippingOptions)}}var lt=(()=>{let s=class s{constructor(){this.dialogRef=b(Oe),this.dialogData=b(Ee),this.shippingOptions=x(this.dialogData.shippingOptions),this.channelType=x(this.dialogData.channelType),this.order=x(this.dialogData.order),this.channelTypeEnum=f,this.pickupData=x(null)}onFormChanges(t){this.pickupData.set(t)}onClose(){this.dialogRef.close()}onSave(){let t=this.generatePickupData();this.dialogRef.close(t)}generatePickupData(){let t=this.dialogData.multipleOrder??!1;switch(this.channelType()){case f.Shopee:return t?{pickup:this.pickupData()}:{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case f.Tiktok:return t?{pickup_slot:this.pickupData(),handover_method:"PICKUP"}:{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(i,n){if(i&1&&(c(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),d(4,"Set Pickup"),m(),c(5,"div",2)(6,"div",3),d(7,"Shipping Method"),m(),c(8,"div",3),d(9),m()()(),c(10,"div")(11,"i",4),g("click",function(){return n.onClose()}),m()()()(),c(12,"mat-dialog-content",5),J(13,ci,1,1,"shopee-pickup",6)(14,pi,1,1,"tiktok-pickup",6),m(),c(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),g("click",function(){return n.onClose()}),d(18," Cancel "),m(),c(19,"button",9),g("click",function(){return n.onSave()}),d(20," Ok "),m()()()),i&2){let r,u;p(9),re(" ",!((r=n.order())==null||r.LogisticService==null)&&r.LogisticService.Name?(r=n.order())==null||r.LogisticService==null?null:r.LogisticService.Name:"-"," "),p(4),ee((u=n.channelType())===n.channelTypeEnum.Shopee?13:u===n.channelTypeEnum.Tiktok?14:-1)}},dependencies:[Fe,Le,Mt,Ve,V,qt,Qt],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 7 Pro";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']});let o=s;return o})();var Xn=(()=>{let s=class s{constructor(){this.shopeeShippingService=b(Gt),this.tiktokShippingService=b(Ut),this.dialog=b(Tt)}setFulfillmentOrder(t){return this.getShippingOptions(t.Number,t.ShopID,t.MarketType).pipe(K(i=>this.dialog.open(at,{height:"400px",width:"530px",data:{options:i,channelType:t.MarketType}}).afterClosed().pipe(X(n=>_e.IsNotEmpty(n)),W(n=>({type:n,order:t,options:i})),K(n=>n.type=="PICK_UP"?this.onPickupOrder(n.order,n.options):this.onDropOffOrder(n.order,n.options)))))}onPickupOrder(t,i){return this.dialog.open(lt,{width:"530px",data:{order:t,shippingOptions:i,channelType:t.MarketType,multipleOrder:!1},disableClose:!0}).afterClosed().pipe(X(n=>_e.IsNotEmpty(n)),K(n=>this.pickupOrder(t,n)))}pickupOrder(t,i){switch(t.MarketType){case f.Shopee:return this.shopeeShippingService.pickupOrder(i);case f.Tiktok:return this.tiktokShippingService.pickupOrder(i)}}onDropOffOrder(t,i){switch(t.MarketType){case f.Shopee:return this.shopeeShippingService.dropOffOrder(t.Number,t.ShopID);case f.Tiktok:let n=i?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(n,t.ShopID)}}setFulfillmentMultipleOrders(t){let i=t[0];return this.getShippingOptions(i.Number,i.ShopID,i.MarketType).pipe(K(n=>this.dialog.open(at,{height:"400px",width:"530px",data:{options:n,channelType:i.MarketType}}).afterClosed().pipe(X(r=>_e.IsNotEmpty(r)),W(r=>({type:r,orders:t,options:n})))),K(n=>n.type=="PICK_UP"?this.openDialogPickupMultipleOrders(n.orders,n.options):this.dropOffMultipleOrder(n.orders,n.options)))}openDialogPickupMultipleOrders(t,i){let n=t[0];return this.dialog.open(lt,{width:"530px",data:{order:n,shippingOptions:i,channelType:n.MarketType,multipleOrder:!0},disableClose:!0}).afterClosed().pipe(X(r=>_e.IsNotEmpty(r)),K(r=>this.pickupMultipleOrder(t,r)))}pickupMultipleOrder(t,i){let n=t[0],r=this.generateMultiplePickupData(t,i);switch(n.MarketType){case f.Shopee:return this.shopeeShippingService.pickupOrder(r);case f.Tiktok:return this.tiktokShippingService.pickupOrder(r)}}generateMultiplePickupData(t,i){switch(t[0].MarketType){case f.Shopee:let n=t.map(u=>({OrderNumber:u.Number,ShopID:u.ShopID}));return i.List=n,i;case f.Tiktok:let r=t.map(u=>({PackageID:u.Number,ShopID:u.ShopID}));return i.List=r,i}}dropOffMultipleOrder(t,i){switch(t[0].MarketType){case f.Shopee:let r=this.generateMultipleDropOffData(t);return this.shopeeShippingService.dropOffMultipleOrders(r);case f.Tiktok:let u=i?.Form?.information?.PackageID,C=this.generateMultipleDropOffData(t,u);return this.tiktokShippingService.dropOffMultipleOrders(C)}}generateMultipleDropOffData(t,i){switch(t[0].MarketType){case f.Shopee:return t.map(C=>({OrderNumber:C.Number,ShopID:C.ShopID}));case f.Tiktok:return{List:t.map(C=>({PackageID:i,ShopID:C.ShopID})),handover_method:"DROP_OFF"}}}getShippingOptions(t,i,n){switch(n){case f.Shopee:return this.getShopeeShippingOptions(t,i);case f.Tiktok:return this.getTiktokShippingOptions(t,i)}}getShopeeShippingOptions(t,i){return this.shopeeShippingService.getShippingOptions(t,i)}getTiktokShippingOptions(t,i){return this.tiktokShippingService.getShippingOptions(t,i)}};s.\u0275fac=function(i){return new(i||s)},s.\u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"});let o=s;return o})();var Wt=`
|
|
2
2
|
.p-contextmenu {
|
|
3
3
|
background: dt('contextmenu.background');
|
|
4
4
|
color: dt('contextmenu.color');
|
|
@@ -146,4 +146,4 @@ import{a as jt}from"./chunk-EYT2YJGK.js";import{a as Ht,b as Ie}from"./chunk-RNW
|
|
|
146
146
|
.p-contextmenu-mobile .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
|
|
147
147
|
transform: rotate(-90deg);
|
|
148
148
|
}
|
|
149
|
-
`;var mi=["sublist"],ui=(o,s)=>({instance:o,processedItem:s}),Yt=()=>({class:"p-contextmenu-submenu-icon"}),di=()=>({exact:!1}),hi=o=>({$implicit:o});function _i(o,s){if(o&1&&y(0,"li",8),o&2){let e=a().$implicit,t=a(2);Ce(t.getItemProp(e,"style")),I(t.cn(t.cx("separator"),t.getItemProp(e,"styleClass"))),l("pBind",t._ptm("separator")),M("id",t.getItemId(e))}}function gi(o,s){if(o&1&&y(0,"span",19),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cn(n.cx("itemIcon"),n.getItemProp(t,"icon"))),l("ngStyle",n.getItemProp(t,"iconStyle"))("pBind",n.getPTOptions(t,i,"itemIcon")),M("aria-hidden",!0)("tabindex",-1)}}function fi(o,s){if(o&1&&(c(0,"span",20),d(1),m()),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("pBind",n.getPTOptions(t,i,"itemLabel")),p(),re(" ",n.getItemLabel(t)," ")}}function xi(o,s){if(o&1&&y(0,"span",21),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("innerHTML",n.getItemLabel(t),$e)("pBind",n.getPTOptions(t,i,"itemLabel"))}}function Ii(o,s){if(o&1&&y(0,"p-badge",22),o&2){let e=a(4).$implicit,t=a(2);I(t.getItemProp(e,"badgeStyleClass")),l("value",t.getItemProp(e,"badge"))}}function bi(o,s){if(o&1&&(Ke(),y(0,"svg",25)),o&2){let e=a(5),t=e.$implicit,i=e.index,n=a(2);I(n.cx("submenuIcon")),l("pBind",n.getPTOptions(t,i,"submenuIcon")),M("aria-hidden",!0)}}function vi(o,s){}function yi(o,s){o&1&&v(0,vi,0,0,"ng-template",26),o&2&&je("aria-hidden",!0)}function Ci(o,s){if(o&1&&(oe(0),v(1,bi,1,4,"svg",23)(2,yi,1,1,null,24),se()),o&2){let e=a(6);p(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),p(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",pe(3,Yt))}}function ki(o,s){if(o&1&&(c(0,"a",15),v(1,gi,1,6,"span",16)(2,fi,2,4,"span",17)(3,xi,1,4,"ng-template",null,2,me)(5,Ii,1,3,"p-badge",18)(6,Ci,3,4,"ng-container",11),m()),o&2){let e=ye(4),t=a(3),i=t.$implicit,n=t.index,r=a(2);I(r.cx("itemLink")),l("target",r.getItemProp(i,"target"))("pBind",r.getPTOptions(i,n,"itemLink")),M("href",r.getItemProp(i,"url"),_t)("data-automationid",r.getItemProp(i,"automationId"))("tabindex",-1),p(),l("ngIf",r.getItemProp(i,"icon")),p(),l("ngIf",r.getItemProp(i,"escape"))("ngIfElse",e),p(3),l("ngIf",r.getItemProp(i,"badge")),p(),l("ngIf",r.isItemGroup(i))}}function Si(o,s){if(o&1&&y(0,"span",19),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cn(n.cx("itemIcon"),n.getItemProp(t,"icon"))),l("ngStyle",n.getItemProp(t,"iconStyle"))("pBind",n.getPTOptions(t,i,"itemIcon")),M("aria-hidden",!0)("tabindex",-1)}}function Ti(o,s){if(o&1&&(c(0,"span",20),d(1),m()),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("pBind",n.getPTOptions(t,i,"itemLabel")),p(),re(" ",n.getItemLabel(t)," ")}}function Mi(o,s){if(o&1&&y(0,"span",21),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("innerHTML",n.getItemLabel(t),$e)("pBind",n.getPTOptions(t,i,"itemLabel"))}}function wi(o,s){if(o&1&&y(0,"p-badge",22),o&2){let e=a(4).$implicit,t=a(2);I(t.getItemProp(e,"badgeStyleClass")),l("value",t.getItemProp(e,"badge"))}}function Di(o,s){if(o&1&&(Ke(),y(0,"svg",25)),o&2){let e=a(5),t=e.$implicit,i=e.index,n=a(2);I(n.cx("submenuIcon")),l("pBind",n.getPTOptions(t,i,"submenuIcon")),M("aria-hidden",!0)}}function Pi(o,s){}function Oi(o,s){o&1&&v(0,Pi,0,0,"ng-template",26),o&2&&je("aria-hidden",!0)}function Ei(o,s){if(o&1&&(oe(0),v(1,Di,1,4,"svg",23)(2,Oi,1,1,null,24),se()),o&2){let e=a(6);p(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),p(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",pe(3,Yt))}}function Li(o,s){if(o&1&&(c(0,"a",27),v(1,Si,1,6,"span",16)(2,Ti,2,4,"span",17)(3,Mi,1,4,"ng-template",null,2,me)(5,wi,1,3,"p-badge",18)(6,Ei,3,4,"ng-container",11),m()),o&2){let e=ye(4),t=a(3),i=t.$implicit,n=t.index,r=a(2);I(r.cx("itemLink")),l("routerLink",r.getItemProp(i,"routerLink"))("queryParams",r.getItemProp(i,"queryParams"))("routerLinkActiveOptions",r.getItemProp(i,"routerLinActiveOptions")||pe(20,di))("target",r.getItemProp(i,"target"))("fragment",r.getItemProp(i,"fragment"))("queryParamsHandling",r.getItemProp(i,"queryParamsHandling"))("preserveFragment",r.getItemProp(i,"preserveFragment"))("skipLocationChange",r.getItemProp(i,"skipLocationChange"))("replaceUrl",r.getItemProp(i,"replaceUrl"))("state",r.getItemProp(i,"state"))("pBind",r.getPTOptions(i,n,"itemLink")),M("data-automationid",r.getItemProp(i,"automationId"))("tabindex",-1),p(),l("ngIf",r.getItemProp(i,"icon")),p(),l("ngIf",r.getItemProp(i,"escape"))("ngIfElse",e),p(3),l("ngIf",r.getItemProp(i,"badge")),p(),l("ngIf",r.isItemGroup(i))}}function Vi(o,s){if(o&1&&(oe(0),v(1,ki,7,12,"a",13)(2,Li,7,21,"a",14),se()),o&2){let e=a(2).$implicit,t=a(2);p(),l("ngIf",!t.getItemProp(e,"routerLink")),p(),l("ngIf",t.getItemProp(e,"routerLink"))}}function Fi(o,s){}function Ni(o,s){o&1&&v(0,Fi,0,0,"ng-template")}function Bi(o,s){if(o&1&&(oe(0),v(1,Ni,1,0,null,24),se()),o&2){let e=a(2).$implicit,t=a(2);p(),l("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",xt(2,hi,e.item))}}function Ai(o,s){if(o&1){let e=S();c(0,"p-contextmenu-sub",28),g("itemClick",function(i){h(e);let n=a(4);return _(n.itemClick.emit(i))})("itemMouseEnter",function(i){h(e);let n=a(4);return _(n.onItemMouseEnter(i))}),m()}if(o&2){let e=a(2).$implicit,t=a(2);l("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)("pt",t.pt())}}function Ki(o,s){if(o&1){let e=S();c(0,"li",9,1)(2,"div",10),g("click",function(i){h(e);let n=a().$implicit,r=a(2);return _(r.onItemClick(i,n))})("mouseenter",function(i){h(e);let n=a().$implicit,r=a(2);return _(r.onItemMouseEnter({$event:i,processedItem:n}))}),v(3,Vi,3,2,"ng-container",11)(4,Bi,2,4,"ng-container",11),m(),v(5,Ai,1,8,"p-contextmenu-sub",12),m()}if(o&2){let e=a(),t=e.$implicit,i=e.index,n=a(2);Ce(n.getItemProp(t,"style")),I(n.cn(n.cx("item",It(23,ui,n,t)),n.getItemProp(t,"styleClass"))),l("pBind",n.getPTOptions(t,i,"item"))("tooltipOptions",n.getItemProp(t,"tooltipOptions")),M("id",n.getItemId(t))("data-p-highlight",n.isItemActive(t))("data-p-focused",n.isItemFocused(t))("data-p-disabled",n.isItemDisabled(t))("aria-label",n.getItemLabel(t))("aria-disabled",n.isItemDisabled(t)||void 0)("aria-haspopup",n.isItemGroup(t)&&!n.getItemProp(t,"to")?"menu":void 0)("aria-expanded",n.isItemGroup(t)?n.isItemActive(t):void 0)("aria-level",n.level+1)("aria-setsize",n.getAriaSetSize())("aria-posinset",n.getAriaPosInset(i)),p(2),I(n.cx("itemContent")),l("pBind",n.getPTOptions(t,i,"itemContent")),p(),l("ngIf",!n.itemTemplate),p(),l("ngIf",n.itemTemplate),p(),l("ngIf",n.isItemVisible(t)&&n.isItemGroup(t))}}function $i(o,s){if(o&1&&v(0,_i,1,6,"li",6)(1,Ki,6,26,"li",7),o&2){let e=s.$implicit,t=a(2);l("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),p(),l("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Ri(o,s){if(o&1){let e=S();c(0,"ul",4,0),g("@overlayAnimation.start",function(i){h(e);let n=ye(1),r=a();return _(r.onEnter(i,n))})("keydown",function(i){h(e);let n=a();return _(n.menuKeydown.emit(i))})("focus",function(i){h(e);let n=a();return _(n.menuFocus.emit(i))})("blur",function(i){h(e);let n=a();return _(n.menuBlur.emit(i))}),v(2,$i,2,2,"ng-template",5),m()}if(o&2){let e=a();I(e.root?e.cx("rootList"):e.cx("submenu")),l("pBind",e._ptm(e.root?"rootList":"submenu"))("@overlayAnimation",e.visible)("tabindex",e.tabindex),M("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical"),p(2),l("ngForOf",e.items)}}var ji=["item"],zi=["submenuicon"],Hi=["rootmenu"],Gi=["container"],Ui=()=>({value:"visible"});function Zi(o,s){if(o&1){let e=S();c(0,"div",3,0),g("@overlayAnimation.start",function(i){h(e);let n=a();return _(n.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){h(e);let n=a();return _(n.onOverlayAnimationEnd(i))}),c(2,"p-contextmenu-sub",4,1),g("itemClick",function(i){h(e);let n=a();return _(n.onItemClick(i))})("menuFocus",function(i){h(e);let n=a();return _(n.onMenuFocus(i))})("menuBlur",function(i){h(e);let n=a();return _(n.onMenuBlur(i))})("menuKeydown",function(i){h(e);let n=a();return _(n.onKeyDown(i))})("itemMouseEnter",function(i){h(e);let n=a();return _(n.onItemMouseEnter(i))}),m()()}if(o&2){let e=a();Ce(e.sx("root")),I(e.cn(e.cx("root"),e.styleClass)),l("ngStyle",e.style)("pBind",e.ptm("root"))("@overlayAnimation",pe(21,Ui)),M("id",e.id),p(2),l("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())("pt",e.pt())}}var qi={root:{position:"absolute"}},Qi={root:()=>["p-contextmenu p-component"],rootList:"p-contextmenu-root-list",item:({instance:o,processedItem:s})=>["p-contextmenu-item",{"p-contextmenu-item-active":o.isItemActive(s),"p-focus":o.isItemFocused(s),"p-disabled":o.isItemDisabled(s),"p-contextmenu-mobile":o.queryMatches}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},Ne=(()=>{class o extends Nt{name="contextmenu";style=Wt;classes=Qi;inlineStyles=qi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=dt(o)))(i||o)}})();static \u0275prov=E({token:o,factory:o.\u0275fac})}return o})();var Jt=new Ae("CONTEXTMENU_INSTANCE"),Xt=new Ae("CONTEXTMENUSUB_INSTANCE"),Wi=(()=>{class o extends it{el;renderer;contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new L;itemMouseEnter=new L;menuFocus=new L;menuBlur=new L;menuKeydown=new L;sublistViewChild;hostName="ContextMenu";_componentStyle=b(Ne);$pcContextMenu=b(Jt,{optional:!0,skipSelf:!0})??void 0;$pcContextMenuSub=b(Xt,{optional:!0,skipSelf:!0})??void 0;constructor(e,t,i){super(),this.el=e,this.renderer=t,this.contextMenu=i}getItemProp(e,t,i=null){return e&&e.item?tt(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemLabel(e){return this.getItemProp(e,"label")}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return N(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}_ptm(e,t){return this.$pcContextMenu?this.$pcContextMenu.ptm(e,t):this.ptm(e,t)}getPTOptions(e,t,i){return this._ptm(i,{context:{item:e.item,index:t,active:this.isItemActive(e),focused:this.isItemFocused(e),disabled:this.isItemDisabled(e)}})}position(e){let t=e.parentElement.parentElement,i=Ot(e.parentElement.parentElement),n=Xe(),r=e.offsetParent?e.offsetWidth:Ye(e),u=wt(t.children[0]);e.style.top="0px",parseInt(i.left,10)+u+r>n.width-Dt()?e.style.left=-1*r+"px":e.style.left=u+"px"}static \u0275fac=function(t){return new(t||o)(Y(ht),Y(gt),Y(mt(()=>Be)))};static \u0275cmp=k({type:o,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&H(mi,5),t&2){let n;P(n=O())&&(i.sublistViewChild=n.first)}},inputs:{visible:[2,"visible","visible",R],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",R],autoZIndex:[2,"autoZIndex","autoZIndex",R],baseZIndex:[2,"baseZIndex","baseZIndex",Q],popup:[2,"popup","popup",R],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Q],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",Q]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[He([Ne,{provide:Xt,useExisting:o},{provide:Kt,useExisting:o}]),Re],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"class","pBind","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","pBind","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","class","pBind",4,"ngIf"],["role","menuitem","pTooltip","",3,"style","class","pBind","tooltipOptions",4,"ngIf"],["role","separator",3,"pBind"],["role","menuitem","pTooltip","",3,"pBind","tooltipOptions"],[3,"click","mouseenter","pBind"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","pt","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","class","pBind",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","class","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","pBind",4,"ngIf"],["pRipple","",3,"target","pBind"],[3,"class","ngStyle","pBind",4,"ngIf"],[3,"class","pBind",4,"ngIf","ngIfElse"],[3,"class","value",4,"ngIf"],[3,"ngStyle","pBind"],[3,"pBind"],[3,"innerHTML","pBind"],[3,"value"],["data-p-icon","angle-right",3,"class","pBind",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["data-p-icon","angle-right",3,"pBind"],[3,"aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","pBind"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","pt"]],template:function(t,i){t&1&&v(0,Ri,3,11,"ul",3),t&2&&l("ngIf",i.root?!0:i.visible)},dependencies:[o,w,vt,Ge,yt,Ue,Ze,Ct,zt,rt,Rt,nt,jt,Ie,Ht,xe,ot],encapsulation:2,data:{animation:[Qe("overlayAnimation",[he(":enter",[de({opacity:0})]),he(":leave",[de({opacity:0})])])]}})}return o})(),Be=(()=>{class o extends it{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;appendTo=V(void 0);onShow=new L;onHide=new L;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=x(!1);focused=!1;activeItemPath=x([]);focusedItemInfo=x({index:-1,level:0,parentKey:"",item:null});submenuVisible=x(!1);$appendTo=Z(()=>this.appendTo()||this.config.overlayAppendTo());searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=b(Ne);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${N(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,bt(()=>{let t=this.activeItemPath();N(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}onInit(){this.id=this.id||Ft("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return Lt()||Et()}bindTriggerEventListener(){ue(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(ue(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild?.nativeElement?.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;onAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}getPTOptions(e,t,i,n){return this.ptm(e,{context:{item:t,index:i,focused:this.isItemFocused({index:i,item:t}),disabled:this.isItemDisabled(t)}})}isItemFocused(e){return this.focusedItemInfo().index===e.index}createProcessedItems(e,t=0,i={},n=""){let r=[];return e&&e.forEach((u,C)=>{let A=(n!==""?n+"_":"")+C,K={item:u,index:C,level:t,key:A,parent:i,parentKey:n};K.items=this.createProcessedItems(u.items,t+1,K,A),r.push(K)}),r}bindMatchMediaListener(){if(ue(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?tt(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&N(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&N(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:r,key:u,level:C,parentKey:A,item:K}=t;this.activeItemPath.set(this.activeItemPath().filter(be=>u!==be.key&&u.startsWith(be.key))),this.focusedItemInfo.set({index:r,level:C,parentKey:A,item:K}),fe(this.rootmenu?.sublistViewChild?.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&Vt(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(u=>u.key===t.parentKey);Je(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let r=this.activeItemPath().filter(u=>u.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(r),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(z(j({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=ge(this.rootmenu?.el?.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&(ge(t,'[data-pc-section="itemlink"]')||ge(t,"a,button"));i?i.click():t&&t.click();let n=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(n)){let u=this.focusedItemInfo();this.focusedItemInfo.set(z(j({},u),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:n}=e;if(Je(i))return;let{index:r,key:u,level:C,parentKey:A,items:K}=i,be=N(K),ct=this.activeItemPath().filter(pt=>pt.parentKey!==A&&pt.parentKey!==u);be&&(ct.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:r,level:C,parentKey:A,item:i.item}),n&&fe(this.rootmenu?.sublistViewChild?.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(ct)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.$attrSelector&&this.container?.setAttribute(this.$attrSelector,""),this.appendOverlay(),this.bindGlobalListeners(),fe(this.rootmenu?.sublistViewChild?.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){$t.appendOverlay(this.container,this.$appendTo()==="body"?this.document.body:this.$appendTo(),this.$appendTo())}moveOnTop(){this.autoZIndex&&this.containerViewChild&&st.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&st.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),fe(this.rootmenu?.sublistViewChild?.nativeElement),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){if(!this.document.scrollingElement||!this.containerViewChild?.nativeElement)return;let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:Ye(this.containerViewChild.nativeElement),n=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:Pt(this.containerViewChild.nativeElement),r=Xe();e+i-this.document.scrollingElement.scrollLeft>r.width&&(e-=i),t+n-this.document.scrollingElement.scrollTop>r.height&&(t-=n),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(r=>this.isItemMatched(r)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(r=>this.isItemMatched(r)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(r=>this.isItemMatched(r)),i!==-1&&(n=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),n}findVisibleItem(e){return N(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return et(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?et(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),n=this.focusedItemInfo();n.index!==t&&(this.focusedItemInfo.set(z(j({},n),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=ge(this.rootmenu?.el?.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){ue(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild?.nativeElement?.isSameNode(e.target)||this.containerViewChild?.nativeElement?.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.$appendTo()&&this.containerViewChild&&this.$appendTo()==="body"&&this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement)}onDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements()}static \u0275fac=function(t){return new(t||o)(Y(Bt))};static \u0275cmp=k({type:o,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,n){if(t&1&&(ve(n,ji,4),ve(n,zi,4),ve(n,At,4)),t&2){let r;P(r=O())&&(i.itemTemplate=r.first),P(r=O())&&(i.submenuIconTemplate=r.first),P(r=O())&&(i.templates=r)}},viewQuery:function(t,i){if(t&1&&(H(Hi,5),H(Gi,5)),t&2){let n;P(n=O())&&(i.rootmenu=n.first),P(n=O())&&(i.containerViewChild=n.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",R],style:"style",styleClass:"styleClass",autoZIndex:[2,"autoZIndex","autoZIndex",R],baseZIndex:[2,"baseZIndex","baseZIndex",Q],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",Q],appendTo:[1,"appendTo"]},outputs:{onShow:"onShow",onHide:"onHide"},features:[He([Ne,{provide:Jt,useExisting:o}]),Re],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"class","style","ngStyle","pBind",4,"ngIf"],[3,"ngStyle","pBind"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath","pt"]],template:function(t,i){t&1&&v(0,Zi,4,22,"div",2),t&2&&l("ngIf",i.visible())},dependencies:[w,Ge,Ue,Wi,Ze,rt,nt,Ie,xe,ot],encapsulation:2,data:{animation:[Qe("overlayAnimation",[he(":enter",[de({opacity:0}),We("250ms")]),he(":leave",[We(".1s linear",de({opacity:0}))])])]},changeDetection:0})}return o})(),ei=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=ft({type:o});static \u0275inj=ut({imports:[Be,xe,xe]})}return o})();var Yi=["contextMenu"];function Ji(o,s){if(o&1){let e=S();c(0,"a",3),g("click",function(){let i=h(e).$implicit,n=a();return _(n.onClickContextMenuItem(i))}),y(1,"i"),c(2,"span",4),d(3),m()()}if(o&2){let e=s.$implicit;p(),I(e.icon),p(2),D(e.label)}}var zo=(()=>{let s=class s{constructor(){this.items=V([]),this.onSelectItem=q()}show(t,i){clearTimeout(this.hoverTimeout),this.selectedData=null,this.hoverTimeout=setTimeout(()=>{this.contextMenuEl.show(t),this.selectedData=i},100)}hide(){this.contextMenuEl?.hide(),clearTimeout(this.hoverTimeout),this.selectedData=null}onClickContextMenuItem(t){this.onSelectItem.emit({item:t,data:this.selectedData})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["app-context-menu"]],viewQuery:function(i,n){if(i&1&&H(Yi,5),i&2){let r;P(r=O())&&(n.contextMenuEl=r.first)}},inputs:{items:[1,"items"]},outputs:{onSelectItem:"onSelectItem"},decls:4,vars:1,consts:[["contextMenu",""],["item",""],[3,"model"],["pRipple","",1,"flex","items-center","p-contextmenu-item-link",3,"click"],[1,"ml-2"]],template:function(i,n){i&1&&(c(0,"p-contextmenu",2,0),v(2,Ji,4,3,"ng-template",null,1,me),m()),i&2&&l("model",n.items())},dependencies:[F,ei,Be,Ie],encapsulation:2});let o=s;return o})();export{Jn as a,zo as b};
|
|
149
|
+
`;var mi=["sublist"],ui=(o,s)=>({instance:o,processedItem:s}),Yt=()=>({class:"p-contextmenu-submenu-icon"}),di=()=>({exact:!1}),hi=o=>({$implicit:o});function _i(o,s){if(o&1&&y(0,"li",8),o&2){let e=a().$implicit,t=a(2);Ce(t.getItemProp(e,"style")),I(t.cn(t.cx("separator"),t.getItemProp(e,"styleClass"))),l("pBind",t._ptm("separator")),M("id",t.getItemId(e))}}function gi(o,s){if(o&1&&y(0,"span",19),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cn(n.cx("itemIcon"),n.getItemProp(t,"icon"))),l("ngStyle",n.getItemProp(t,"iconStyle"))("pBind",n.getPTOptions(t,i,"itemIcon")),M("aria-hidden",!0)("tabindex",-1)}}function fi(o,s){if(o&1&&(c(0,"span",20),d(1),m()),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("pBind",n.getPTOptions(t,i,"itemLabel")),p(),re(" ",n.getItemLabel(t)," ")}}function xi(o,s){if(o&1&&y(0,"span",21),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("innerHTML",n.getItemLabel(t),$e)("pBind",n.getPTOptions(t,i,"itemLabel"))}}function Ii(o,s){if(o&1&&y(0,"p-badge",22),o&2){let e=a(4).$implicit,t=a(2);I(t.getItemProp(e,"badgeStyleClass")),l("value",t.getItemProp(e,"badge"))}}function bi(o,s){if(o&1&&(Ke(),y(0,"svg",25)),o&2){let e=a(5),t=e.$implicit,i=e.index,n=a(2);I(n.cx("submenuIcon")),l("pBind",n.getPTOptions(t,i,"submenuIcon")),M("aria-hidden",!0)}}function vi(o,s){}function yi(o,s){o&1&&v(0,vi,0,0,"ng-template",26),o&2&&je("aria-hidden",!0)}function Ci(o,s){if(o&1&&(oe(0),v(1,bi,1,4,"svg",23)(2,yi,1,1,null,24),se()),o&2){let e=a(6);p(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),p(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",pe(3,Yt))}}function ki(o,s){if(o&1&&(c(0,"a",15),v(1,gi,1,6,"span",16)(2,fi,2,4,"span",17)(3,xi,1,4,"ng-template",null,2,me)(5,Ii,1,3,"p-badge",18)(6,Ci,3,4,"ng-container",11),m()),o&2){let e=ye(4),t=a(3),i=t.$implicit,n=t.index,r=a(2);I(r.cx("itemLink")),l("target",r.getItemProp(i,"target"))("pBind",r.getPTOptions(i,n,"itemLink")),M("href",r.getItemProp(i,"url"),_t)("data-automationid",r.getItemProp(i,"automationId"))("tabindex",-1),p(),l("ngIf",r.getItemProp(i,"icon")),p(),l("ngIf",r.getItemProp(i,"escape"))("ngIfElse",e),p(3),l("ngIf",r.getItemProp(i,"badge")),p(),l("ngIf",r.isItemGroup(i))}}function Si(o,s){if(o&1&&y(0,"span",19),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cn(n.cx("itemIcon"),n.getItemProp(t,"icon"))),l("ngStyle",n.getItemProp(t,"iconStyle"))("pBind",n.getPTOptions(t,i,"itemIcon")),M("aria-hidden",!0)("tabindex",-1)}}function Ti(o,s){if(o&1&&(c(0,"span",20),d(1),m()),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("pBind",n.getPTOptions(t,i,"itemLabel")),p(),re(" ",n.getItemLabel(t)," ")}}function Mi(o,s){if(o&1&&y(0,"span",21),o&2){let e=a(4),t=e.$implicit,i=e.index,n=a(2);I(n.cx("itemLabel")),l("innerHTML",n.getItemLabel(t),$e)("pBind",n.getPTOptions(t,i,"itemLabel"))}}function wi(o,s){if(o&1&&y(0,"p-badge",22),o&2){let e=a(4).$implicit,t=a(2);I(t.getItemProp(e,"badgeStyleClass")),l("value",t.getItemProp(e,"badge"))}}function Di(o,s){if(o&1&&(Ke(),y(0,"svg",25)),o&2){let e=a(5),t=e.$implicit,i=e.index,n=a(2);I(n.cx("submenuIcon")),l("pBind",n.getPTOptions(t,i,"submenuIcon")),M("aria-hidden",!0)}}function Pi(o,s){}function Oi(o,s){o&1&&v(0,Pi,0,0,"ng-template",26),o&2&&je("aria-hidden",!0)}function Ei(o,s){if(o&1&&(oe(0),v(1,Di,1,4,"svg",23)(2,Oi,1,1,null,24),se()),o&2){let e=a(6);p(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),p(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",pe(3,Yt))}}function Li(o,s){if(o&1&&(c(0,"a",27),v(1,Si,1,6,"span",16)(2,Ti,2,4,"span",17)(3,Mi,1,4,"ng-template",null,2,me)(5,wi,1,3,"p-badge",18)(6,Ei,3,4,"ng-container",11),m()),o&2){let e=ye(4),t=a(3),i=t.$implicit,n=t.index,r=a(2);I(r.cx("itemLink")),l("routerLink",r.getItemProp(i,"routerLink"))("queryParams",r.getItemProp(i,"queryParams"))("routerLinkActiveOptions",r.getItemProp(i,"routerLinActiveOptions")||pe(20,di))("target",r.getItemProp(i,"target"))("fragment",r.getItemProp(i,"fragment"))("queryParamsHandling",r.getItemProp(i,"queryParamsHandling"))("preserveFragment",r.getItemProp(i,"preserveFragment"))("skipLocationChange",r.getItemProp(i,"skipLocationChange"))("replaceUrl",r.getItemProp(i,"replaceUrl"))("state",r.getItemProp(i,"state"))("pBind",r.getPTOptions(i,n,"itemLink")),M("data-automationid",r.getItemProp(i,"automationId"))("tabindex",-1),p(),l("ngIf",r.getItemProp(i,"icon")),p(),l("ngIf",r.getItemProp(i,"escape"))("ngIfElse",e),p(3),l("ngIf",r.getItemProp(i,"badge")),p(),l("ngIf",r.isItemGroup(i))}}function Vi(o,s){if(o&1&&(oe(0),v(1,ki,7,12,"a",13)(2,Li,7,21,"a",14),se()),o&2){let e=a(2).$implicit,t=a(2);p(),l("ngIf",!t.getItemProp(e,"routerLink")),p(),l("ngIf",t.getItemProp(e,"routerLink"))}}function Fi(o,s){}function Ni(o,s){o&1&&v(0,Fi,0,0,"ng-template")}function Bi(o,s){if(o&1&&(oe(0),v(1,Ni,1,0,null,24),se()),o&2){let e=a(2).$implicit,t=a(2);p(),l("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",xt(2,hi,e.item))}}function Ai(o,s){if(o&1){let e=S();c(0,"p-contextmenu-sub",28),g("itemClick",function(i){h(e);let n=a(4);return _(n.itemClick.emit(i))})("itemMouseEnter",function(i){h(e);let n=a(4);return _(n.onItemMouseEnter(i))}),m()}if(o&2){let e=a(2).$implicit,t=a(2);l("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)("pt",t.pt())}}function Ki(o,s){if(o&1){let e=S();c(0,"li",9,1)(2,"div",10),g("click",function(i){h(e);let n=a().$implicit,r=a(2);return _(r.onItemClick(i,n))})("mouseenter",function(i){h(e);let n=a().$implicit,r=a(2);return _(r.onItemMouseEnter({$event:i,processedItem:n}))}),v(3,Vi,3,2,"ng-container",11)(4,Bi,2,4,"ng-container",11),m(),v(5,Ai,1,8,"p-contextmenu-sub",12),m()}if(o&2){let e=a(),t=e.$implicit,i=e.index,n=a(2);Ce(n.getItemProp(t,"style")),I(n.cn(n.cx("item",It(23,ui,n,t)),n.getItemProp(t,"styleClass"))),l("pBind",n.getPTOptions(t,i,"item"))("tooltipOptions",n.getItemProp(t,"tooltipOptions")),M("id",n.getItemId(t))("data-p-highlight",n.isItemActive(t))("data-p-focused",n.isItemFocused(t))("data-p-disabled",n.isItemDisabled(t))("aria-label",n.getItemLabel(t))("aria-disabled",n.isItemDisabled(t)||void 0)("aria-haspopup",n.isItemGroup(t)&&!n.getItemProp(t,"to")?"menu":void 0)("aria-expanded",n.isItemGroup(t)?n.isItemActive(t):void 0)("aria-level",n.level+1)("aria-setsize",n.getAriaSetSize())("aria-posinset",n.getAriaPosInset(i)),p(2),I(n.cx("itemContent")),l("pBind",n.getPTOptions(t,i,"itemContent")),p(),l("ngIf",!n.itemTemplate),p(),l("ngIf",n.itemTemplate),p(),l("ngIf",n.isItemVisible(t)&&n.isItemGroup(t))}}function $i(o,s){if(o&1&&v(0,_i,1,6,"li",6)(1,Ki,6,26,"li",7),o&2){let e=s.$implicit,t=a(2);l("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),p(),l("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Ri(o,s){if(o&1){let e=S();c(0,"ul",4,0),g("@overlayAnimation.start",function(i){h(e);let n=ye(1),r=a();return _(r.onEnter(i,n))})("keydown",function(i){h(e);let n=a();return _(n.menuKeydown.emit(i))})("focus",function(i){h(e);let n=a();return _(n.menuFocus.emit(i))})("blur",function(i){h(e);let n=a();return _(n.menuBlur.emit(i))}),v(2,$i,2,2,"ng-template",5),m()}if(o&2){let e=a();I(e.root?e.cx("rootList"):e.cx("submenu")),l("pBind",e._ptm(e.root?"rootList":"submenu"))("@overlayAnimation",e.visible)("tabindex",e.tabindex),M("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical"),p(2),l("ngForOf",e.items)}}var ji=["item"],zi=["submenuicon"],Hi=["rootmenu"],Gi=["container"],Ui=()=>({value:"visible"});function Zi(o,s){if(o&1){let e=S();c(0,"div",3,0),g("@overlayAnimation.start",function(i){h(e);let n=a();return _(n.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){h(e);let n=a();return _(n.onOverlayAnimationEnd(i))}),c(2,"p-contextmenu-sub",4,1),g("itemClick",function(i){h(e);let n=a();return _(n.onItemClick(i))})("menuFocus",function(i){h(e);let n=a();return _(n.onMenuFocus(i))})("menuBlur",function(i){h(e);let n=a();return _(n.onMenuBlur(i))})("menuKeydown",function(i){h(e);let n=a();return _(n.onKeyDown(i))})("itemMouseEnter",function(i){h(e);let n=a();return _(n.onItemMouseEnter(i))}),m()()}if(o&2){let e=a();Ce(e.sx("root")),I(e.cn(e.cx("root"),e.styleClass)),l("ngStyle",e.style)("pBind",e.ptm("root"))("@overlayAnimation",pe(21,Ui)),M("id",e.id),p(2),l("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())("pt",e.pt())}}var qi={root:{position:"absolute"}},Qi={root:()=>["p-contextmenu p-component"],rootList:"p-contextmenu-root-list",item:({instance:o,processedItem:s})=>["p-contextmenu-item",{"p-contextmenu-item-active":o.isItemActive(s),"p-focus":o.isItemFocused(s),"p-disabled":o.isItemDisabled(s),"p-contextmenu-mobile":o.queryMatches}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},Ne=(()=>{class o extends Nt{name="contextmenu";style=Wt;classes=Qi;inlineStyles=qi;static \u0275fac=(()=>{let e;return function(i){return(e||(e=dt(o)))(i||o)}})();static \u0275prov=O({token:o,factory:o.\u0275fac})}return o})();var Jt=new Ae("CONTEXTMENU_INSTANCE"),Xt=new Ae("CONTEXTMENUSUB_INSTANCE"),Wi=(()=>{class o extends it{el;renderer;contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new E;itemMouseEnter=new E;menuFocus=new E;menuBlur=new E;menuKeydown=new E;sublistViewChild;hostName="ContextMenu";_componentStyle=b(Ne);$pcContextMenu=b(Jt,{optional:!0,skipSelf:!0})??void 0;$pcContextMenuSub=b(Xt,{optional:!0,skipSelf:!0})??void 0;constructor(e,t,i){super(),this.el=e,this.renderer=t,this.contextMenu=i}getItemProp(e,t,i=null){return e&&e.item?tt(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemLabel(e){return this.getItemProp(e,"label")}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return F(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}_ptm(e,t){return this.$pcContextMenu?this.$pcContextMenu.ptm(e,t):this.ptm(e,t)}getPTOptions(e,t,i){return this._ptm(i,{context:{item:e.item,index:t,active:this.isItemActive(e),focused:this.isItemFocused(e),disabled:this.isItemDisabled(e)}})}position(e){let t=e.parentElement.parentElement,i=Ot(e.parentElement.parentElement),n=Xe(),r=e.offsetParent?e.offsetWidth:Ye(e),u=wt(t.children[0]);e.style.top="0px",parseInt(i.left,10)+u+r>n.width-Dt()?e.style.left=-1*r+"px":e.style.left=u+"px"}static \u0275fac=function(t){return new(t||o)(Y(ht),Y(gt),Y(mt(()=>Be)))};static \u0275cmp=k({type:o,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&H(mi,5),t&2){let n;D(n=P())&&(i.sublistViewChild=n.first)}},inputs:{visible:[2,"visible","visible",$],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",$],autoZIndex:[2,"autoZIndex","autoZIndex",$],baseZIndex:[2,"baseZIndex","baseZIndex",Q],popup:[2,"popup","popup",$],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Q],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",Q]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[He([Ne,{provide:Xt,useExisting:o},{provide:Kt,useExisting:o}]),Re],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"class","pBind","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","pBind","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","class","pBind",4,"ngIf"],["role","menuitem","pTooltip","",3,"style","class","pBind","tooltipOptions",4,"ngIf"],["role","separator",3,"pBind"],["role","menuitem","pTooltip","",3,"pBind","tooltipOptions"],[3,"click","mouseenter","pBind"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","pt","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","class","pBind",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","class","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","pBind",4,"ngIf"],["pRipple","",3,"target","pBind"],[3,"class","ngStyle","pBind",4,"ngIf"],[3,"class","pBind",4,"ngIf","ngIfElse"],[3,"class","value",4,"ngIf"],[3,"ngStyle","pBind"],[3,"pBind"],[3,"innerHTML","pBind"],[3,"value"],["data-p-icon","angle-right",3,"class","pBind",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["data-p-icon","angle-right",3,"pBind"],[3,"aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","pBind"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","pt"]],template:function(t,i){t&1&&v(0,Ri,3,11,"ul",3),t&2&&l("ngIf",i.root?!0:i.visible)},dependencies:[o,R,vt,Ge,yt,Ue,Ze,Ct,zt,rt,Rt,nt,jt,Ie,Ht,xe,ot],encapsulation:2,data:{animation:[Qe("overlayAnimation",[he(":enter",[de({opacity:0})]),he(":leave",[de({opacity:0})])])]}})}return o})(),Be=(()=>{class o extends it{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;appendTo=L(void 0);onShow=new E;onHide=new E;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=x(!1);focused=!1;activeItemPath=x([]);focusedItemInfo=x({index:-1,level:0,parentKey:"",item:null});submenuVisible=x(!1);$appendTo=Z(()=>this.appendTo()||this.config.overlayAppendTo());searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=b(Ne);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${F(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,bt(()=>{let t=this.activeItemPath();F(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}onInit(){this.id=this.id||Ft("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return Lt()||Et()}bindTriggerEventListener(){ue(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(ue(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild?.nativeElement?.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;onAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}getPTOptions(e,t,i,n){return this.ptm(e,{context:{item:t,index:i,focused:this.isItemFocused({index:i,item:t}),disabled:this.isItemDisabled(t)}})}isItemFocused(e){return this.focusedItemInfo().index===e.index}createProcessedItems(e,t=0,i={},n=""){let r=[];return e&&e.forEach((u,C)=>{let B=(n!==""?n+"_":"")+C,A={item:u,index:C,level:t,key:B,parent:i,parentKey:n};A.items=this.createProcessedItems(u.items,t+1,A,B),r.push(A)}),r}bindMatchMediaListener(){if(ue(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?tt(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&F(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&F(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:r,key:u,level:C,parentKey:B,item:A}=t;this.activeItemPath.set(this.activeItemPath().filter(be=>u!==be.key&&u.startsWith(be.key))),this.focusedItemInfo.set({index:r,level:C,parentKey:B,item:A}),fe(this.rootmenu?.sublistViewChild?.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&Vt(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(u=>u.key===t.parentKey);Je(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let r=this.activeItemPath().filter(u=>u.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(r),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(z(j({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=ge(this.rootmenu?.el?.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&(ge(t,'[data-pc-section="itemlink"]')||ge(t,"a,button"));i?i.click():t&&t.click();let n=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(n)){let u=this.focusedItemInfo();this.focusedItemInfo.set(z(j({},u),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:n}=e;if(Je(i))return;let{index:r,key:u,level:C,parentKey:B,items:A}=i,be=F(A),ct=this.activeItemPath().filter(pt=>pt.parentKey!==B&&pt.parentKey!==u);be&&(ct.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:r,level:C,parentKey:B,item:i.item}),n&&fe(this.rootmenu?.sublistViewChild?.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(ct)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.$attrSelector&&this.container?.setAttribute(this.$attrSelector,""),this.appendOverlay(),this.bindGlobalListeners(),fe(this.rootmenu?.sublistViewChild?.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){$t.appendOverlay(this.container,this.$appendTo()==="body"?this.document.body:this.$appendTo(),this.$appendTo())}moveOnTop(){this.autoZIndex&&this.containerViewChild&&st.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&st.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),fe(this.rootmenu?.sublistViewChild?.nativeElement),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){if(!this.document.scrollingElement||!this.containerViewChild?.nativeElement)return;let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:Ye(this.containerViewChild.nativeElement),n=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:Pt(this.containerViewChild.nativeElement),r=Xe();e+i-this.document.scrollingElement.scrollLeft>r.width&&(e-=i),t+n-this.document.scrollingElement.scrollTop>r.height&&(t-=n),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(r=>this.isItemMatched(r)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(r=>this.isItemMatched(r)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(r=>this.isItemMatched(r)),i!==-1&&(n=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),n}findVisibleItem(e){return F(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return et(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?et(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),n=this.focusedItemInfo();n.index!==t&&(this.focusedItemInfo.set(z(j({},n),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=ge(this.rootmenu?.el?.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){ue(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild?.nativeElement?.isSameNode(e.target)||this.containerViewChild?.nativeElement?.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.$appendTo()&&this.containerViewChild&&this.$appendTo()==="body"&&this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement)}onDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements()}static \u0275fac=function(t){return new(t||o)(Y(Bt))};static \u0275cmp=k({type:o,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,n){if(t&1&&(ve(n,ji,4),ve(n,zi,4),ve(n,At,4)),t&2){let r;D(r=P())&&(i.itemTemplate=r.first),D(r=P())&&(i.submenuIconTemplate=r.first),D(r=P())&&(i.templates=r)}},viewQuery:function(t,i){if(t&1&&(H(Hi,5),H(Gi,5)),t&2){let n;D(n=P())&&(i.rootmenu=n.first),D(n=P())&&(i.containerViewChild=n.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",$],style:"style",styleClass:"styleClass",autoZIndex:[2,"autoZIndex","autoZIndex",$],baseZIndex:[2,"baseZIndex","baseZIndex",Q],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",Q],appendTo:[1,"appendTo"]},outputs:{onShow:"onShow",onHide:"onHide"},features:[He([Ne,{provide:Jt,useExisting:o}]),Re],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"class","style","ngStyle","pBind",4,"ngIf"],[3,"ngStyle","pBind"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath","pt"]],template:function(t,i){t&1&&v(0,Zi,4,22,"div",2),t&2&&l("ngIf",i.visible())},dependencies:[R,Ge,Ue,Wi,Ze,rt,nt,Ie,xe,ot],encapsulation:2,data:{animation:[Qe("overlayAnimation",[he(":enter",[de({opacity:0}),We("250ms")]),he(":leave",[We(".1s linear",de({opacity:0}))])])]},changeDetection:0})}return o})(),ei=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=ft({type:o});static \u0275inj=ut({imports:[Be,xe,xe]})}return o})();var Yi=["contextMenu"];function Ji(o,s){if(o&1){let e=S();c(0,"a",3),g("click",function(){let i=h(e).$implicit,n=a();return _(n.onClickContextMenuItem(i))}),y(1,"i"),c(2,"span",4),d(3),m()()}if(o&2){let e=s.$implicit;p(),I(e.icon),p(2),w(e.label)}}var Ro=(()=>{let s=class s{constructor(){this.items=L([]),this.onSelectItem=q()}show(t,i){clearTimeout(this.hoverTimeout),this.selectedData=null,this.hoverTimeout=setTimeout(()=>{this.contextMenuEl.show(t),this.selectedData=i},100)}hide(){this.contextMenuEl?.hide(),clearTimeout(this.hoverTimeout),this.selectedData=null}onClickContextMenuItem(t){this.onSelectItem.emit({item:t,data:this.selectedData})}};s.\u0275fac=function(i){return new(i||s)},s.\u0275cmp=k({type:s,selectors:[["app-context-menu"]],viewQuery:function(i,n){if(i&1&&H(Yi,5),i&2){let r;D(r=P())&&(n.contextMenuEl=r.first)}},inputs:{items:[1,"items"]},outputs:{onSelectItem:"onSelectItem"},decls:4,vars:1,consts:[["contextMenu",""],["item",""],[3,"model"],["pRipple","",1,"flex","items-center","p-contextmenu-item-link",3,"click"],[1,"ml-2"]],template:function(i,n){i&1&&(c(0,"p-contextmenu",2,0),v(2,Ji,4,3,"ng-template",null,1,me),m()),i&2&&l("model",n.items())},dependencies:[V,ei,Be,Ie],encapsulation:2});let o=s;return o})();export{Xn as a,Ro as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-
|
|
1
|
+
import{a as Q}from"./chunk-6OJQRHIZ.js";import{a as q}from"./chunk-FHER4TFY.js";import{a as X}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as J}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as M}from"./chunk-AGBJEXIM.js";import{e as Z}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as j,n as z}from"./chunk-EDEZ3JLR.js";import{A as H,h as $,m as G}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{G as O,I as W,i as N,l as R,m as F}from"./chunk-LNJUGHOX.js";import{$b as I,Gb as U,Ha as V,Mc as a,Nc as g,Qc as P,Rc as T,Sc as B,Tc as A,Z as b,bc as k,cc as E,ec as L,fc as K,gc as s,hc as e,hd as v,ic as t,id as y,jc as c,lb as D,nb as l,qc as w,ra as x,vc as h,xa as u,xc as S,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function Y(r,p){if(r&1){let o=w();e(0,"img",21),h("click",function(m){u(o);let i=S().$implicit,n=S();return d(n.onZoomImage(m,i==null?null:i.ImageUrl))}),t()}if(r&2){let o=S().$implicit;s("src",o==null?null:o.ThumbnailUrl,D)}}function ee(r,p){r&1&&c(0,"img",17)}function te(r,p){if(r&1&&(e(0,"tr")(1,"td")(2,"div",15),I(3,Y,1,1,"img",16)(4,ee,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),v(16,"number"),t()()),r&2){let o=p.$implicit;l(3),k(o.ImageUrl?3:4),l(3),g(o.Name),l(2),g(o.SKU),l(3),s("typeId",o.TypeID),l(2),g(o.ChannelName),l(2),g(y(16,6,o.Count))}}var we=(()=>{let p=class p{constructor(){this.httpService=x(Z),this.biggerPictureService=x(Q),this.filter=V({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=M.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(M.GetMultiListingSKU,this.filter()).pipe(b(1))}onZoomImage(_,m){this.biggerPictureService.openBiggerPicture(_,m)}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=U({type:p,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(m,i){if(m&1){let n=w();A(0),v(1,"async"),e(2,"mainpanel",0),h("onSubmit",function(){return u(n),d(i.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),B("ngModelChange",function(C){return u(n),T(i.filter().ListChannelID,C)||(i.filter().ListChannelID=C),d(C)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),L(30,te,17,8,"tr",null,E),t()(),e(32,"app-custom-paginator",14),h("next",function(){return u(n),d(i.initMultipleListingSKU())})("previous",function(){return u(n),d(i.initMultipleListingSKU())}),t()()()()()()}if(m&2){let n=y(1,6,i.multipleListingSKU$);l(2),s("hideSearchBox",!0),l(10),s("multiple",!0),P("ngModel",i.filter().ListChannelID),l(18),K(n==null?null:n.Data),l(2),s("filter",i.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",i.rowCountApi)}},dependencies:[F,z,j,J,W,O,q,X,H,$,G,N,R],encapsulation:2});let r=p;return r})();export{we as DuplicateSkuV2Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae,b as pe,c as ce,d as se,e as le,f as de}from"./chunk-RUBV3KX2.js";import{a as G}from"./chunk-
|
|
1
|
+
import{a as ae,b as pe,c as ce,d as se,e as le,f as de}from"./chunk-RUBV3KX2.js";import{a as G}from"./chunk-RQQWNLDZ.js";import"./chunk-AZOCRKXK.js";import"./chunk-UH5C5HXK.js";import{b as re,c as ne}from"./chunk-E6AMKEQR.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import{a as oe,b as ie}from"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as Z}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{m as ee,n as te}from"./chunk-EDEZ3JLR.js";import{A as Y,c as Q,h as U,m as X}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{D as q,F as H,G as J,I as K,i as j,m as z}from"./chunk-LNJUGHOX.js";import{$b as V,$c as L,Gb as P,Ha as C,Kc as F,Lc as E,Mc as _,Nc as I,Oc as O,Qc as x,Rc as v,Sc as w,Tc as W,Zc as B,_c as T,aa as D,bc as N,cc as y,ea as R,ec as M,fc as S,gc as b,hc as n,hd as $,ic as p,id as A,nb as s,qc as k,ra as g,vc as h,xa as l,xc as f,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var me=()=>({display:"d-flex"}),ue=a=>({"border-end-0":a});function _e(a,c){if(a&1){let i=k();n(0,"div",18),h("click",function(){let o=l(i).$implicit;return d(o.checked=!o.checked)}),n(1,"div",19)(2,"p-checkbox",20),w("ngModelChange",function(o){let e=l(i).$implicit;return v(e.checked,o)||(e.checked=o),d(o)}),h("click",function(o){return l(i),d(o.stopPropagation())}),p(),n(3,"p",21),_(4),p()()()}if(a&2){let i=c.$implicit,t=c.$index,o=f().$implicit;E(L(8,ue,t!==o.Roles.length-1)),b("pTooltip",i.Description),s(2),F(T(10,me)),b("binary",!0),x("ngModel",i.checked),s(2),O(" ",i.Name," ")}}function he(a,c){if(a&1){let i=k();n(0,"div",11)(1,"div",12),h("click",function(){let o=l(i).$implicit,e=f(2);return d(e.onPermissionGroupChange(!o.checked,o.ID))}),n(2,"div",13)(3,"span",14),_(4),p(),n(5,"p-checkbox",15),h("click",function(o){return l(i),d(o.stopPropagation())})("onChange",function(o){let e=l(i).$implicit,r=f(2);return d(r.onPermissionGroupChange(o.checked,e.ID))}),p()()(),n(6,"div",16)(7,"div",11),M(8,_e,5,11,"div",17,y),p()()()}if(a&2){let i=c.$implicit;s(4),I(i.Name),s(),F(T(5,me)),b("binary",!0)("ngModel",i.checked),s(3),S(i==null?null:i.Roles)}}function ge(a,c){if(a&1&&(n(0,"div",9),M(1,he,10,6,"div",11,y),p()),a&2){let i=f();s(),S(i.roleOptions())}}var Be=(()=>{let c=class c{constructor(){this.groupService=g(G),this.activatedRoute=g(q),this.toastr=g(Z),this.router=g(H),this.groupName=C(null),this.roleOptions=C([]),this.description=C(null),this.group$=this.activatedRoute.queryParams.pipe(D(t=>(this.groupID=t.ID,this.groupService.getGroupsForm(t.ID))),R(t=>{this.groupName.set(t.Group.Name),this.description.set(t.Group.Description),this.initRoleOptions(t.Options,t.RoleSelected)}))}initRoleOptions(t,o){t=t.map(e=>(e.Roles=e.Roles.map(r=>(r.checked=o.includes(r.ID),r)),e.checked=e.Roles.every(r=>r.checked),e)),this.roleOptions.set(t)}onPermissionGroupChange(t,o){this.roleOptions.update(e=>{let r=e.findIndex(m=>m.ID===o);return r!==-1&&(e[r].checked=t,e[r].Roles=e[r].Roles.map(m=>(m.checked=t,m))),[...e]})}onSubmit(){let t={Group:{ID:this.groupID,Name:this.groupName(),Description:this.description()},RoleSelected:this.getSelecedRoles()};this.groupService.submitGroup(t).subscribe({next:o=>{this.toastr.success("Group saved successfully","Success"),this.router.navigate(["/menu/users/groups"])}})}getSelecedRoles(){let t=[];return this.roleOptions().forEach(o=>{o.Roles.forEach(e=>{e.checked&&t.push(e.ID)})}),t}};c.\u0275fac=function(o){return new(o||c)},c.\u0275cmp=P({type:c,selectors:[["app-groups-form"]],features:[B([G])],decls:24,vars:8,consts:[["headerTitle","Groups Form",3,"headerTitle","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/users/groups",1,"btn","btn-secondary","me-3"],[1,"btn","btn-success",3,"click"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12"],["type","text","pInputText","","placeholder","Group Name",1,"w-100","form-control","rounded-1",2,"padding-top","12px","padding-bottom","12px","font-size","14px",3,"ngModelChange","ngModel"],["value","0"],["value","1"],[1,"d-flex","flex-column","row-gap-6","ps-8"],["pInputTextarea","","rows","10","placeholder","Description",1,"w-100","form-control","rounded-1",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between","border-end-0","cursor-pointer",2,"height","40px","background","#f6f6f6","cursor","pointer",3,"click"],[1,"d-flex","justify-content-center","w-100","align-items-center","gap-4"],[1,"fs-5","w-100","text-center"],["size","small",3,"click","onChange","binary","ngModel"],[1,"col"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white","cursor-pointer",2,"height","40px",3,"class","pTooltip"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white","cursor-pointer",2,"height","40px",3,"click","pTooltip"],[1,"d-flex","h-100","align-items-center","gap-4","px-2"],["size","small",3,"ngModelChange","click","binary","ngModel"],[1,"fs-6","text-dark",2,"margin","0"]],template:function(o,e){if(o&1){let r=k();W(0),$(1,"async"),n(2,"mainpanel",0)(3,"actions")(4,"a",1),_(5," Cancel "),p(),n(6,"button",2),h("click",function(){return l(r),d(e.onSubmit())}),_(7,"Save"),p()(),n(8,"content")(9,"div",3)(10,"div",4)(11,"div",5)(12,"input",6),w("ngModelChange",function(u){return l(r),v(e.groupName,u)||(e.groupName=u),d(u)}),p()()(),n(13,"p-tabs",7)(14,"p-tablist")(15,"p-tab",7),_(16,"Permission"),p(),n(17,"p-tab",8),_(18,"Description"),p()(),n(19,"p-tabpanels")(20,"p-tabpanel",7),V(21,ge,3,0,"div",9),p(),n(22,"p-tabpanel",8)(23,"textarea",10),w("ngModelChange",function(u){return l(r),v(e.description,u)||(e.description=u),d(u)}),p()()()()()()()}if(o&2){let r=A(1,6,e.group$);s(2),b("headerTitle",e.groupName()?"Edit Group - "+e.groupName():"New Group Form")("hideSearchBox",!0)("hideSearchDropdown",!0),s(10),x("ngModel",e.groupName),s(9),N(r?21:-1),s(2),x("ngModel",e.description)}},dependencies:[z,te,ee,de,le,se,ce,ae,pe,Y,Q,U,X,ne,re,ie,oe,K,J,j],styles:["[_nghost-%COMP%] .p-checkbox{display:flex!important;--p-checkbox-checked-background: #0976b4;--p-checkbox-hover-border-color: #0976b4;--p-checkbox-checked-border-color: #0976b4;--p-checkbox-checked-hover-border-color: #0976b4;--p-checkbox-hover-border-color-background: #0669a2;--p-checkbox-checked-hover-background: #0976b4}[_nghost-%COMP%] .p-tabs{--p-tabs-tab-active-color: #555555;--p-tabs-tab-color: #0976b4}[_nghost-%COMP%] .p-tabs .p-tabpanels{padding-left:0!important}[_nghost-%COMP%] .p-tabs .p-tablist-active-bar{background-color:#555!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}"],changeDetection:0});let a=c;return a})();export{Be as GroupsFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as F}from"./chunk-5X2E3W32.js";import{a as x}from"./chunk-2IASUYTM.js";import{i as E}from"./chunk-I723PUUO.js";import{a as T}from"./chunk-AGBJEXIM.js";import{b as w,e as d}from"./chunk-OXWPYJNB.js";import{b as i,c as g}from"./chunk-JBEKD57G.js";import{F as D}from"./chunk-LNJUGHOX.js";import{B as U,G as C,Ha as j,J as l,g as A,ma as s,q as u,ra as p,v as I}from"./chunk-ZYJ6LAJ3.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(w),this.router=p(D),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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as E}from"./chunk-DHPNXR6E.js";import{a as je}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as Ke}from"./chunk-TYQY4WPY.js";import"./chunk-IM5M2CAI.js";import{a as J}from"./chunk-ISMIPSYN.js";import{a as ze,b as Ge,c as qe,d as Y,e as ee}from"./chunk-S5R6MCNP.js";import{c as We,d as $e}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import{a as He,b as Qe}from"./chunk-DXYMG6QK.js";import"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import"./chunk-63I3I3MX.js";import{a as Ae}from"./chunk-2IASUYTM.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as Z}from"./chunk-ZSUWHVKX.js";import{a as Le,b as Oe,c as Be}from"./chunk-6PW6S7MI.js";import"./chunk-N5AE5WMQ.js";import{a as Ue}from"./chunk-6OJQRHIZ.js";import"./chunk-6OIMOM7S.js";import{e as Ie}from"./chunk-6KWG6O5L.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as be}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as X}from"./chunk-AGBJEXIM.js";import{b as fe,e as Se}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as y}from"./chunk-JBEKD57G.js";import{b as Pe,c as De,d as Me,j as Ve,k as Ee,l as ke,m as Re,n as Ne}from"./chunk-EDEZ3JLR.js";import{A as xe,b as _e,c as Ce,h as ue,m as he,o as ge}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{a as ye,b as ve,c as we}from"./chunk-ZETUYNFJ.js";import{v as Fe,w as Te}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{G as pe,I as me,c as ce,i as $,j as H,l as de,m as Q}from"./chunk-LNJUGHOX.js";import{$b as u,$c as D,G as j,Gb as O,Ha as M,Lc as ie,Mb as B,Mc as m,Nc as L,Oc as I,Qc as F,Rc as T,Sc as P,Tc as oe,Uc as ae,Vc as le,Wc as re,Z as R,Zc as W,_c as se,bc as h,cc as G,ea as z,ec as q,fc as K,gc as g,hc as a,hd as f,ic as r,id as b,jc as v,jd as V,lb as N,nb as s,nc as A,oc as U,qc as w,ra as S,v as k,vc as x,xa as _,xc as l,ya as C}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as ne}from"./chunk-66YHNWRR.js";var Je=()=>["/menu/order/download"];function et(i,c){if(i&1&&(a(0,"li",4)(1,"div"),m(2," The last time you manually download your order is on "),a(3,"span",8),m(4),f(5,"date"),r()(),a(6,"div",9),m(7),r()()),i&2){l();let e=le(0);s(4),I(" ",V(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function tt(i,c){i&1&&(a(0,"li",4),m(1," The last time you manually download your order is on (-) "),r())}var Ze=(()=>{let c=class c{constructor(){this.dialogRef=S(Pe),this.data=S(De),this.modalConfig=new Ve,this.inventoryService=S(E),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(k(n=>{let t=n.OrderDownloadLatestOn!=y.MinDate,o=null,p=null;return t&&(o=new Date(n.OrderDownloadLatestOn),p=y.convertToReadableDate(o)),{OrderDownloadLatestOn:o,calculatedDate:p}}),R(1)),this.selectedProducts=M(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}};c.\u0275fac=function(t){return new(t||c)},c.\u0275cmp=O({type:c,selectors:[["app-dialog-update-product-info"]],features:[W([E])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(t,o){if(t&1){let p=w();oe(0),f(1,"async"),a(2,"modal-material",0),x("onCancel",function(){return _(p),C(o.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),m(6),r(),a(7,"div",3)(8,"ul"),u(9,et,8,5,"li",4)(10,tt,2,0,"li",4),r()()()(),a(11,"div",5)(12,"a",6),x("click",function(){return _(p),C(o.onCancel())}),m(13," Download "),r(),a(14,"button",7),x("click",function(){return _(p),C(o.onUpdate())})("keyup.F2",function(){return _(p),C(o.onUpdate())}),m(15," Update Anyway "),r()()()}if(t&2){let p=ae(b(1,4,o.lastDownloadInfo$));s(2),g("config",o.modalConfig),s(4),I("",o.selectedProducts().length," Product(s) will be updated."),s(3),h(p!=null&&p.OrderDownloadLatestOn?9:10),s(3),g("routerLink",se(7,Je))}},dependencies:[Ee,Q,me,pe,$,H],encapsulation:2});let i=c;return i})();var te=i=>[i],nt=i=>({"text-decoration-line-through":i}),it=i=>({"me-10":i}),ot=i=>({"bg-gradient-warning":i}),at=i=>({cursor:i});function lt(i,c){if(i&1){let e=w();a(0,"button",37),x("click",function(){_(e);let t=l(),o=l(2);return C(o.onScanInventory(t))}),v(1,"i",38),m(2,"Refresh "),r()}}function rt(i,c){if(i&1){let e=w();a(0,"div",35)(1,"button",39),x("click",function(){_(e);let t=l(),o=l(2);return C(o.onOpenDialogUpdateStockInfo(t))}),v(2,"i",40),m(3," Update "),r(),v(4,"button",41),a(5,"ul",42)(6,"a",43),x("click",function(){_(e);let t=l(3);return C(t.openExportDialog())}),v(7,"i",44),a(8,"span"),m(9,"Export"),r()()()()}}function st(i,c){if(i&1){let e=w();a(0,"button",45),x("click",function(){_(e);let t=l(3);return C(t.openExportDialog())}),v(1,"i",44),a(2,"span"),m(3,"Export"),r()()}}function ct(i,c){if(i&1&&(a(0,"div"),u(1,lt,3,0,"button",34),u(2,rt,10,0,"div",35)(3,st,4,0,"button",36),r()),i&2){let e=c,n=l(2);s(),h(n.productService.hasSelectionVariant(e)?1:-1),s(),h(n.productService.hasSelectionVariant(e)?2:3)}}function dt(i,c){i&1&&(a(0,"div",18)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function pt(i,c){if(i&1){let e=w();a(0,"th")(1,"input",46),P("ngModelChange",function(t){_(e);let o=l(3);return T(o.checkboxState,t)||(o.checkboxState=t),C(t)}),x("ngModelChange",function(){let t=_(e),o=l(3);return C(o.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(3);s(),F("ngModel",e.checkboxState)}}function mt(i,c){if(i&1&&(A(0),u(1,pt,2,1,"th"),f(2,"async"),U()),i&2){let e,n=l(2);s(),h((e=b(2,1,n.products$))?1:-1,e)}}function _t(i,c){i&1&&(a(0,"th",31),m(1," Reserved "),r())}function Ct(i,c){if(i&1){let e=w();a(0,"input",63),P("ngModelChange",function(t){_(e);let o=l(4).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),x("ngModelChange",function(){_(e);let t=l(4).$implicit,o=l(2);return C(o.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(4).$implicit;F("ngModel",e.selected)}}function ut(i,c){if(i&1&&(A(0),a(1,"div",61),u(2,Ct,1,1,"input",62),r(),U()),i&2){let e=l(3).$implicit;s(),g("ngClass",D(2,it,e.Variants.length<=1)),s(),h(e.Variants.length>1?2:-1)}}function ht(i,c){if(i&1){let e=w();a(0,"img",64),x("click",function(t){_(e);let o=l(3).$implicit,p=l(2);return C(p.onZoomImage(t,o==null?null:o.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;g("src",re(e==null?null:e.ThumbnailUrl),N)}}function gt(i,c){i&1&&v(0,"img",58)}function xt(i,c){if(i&1&&(v(0,"br"),a(1,"div",65),v(2,"i",66),a(3,"small"),m(4),r()()),i&2){let e=l(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function ft(i,c){if(i&1&&(a(0,"td",56)(1,"div",12),B(2,ut,3,4,"ng-container",25),a(3,"div"),u(4,ht,1,2,"img",57)(5,gt,1,0,"img",58),r()()(),a(6,"td",59)(7,"span",60),m(8),r(),u(9,xt,5,1),r()),i&2){let e=l(2).$implicit,n=l(2);g("rowSpan",e==null?null:e.Variants.length),s(2),g("ngxPermissionsOnly",D(6,te,n.inventoryUpdateRole)),s(2),h(e!=null&&e.ThumbnailUrl?4:5),s(2),g("rowSpan",e==null?null:e.Variants.length),s(2),L(e==null?null:e.Name),s(),h(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function St(i,c){if(i&1){let e=w();a(0,"input",46),P("ngModelChange",function(t){_(e);let o=l(3).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),r()}if(i&2){let e=l(3).$implicit;F("ngModel",e.selected)}}function yt(i,c){if(i&1&&u(0,St,1,1,"input",68),i&2){let e=l(2).$implicit;h((e==null?null:e.Inventory)<=1e5?0:-1)}}function vt(i,c){if(i&1){let e=w();a(0,"input",46),P("ngModelChange",function(t){_(e);let o=l(2).$implicit;return T(o.selected,t)||(o.selected=t),C(t)}),r()}if(i&2){let e=l(2).$implicit;F("ngModel",e.selected)}}function wt(i,c){if(i&1&&(A(0),a(1,"td",67),u(2,yt,1,1)(3,vt,1,1,"input",68),r(),U()),i&2){let e=l().$implicit;s(2),h((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function bt(i,c){i&1&&(a(0,"div",51),m(1," Not Found "),r())}function It(i,c){if(i&1&&(a(0,"div")(1,"span",69),m(2),f(3,"number"),r(),m(4," => "),a(5,"span",70),m(6),f(7,"number"),r()()),i&2){let e=l().$implicit;s(2),I(" ",b(3,2,e==null||e.I==null?null:e.I.Available)),s(4),L(b(7,4,e==null?null:e.Inventory))}}function Ft(i,c){if(i&1&&(m(0),f(1,"number")),i&2){let e=l().$implicit;I(" ",b(1,1,e==null?null:e.Inventory)," ")}}function Tt(i,c){if(i&1&&(a(0,"div",52)(1,"a",71),v(2,"i",72),r()()),i&2){let e=l().$implicit,n=l(3);s(),g("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N)}}function Pt(i,c){if(i&1){let e=w();a(0,"span",76),x("click",function(){_(e);let t=l(2).$implicit,o=l().$implicit,p=l(2);return C(p.openTableDialog(o,t))}),m(1),f(2,"number"),r()}if(i&2){let e=l(2).$implicit,n=l(3);ie(D(5,at,n.hasInventoryEdit())),s(),I(" ",b(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Dt(i,c){if(i&1){let e=w();a(0,"td",53)(1,"div",50)(2,"div"),u(3,Pt,3,7,"span",73),f(4,"async"),r(),a(5,"div",52)(6,"a",71),v(7,"i",72),r()(),a(8,"div",52)(9,"span",74),x("click",function(){_(e);let t=l().$implicit,o=l(3);return C(o.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),v(10,"i",75),r()()()()}if(i&2){let e,n=l().$implicit,t=l(3);g("ngClass",D(5,ot,(n==null?null:n.Inventory)!=(n==null||n.Channel[0]==null?null:n.Channel[0].Inventory))),s(3),h((e=b(4,3,t.products$))?3:-1,e),s(3),g("href",n==null||n.Channel[0]==null?null:n.Channel[0].Url,N)}}function Mt(i,c){if(i&1&&(a(0,"span",77),m(1),f(2,"number"),r()),i&2){let e=l(2).$implicit;s(),I(" (",b(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function Vt(i,c){i&1&&m(0," - ")}function Et(i,c){if(i&1&&(a(0,"td",48),u(1,Mt,3,3,"span",77)(2,Vt,1,0),r()),i&2){let e=l().$implicit;s(),h(!(e==null||e.Channel[0]==null)&&e.Channel[0].InventoryReserved?1:2)}}function kt(i,c){i&1&&m(0," - ")}function Rt(i,c){if(i&1&&(a(0,"span",55),f(1,"date"),m(2),f(3,"date"),r()),i&2){let e=l().$implicit;g("matTooltip",V(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",V(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function Nt(i,c){if(i&1&&(a(0,"tr"),u(1,ft,10,8),a(2,"td",47),m(3),r(),a(4,"td",48)(5,"span",49),m(6),r()(),B(7,wt,4,1,"ng-container",25),a(8,"td")(9,"div",50),u(10,bt,2,0,"div",51),u(11,It,8,6,"div"),u(12,Ft,2,3),u(13,Tt,3,1,"div",52),r()(),u(14,Dt,11,7,"td",53),u(15,Et,3,1,"td",48),a(16,"td",54),u(17,kt,1,0)(18,Rt,4,8,"span",55),r()()),i&2){let e=c.$implicit,n=c.$index,t=l(3);s(),h(n==0?1:-1),s(2),L(e==null?null:e.Model),s(2),g("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",D(13,nt,e.Discontinued)),s(),L(e==null?null:e.Code),s(),g("ngxPermissionsOnly",D(15,te,t.inventoryUpdateRole)),s(3),h((e==null?null:e.I)==null?10:-1),s(),h((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),h((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),h((e==null?null:e.I)!=null?13:-1),s(),h(e!=null&&e.Channel?14:-1),s(),h(t.isShowReservedColumn?15:-1),s(2),h((e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==t.minDate?17:18)}}function Lt(i,c){if(i&1&&(a(0,"tbody"),q(1,Nt,19,17,"tr",null,G),r()),i&2){let e=c.$implicit;s(),K(e.Variants)}}function Ot(i,c){if(i&1){let e=w();a(0,"mainpanel",1),x("onSubmit",function(t){_(e);let o=l();return C(o.onSearch(t))}),a(1,"actions")(2,"div",2),u(3,ct,4,2,"div"),f(4,"async"),r()(),a(5,"filters")(6,"div",3)(7,"label",4),m(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",5),x("onChannelChange",function(t){_(e);let o=l();return C(o.onChannelChange(t))}),r()(),a(10,"div",3)(11,"filter-query-type",6),P("numberFilterComparatorChange",function(t){_(e);let o=l();return T(o.searchFilter.NumberFilterComparator,t)||(o.searchFilter.NumberFilterComparator=t),C(t)})("searchTypeChange",function(t){_(e);let o=l();return T(o.searchFilter.SearchType,t)||(o.searchFilter.SearchType=t),C(t)}),r()(),a(12,"div",3)(13,"label",7),m(14,"PageNumber"),r(),a(15,"input",8),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),C(t)}),r()(),a(16,"div",3)(17,"label",9),m(18,"Page Size"),r(),a(19,"input",10),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),C(t)}),r()(),a(20,"div")(21,"label",11),m(22,"Quantity From - To"),r(),a(23,"div",12)(24,"input",13),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.QuantityFrom,t)||(o.searchFilter.QuantityFrom=t),C(t)}),r(),m(25," - "),a(26,"input",14),P("ngModelChange",function(t){_(e);let o=l();return T(o.searchFilter.QuantityTo,t)||(o.searchFilter.QuantityTo=t),C(t)}),r()()()(),a(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),u(31,dt,3,0,"div",18),a(32,"table",19),x("matSortChange",function(t){_(e);let o=l();return C(o.onSortVariant(t))}),a(33,"thead",20)(34,"tr")(35,"th",21),m(36," Product "),v(37,"br"),a(38,"mat-slide-toggle",22),x("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,C(t.onShowDifferenceStock())}),a(39,"small",11),m(40,"FILTER DIFFERENT INVENTORY"),r()()(),a(41,"th",23),m(42,"Variant"),r(),a(43,"th",24),m(44,"SKU"),r(),B(45,mt,3,3,"ng-container",25),a(46,"th",26),m(47," POS "),r(),a(48,"th",27)(49,"div",28),x("click",function(){_(e);let t=l();return C(t.openModalFilter())}),v(50,"img",29),a(51,"span",30),m(52),f(53,"stringLimit"),r()()(),u(54,_t,2,0,"th",31),a(55,"th",32),m(56,"Last Sync"),r()()(),q(57,Lt,3,0,"tbody",null,G),f(59,"async"),r(),a(60,"infinite-paginator",33),f(61,"async"),x("onNextPage",function(){_(e);let t=l();return C(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return C(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return C(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,n,t,o,p=c,d=l();g("hideSearchBox",!1)("searchBoxPlaceHolder",d.searchPlaceholder()),s(3),h((e=b(4,24,d.products$))?3:-1,e),s(6),g("ngModel",(d.searchFilter==null?null:d.searchFilter.LocationID)||(d.searchFilter==null?null:d.searchFilter.ChannelID)),s(2),g("numberFilterComparatorOptions",p==null||p.Options==null?null:p.Options.SearchComparatorTypeOptions),F("numberFilterComparator",d.searchFilter.NumberFilterComparator),g("searchTypeOptions",p==null||p.Options==null?null:p.Options.SearchSKUOnlyOrSKUNameOptions),F("searchType",d.searchFilter.SearchType),s(4),F("ngModel",d.searchFilter.PageNumber),s(4),F("ngModel",d.searchFilter.RowCount),s(5),F("ngModel",d.searchFilter.QuantityFrom),s(2),F("ngModel",d.searchFilter.QuantityTo),s(5),h((d.searchFilter==null?null:d.searchFilter.filterModel)==3?31:-1),s(14),g("ngxPermissionsOnly",D(33,te,d.inventoryUpdateRole)),s(4),g("matTooltip",((n=d.channelIdentity())==null||n.label==null?null:n.label.length)>13?(n=d.channelIdentity())==null?null:n.label:""),s(),g("src",(t=d.channelIdentity())==null?null:t.img,N),s(2),I(" ",V(53,26,(o=d.channelIdentity())==null?null:o.label,13)," "),s(2),h(d.isShowReservedColumn?54:-1),s(3),K(b(59,29,d.products$)),s(3),g("totalData",d.infinitePagination.totalData())("hideCount",d.infinitePagination.hideCount())("rowCount",b(61,31,d.infinitePagination.totalRowCount$))("pageNumber",d.infinitePagination.pageNumber())("disableNextButton",d.infinitePagination.disableNextButton())("goToLastPage",d.infinitePagination.isLastPage())}}var Bn=(()=>{let c=class c{constructor(){this.http=S(Se),this.toastr=S(fe),this.dialog=S(Me),this.productService=S(Ae),this.authService=S(be),this.biggerPictureService=S(Ue),this.mainPanelService=S(ke),this.placeholderService=S(We),this.infinitePagination=S(Y),this.ngxPermissionsService=S(ye),this.updateResHandling=S(ee),this.inventoryService=S(E),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=y.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=y.GuidEMpty,this.selectedChannel=M(null),this.channelIdentity=M({img:null,label:null}),this.inventoryUpdateRole=Z.InventoryUpdate,this.hasInventoryEdit=M(!0),this.searchPlaceholder=M("Search ...")}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(z(n=>{this.checkShowReservedColumn(n)}),k(n=>(n=this.calculateAvailableStock(n),n)),R(1)),this.products$=this.sourceObs$}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(R(1),z(n=>{this.searchFilter={RowCount:n.Filter?.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter?.ChannelID,LocationID:n.Filter?.LocationID,NumberFilterComparator:n.Filter?.NumberFilterComparator,SearchType:n.Filter?.SearchType},this.initReloadData(),this.initSearchPlaceholder(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}initRoles(){this.ngxPermissionsService.hasPermission(Z.InventoryUpdate).then(n=>this.hasInventoryEdit.set(n))}calculateAvailableStock(n){return n.map(o=>(o.totalAvailable=o.Variants.reduce((p,d)=>(p+=d.I?.Available||0,p),0),o))}checkShowReservedColumn(n){let t=0,o;n.forEach(p=>{o=p.Variants.find(d=>y.IsNotEmpty(d?.Channel[0]?.InventoryReserved)),o&&(t+=1)}),this.isShowReservedColumn=t>0}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),y.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());y.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=y.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=y.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
|
+
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(n){this.searchFilter.text=n,this.setChannelFilter(),this.initReloadData(),this.initSearchPlaceholder()}openModalFilter(){this.mainPanelService.openModalFilter()}onOpenDialogUpdateStockInfo(n){let t=this.productService.selectedVariantProduct(n);this.dialog.open(Ze,{data:{channelId:t[0]?.Channel[0]?.ChannelID,selectedProducts:t}}).afterClosed().pipe(j(o=>o===!0)).subscribe(()=>{this.updateStock(t)})}updateStock(n){if(n.length>0){let t=this.searchFilter.LocationID,o=n.map(d=>ne({ChannelItemID:d?.Channel[0]?.ChannelItemID,ChannelVariationID:d?.Channel[0]?.ChannelVariationID,Inventory:d.Inventory},y.IsNotEmpty(t)&&{LocationID:t})),p={ListChannelID:[this.searchFilter.ChannelID],List:o};this.http.post(X.UpdateInventoryChannel,p).subscribe(d=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(d)})}}handlingUpdateStock(n){if(n[0]?.Response){let t=n[0]?.Response?.Fail_list,o=n[0]?.Response?.Success_list;this.updateResHandling.responseHandling(o,t,"Stock")}else this.toastr.error(n[0]?.Exception,"Error")}refreshInventory(n,t,o,p){let d={ChannelItemID:n,ChannelVariationID:t,ChannelID:o,VariantID:p};this.http.post("/api/Inventory/RefreshInventoryChannel",d).subscribe(Bt=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.Inventory>=0&&(t.selected=n.selected),t))}onCheckboxStateChange(n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=this.checkboxState,o)),t))}openTableDialog(n,t){this.hasInventoryEdit()&&this.dialog.open(ze,{data:{Name:n.Name,Variant:t,ChannelID:t?.Channel[0]?.ChannelID,Table:"inventory",ChannelItemID:n.ChannelItemID}}).afterClosed().pipe(j(p=>y.IsNotEmpty(p))).subscribe(p=>{this.updateItemAfterDialog(p)})}updateItemAfterDialog(n){let t=n.InventoryMultiwarehouse[0]?.LocationID,o={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n?.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:t};this.http.post(X.UpdateUpdateQuantityByItem,o).subscribe(p=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([p])})}onScanInventory(n){let t=this.productService.selectedVariantProduct(n);this.inventoryService.refreshInventory(t).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(je,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=J.DIFFERENCE:this.searchFilter.filterModel=J.ALL,this.initReloadData()}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}onSortVariant(n){if(n.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(k(t=>t.map(o=>(o.Variants=o.Variants.sort((p,d)=>y.compare(p.I?.Available,d.I?.Available,n.direction==="asc")),o)).sort((o,p)=>y.compare(o.totalAvailable,p.totalAvailable,n.direction==="asc"))))}};c.\u0275fac=function(t){return new(t||c)},c.\u0275cmp=O({type:c,selectors:[["app-single-channel-comparison"]],features:[W([Y,E,ee])],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"hideSearchBox","searchBoxPlaceHolder"],["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"d-flex"],[1,"mb-5"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],[4,"ngxPermissionsOnly"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[1,"text-center"],["matTooltipShowDelay","500",3,"matTooltip"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[3,"ngClass"],["type","checkbox",1,"me-3",3,"ngModel"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["title","Stock Available"],["title","Inventory below minimum inventory"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[3,"class"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[3,"click"],[1,"text-danger"]],template:function(t,o){if(t&1&&(u(0,Ot,62,35,"mainpanel",0),f(1,"async")),t&2){let p;h((p=b(1,1,o.loader$))?0:-1,p)}},dependencies:[Q,ce,Ne,Re,Ie,xe,Ce,ge,_e,ue,he,qe,we,ve,Qe,He,Te,Fe,Be,Le,Oe,Ke,$e,$,de,H,Ge],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=c;return i})();export{Bn as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as te,b as ie,c as oe,d as ne,e as re,f as ae}from"./chunk-RUBV3KX2.js";import{a as P}from"./chunk-
|
|
1
|
+
import{a as te,b as ie,c as oe,d as ne,e as re,f as ae}from"./chunk-RUBV3KX2.js";import{a as P}from"./chunk-RQQWNLDZ.js";import"./chunk-AZOCRKXK.js";import"./chunk-UH5C5HXK.js";import{a as R}from"./chunk-ZSUWHVKX.js";import"./chunk-HK5FXZE4.js";import"./chunk-4ILDFTIG.js";import{a as Z,b as ee}from"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as K}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{m as X,n as Y}from"./chunk-EDEZ3JLR.js";import"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as Q,c as W}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{D as V,F as z,G as H,I as J,i as q,m as U}from"./chunk-LNJUGHOX.js";import{$b as _,$c as T,Gb as w,Lc as O,Mb as M,Mc as u,Nc as F,Oc as $,Tc as L,Uc as N,Vc as x,Zc as A,aa as D,bc as g,cc as h,ec as v,fc as C,gc as c,hc as l,hd as B,ic as p,id as j,jc as f,nb as s,nc as y,oc as S,qc as G,ra as m,v as b,vc as k,xa as I,xc as d,ya as E}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var le=e=>({ID:e}),pe=e=>({"border-end-0":e});function se(e,o){if(e&1){let t=G();y(0),l(1,"button",11),k("click",function(){I(t);let r=d(),a=x(0);return E(r.onDeleteGroup(a==null?null:a.id))}),f(2,"i",12),u(3," Delete "),p(),S()}}function ce(e,o){if(e&1&&(y(0),l(1,"a",13),f(2,"i",14),u(3," Edit "),p(),S()),e&2){d();let t=x(0);s(),c("queryParams",T(1,le,t==null?null:t.id))}}function de(e,o){if(e&1&&(l(0,"div",21)(1,"div",22)(2,"p",23),u(3),p()()()),e&2){let t=d(),i=t.$implicit,r=t.$index,a=d(2).$implicit;O(T(4,pe,r!==a.Roles.length-1)),c("pTooltip",i.Description),s(3),$(" ",i.Name," ")}}function ue(e,o){if(e&1&&_(0,de,4,6,"div",20),e&2){let t=o.$implicit;g(t.checked?0:-1)}}function me(e,o){if(e&1&&(l(0,"div",15)(1,"div",16)(2,"div",17)(3,"span",18),u(4),p()()(),l(5,"div",19)(6,"div",15),v(7,ue,1,1,null,null,h),p()()()),e&2){let t=d().$implicit;s(4),F(t.Name),s(3),C(t==null?null:t.Roles)}}function fe(e,o){if(e&1&&_(0,me,9,1,"div",15),e&2){let t=o.$implicit;g((t==null||t.Roles==null?null:t.Roles.length)>0?0:-1)}}function _e(e,o){if(e&1&&(l(0,"div",9),v(1,fe,1,1,null,null,h),p()),e&2){d();let t=x(0);s(),C(t.groups)}}var $e=(()=>{let o=class o{constructor(){this.groupService=m(P),this.activatedRoute=m(V),this.toastr=m(K),this.route=m(z),this.group$=this.activatedRoute.queryParams.pipe(D(i=>this.groupService.getGroupsForm(i.ID).pipe(b(r=>(r.ID=i.ID,r)))),b(i=>({id:i.ID,name:i.Group.Name,groups:this.mapSelectedRoles(i.Options,i.RoleSelected),description:i.Group.Description}))),this.userEditRole=R.UserEdit,this.userDeleteRole=R.UserDelete}mapSelectedRoles(i,r){return i.map(a=>(a.Roles=a.Roles.map(n=>(n.checked=r.includes(n.ID),n)).filter(n=>n.checked),a.checked=a.Roles.some(n=>n.checked),a))}onDeleteGroup(i){confirm("Are you sure you want to delete this group?")&&this.groupService.deleteGroups([i]).subscribe(()=>{this.toastr.success("Group deleted successfully","Success"),this.route.navigate(["/menu/users/groups"])})}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=w({type:o,selectors:[["app-group-info"]],features:[A([P])],decls:23,vars:11,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Group Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12"],["type","text","pInputText","","placeholder","Group Name","readonly","",1,"w-100","form-control","rounded-1",2,"padding-top","12px","padding-bottom","12px","font-size","14px",3,"value"],["value","0"],["value","1"],[1,"d-flex","flex-column","row-gap-6","ps-8"],["pInputTextarea","","rows","10","placeholder","Description","readonly","",1,"w-100","form-control","rounded-1",3,"value"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/groups/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between","border-end-0",2,"height","40px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100","align-items-center","gap-4"],[1,"fs-5","w-100","text-center"],[1,"col"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",2,"height","40px",3,"class","pTooltip"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",2,"height","40px",3,"pTooltip"],[1,"d-flex","h-100","align-items-center","gap-4","px-2"],[1,"fs-6","text-dark",2,"margin","0"]],template:function(r,a){if(r&1&&(L(0),B(1,"async"),l(2,"mainpanel",0)(3,"actions")(4,"div",1),M(5,se,4,0,"ng-container",2)(6,ce,4,3,"ng-container",2),p()(),l(7,"content")(8,"div",3)(9,"div",4)(10,"div",5),f(11,"input",6),p()(),l(12,"p-tabs",7)(13,"p-tablist")(14,"p-tab",7),u(15,"Permission"),p(),l(16,"p-tab",8),u(17,"Description"),p()(),l(18,"p-tabpanels")(19,"p-tabpanel",7),_(20,_e,3,0,"div",9),p(),l(21,"p-tabpanel",8),f(22,"textarea",10),p()()()()()()),r&2){let n=N(j(1,8,a.group$));s(2),c("headerTitle",(n==null?null:n.name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),s(3),c("ngxPermissionsOnly",a.userDeleteRole),s(),c("ngxPermissionsOnly",a.userEditRole),s(5),c("value",n==null?null:n.name),s(9),g(n?20:-1),s(2),c("value",n==null?null:n.description)}},dependencies:[U,Y,X,ae,re,ne,oe,te,ie,ee,Z,W,Q,J,H,q],styles:["[_nghost-%COMP%] .p-tabs{--p-tabs-tab-active-color: #555555;--p-tabs-tab-color: #0976b4}[_nghost-%COMP%] .p-tabs .p-tabpanels{padding-left:0!important}[_nghost-%COMP%] .p-tabs .p-tablist-active-bar{background-color:#555!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}[_nghost-%COMP%] .btn-outline-secondary{background-color:#fff;border-color:#ccc;color:#000}[_nghost-%COMP%] .btn-outline-secondary:hover{background-color:#f8f9fa;border-color:#b3b3b3;color:#000}"]});let e=o;return e})();export{$e as GroupInfoComponent};
|