dealpos 25.45.0 → 25.45.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/browser/{chunk-Z4NZP4NH.js → chunk-2BSYBLS4.js} +1 -1
- package/browser/{chunk-UARWMJ5H.js → chunk-2JU7KFOZ.js} +1 -1
- package/browser/{chunk-4UJTVSL2.js → chunk-2QD46TNT.js} +1 -1
- package/browser/{chunk-QNJH27F5.js → chunk-33B62QHS.js} +1 -1
- package/browser/{chunk-7NQ56KZ6.js → chunk-3CZ6HKSM.js} +1 -1
- package/browser/{chunk-KHFL6T5N.js → chunk-3LPZYQS6.js} +1 -1
- package/browser/{chunk-B7QNQTF3.js → chunk-3MU2GNGM.js} +1 -1
- package/browser/{chunk-OLC5OIWO.js → chunk-3MUHZKUR.js} +1 -1
- package/browser/{chunk-TKZU227J.js → chunk-3RGQWWNI.js} +1 -1
- package/browser/{chunk-2YGMAT2F.js → chunk-4CFMB4IK.js} +1 -1
- package/browser/chunk-4KBU47GN.js +1 -0
- package/browser/{chunk-G2QZRGKV.js → chunk-4KMN7PSV.js} +1 -1
- package/browser/{chunk-AF5V3BUB.js → chunk-4ZFVM7K7.js} +1 -1
- package/browser/{chunk-LQDIK5ZH.js → chunk-5DXDXIDO.js} +1 -1
- package/browser/{chunk-P3BUVJKX.js → chunk-5I74KDE7.js} +1 -1
- package/browser/{chunk-ODEK2WQO.js → chunk-5PWOYB4R.js} +5 -5
- package/browser/{chunk-EI2XG4ML.js → chunk-5ZU5FBGM.js} +1 -1
- package/browser/{chunk-Q32BQBU5.js → chunk-67UQKMLX.js} +1 -1
- package/browser/{chunk-ZDX5LF2K.js → chunk-6A3BN6JC.js} +1 -1
- package/browser/{chunk-2PIAS2C5.js → chunk-6BGTH62C.js} +1 -1
- package/browser/{chunk-TIBTGPW2.js → chunk-6DRTZA6S.js} +1 -1
- package/browser/{chunk-VJQA5UAH.js → chunk-6Q7J43H4.js} +1 -1
- package/browser/chunk-6VM27TUY.js +1 -0
- package/browser/{chunk-CTPHJSLU.js → chunk-7EVERJPZ.js} +1 -1
- package/browser/{chunk-TEH7D4QV.js → chunk-7FUWLNHK.js} +1 -1
- package/browser/{chunk-M67ULXNR.js → chunk-7IRMDCKA.js} +1 -1
- package/browser/{chunk-WOMVTVEQ.js → chunk-7USHMTB5.js} +1 -1
- package/browser/{chunk-NE57UXZU.js → chunk-A4SCCZAY.js} +1 -1
- package/browser/{chunk-KHDFH3GS.js → chunk-A6F6V3WW.js} +1 -1
- package/browser/{chunk-JHYJTTAR.js → chunk-AASKAWJ4.js} +1 -1
- package/browser/{chunk-7ZTWH3L6.js → chunk-B235RUOX.js} +1 -1
- package/browser/{chunk-WFIKDWZE.js → chunk-B3LNBFJF.js} +1 -1
- package/browser/{chunk-PVSXCHI3.js → chunk-B5ORO5G4.js} +1 -1
- package/browser/{chunk-QOTJ7B7C.js → chunk-B6EKSPI2.js} +1 -1
- package/browser/{chunk-CKRLMZHY.js → chunk-BG6GTLXF.js} +1 -1
- package/browser/chunk-BJG2UU2M.js +1 -0
- package/browser/{chunk-AFCABMLQ.js → chunk-BJKHMXAA.js} +1 -1
- package/browser/{chunk-32GJXDHR.js → chunk-BLQKJ5OK.js} +1 -1
- package/browser/{chunk-NYTOBW2G.js → chunk-BQAKWHPC.js} +1 -1
- package/browser/{chunk-CANN2XN6.js → chunk-BRHHRJLT.js} +1 -1
- package/browser/{chunk-PHWHZQFM.js → chunk-BXGUZIC4.js} +1 -1
- package/browser/chunk-CKGJCUHW.js +1 -0
- package/browser/{chunk-235POOLV.js → chunk-DB3W42KN.js} +1 -1
- package/browser/{chunk-YNRHLKM5.js → chunk-DELGLVJJ.js} +1 -1
- package/browser/chunk-DG4IHOM2.js +1 -0
- package/browser/{chunk-CQPKVO7W.js → chunk-DJNB7COU.js} +1 -1
- package/browser/{chunk-KHDUUG2S.js → chunk-DU7W2G2L.js} +1 -1
- package/browser/{chunk-66DT3BE2.js → chunk-DZA27E5L.js} +1 -1
- package/browser/{chunk-ZRAK4HYU.js → chunk-E2XUBZDW.js} +1 -1
- package/browser/{chunk-V2PGBJHJ.js → chunk-E4GYCB3G.js} +1 -1
- package/browser/{chunk-RJJZC7JC.js → chunk-EAXUIPR5.js} +1 -1
- package/browser/{chunk-62E2JEWQ.js → chunk-EGADVOKH.js} +1 -1
- package/browser/{chunk-YFMVQJRL.js → chunk-EGUIWOC3.js} +1 -1
- package/browser/{chunk-3AHCNKRE.js → chunk-EHXTW46H.js} +1 -1
- package/browser/{chunk-5JQ2TYZU.js → chunk-EIH377TR.js} +1 -1
- package/browser/{chunk-6QKBTWAT.js → chunk-ELTC3POX.js} +1 -1
- package/browser/{chunk-6EP37ICB.js → chunk-EOJJS4LU.js} +1 -1
- package/browser/{chunk-OIMBKUXO.js → chunk-EPINEYFX.js} +1 -1
- package/browser/{chunk-T4K6XBGC.js → chunk-ETTSYVEZ.js} +1 -1
- package/browser/{chunk-WSFK2BTV.js → chunk-F7EO5OHI.js} +1 -1
- package/browser/{chunk-5NRBDWB4.js → chunk-FADT3LJL.js} +1 -1
- package/browser/{chunk-CKN6D7N7.js → chunk-FAGD2TBB.js} +1 -1
- package/browser/{chunk-D7J7CQGT.js → chunk-FAN4YDVT.js} +1 -1
- package/browser/{chunk-HPXDTBZD.js → chunk-FFOK3ZNC.js} +1 -1
- package/browser/{chunk-JKBDSVHR.js → chunk-FR4CH42S.js} +1 -1
- package/browser/{chunk-ZGPKGJBM.js → chunk-FR6L6XAP.js} +1 -1
- package/browser/{chunk-JL56QKED.js → chunk-FSGCO2Z5.js} +1 -1
- package/browser/{chunk-Y5GN5XOG.js → chunk-FV3VHB7N.js} +1 -1
- package/browser/chunk-G4XFK7EF.js +1 -0
- package/browser/{chunk-WVCZAPRZ.js → chunk-G7HGWSUU.js} +1 -1
- package/browser/{chunk-MLFDP74G.js → chunk-GDPQI6PI.js} +1 -1
- package/browser/{chunk-LBWSX76J.js → chunk-GINPKODK.js} +1 -1
- package/browser/{chunk-HNU2JIBP.js → chunk-GJIFUWGQ.js} +1 -1
- package/browser/{chunk-OYNVXKZ3.js → chunk-GUF6JXSS.js} +1 -1
- package/browser/{chunk-DDM5K7MP.js → chunk-GWL7ZN37.js} +1 -1
- package/browser/{chunk-L6YGMZJK.js → chunk-HBH23XBO.js} +1 -1
- package/browser/{chunk-E5HC3WFJ.js → chunk-HC2YTBED.js} +1 -1
- package/browser/{chunk-LC5JP6E6.js → chunk-HDJJJAZJ.js} +1 -1
- package/browser/{chunk-SWQE65GY.js → chunk-HHSXXJFJ.js} +1 -1
- package/browser/{chunk-SZDTKNUH.js → chunk-HK2NKWCI.js} +1 -1
- package/browser/{chunk-4MFA5Y4Y.js → chunk-HMKM466S.js} +1 -1
- package/browser/{chunk-63WMMXIG.js → chunk-HPPKFGND.js} +1 -1
- package/browser/{chunk-IZK2IN4R.js → chunk-HVRLWPZX.js} +1 -1
- package/browser/{chunk-2525CDKJ.js → chunk-HYXSN2J6.js} +1 -1
- package/browser/{chunk-X34LKMFX.js → chunk-I24HJLN4.js} +1 -1
- package/browser/{chunk-MCPXNQRW.js → chunk-I4WJ5CEN.js} +1 -1
- package/browser/{chunk-J4J3XVRF.js → chunk-IAFZ6YAO.js} +1 -1
- package/browser/{chunk-2MGVRRAP.js → chunk-IAFZ75L3.js} +13 -13
- package/browser/chunk-IBZF5QXJ.js +1 -0
- package/browser/{chunk-OVSWMLB3.js → chunk-IE2H4VRD.js} +1 -1
- package/browser/{chunk-NCXT27M5.js → chunk-IJXCL7KL.js} +1 -1
- package/browser/{chunk-KJROORJO.js → chunk-IPJU7D3K.js} +1 -1
- package/browser/chunk-IQ7VK4UE.js +5 -0
- package/browser/{chunk-J55W7XV7.js → chunk-IR75FMI5.js} +1 -1
- package/browser/{chunk-PY3PDRRW.js → chunk-ISY4SDFY.js} +1 -1
- package/browser/{chunk-KLKZQABE.js → chunk-IT7I47UZ.js} +1 -1
- package/browser/{chunk-3XRT75ZN.js → chunk-IUE6IUOH.js} +1 -1
- package/browser/{chunk-YBLSVIMZ.js → chunk-IZQ5FNXP.js} +1 -1
- package/browser/{chunk-44LXIDEF.js → chunk-J3OQGBIN.js} +1 -1
- package/browser/{chunk-QBNQANTG.js → chunk-JGWQC4DI.js} +1 -1
- package/browser/{chunk-RINV4BX7.js → chunk-JGYO4OTZ.js} +1 -1
- package/browser/{chunk-IH5OCDKI.js → chunk-JRM47ALM.js} +1 -1
- package/browser/{chunk-24A2APSJ.js → chunk-JXHHT6R2.js} +1 -1
- package/browser/{chunk-LIH722A3.js → chunk-JXXEYFN7.js} +1 -1
- package/browser/{chunk-MJV24UTS.js → chunk-KB64CIW5.js} +2 -2
- package/browser/{chunk-6IVR565J.js → chunk-KDOS4X4T.js} +1 -1
- package/browser/{chunk-3XJHHRJT.js → chunk-KFUPP33B.js} +1 -1
- package/browser/{chunk-6M6QFFLT.js → chunk-KL5VH4OU.js} +1 -1
- package/browser/{chunk-XOOFBNDP.js → chunk-KLZBTT2P.js} +1 -1
- package/browser/{chunk-WPTBNQ2V.js → chunk-KMYTSO3Q.js} +1 -1
- package/browser/{chunk-PF3TLOCL.js → chunk-KNQEOPID.js} +1 -1
- package/browser/{chunk-K6YQ5CRH.js → chunk-KPZU3ZPZ.js} +1 -1
- package/browser/{chunk-YX5ADQPF.js → chunk-KTV4REGV.js} +1 -1
- package/browser/{chunk-4ZMJFXGW.js → chunk-KWDQGODG.js} +1 -1
- package/browser/{chunk-5XDBC6O7.js → chunk-L3JI6OZ3.js} +1 -1
- package/browser/{chunk-AOQIZ6M2.js → chunk-L453AX2W.js} +1 -1
- package/browser/{chunk-TW3MVM2R.js → chunk-L5HF7UAT.js} +1 -1
- package/browser/{chunk-PO2OKV6Q.js → chunk-LAQMHKSP.js} +1 -1
- package/browser/{chunk-M5IOFMBZ.js → chunk-LDDG4GE7.js} +1 -1
- package/browser/{chunk-XLE4M4WS.js → chunk-LFHXGZHT.js} +1 -1
- package/browser/{chunk-CNCKIVTQ.js → chunk-LJMHI6I5.js} +1 -1
- package/browser/{chunk-XYHPCRIZ.js → chunk-LODGW3WU.js} +1 -1
- package/browser/{chunk-2CWEU47S.js → chunk-M4BTEXS6.js} +1 -1
- package/browser/{chunk-ORP2SVPR.js → chunk-M76YU6SQ.js} +1 -1
- package/browser/{chunk-CRU6KO53.js → chunk-MFDMUMA4.js} +1 -1
- package/browser/{chunk-TKJUJYEI.js → chunk-MHZV4BL7.js} +1 -1
- package/browser/{chunk-CUY227OT.js → chunk-MNZLKEWQ.js} +1 -1
- package/browser/{chunk-7H3GMZJN.js → chunk-MREFZR3I.js} +1 -1
- package/browser/{chunk-T4MVTLYE.js → chunk-MTU6753J.js} +1 -1
- package/browser/{chunk-IEYBKFX7.js → chunk-MXGNASOC.js} +1 -1
- package/browser/{chunk-PZVPROT6.js → chunk-N43HXORE.js} +1 -1
- package/browser/{chunk-S6FVFOZM.js → chunk-N7C7P5QN.js} +1 -1
- package/browser/{chunk-EE3OKRUQ.js → chunk-NCT5IK4R.js} +1 -1
- package/browser/{chunk-EIBM6U5N.js → chunk-NERV3W42.js} +1 -1
- package/browser/{chunk-RCMYO542.js → chunk-NJB3X4XL.js} +1 -1
- package/browser/{chunk-JQOVAMQC.js → chunk-NM3RF6OH.js} +1 -1
- package/browser/{chunk-2SFQGHFV.js → chunk-O4IQZBVW.js} +1 -1
- package/browser/{chunk-WGBW2YLG.js → chunk-O4SFEWMN.js} +1 -1
- package/browser/{chunk-2EEKMQEX.js → chunk-OGN6JWED.js} +1 -1
- package/browser/{chunk-PRROMENK.js → chunk-OJ5SEYSF.js} +1 -1
- package/browser/{chunk-XF27FA5V.js → chunk-OKEI5RKW.js} +1 -1
- package/browser/{chunk-5VGCSK5N.js → chunk-OKVQYK4Y.js} +1 -1
- package/browser/{chunk-M6UB4WVK.js → chunk-OLT6DXR7.js} +1 -1
- package/browser/{chunk-TQZVYC7J.js → chunk-OMKIT3Z4.js} +1 -1
- package/browser/{chunk-WIYO452T.js → chunk-OTT6RJHI.js} +1 -1
- package/browser/{chunk-FPGIRAZZ.js → chunk-OYO4SRAO.js} +1 -1
- package/browser/{chunk-CF4MHWEX.js → chunk-P2FSLJ4X.js} +1 -1
- package/browser/{chunk-NJOOFJNE.js → chunk-PCAFUCUK.js} +1 -1
- package/browser/chunk-PCFR4J66.js +131 -0
- package/browser/{chunk-CRMTCX6F.js → chunk-PIW2M2DH.js} +2 -2
- package/browser/{chunk-M6PA26FM.js → chunk-PIYVELLT.js} +1 -1
- package/browser/{chunk-WT6PMWGG.js → chunk-PLVOH67J.js} +1 -1
- package/browser/{chunk-CFSYN7MV.js → chunk-PNN75KZR.js} +1 -1
- package/browser/{chunk-JJ55MEGU.js → chunk-PQ65IMRY.js} +1 -1
- package/browser/{chunk-SLDIBIUY.js → chunk-PQFMYP23.js} +1 -1
- package/browser/{chunk-LLXEUJDC.js → chunk-PQS3RLPI.js} +1 -1
- package/browser/{chunk-WPKJOXVT.js → chunk-PROSYUA2.js} +1 -1
- package/browser/{chunk-27KLJCCF.js → chunk-PTQCXOVM.js} +1 -1
- package/browser/chunk-PUFGTKWO.js +1 -0
- package/browser/{chunk-K2U4QSXW.js → chunk-PUXE7FLT.js} +1 -1
- package/browser/{chunk-7YKHGYIG.js → chunk-PXKNGMLL.js} +1 -1
- package/browser/{chunk-MSSTCYNC.js → chunk-QCCKEP2R.js} +1 -1
- package/browser/{chunk-TY7JJASH.js → chunk-QGYIPOLS.js} +1 -1
- package/browser/{chunk-SZ24MNHM.js → chunk-QHWRBSOD.js} +1 -1
- package/browser/chunk-QMFA3PF5.js +1 -0
- package/browser/{chunk-A3FTQA6E.js → chunk-RCC5SUNH.js} +1 -1
- package/browser/{chunk-Q2GPSDAM.js → chunk-RFVQHGYD.js} +1 -1
- package/browser/{chunk-IMO77OHS.js → chunk-RKCNENWQ.js} +1 -1
- package/browser/{chunk-HPWVZRZF.js → chunk-RMIJZMA5.js} +1 -1
- package/browser/{chunk-NEJRKLYO.js → chunk-RNEU5YBN.js} +1 -1
- package/browser/{chunk-K5ERLQ63.js → chunk-RO5PWDCR.js} +1 -1
- package/browser/{chunk-JR6SBNDP.js → chunk-RPJIPLQS.js} +1 -1
- package/browser/{chunk-6B56KYAF.js → chunk-RRYYS272.js} +1 -1
- package/browser/{chunk-NUVM5VMH.js → chunk-S4ZRXSPZ.js} +1 -1
- package/browser/{chunk-6BWXSO4B.js → chunk-SA67OWFV.js} +1 -1
- package/browser/{chunk-HEGIEXS3.js → chunk-SGSOCLV7.js} +1 -1
- package/browser/{chunk-ZHTSXEVO.js → chunk-SICZ4VWZ.js} +1 -1
- package/browser/{chunk-PT3R3NCF.js → chunk-SYMXIBEB.js} +1 -1
- package/browser/{chunk-FW2LVBF2.js → chunk-T3HVVJIV.js} +1 -1
- package/browser/{chunk-RUE7RBU6.js → chunk-TCR2YYM5.js} +1 -1
- package/browser/{chunk-IWPVMLPY.js → chunk-TMQ7NWGZ.js} +1 -1
- package/browser/{chunk-MVCDG4KS.js → chunk-TPHEWWHE.js} +5 -5
- package/browser/{chunk-3JW3NITX.js → chunk-TPKU52VV.js} +1 -1
- package/browser/chunk-TR5NO2CB.js +1 -0
- package/browser/{chunk-ODGFQ7QJ.js → chunk-TS6CZC3J.js} +1 -1
- package/browser/{chunk-SUP23S2E.js → chunk-TWVDGGTY.js} +1 -1
- package/browser/{chunk-ZOPOSPVC.js → chunk-TX6ZFPHY.js} +1 -1
- package/browser/{chunk-Y3BA3YGC.js → chunk-U3EOEZ3B.js} +1 -1
- package/browser/{chunk-GHGFRLKE.js → chunk-U3WVC6SN.js} +1 -1
- package/browser/{chunk-DMZ5HEOT.js → chunk-U5HTULBC.js} +1 -1
- package/browser/{chunk-ZRNGBR7A.js → chunk-UEMKVZMR.js} +1 -1
- package/browser/{chunk-MIW5EYCH.js → chunk-USEPOJ5L.js} +1 -1
- package/browser/{chunk-ZWPJWDYN.js → chunk-UYXD7WPN.js} +1 -1
- package/browser/{chunk-HNLSUZUH.js → chunk-V6MKE6LP.js} +1 -1
- package/browser/{chunk-CJFDTLOQ.js → chunk-V7HBROQ5.js} +1 -1
- package/browser/{chunk-UZMFXHQD.js → chunk-VBX5VOJG.js} +1 -1
- package/browser/{chunk-HG6BRXAC.js → chunk-VCQBS5CA.js} +1 -1
- package/browser/{chunk-74B5JZ5G.js → chunk-VO3NT5EH.js} +1 -1
- package/browser/{chunk-HD6ETXDZ.js → chunk-VQBUIUJC.js} +1 -1
- package/browser/chunk-VS3RTXZC.js +5 -0
- package/browser/{chunk-2SJZWKFD.js → chunk-W34NDG3T.js} +1 -1
- package/browser/{chunk-Q5FKQWU2.js → chunk-W5N6DMDQ.js} +1 -1
- package/browser/{chunk-ZKQFRAZ2.js → chunk-WAAJYULE.js} +1 -1
- package/browser/{chunk-K2M625FR.js → chunk-WACBOZDR.js} +1 -1
- package/browser/{chunk-4DH3BDE3.js → chunk-WAXYETAG.js} +1 -1
- package/browser/{chunk-NWBLFLVC.js → chunk-WKB7BKHN.js} +1 -1
- package/browser/chunk-WRZUQ2QI.js +1 -0
- package/browser/{chunk-BFHHIWRM.js → chunk-WXJTNRD3.js} +1 -1
- package/browser/{chunk-4KOOWCML.js → chunk-X6XUOWVT.js} +2 -2
- package/browser/{chunk-GIW2PDIG.js → chunk-XF5XKXE6.js} +1 -1
- package/browser/{chunk-R4K5X4RE.js → chunk-XHA6WGTO.js} +1 -1
- package/browser/{chunk-2ILW7WWJ.js → chunk-XIXREDEB.js} +1 -1
- package/browser/{chunk-2557JAG4.js → chunk-XKAKP3E6.js} +1 -1
- package/browser/{chunk-5RLB3NV4.js → chunk-XRLRUCRR.js} +1 -1
- package/browser/{chunk-CABP6X3M.js → chunk-XTMUP2BA.js} +1 -1
- package/browser/{chunk-EUQGYTUL.js → chunk-XWWKCPZS.js} +1 -1
- package/browser/{chunk-JTLGGNCW.js → chunk-XXNLATCJ.js} +1 -1
- package/browser/{chunk-2IE6U5ND.js → chunk-XZFHDKIK.js} +1 -1
- package/browser/{chunk-7WXTIXID.js → chunk-XZXNHGZ2.js} +1 -1
- package/browser/{chunk-RHVNZ2DF.js → chunk-YL6HCV6T.js} +1 -1
- package/browser/{chunk-5574BNHI.js → chunk-YM2ZQTDF.js} +1 -1
- package/browser/{chunk-LPD3H6QQ.js → chunk-YMVBGQ2W.js} +1 -1
- package/browser/{chunk-ZJ4AGOKX.js → chunk-YQ5GJPDB.js} +1 -1
- package/browser/chunk-YQE3PJGM.js +18 -0
- package/browser/{chunk-SII6VICE.js → chunk-YXNBLVK4.js} +1 -1
- package/browser/{chunk-EXIKKRCD.js → chunk-YZP4FX7D.js} +1 -1
- package/browser/{chunk-WGWBCLKM.js → chunk-ZEXXJZ7U.js} +1 -1
- package/browser/chunk-ZRHYTE5S.js +1 -0
- package/browser/index.html +2 -2
- package/browser/{main-H2XKB5YR.js → main-7FKCOQYA.js} +2 -2
- package/browser/{styles-CA5KWC36.css → styles-J6LGFNKV.css} +1 -1
- package/package.json +1 -1
- package/browser/chunk-2IOQJSBS.js +0 -1
- package/browser/chunk-3UKPPC6K.js +0 -131
- package/browser/chunk-4XD6LZU6.js +0 -1
- package/browser/chunk-5J2SNOT2.js +0 -1
- package/browser/chunk-5YCIPH6P.js +0 -1
- package/browser/chunk-AXUFQOIY.js +0 -1
- package/browser/chunk-D75PDB6P.js +0 -1
- package/browser/chunk-ERFYUZ7W.js +0 -1
- package/browser/chunk-GERGGB25.js +0 -1
- package/browser/chunk-GZXTL4RE.js +0 -1
- package/browser/chunk-IRPQWJZH.js +0 -5
- package/browser/chunk-LBIXL2NM.js +0 -5
- package/browser/chunk-SQVN35HO.js +0 -1
- package/browser/chunk-UAVXXCN2.js +0 -1
- package/browser/chunk-WR3A6SD3.js +0 -18
- package/browser/chunk-XDJAJP7W.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as at}from"./chunk-HNU2JIBP.js";import{c as nt,d as st,e as ot}from"./chunk-V2PGBJHJ.js";import{a as fe}from"./chunk-FPGIRAZZ.js";import{c as it}from"./chunk-HD6ETXDZ.js";import{N as rt}from"./chunk-2525CDKJ.js";import{$ as pe,A as le,C as $e,G as N,O as Xe,V as Je,W as de,Z as me,aa as et,da as he,f as h,ha as tt,k as ce,n as ue,o as Ze}from"./chunk-K2M625FR.js";import{a as Ge}from"./chunk-PRROMENK.js";import{$ as w,Ab as v,Ac as K,Bb as u,Ca as Pe,Cb as d,D as q,Db as E,Dc as B,Ea as Z,Eb as ee,F as xe,Fa as $,Fb as te,Ga as X,Gb as qe,Ha as Re,Ia as Ae,Ja as H,Jc as Ue,Ka as Ke,Kb as R,Lb as ie,M as Te,Mb as p,O as Se,Ob as l,Q as De,Ra as J,Rb as He,Tb as Qe,Ub as Le,Uc as re,Wa as c,Wc as ae,Xa as b,Ya as Q,Yd as Ye,Z as Ee,_ as we,_b as ne,_d as We,aa as Oe,ab as L,ac as Ve,bc as f,cc as A,d as _,da as m,db as Be,dc as Y,fb as V,gb as Ne,hb as k,jb as P,la as G,ma as Fe,na as T,pa as o,pd as je,qc as I,qd as ze,rb as D,rc as se,sc as oe,ta as O,tb as M,ua as F,v as ve,vb as C,w as Ie,xa as S,xb as U,yb as j,zb as z}from"./chunk-LBIXL2NM.js";import{a as x,b as Ce}from"./chunk-SNAKHGZS.js";var lt=()=>["/menu/Outlets/Master/Quick_Key_Templates/Form"],bt=t=>({ID:t}),Mt=t=>({OutletID:t});function Ct(t,s){if(t&1&&E(0,"img",16),t&2){let e=l(2).$implicit;v("src",e.ImageURLClient,J)}}function vt(t,s){if(t&1&&(u(0,"div",14)(1,"div",15),M(2,Ct,1,1,"img",16),d()()),t&2){let e=l().$implicit;c(2),C(e.ImageURLClient?2:-1)}}function It(t,s){if(t&1&&(u(0,"div",15)(1,"p",17)(2,"span"),f(3),K(4,"slice"),d()()()),t&2){let e=l().$implicit;c(3),A(B(4,1,e.Display,0,3))}}function xt(t,s){if(t&1){let e=R();u(0,"div",9)(1,"a",13),p("click",function(){let n=O(e).$implicit,r=l(4);return F(r.onSelectQuickKeyItem(n))}),M(2,vt,3,1,"div",14)(3,It,5,5,"div",15),u(4,"small"),f(5),K(6,"slice"),d()()()}if(t&2){let e=s.$implicit;c(2),C(e.ImageURLClient?2:3),c(3),A(B(6,2,e.Display,0,36))}}function Tt(t,s){if(t&1&&(u(0,"mat-tab",6)(1,"div",7)(2,"div",8),j(3,xt,7,6,"div",9,U),u(5,"div",10)(6,"a",11),E(7,"i",12),d()()()()()),t&2){let e=s.$implicit,i=l(3);v("label",e.Name),c(3),z(e==null?null:e.Items),c(3),v("routerLink",se(3,lt))("queryParams",oe(4,bt,i.quickKey.ID))}}function St(t,s){if(t&1){let e=R();u(0,"mat-tab-group",5),p("selectedIndexChange",function(n){O(e);let r=l(2);return F(r.onChangeTab(n))}),j(1,Tt,8,6,"mat-tab",6,U),d()}if(t&2){let e=l(2);v("disableRipple",!0)("selectedIndex",e.selectedTabIndex),c(),z(e.quickKey==null?null:e.quickKey.Groups)}}function Dt(t,s){if(t&1&&E(0,"img",16),t&2){let e=l(2).$implicit;v("src",e.ImageURLClient,J)}}function Et(t,s){if(t&1&&(u(0,"div",14)(1,"div",15),M(2,Dt,1,1,"img",16),d()()),t&2){let e=l().$implicit;c(2),C(e.ImageURLClient?2:-1)}}function wt(t,s){if(t&1&&(u(0,"div",15)(1,"p",17)(2,"span"),f(3),K(4,"slice"),d()()()),t&2){let e=l().$implicit;c(3),A(B(4,1,e.Model,0,3))}}function Ot(t,s){if(t&1){let e=R();u(0,"div",9)(1,"a",13),p("click",function(){let n=O(e).$implicit,r=l(3);return F(r.onSelectVariant(n.ID))}),M(2,Et,3,1,"div",14)(3,wt,5,5,"div",15),u(4,"small"),f(5),K(6,"slice"),d()()()}if(t&2){let e=s.$implicit;c(2),C(e.ImageURLClient?2:3),c(3),A(B(6,2,e.Model,0,30))}}function Ft(t,s){if(t&1){let e=R();u(0,"div",18)(1,"div",19),p("click",function(){O(e);let n=l(2);return F(n.quickKeyState="QUICKKEY")}),E(2,"i",20),d(),u(3,"div",21)(4,"b"),f(5),d()()(),u(6,"div",7)(7,"div",8),j(8,Ot,7,6,"div",9,U),d()()}if(t&2){let e=l(2);c(5),Y(" ",e.subQuickKeyPack.Display),c(3),z(e.subQuickKeyPack==null?null:e.subQuickKeyPack.Children)}}function Pt(t,s){if(t&1&&M(0,St,3,2,"mat-tab-group",4)(1,Ft,10,1),t&2){let e=l();C(e.quickKeyState=="QUICKKEY"?0:1)}}function Rt(t,s){if(t&1&&(u(0,"div",3)(1,"a",22)(2,"strong"),f(3,"QUICK KEYS UNCONFIGURED"),d(),E(4,"i",23),u(5,"span"),f(6,"Click here to setup your Quick keys"),d()()()),t&2){let e=l();c(),v("routerLink",se(2,lt))("queryParams",oe(3,Mt,e.outletID))}}var ct=class t{sf=o(at);quickKey;get outletID(){return this._outletID}set outletID(s){this._outletID=s,this._outletID&&(this.quickKeyState="QUICKKEY")}_outletID="";_onSelectVariant=new b;quickKeyState="QUICKKEY";subQuickKeyPack;selectedTabIndex=0;disabled=!1;onChange=s=>{};onTouched=()=>{};writeValue(s){}registerOnChange(s){this.onChange=s}registerOnTouched(s){this.onTouched=s}setDisabledState(s){this.disabled=s}onSelectQuickKeyItem(s){s.Children?s.Children.length==1?this.onSelectVariant(s.Children[0].ID):(this.quickKeyState="SUBQUICKKEY",this.subQuickKeyPack={Children:s.Children,Display:s.Display}):this.onSelectVariant(s.ItemID)}onSelectVariant(s){this.quickKeyState="QUICKKEY",this._onSelectVariant.emit(s),this.onChange(s),this.sf.searchFilterNativeEl?.focus()}onChangeTab(s){this.selectedTabIndex=s}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=V({type:t,selectors:[["POS-quick-key"]],inputs:{quickKey:"quickKey",outletID:"outletID"},outputs:{_onSelectVariant:"onSelectVariant"},features:[I([{provide:Ge,multi:!0,useExisting:t}])],decls:5,vars:1,consts:[[1,"row","h-100"],[1,"col-12"],[1,"quick-key-tab","h-100","pt-4"],[1,"no-quick-key"],[1,"h-100","bgQuickkeyIllustration","landscape",3,"disableRipple","selectedIndex"],[1,"h-100","bgQuickkeyIllustration","landscape",3,"selectedIndexChange","disableRipple","selectedIndex"],[3,"label"],[1,"container","tabItems"],[1,"row","g-0"],[1,"col-3","column","px-6"],[1,"col-3","column","px-8","add","pt-8"],[3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-plus-circle","fa-5x","d-flex","align-items-center","justify-content-center","bg-white","h-100","text-primary"],[3,"click"],[1,"img-box","d-flex","align-items-center"],[1,"ratio","ratio-1x1"],[1,"full-screen-image",3,"src"],[1,"fw-normal","fs-1","d-flex","align-items-center","justify-content-center"],[1,"row","g-0","border","align-items-center","subquicKey"],[1,"col-auto","border-end","py-5","px-7","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa","fa-arrow-left"],[1,"col","text-center","fw-bold","text-uppercase","fs-5"],["id","LinkConfigureQuickkey","target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-regular","fa-hand-pointer"]],template:function(e,i){e&1&&(u(0,"div",0)(1,"div",1)(2,"section",2),M(3,Pt,2,1)(4,Rt,7,5,"div",3),d()()()),e&2&&(c(3),C(i.quickKey&&i.quickKey.Groups?3:4))},dependencies:[ze,We,Ye,rt,ot,nt,st,je],styles:[".quick-key-tab{width:100%;position:relative;height:100%;max-height:calc(100vh - 70px)} .quick-key-tab .mat-mdc-tab-header-pagination{display:none!important} .quick-key-tab .mat-mdc-tab-header{border:none} .quick-key-tab .mdc-tab-indicator{display:none!important} .quick-key-tab .mat-mdc-tab-body-wrapper{width:102%} .quick-key-tab .mat-mdc-tab-labels{border-bottom:0px;display:flex;flex-wrap:wrap;border-radius:6px} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab{color:#151515;opacity:1;height:38px;max-height:40px;white-space:normal!important;overflow:hidden;padding:0!important;min-width:25%!important;flex-basis:0;font-size:12px;font-weight:700;outline:none;text-transform:uppercase;background:#fff;display:flex} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab .mdc-tab__content{white-space:normal!important;align-self:center;font-size:.875rem!important} .quick-key-tab .mat-mdc-tab-labels .mdc-tab--active{background:linear-gradient(to bottom,#fff,#eee);border-radius:6px;border:.5px solid #dadada} .quick-key-tab .mat-mdc-tab-labels .mdc-tab--active .mdc-tab__text-label{color:gray!important;font-weight:700} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab:nth-child(n+5){flex-grow:0!important} .quick-key-tab .tabItems{padding:0} .quick-key-tab .tabItems .column{margin-top:15px;margin-bottom:10px;word-break:break-all} .quick-key-tab .tabItems .column>div{border:solid 1px #cfcfcf} .quick-key-tab .tabItems .column>a{text-align:center;display:block;cursor:pointer} .quick-key-tab .tabItems .column>a div.img-box{display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #dddddd} .quick-key-tab .tabItems .column>a .full-screen-image{position:absolute;object-fit:scale-down} .quick-key-tab .tabItems .column>a p{display:block;margin:0 auto;background-color:#a6a6a6;border:solid 1px #999999;border-top-left-radius:5px;border-bottom-right-radius:5px;color:#fff} .quick-key-tab .tabItems .column>a small{font-size:11px;display:block;margin:5px 0 0} .quick-key-tab .tabItems .column .ion-icon{font-size:75px;margin:10px} .quick-key-tab .col-md-3.column.add{cursor:pointer} .quick-key-tab .col-md-3.column.add i{margin-top:10px} .quick-key-tab ::-webkit-scrollbar{width:3px} .quick-key-tab ::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #bfd2da} .quick-key-tab ::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:10px} .quick-key-tab .subquicKey{background:linear-gradient(to bottom,#fff,#eee);color:gray;border-radius:6px} .quick-key-tab .no-quick-key{background-image:url(//res.cloudinary.com/pos/image/upload/w_500/POS/Images/Cashier/no-quick-key.png)!important;background-repeat:no-repeat;height:calc(100vh - 70px);background-size:contain}a#LinkConfigureQuickkey[_ngcontent-%COMP%]{background-color:#479ccf;padding:15px 25px;color:#fff;text-decoration:none;width:240px;display:block;opacity:.85;border-radius:6px}a#LinkConfigureQuickkey[_ngcontent-%COMP%]{position:absolute;top:200px;left:calc(50% - 120px)}a#LinkConfigureQuickkey[_ngcontent-%COMP%]:hover{opacity:.95}a#LinkConfigureQuickkey[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%]{border-bottom:1px solid white;font-size:14px;margin:0 0 10px;padding:0 0 3px;display:block}a#LinkConfigureQuickkey[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:inline-block;height:35px;margin:0 10px 0 0;font-size:28px}a#LinkConfigureQuickkey[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;font-size:14px;width:135px;vertical-align:top}"]})};var pt=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenuGroup",""]],hostAttrs:["role","group",1,"cdk-menu-group"],exportAs:["cdkMenuGroup"],features:[I([{provide:fe,useClass:fe}])]})}return t})(),ye=new T("cdk-menu"),y=(function(t){return t[t.nextItem=0]="nextItem",t[t.previousItem=1]="previousItem",t[t.currentItem=2]="currentItem",t})(y||{}),g=new T("cdk-menu-stack"),Kt={provide:g,deps:[[new $,new X,new Z(g)]],useFactory:t=>t||new be},Bt=t=>({provide:g,deps:[[new $,new X,new Z(g)]],useFactory:s=>s||be.inline(t)}),be=(()=>{class t{id=o(le).getId("cdk-menu-stack-");_elements=[];_close=new _;_empty=new _;_hasFocus=new _;closed=this._close;hasFocus=this._hasFocus.pipe(w(!1),Te(0),De());emptied=this._empty;_inlineMenuOrientation=null;static inline(e){let i=new t;return i._inlineMenuOrientation=e,i}push(e){this._elements.push(e)}close(e,i){let{focusNextOnEmpty:n,focusParentTrigger:r}=x({},i);if(this._elements.indexOf(e)>=0){let a;do a=this._elements.pop(),this._close.next({item:a,focusParentTrigger:r});while(a!==e);this.isEmpty()&&this._empty.next(n)}}closeSubMenuOf(e){let i=!1;if(this._elements.indexOf(e)>=0)for(i=this.peek()!==e;this.peek()!==e;)this._close.next({item:this._elements.pop()});return i}closeAll(e){let{focusNextOnEmpty:i,focusParentTrigger:n}=x({},e);if(!this.isEmpty()){for(;!this.isEmpty();){let r=this._elements.pop();r&&this._close.next({item:r,focusParentTrigger:n})}this._empty.next(i)}}isEmpty(){return!this._elements.length}length(){return this._elements.length}peek(){return this._elements[this._elements.length-1]}hasInlineMenu(){return this._inlineMenuOrientation!=null}inlineMenuOrientation(){return this._inlineMenuOrientation}setHasFocus(e){this._hasFocus.next(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=G({token:t,factory:t.\u0275fac})}return t})(),W=new T("cdk-menu-trigger"),Nt=new T("cdk-menu-scroll-strategy",{providedIn:"root",factory:()=>{let t=o(S);return()=>Je(t)}}),ht=(()=>{class t{static _openMenuTrigger;update(e){t._openMenuTrigger!==e&&(t._openMenuTrigger?.close(),t._openMenuTrigger=e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=G({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ft=(()=>{class t{injector=o(S);viewContainerRef=o(Be);menuStack=o(g);menuScrollStrategy=o(Nt);menuPosition;opened=new b;closed=new b;menuTemplateRef;menuData;overlayRef=null;destroyed=new _;stopOutsideClicksListener=q(this.closed,this.destroyed);childMenu;_menuPortal;_childMenuInjector;ngOnDestroy(){this._destroyOverlay(),this.destroyed.next(),this.destroyed.complete()}isOpen(){return!!this.overlayRef?.hasAttached()}registerChildMenu(e){this.childMenu=e}getMenuContentPortal(){let e=this.menuTemplateRef!==this._menuPortal?.templateRef;return this.menuTemplateRef&&(!this._menuPortal||e)&&(this._menuPortal=new Xe(this.menuTemplateRef,this.viewContainerRef,this.menuData,this._getChildMenuInjector())),this._menuPortal}isElementInsideMenuStack(e){for(let i=e;i;i=i?.parentElement??null)if(i.getAttribute("data-cdk-menu-stack-id")===this.menuStack.id)return!0;return!1}_destroyOverlay(){this.overlayRef&&(this.overlayRef.dispose(),this.overlayRef=null)}_getChildMenuInjector(){return this._childMenuInjector=this._childMenuInjector||S.create({providers:[{provide:W,useValue:this},{provide:g,useValue:this.menuStack}],parent:this.injector}),this._childMenuInjector}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,hostVars:2,hostBindings:function(i,n){i&2&&D("aria-controls",n.childMenu==null?null:n.childMenu.id)("data-cdk-menu-stack-id",n.menuStack.id)}})}return t})();var Me=new T("cdk-menu-aim");function _t(t,s){if(!s.isTrusted)return!1;let e=t.nativeElement,i=s.keyCode;return e.nodeName==="BUTTON"&&!e.disabled?i===13||i===32:e.nodeName==="A"?i===13:!1}var qt=(()=>{class t extends ft{_elementRef=o(H);_ngZone=o(Q);_changeDetectorRef=o(re);_inputModalityDetector=o(ue);_directionality=o(N,{optional:!0});_renderer=o(L);_injector=o(S);_cleanupMouseenter;_menuTracker=o(ht);_parentMenu=o(ye,{optional:!0});_menuAim=o(Me,{optional:!0});constructor(){super(),this._setRole(),this._registerCloseHandler(),this._subscribeToMenuStackClosed(),this._subscribeToMouseEnter(),this._subscribeToMenuStackHasFocus(),this._setType()}toggle(){this.isOpen()?this.close():this.open()}open(){this._parentMenu||this._menuTracker.update(this),!this.isOpen()&&this.menuTemplateRef!=null&&(this.opened.next(),this.overlayRef=this.overlayRef||he(this._injector,this._getOverlayConfig()),this.overlayRef.attach(this.getMenuContentPortal()),this._changeDetectorRef.markForCheck(),this._subscribeToOutsideClicks())}close(){this.isOpen()&&(this.closed.next(),this.overlayRef.detach(),this._changeDetectorRef.markForCheck()),this._closeSiblingTriggers()}getMenu(){return this.childMenu}ngOnChanges(e){e.menuPosition&&this.overlayRef&&this.overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy())}ngOnDestroy(){this._cleanupMouseenter(),super.ngOnDestroy()}_toggleOnKeydown(e){let i=this._parentMenu?.orientation==="vertical";switch(e.keyCode){case 32:case 13:!h(e)&&!_t(this._elementRef,e)&&(this.toggle(),this.childMenu?.focusFirstItem("keyboard"));break;case 39:h(e)||this._parentMenu&&i&&this._directionality?.value!=="rtl"&&(e.preventDefault(),this.open(),this.childMenu?.focusFirstItem("keyboard"));break;case 37:h(e)||this._parentMenu&&i&&this._directionality?.value==="rtl"&&(e.preventDefault(),this.open(),this.childMenu?.focusFirstItem("keyboard"));break;case 40:case 38:h(e)||i||(e.preventDefault(),this.open(),e.keyCode===40?this.childMenu?.focusFirstItem("keyboard"):this.childMenu?.focusLastItem("keyboard"));break}}_handleClick(){this.toggle(),this.childMenu?.focusFirstItem("mouse")}_setHasFocus(e){this._parentMenu||this.menuStack.setHasFocus(e)}_subscribeToMouseEnter(){this._cleanupMouseenter=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"mouseenter",()=>{if(this._inputModalityDetector.mostRecentModality!=="touch"&&!this.menuStack.isEmpty()&&!this.isOpen()){let e=()=>this._ngZone.run(()=>{this._closeSiblingTriggers(),this.open()});this._menuAim?this._menuAim.toggle(e):e()}}))}_closeSiblingTriggers(){this._parentMenu?!this.menuStack.closeSubMenuOf(this._parentMenu)&&this.menuStack.peek()!==this._parentMenu&&this.menuStack.closeAll():this.menuStack.closeAll()}_getOverlayConfig(){return new de({positionStrategy:this._getOverlayPositionStrategy(),scrollStrategy:this.menuScrollStrategy(),direction:this._directionality||void 0})}_getOverlayPositionStrategy(){return me(this._injector,this._elementRef).withLockedPosition().withFlexibleDimensions(!1).withPositions(this._getOverlayPositions())}_getOverlayPositions(){return this.menuPosition??(!this._parentMenu||this._parentMenu.orientation==="horizontal"?pe:et)}_registerCloseHandler(){this._parentMenu||this.menuStack.closed.pipe(m(this.destroyed)).subscribe(({item:e})=>{e===this.childMenu&&this.close()})}_subscribeToOutsideClicks(){this.overlayRef&&this.overlayRef.outsidePointerEvents().pipe(m(this.stopOutsideClicksListener)).subscribe(e=>{let i=ce(e),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&(this.isElementInsideMenuStack(i)?this._closeSiblingTriggers():this.menuStack.closeAll())})}_subscribeToMenuStackHasFocus(){this._parentMenu||this.menuStack.hasFocus.pipe(m(this.destroyed)).subscribe(e=>{e||this.menuStack.closeAll()})}_subscribeToMenuStackClosed(){this._parentMenu||this.menuStack.closed.subscribe(({focusParentTrigger:e})=>{e&&!this.menuStack.length()&&this._elementRef.nativeElement.focus()})}_setRole(){this._parentMenu||this._elementRef.nativeElement.setAttribute("role","button")}_setType(){let e=this._elementRef.nativeElement;e.nodeName==="BUTTON"&&!e.getAttribute("type")&&e.setAttribute("type","button")}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenuTriggerFor",""]],hostAttrs:[1,"cdk-menu-trigger"],hostVars:2,hostBindings:function(i,n){i&1&&p("focusin",function(){return n._setHasFocus(!0)})("focusout",function(){return n._setHasFocus(!1)})("keydown",function(a){return n._toggleOnKeydown(a)})("click",function(){return n._handleClick()}),i&2&&D("aria-haspopup",n.menuTemplateRef?"menu":null)("aria-expanded",n.menuTemplateRef==null?null:n.isOpen())},inputs:{menuTemplateRef:[0,"cdkMenuTriggerFor","menuTemplateRef"],menuPosition:[0,"cdkMenuPosition","menuPosition"],menuData:[0,"cdkMenuTriggerData","menuData"]},outputs:{opened:"cdkMenuOpened",closed:"cdkMenuClosed"},exportAs:["cdkMenuTriggerFor"],features:[I([{provide:W,useExisting:t},Kt]),P,Re]})}return t})(),Ht=(()=>{class t{_dir=o(N,{optional:!0});_elementRef=o(H);_ngZone=o(Q);_inputModalityDetector=o(ue);_renderer=o(L);_cleanupMouseEnter;_menuAim=o(Me,{optional:!0});_menuStack=o(g);_parentMenu=o(ye,{optional:!0});_menuTrigger=o(qt,{optional:!0,self:!0});disabled=!1;typeaheadLabel;triggered=new b;get hasMenu(){return this._menuTrigger?.menuTemplateRef!=null}_tabindex=-1;closeOnSpacebarTrigger=!0;destroyed=new _;constructor(){this._setupMouseEnter(),this._setType(),this._isStandaloneItem()&&(this._tabindex=0)}ngOnDestroy(){this._cleanupMouseEnter?.(),this.destroyed.next(),this.destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}trigger(e){let{keepOpen:i}=x({},e);!this.disabled&&!this.hasMenu&&(this.triggered.next(),i||this._menuStack.closeAll({focusParentTrigger:!0}))}isMenuOpen(){return!!this._menuTrigger?.isOpen()}getMenu(){return this._menuTrigger?.getMenu()}getMenuTrigger(){return this._menuTrigger}getLabel(){return this.typeaheadLabel||this._elementRef.nativeElement.textContent?.trim()||""}_resetTabIndex(){this._isStandaloneItem()||(this._tabindex=-1)}_setTabIndex(e){this.disabled||(!e||!this._menuStack.isEmpty())&&(this._tabindex=0)}_handleClick(e){this.disabled?(e.preventDefault(),e.stopPropagation()):this.trigger()}_onKeydown(e){switch(e.keyCode){case 32:case 13:if(!h(e)&&!_t(this._elementRef,e)){let i=this._elementRef.nativeElement.nodeName;i!=="A"&&i!=="BUTTON"&&e.preventDefault(),this.trigger({keepOpen:e.keyCode===32&&!this.closeOnSpacebarTrigger})}break;case 39:h(e)||this._parentMenu&&this._isParentVertical()&&(this._dir?.value!=="rtl"?this._forwardArrowPressed(e):this._backArrowPressed(e));break;case 37:h(e)||this._parentMenu&&this._isParentVertical()&&(this._dir?.value!=="rtl"?this._backArrowPressed(e):this._forwardArrowPressed(e));break}}_isStandaloneItem(){return!this._parentMenu}_backArrowPressed(e){let i=this._parentMenu;(this._menuStack.hasInlineMenu()||this._menuStack.length()>1)&&(e.preventDefault(),this._menuStack.close(i,{focusNextOnEmpty:this._menuStack.inlineMenuOrientation()==="horizontal"?y.previousItem:y.currentItem,focusParentTrigger:!0}))}_forwardArrowPressed(e){!this.hasMenu&&this._menuStack.inlineMenuOrientation()==="horizontal"&&(e.preventDefault(),this._menuStack.closeAll({focusNextOnEmpty:y.nextItem,focusParentTrigger:!0}))}_setupMouseEnter(){if(!this._isStandaloneItem()){let e=()=>this._ngZone.run(()=>this._menuStack.closeSubMenuOf(this._parentMenu));this._cleanupMouseEnter=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"mouseenter",()=>{this._inputModalityDetector.mostRecentModality!=="touch"&&!this._menuStack.isEmpty()&&!this.hasMenu&&(this._menuAim?this._menuAim.toggle(e):e())}))}}_isParentVertical(){return this._parentMenu?.orientation==="vertical"}_setType(){let e=this._elementRef.nativeElement;e.nodeName==="BUTTON"&&!e.getAttribute("type")&&e.setAttribute("type","button")}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenuItem",""]],hostAttrs:["role","menuitem",1,"cdk-menu-item"],hostVars:4,hostBindings:function(i,n){i&1&&p("blur",function(){return n._resetTabIndex()})("focus",function(){return n._setTabIndex()})("click",function(a){return n._handleClick(a)})("keydown",function(a){return n._onKeydown(a)}),i&2&&(ie("tabIndex",n._tabindex),D("aria-disabled",n.disabled||null),ne("cdk-menu-item-disabled",n.disabled))},inputs:{disabled:[2,"cdkMenuItemDisabled","disabled",ae],typeaheadLabel:[0,"cdkMenuitemTypeaheadLabel","typeaheadLabel"]},outputs:{triggered:"cdkMenuItemTriggered"},exportAs:["cdkMenuItem"]})}return t})(),ke=class{_renderer;_items;_eventCleanups;_itemsSubscription;entered=new _;exited=new _;activeElement;previousElement;constructor(s,e){this._renderer=s,this._items=e,this._bindEvents(),this.entered.subscribe(i=>this.activeElement=i),this.exited.subscribe(()=>{this.previousElement=this.activeElement,this.activeElement=void 0})}destroy(){this._cleanupEvents(),this._itemsSubscription?.unsubscribe()}_bindEvents(){this._itemsSubscription=this._items.changes.pipe(w(this._items)).subscribe(()=>{this._cleanupEvents(),this._eventCleanups=[],this._items.forEach(s=>{let e=s._elementRef.nativeElement;this._eventCleanups.push(this._renderer.listen(e,"mouseenter",()=>{this.entered.next(s)}),this._renderer.listen(e,"mouseout",()=>{this.exited.next(s)}))})})}_cleanupEvents(){this._eventCleanups?.forEach(s=>s()),this._eventCleanups=void 0}},Qt=(()=>{class t extends pt{_focusMonitor=o(Ze);ngZone=o(Q);_renderer=o(L);nativeElement=o(H).nativeElement;menuStack=o(g);menuAim=o(Me,{optional:!0,self:!0});dir=o(N,{optional:!0});_allItems;id=o(le).getId("cdk-menu-");items=new Ke;orientation="vertical";isInline=!1;keyManager;destroyed=new _;triggerItem;pointerTracker;_menuStackHasFocus=Pe(!1);_tabIndexSignal=Ue(()=>{let e=this._menuStackHasFocus()?-1:0;return this.isInline?e:null});ngAfterContentInit(){this.isInline||this.menuStack.push(this),this._setItems(),this._setKeyManager(),this._handleFocus(),this._subscribeToMenuStackHasFocus(),this._subscribeToMenuOpen(),this._subscribeToMenuStackClosed(),this._setUpPointerTracker()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this.nativeElement),this.keyManager?.destroy(),this.destroyed.next(),this.destroyed.complete(),this.pointerTracker?.destroy()}focusFirstItem(e="program"){this.keyManager.setFocusOrigin(e),this.keyManager.setFirstItemActive()}focusLastItem(e="program"){this.keyManager.setFocusOrigin(e),this.keyManager.setLastItemActive()}setActiveMenuItem(e){this.keyManager?.setActiveItem(e)}_getTabIndex(){return this._tabIndexSignal()}closeOpenMenu(e,i){let{focusParentTrigger:n}=x({},i),r=this.keyManager,a=this.triggerItem;e===a?.getMenuTrigger()?.getMenu()&&(a?.getMenuTrigger()?.close(),n&&(a?r.setActiveItem(a):r.setFirstItemActive()))}_setItems(){this._allItems.changes.pipe(w(this._allItems),m(this.destroyed)).subscribe(e=>{this.items.reset(e.filter(i=>i._parentMenu===this)),this.items.notifyOnChanges()})}_setKeyManager(){this.keyManager=new $e(this.items).withWrap().withTypeAhead().withHomeAndEnd().skipPredicate(()=>!1),this.orientation==="horizontal"?this.keyManager.withHorizontalOrientation(this.dir?.value||"ltr"):this.keyManager.withVerticalOrientation()}_subscribeToMenuOpen(){let e=q(this.items.changes,this.destroyed);this.items.changes.pipe(w(this.items),ve(i=>i.filter(n=>n.hasMenu).map(n=>n.getMenuTrigger().opened.pipe(Se(n),m(e)))),Ie(),Oe(i=>(this.triggerItem=i,i.getMenuTrigger().closed)),m(this.destroyed)).subscribe(()=>this.triggerItem=void 0)}_subscribeToMenuStackClosed(){this.menuStack.closed.pipe(m(this.destroyed)).subscribe(({item:e,focusParentTrigger:i})=>this.closeOpenMenu(e,{focusParentTrigger:i}))}_subscribeToMenuStackHasFocus(){this.isInline&&this.menuStack.hasFocus.pipe(m(this.destroyed)).subscribe(e=>{this._menuStackHasFocus.set(e)})}_setUpPointerTracker(){this.menuAim&&(this.ngZone.runOutsideAngular(()=>{this.pointerTracker=new ke(this._renderer,this.items)}),this.menuAim.initialize(this,this.pointerTracker))}_handleFocus(){this._focusMonitor.monitor(this.nativeElement,!1).pipe(m(this.destroyed)).subscribe(e=>{e!==null&&e!=="mouse"&&this.focusFirstItem(e)})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=Ae(t)))(n||t)}})();static \u0275dir=k({type:t,contentQueries:function(i,n,r){if(i&1&&He(r,Ht,5),i&2){let a;Qe(a=Le())&&(n._allItems=a)}},hostAttrs:["role","menu"],hostVars:4,hostBindings:function(i,n){i&1&&p("focusin",function(){return n.menuStack.setHasFocus(!0)})("focusout",function(){return n.menuStack.setHasFocus(!1)}),i&2&&(ie("tabIndex",n._getTabIndex())("id",n.id),D("aria-orientation",n.orientation)("data-cdk-menu-stack-id",n.menuStack.id))},inputs:{id:"id"},features:[P]})}return t})(),Ti=(()=>{class t extends Qt{_parentTrigger=o(W,{optional:!0});closed=new b;orientation="vertical";isInline=!this._parentTrigger;constructor(){super(),this.destroyed.subscribe(this.closed),this._parentTrigger?.registerChildMenu(this)}ngAfterContentInit(){super.ngAfterContentInit(),this._subscribeToMenuStackEmptied()}ngOnDestroy(){super.ngOnDestroy(),this.closed.complete()}_handleKeyEvent(e){let i=this.keyManager;switch(e.keyCode){case 37:case 39:h(e)||(e.preventDefault(),i.setFocusOrigin("keyboard"),i.onKeydown(e));break;case 27:h(e)||(e.preventDefault(),this.menuStack.close(this,{focusNextOnEmpty:y.currentItem,focusParentTrigger:!0}));break;case 9:h(e,"altKey","metaKey","ctrlKey")||this.menuStack.closeAll({focusParentTrigger:!0});break;default:i.onKeydown(e)}}_toggleMenuFocus(e){let i=this.keyManager;switch(e){case y.nextItem:i.setFocusOrigin("keyboard"),i.setNextItemActive();break;case y.previousItem:i.setFocusOrigin("keyboard"),i.setPreviousItemActive();break;case y.currentItem:i.activeItem&&(i.setFocusOrigin("keyboard"),i.setActiveItem(i.activeItem));break}}_subscribeToMenuStackEmptied(){this.menuStack.emptied.pipe(m(this.destroyed)).subscribe(e=>this._toggleMenuFocus(e))}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenu",""]],hostAttrs:["role","menu",1,"cdk-menu"],hostVars:2,hostBindings:function(i,n){i&1&&p("keydown",function(a){return n._handleKeyEvent(a)}),i&2&&ne("cdk-menu-inline",n.isInline)},outputs:{closed:"closed"},exportAs:["cdkMenu"],features:[I([{provide:pt,useExisting:t},{provide:ye,useExisting:t},Bt("vertical")]),P]})}return t})();var Lt=pe.map(t=>{let s=t.overlayX==="start"?2:-2,e=t.overlayY==="top"?2:-2;return Ce(x({},t),{offsetX:s,offsetY:e})}),Si=(()=>{class t extends ft{_injector=o(S);_directionality=o(N,{optional:!0});_menuTracker=o(ht);_changeDetectorRef=o(re);disabled=!1;constructor(){super(),this._setMenuStackCloseListener()}open(e){this._open(null,e),this._changeDetectorRef.markForCheck()}close(){this.menuStack.closeAll()}_openOnContextMenu(e){this.disabled||(e.preventDefault(),e.stopPropagation(),this._menuTracker.update(this),this._open(e,{x:e.clientX,y:e.clientY}),e.button===2?this.childMenu?.focusFirstItem("mouse"):e.button===0?this.childMenu?.focusFirstItem("keyboard"):this.childMenu?.focusFirstItem("program"))}_getOverlayConfig(e){return new de({positionStrategy:this._getOverlayPositionStrategy(e),scrollStrategy:this.menuScrollStrategy(),direction:this._directionality||void 0})}_getOverlayPositionStrategy(e){return me(this._injector,e).withLockedPosition().withGrowAfterOpen().withPositions(this.menuPosition??Lt)}_setMenuStackCloseListener(){this.menuStack.closed.pipe(m(this.destroyed)).subscribe(({item:e})=>{e===this.childMenu&&this.isOpen()&&(this.closed.next(),this.overlayRef.detach(),this.childMenu=void 0,this._changeDetectorRef.markForCheck())})}_subscribeToOutsideClicks(e){if(this.overlayRef){let i=this.overlayRef.outsidePointerEvents();if(e){let[n,r]=xe(i,({type:a})=>a==="auxclick");i=q(r.pipe(we((a,kt)=>e.ctrlKey&&kt===0&&a.ctrlKey)),n.pipe(Ee(1)))}i.pipe(m(this.stopOutsideClicksListener)).subscribe(n=>{this.isElementInsideMenuStack(ce(n))||this.menuStack.closeAll()})}}_open(e,i){this.disabled||(this.isOpen()?(this.menuStack.closeSubMenuOf(this.childMenu),this.overlayRef.getConfig().positionStrategy.setOrigin(i),this.overlayRef.updatePosition()):(this.opened.next(),this.overlayRef?(this.overlayRef.getConfig().positionStrategy.setOrigin(i),this.overlayRef.updatePosition()):this.overlayRef=he(this._injector,this._getOverlayConfig(i)),this.overlayRef.attach(this.getMenuContentPortal()),this._subscribeToOutsideClicks(e)))}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkContextMenuTriggerFor",""]],hostVars:1,hostBindings:function(i,n){i&1&&p("contextmenu",function(a){return n._openOnContextMenu(a)}),i&2&&D("data-cdk-menu-stack-id",null)},inputs:{menuTemplateRef:[0,"cdkContextMenuTriggerFor","menuTemplateRef"],menuPosition:[0,"cdkContextMenuPosition","menuPosition"],menuData:[0,"cdkContextMenuTriggerData","menuData"],disabled:[2,"cdkContextMenuDisabled","disabled",ae]},outputs:{opened:"cdkContextMenuOpened",closed:"cdkContextMenuClosed"},exportAs:["cdkContextMenuTriggerFor"],features:[I([{provide:W,useExisting:t},{provide:g,useClass:be}]),P]})}return t})();var Di=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Ne({type:t});static \u0275inj=Fe({imports:[tt]})}return t})();var gt=class t{icon="";label="";truncate=!1;static \u0275fac=function(e){return new(e||t)};static \u0275cmp=V({type:t,selectors:[["POS-dropdown-item-more-action"]],inputs:{icon:"icon",label:"label",truncate:"truncate"},decls:6,vars:3,consts:[[1,"dropdown-item","px-1"],[1,"row","g-0","d-flex","align-items-center"],[1,"col-2","px-0"],["aria-hidden","true",1,"fs-3"],[1,"col-10","pe-0","ps-4","fs-6"]],template:function(e,i){e&1&&(ee(0,"div",0)(1,"div",1)(2,"div",2),qe(3,"i",3),te(),ee(4,"div",4),f(5),te()()()),e&2&&(c(3),Ve(i.icon),c(2),Y(" ",i.label," "))},dependencies:[it],encapsulation:2})};export{ct as a,Ht as b,Ti as c,Si as d,Di as e,gt as f};
|
|
1
|
+
import{a as at}from"./chunk-GJIFUWGQ.js";import{c as nt,d as st,e as ot}from"./chunk-E4GYCB3G.js";import{a as fe}from"./chunk-OYO4SRAO.js";import{c as it}from"./chunk-VQBUIUJC.js";import{N as rt}from"./chunk-HYXSN2J6.js";import{$ as pe,A as le,C as $e,G as N,O as Xe,V as Je,W as de,Z as me,aa as et,da as he,f as h,ha as tt,k as ce,n as ue,o as Ze}from"./chunk-WACBOZDR.js";import{a as Ge}from"./chunk-OJ5SEYSF.js";import{$ as w,$b as ne,$d as We,Ab as z,Bb as v,Bc as K,Ca as Pe,Cb as u,D as q,Db as d,Ea as Z,Eb as E,Ec as B,F as xe,Fa as $,Fb as ee,Ga as X,Gb as te,Ha as Re,Hb as qe,Ia as Ae,Ja as H,Ka as Ke,Kc as Ue,Lb as R,M as Te,Mb as ie,Nb as p,O as Se,Pb as l,Q as De,Ra as J,Sb as He,Ub as Qe,Vb as Le,Vc as re,Wa as c,Xa as b,Xc as ae,Ya as Q,Z as Ee,Zd as Ye,_ as we,aa as Oe,bb as L,bc as Ve,cc as f,d as _,da as m,dc as A,eb as Be,ec as Y,gb as V,hb as Ne,ib as k,kb as P,la as G,ma as Fe,na as T,pa as o,qd as je,rc as I,rd as ze,sb as D,sc as se,ta as O,tc as oe,ua as F,ub as M,v as ve,w as Ie,wb as C,xa as S,yb as U,zb as j}from"./chunk-VS3RTXZC.js";import{a as x,b as Ce}from"./chunk-SNAKHGZS.js";var lt=()=>["/menu/Outlets/Master/Quick_Key_Templates/Form"],bt=t=>({ID:t}),Mt=t=>({OutletID:t});function Ct(t,s){if(t&1&&E(0,"img",16),t&2){let e=l(2).$implicit;v("src",e.ImageURLClient,J)}}function vt(t,s){if(t&1&&(u(0,"div",14)(1,"div",15),M(2,Ct,1,1,"img",16),d()()),t&2){let e=l().$implicit;c(2),C(e.ImageURLClient?2:-1)}}function It(t,s){if(t&1&&(u(0,"div",15)(1,"p",17)(2,"span"),f(3),K(4,"slice"),d()()()),t&2){let e=l().$implicit;c(3),A(B(4,1,e.Display,0,3))}}function xt(t,s){if(t&1){let e=R();u(0,"div",9)(1,"a",13),p("click",function(){let n=O(e).$implicit,r=l(4);return F(r.onSelectQuickKeyItem(n))}),M(2,vt,3,1,"div",14)(3,It,5,5,"div",15),u(4,"small"),f(5),K(6,"slice"),d()()()}if(t&2){let e=s.$implicit;c(2),C(e.ImageURLClient?2:3),c(3),A(B(6,2,e.Display,0,36))}}function Tt(t,s){if(t&1&&(u(0,"mat-tab",6)(1,"div",7)(2,"div",8),j(3,xt,7,6,"div",9,U),u(5,"div",10)(6,"a",11),E(7,"i",12),d()()()()()),t&2){let e=s.$implicit,i=l(3);v("label",e.Name),c(3),z(e==null?null:e.Items),c(3),v("routerLink",se(3,lt))("queryParams",oe(4,bt,i.quickKey.ID))}}function St(t,s){if(t&1){let e=R();u(0,"mat-tab-group",5),p("selectedIndexChange",function(n){O(e);let r=l(2);return F(r.onChangeTab(n))}),j(1,Tt,8,6,"mat-tab",6,U),d()}if(t&2){let e=l(2);v("disableRipple",!0)("selectedIndex",e.selectedTabIndex),c(),z(e.quickKey==null?null:e.quickKey.Groups)}}function Dt(t,s){if(t&1&&E(0,"img",16),t&2){let e=l(2).$implicit;v("src",e.ImageURLClient,J)}}function Et(t,s){if(t&1&&(u(0,"div",14)(1,"div",15),M(2,Dt,1,1,"img",16),d()()),t&2){let e=l().$implicit;c(2),C(e.ImageURLClient?2:-1)}}function wt(t,s){if(t&1&&(u(0,"div",15)(1,"p",17)(2,"span"),f(3),K(4,"slice"),d()()()),t&2){let e=l().$implicit;c(3),A(B(4,1,e.Model,0,3))}}function Ot(t,s){if(t&1){let e=R();u(0,"div",9)(1,"a",13),p("click",function(){let n=O(e).$implicit,r=l(3);return F(r.onSelectVariant(n.ID))}),M(2,Et,3,1,"div",14)(3,wt,5,5,"div",15),u(4,"small"),f(5),K(6,"slice"),d()()()}if(t&2){let e=s.$implicit;c(2),C(e.ImageURLClient?2:3),c(3),A(B(6,2,e.Model,0,30))}}function Ft(t,s){if(t&1){let e=R();u(0,"div",18)(1,"div",19),p("click",function(){O(e);let n=l(2);return F(n.quickKeyState="QUICKKEY")}),E(2,"i",20),d(),u(3,"div",21)(4,"b"),f(5),d()()(),u(6,"div",7)(7,"div",8),j(8,Ot,7,6,"div",9,U),d()()}if(t&2){let e=l(2);c(5),Y(" ",e.subQuickKeyPack.Display),c(3),z(e.subQuickKeyPack==null?null:e.subQuickKeyPack.Children)}}function Pt(t,s){if(t&1&&M(0,St,3,2,"mat-tab-group",4)(1,Ft,10,1),t&2){let e=l();C(e.quickKeyState=="QUICKKEY"?0:1)}}function Rt(t,s){if(t&1&&(u(0,"div",3)(1,"a",22)(2,"strong"),f(3,"QUICK KEYS UNCONFIGURED"),d(),E(4,"i",23),u(5,"span"),f(6,"Click here to setup your Quick keys"),d()()()),t&2){let e=l();c(),v("routerLink",se(2,lt))("queryParams",oe(3,Mt,e.outletID))}}var ct=class t{sf=o(at);quickKey;get outletID(){return this._outletID}set outletID(s){this._outletID=s,this._outletID&&(this.quickKeyState="QUICKKEY")}_outletID="";_onSelectVariant=new b;quickKeyState="QUICKKEY";subQuickKeyPack;selectedTabIndex=0;disabled=!1;onChange=s=>{};onTouched=()=>{};writeValue(s){}registerOnChange(s){this.onChange=s}registerOnTouched(s){this.onTouched=s}setDisabledState(s){this.disabled=s}onSelectQuickKeyItem(s){s.Children?s.Children.length==1?this.onSelectVariant(s.Children[0].ID):(this.quickKeyState="SUBQUICKKEY",this.subQuickKeyPack={Children:s.Children,Display:s.Display}):this.onSelectVariant(s.ItemID)}onSelectVariant(s){this.quickKeyState="QUICKKEY",this._onSelectVariant.emit(s),this.onChange(s),this.sf.searchFilterNativeEl?.focus()}onChangeTab(s){this.selectedTabIndex=s}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=V({type:t,selectors:[["POS-quick-key"]],inputs:{quickKey:"quickKey",outletID:"outletID"},outputs:{_onSelectVariant:"onSelectVariant"},features:[I([{provide:Ge,multi:!0,useExisting:t}])],decls:5,vars:1,consts:[[1,"row","h-100"],[1,"col-12"],[1,"quick-key-tab","h-100","pt-4"],[1,"no-quick-key"],[1,"h-100","bgQuickkeyIllustration","landscape",3,"disableRipple","selectedIndex"],[1,"h-100","bgQuickkeyIllustration","landscape",3,"selectedIndexChange","disableRipple","selectedIndex"],[3,"label"],[1,"container","tabItems"],[1,"row","g-0"],[1,"col-3","column","px-6"],[1,"col-3","column","px-8","add","pt-8"],[3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-plus-circle","fa-5x","d-flex","align-items-center","justify-content-center","bg-white","h-100","text-primary"],[3,"click"],[1,"img-box","d-flex","align-items-center"],[1,"ratio","ratio-1x1"],[1,"full-screen-image",3,"src"],[1,"fw-normal","fs-1","d-flex","align-items-center","justify-content-center"],[1,"row","g-0","border","align-items-center","subquicKey"],[1,"col-auto","border-end","py-5","px-7","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa","fa-arrow-left"],[1,"col","text-center","fw-bold","text-uppercase","fs-5"],["id","LinkConfigureQuickkey","target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa-regular","fa-hand-pointer"]],template:function(e,i){e&1&&(u(0,"div",0)(1,"div",1)(2,"section",2),M(3,Pt,2,1)(4,Rt,7,5,"div",3),d()()()),e&2&&(c(3),C(i.quickKey&&i.quickKey.Groups?3:4))},dependencies:[ze,We,Ye,rt,ot,nt,st,je],styles:[".quick-key-tab{width:100%;position:relative;height:100%;max-height:calc(100vh - 70px)} .quick-key-tab .mat-mdc-tab-header-pagination{display:none!important} .quick-key-tab .mat-mdc-tab-header{border:none} .quick-key-tab .mdc-tab-indicator{display:none!important} .quick-key-tab .mat-mdc-tab-body-wrapper{width:102%} .quick-key-tab .mat-mdc-tab-labels{border-bottom:0px;display:flex;flex-wrap:wrap;border-radius:6px} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab{color:#151515;opacity:1;height:38px;max-height:40px;white-space:normal!important;overflow:hidden;padding:0!important;min-width:25%!important;flex-basis:0;font-size:12px;font-weight:700;outline:none;text-transform:uppercase;background:#fff;display:flex} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab .mdc-tab__content{white-space:normal!important;align-self:center;font-size:.875rem!important} .quick-key-tab .mat-mdc-tab-labels .mdc-tab--active{background:linear-gradient(to bottom,#fff,#eee);border-radius:6px;border:.5px solid #dadada} .quick-key-tab .mat-mdc-tab-labels .mdc-tab--active .mdc-tab__text-label{color:gray!important;font-weight:700} .quick-key-tab .mat-mdc-tab-labels .mat-mdc-tab:nth-child(n+5){flex-grow:0!important} .quick-key-tab .tabItems{padding:0} .quick-key-tab .tabItems .column{margin-top:15px;margin-bottom:10px;word-break:break-all} .quick-key-tab .tabItems .column>div{border:solid 1px #cfcfcf} .quick-key-tab .tabItems .column>a{text-align:center;display:block;cursor:pointer} .quick-key-tab .tabItems .column>a div.img-box{display:block;margin:0 auto;border-top-left-radius:5px;border-bottom-right-radius:5px;border:solid 1px #dddddd} .quick-key-tab .tabItems .column>a .full-screen-image{position:absolute;object-fit:scale-down} .quick-key-tab .tabItems .column>a p{display:block;margin:0 auto;background-color:#a6a6a6;border:solid 1px #999999;border-top-left-radius:5px;border-bottom-right-radius:5px;color:#fff} .quick-key-tab .tabItems .column>a small{font-size:11px;display:block;margin:5px 0 0} .quick-key-tab .tabItems .column .ion-icon{font-size:75px;margin:10px} .quick-key-tab .col-md-3.column.add{cursor:pointer} .quick-key-tab .col-md-3.column.add i{margin-top:10px} .quick-key-tab ::-webkit-scrollbar{width:3px} .quick-key-tab ::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #bfd2da} .quick-key-tab ::-webkit-scrollbar-thumb{background:#c4c4c4;border-radius:10px} .quick-key-tab .subquicKey{background:linear-gradient(to bottom,#fff,#eee);color:gray;border-radius:6px} .quick-key-tab .no-quick-key{background-image:url(//res.cloudinary.com/pos/image/upload/w_500/POS/Images/Cashier/no-quick-key.png)!important;background-repeat:no-repeat;height:calc(100vh - 70px);background-size:contain}a#LinkConfigureQuickkey[_ngcontent-%COMP%]{background-color:#479ccf;padding:15px 25px;color:#fff;text-decoration:none;width:240px;display:block;opacity:.85;border-radius:6px}a#LinkConfigureQuickkey[_ngcontent-%COMP%]{position:absolute;top:200px;left:calc(50% - 120px)}a#LinkConfigureQuickkey[_ngcontent-%COMP%]:hover{opacity:.95}a#LinkConfigureQuickkey[_ngcontent-%COMP%] Strong[_ngcontent-%COMP%]{border-bottom:1px solid white;font-size:14px;margin:0 0 10px;padding:0 0 3px;display:block}a#LinkConfigureQuickkey[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:inline-block;height:35px;margin:0 10px 0 0;font-size:28px}a#LinkConfigureQuickkey[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:inline-block;font-size:14px;width:135px;vertical-align:top}"]})};var pt=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenuGroup",""]],hostAttrs:["role","group",1,"cdk-menu-group"],exportAs:["cdkMenuGroup"],features:[I([{provide:fe,useClass:fe}])]})}return t})(),ye=new T("cdk-menu"),y=(function(t){return t[t.nextItem=0]="nextItem",t[t.previousItem=1]="previousItem",t[t.currentItem=2]="currentItem",t})(y||{}),g=new T("cdk-menu-stack"),Kt={provide:g,deps:[[new $,new X,new Z(g)]],useFactory:t=>t||new be},Bt=t=>({provide:g,deps:[[new $,new X,new Z(g)]],useFactory:s=>s||be.inline(t)}),be=(()=>{class t{id=o(le).getId("cdk-menu-stack-");_elements=[];_close=new _;_empty=new _;_hasFocus=new _;closed=this._close;hasFocus=this._hasFocus.pipe(w(!1),Te(0),De());emptied=this._empty;_inlineMenuOrientation=null;static inline(e){let i=new t;return i._inlineMenuOrientation=e,i}push(e){this._elements.push(e)}close(e,i){let{focusNextOnEmpty:n,focusParentTrigger:r}=x({},i);if(this._elements.indexOf(e)>=0){let a;do a=this._elements.pop(),this._close.next({item:a,focusParentTrigger:r});while(a!==e);this.isEmpty()&&this._empty.next(n)}}closeSubMenuOf(e){let i=!1;if(this._elements.indexOf(e)>=0)for(i=this.peek()!==e;this.peek()!==e;)this._close.next({item:this._elements.pop()});return i}closeAll(e){let{focusNextOnEmpty:i,focusParentTrigger:n}=x({},e);if(!this.isEmpty()){for(;!this.isEmpty();){let r=this._elements.pop();r&&this._close.next({item:r,focusParentTrigger:n})}this._empty.next(i)}}isEmpty(){return!this._elements.length}length(){return this._elements.length}peek(){return this._elements[this._elements.length-1]}hasInlineMenu(){return this._inlineMenuOrientation!=null}inlineMenuOrientation(){return this._inlineMenuOrientation}setHasFocus(e){this._hasFocus.next(e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=G({token:t,factory:t.\u0275fac})}return t})(),W=new T("cdk-menu-trigger"),Nt=new T("cdk-menu-scroll-strategy",{providedIn:"root",factory:()=>{let t=o(S);return()=>Je(t)}}),ht=(()=>{class t{static _openMenuTrigger;update(e){t._openMenuTrigger!==e&&(t._openMenuTrigger?.close(),t._openMenuTrigger=e)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=G({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ft=(()=>{class t{injector=o(S);viewContainerRef=o(Be);menuStack=o(g);menuScrollStrategy=o(Nt);menuPosition;opened=new b;closed=new b;menuTemplateRef;menuData;overlayRef=null;destroyed=new _;stopOutsideClicksListener=q(this.closed,this.destroyed);childMenu;_menuPortal;_childMenuInjector;ngOnDestroy(){this._destroyOverlay(),this.destroyed.next(),this.destroyed.complete()}isOpen(){return!!this.overlayRef?.hasAttached()}registerChildMenu(e){this.childMenu=e}getMenuContentPortal(){let e=this.menuTemplateRef!==this._menuPortal?.templateRef;return this.menuTemplateRef&&(!this._menuPortal||e)&&(this._menuPortal=new Xe(this.menuTemplateRef,this.viewContainerRef,this.menuData,this._getChildMenuInjector())),this._menuPortal}isElementInsideMenuStack(e){for(let i=e;i;i=i?.parentElement??null)if(i.getAttribute("data-cdk-menu-stack-id")===this.menuStack.id)return!0;return!1}_destroyOverlay(){this.overlayRef&&(this.overlayRef.dispose(),this.overlayRef=null)}_getChildMenuInjector(){return this._childMenuInjector=this._childMenuInjector||S.create({providers:[{provide:W,useValue:this},{provide:g,useValue:this.menuStack}],parent:this.injector}),this._childMenuInjector}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,hostVars:2,hostBindings:function(i,n){i&2&&D("aria-controls",n.childMenu==null?null:n.childMenu.id)("data-cdk-menu-stack-id",n.menuStack.id)}})}return t})();var Me=new T("cdk-menu-aim");function _t(t,s){if(!s.isTrusted)return!1;let e=t.nativeElement,i=s.keyCode;return e.nodeName==="BUTTON"&&!e.disabled?i===13||i===32:e.nodeName==="A"?i===13:!1}var qt=(()=>{class t extends ft{_elementRef=o(H);_ngZone=o(Q);_changeDetectorRef=o(re);_inputModalityDetector=o(ue);_directionality=o(N,{optional:!0});_renderer=o(L);_injector=o(S);_cleanupMouseenter;_menuTracker=o(ht);_parentMenu=o(ye,{optional:!0});_menuAim=o(Me,{optional:!0});constructor(){super(),this._setRole(),this._registerCloseHandler(),this._subscribeToMenuStackClosed(),this._subscribeToMouseEnter(),this._subscribeToMenuStackHasFocus(),this._setType()}toggle(){this.isOpen()?this.close():this.open()}open(){this._parentMenu||this._menuTracker.update(this),!this.isOpen()&&this.menuTemplateRef!=null&&(this.opened.next(),this.overlayRef=this.overlayRef||he(this._injector,this._getOverlayConfig()),this.overlayRef.attach(this.getMenuContentPortal()),this._changeDetectorRef.markForCheck(),this._subscribeToOutsideClicks())}close(){this.isOpen()&&(this.closed.next(),this.overlayRef.detach(),this._changeDetectorRef.markForCheck()),this._closeSiblingTriggers()}getMenu(){return this.childMenu}ngOnChanges(e){e.menuPosition&&this.overlayRef&&this.overlayRef.updatePositionStrategy(this._getOverlayPositionStrategy())}ngOnDestroy(){this._cleanupMouseenter(),super.ngOnDestroy()}_toggleOnKeydown(e){let i=this._parentMenu?.orientation==="vertical";switch(e.keyCode){case 32:case 13:!h(e)&&!_t(this._elementRef,e)&&(this.toggle(),this.childMenu?.focusFirstItem("keyboard"));break;case 39:h(e)||this._parentMenu&&i&&this._directionality?.value!=="rtl"&&(e.preventDefault(),this.open(),this.childMenu?.focusFirstItem("keyboard"));break;case 37:h(e)||this._parentMenu&&i&&this._directionality?.value==="rtl"&&(e.preventDefault(),this.open(),this.childMenu?.focusFirstItem("keyboard"));break;case 40:case 38:h(e)||i||(e.preventDefault(),this.open(),e.keyCode===40?this.childMenu?.focusFirstItem("keyboard"):this.childMenu?.focusLastItem("keyboard"));break}}_handleClick(){this.toggle(),this.childMenu?.focusFirstItem("mouse")}_setHasFocus(e){this._parentMenu||this.menuStack.setHasFocus(e)}_subscribeToMouseEnter(){this._cleanupMouseenter=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"mouseenter",()=>{if(this._inputModalityDetector.mostRecentModality!=="touch"&&!this.menuStack.isEmpty()&&!this.isOpen()){let e=()=>this._ngZone.run(()=>{this._closeSiblingTriggers(),this.open()});this._menuAim?this._menuAim.toggle(e):e()}}))}_closeSiblingTriggers(){this._parentMenu?!this.menuStack.closeSubMenuOf(this._parentMenu)&&this.menuStack.peek()!==this._parentMenu&&this.menuStack.closeAll():this.menuStack.closeAll()}_getOverlayConfig(){return new de({positionStrategy:this._getOverlayPositionStrategy(),scrollStrategy:this.menuScrollStrategy(),direction:this._directionality||void 0})}_getOverlayPositionStrategy(){return me(this._injector,this._elementRef).withLockedPosition().withFlexibleDimensions(!1).withPositions(this._getOverlayPositions())}_getOverlayPositions(){return this.menuPosition??(!this._parentMenu||this._parentMenu.orientation==="horizontal"?pe:et)}_registerCloseHandler(){this._parentMenu||this.menuStack.closed.pipe(m(this.destroyed)).subscribe(({item:e})=>{e===this.childMenu&&this.close()})}_subscribeToOutsideClicks(){this.overlayRef&&this.overlayRef.outsidePointerEvents().pipe(m(this.stopOutsideClicksListener)).subscribe(e=>{let i=ce(e),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&(this.isElementInsideMenuStack(i)?this._closeSiblingTriggers():this.menuStack.closeAll())})}_subscribeToMenuStackHasFocus(){this._parentMenu||this.menuStack.hasFocus.pipe(m(this.destroyed)).subscribe(e=>{e||this.menuStack.closeAll()})}_subscribeToMenuStackClosed(){this._parentMenu||this.menuStack.closed.subscribe(({focusParentTrigger:e})=>{e&&!this.menuStack.length()&&this._elementRef.nativeElement.focus()})}_setRole(){this._parentMenu||this._elementRef.nativeElement.setAttribute("role","button")}_setType(){let e=this._elementRef.nativeElement;e.nodeName==="BUTTON"&&!e.getAttribute("type")&&e.setAttribute("type","button")}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenuTriggerFor",""]],hostAttrs:[1,"cdk-menu-trigger"],hostVars:2,hostBindings:function(i,n){i&1&&p("focusin",function(){return n._setHasFocus(!0)})("focusout",function(){return n._setHasFocus(!1)})("keydown",function(a){return n._toggleOnKeydown(a)})("click",function(){return n._handleClick()}),i&2&&D("aria-haspopup",n.menuTemplateRef?"menu":null)("aria-expanded",n.menuTemplateRef==null?null:n.isOpen())},inputs:{menuTemplateRef:[0,"cdkMenuTriggerFor","menuTemplateRef"],menuPosition:[0,"cdkMenuPosition","menuPosition"],menuData:[0,"cdkMenuTriggerData","menuData"]},outputs:{opened:"cdkMenuOpened",closed:"cdkMenuClosed"},exportAs:["cdkMenuTriggerFor"],features:[I([{provide:W,useExisting:t},Kt]),P,Re]})}return t})(),Ht=(()=>{class t{_dir=o(N,{optional:!0});_elementRef=o(H);_ngZone=o(Q);_inputModalityDetector=o(ue);_renderer=o(L);_cleanupMouseEnter;_menuAim=o(Me,{optional:!0});_menuStack=o(g);_parentMenu=o(ye,{optional:!0});_menuTrigger=o(qt,{optional:!0,self:!0});disabled=!1;typeaheadLabel;triggered=new b;get hasMenu(){return this._menuTrigger?.menuTemplateRef!=null}_tabindex=-1;closeOnSpacebarTrigger=!0;destroyed=new _;constructor(){this._setupMouseEnter(),this._setType(),this._isStandaloneItem()&&(this._tabindex=0)}ngOnDestroy(){this._cleanupMouseEnter?.(),this.destroyed.next(),this.destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}trigger(e){let{keepOpen:i}=x({},e);!this.disabled&&!this.hasMenu&&(this.triggered.next(),i||this._menuStack.closeAll({focusParentTrigger:!0}))}isMenuOpen(){return!!this._menuTrigger?.isOpen()}getMenu(){return this._menuTrigger?.getMenu()}getMenuTrigger(){return this._menuTrigger}getLabel(){return this.typeaheadLabel||this._elementRef.nativeElement.textContent?.trim()||""}_resetTabIndex(){this._isStandaloneItem()||(this._tabindex=-1)}_setTabIndex(e){this.disabled||(!e||!this._menuStack.isEmpty())&&(this._tabindex=0)}_handleClick(e){this.disabled?(e.preventDefault(),e.stopPropagation()):this.trigger()}_onKeydown(e){switch(e.keyCode){case 32:case 13:if(!h(e)&&!_t(this._elementRef,e)){let i=this._elementRef.nativeElement.nodeName;i!=="A"&&i!=="BUTTON"&&e.preventDefault(),this.trigger({keepOpen:e.keyCode===32&&!this.closeOnSpacebarTrigger})}break;case 39:h(e)||this._parentMenu&&this._isParentVertical()&&(this._dir?.value!=="rtl"?this._forwardArrowPressed(e):this._backArrowPressed(e));break;case 37:h(e)||this._parentMenu&&this._isParentVertical()&&(this._dir?.value!=="rtl"?this._backArrowPressed(e):this._forwardArrowPressed(e));break}}_isStandaloneItem(){return!this._parentMenu}_backArrowPressed(e){let i=this._parentMenu;(this._menuStack.hasInlineMenu()||this._menuStack.length()>1)&&(e.preventDefault(),this._menuStack.close(i,{focusNextOnEmpty:this._menuStack.inlineMenuOrientation()==="horizontal"?y.previousItem:y.currentItem,focusParentTrigger:!0}))}_forwardArrowPressed(e){!this.hasMenu&&this._menuStack.inlineMenuOrientation()==="horizontal"&&(e.preventDefault(),this._menuStack.closeAll({focusNextOnEmpty:y.nextItem,focusParentTrigger:!0}))}_setupMouseEnter(){if(!this._isStandaloneItem()){let e=()=>this._ngZone.run(()=>this._menuStack.closeSubMenuOf(this._parentMenu));this._cleanupMouseEnter=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"mouseenter",()=>{this._inputModalityDetector.mostRecentModality!=="touch"&&!this._menuStack.isEmpty()&&!this.hasMenu&&(this._menuAim?this._menuAim.toggle(e):e())}))}}_isParentVertical(){return this._parentMenu?.orientation==="vertical"}_setType(){let e=this._elementRef.nativeElement;e.nodeName==="BUTTON"&&!e.getAttribute("type")&&e.setAttribute("type","button")}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenuItem",""]],hostAttrs:["role","menuitem",1,"cdk-menu-item"],hostVars:4,hostBindings:function(i,n){i&1&&p("blur",function(){return n._resetTabIndex()})("focus",function(){return n._setTabIndex()})("click",function(a){return n._handleClick(a)})("keydown",function(a){return n._onKeydown(a)}),i&2&&(ie("tabIndex",n._tabindex),D("aria-disabled",n.disabled||null),ne("cdk-menu-item-disabled",n.disabled))},inputs:{disabled:[2,"cdkMenuItemDisabled","disabled",ae],typeaheadLabel:[0,"cdkMenuitemTypeaheadLabel","typeaheadLabel"]},outputs:{triggered:"cdkMenuItemTriggered"},exportAs:["cdkMenuItem"]})}return t})(),ke=class{_renderer;_items;_eventCleanups;_itemsSubscription;entered=new _;exited=new _;activeElement;previousElement;constructor(s,e){this._renderer=s,this._items=e,this._bindEvents(),this.entered.subscribe(i=>this.activeElement=i),this.exited.subscribe(()=>{this.previousElement=this.activeElement,this.activeElement=void 0})}destroy(){this._cleanupEvents(),this._itemsSubscription?.unsubscribe()}_bindEvents(){this._itemsSubscription=this._items.changes.pipe(w(this._items)).subscribe(()=>{this._cleanupEvents(),this._eventCleanups=[],this._items.forEach(s=>{let e=s._elementRef.nativeElement;this._eventCleanups.push(this._renderer.listen(e,"mouseenter",()=>{this.entered.next(s)}),this._renderer.listen(e,"mouseout",()=>{this.exited.next(s)}))})})}_cleanupEvents(){this._eventCleanups?.forEach(s=>s()),this._eventCleanups=void 0}},Qt=(()=>{class t extends pt{_focusMonitor=o(Ze);ngZone=o(Q);_renderer=o(L);nativeElement=o(H).nativeElement;menuStack=o(g);menuAim=o(Me,{optional:!0,self:!0});dir=o(N,{optional:!0});_allItems;id=o(le).getId("cdk-menu-");items=new Ke;orientation="vertical";isInline=!1;keyManager;destroyed=new _;triggerItem;pointerTracker;_menuStackHasFocus=Pe(!1);_tabIndexSignal=Ue(()=>{let e=this._menuStackHasFocus()?-1:0;return this.isInline?e:null});ngAfterContentInit(){this.isInline||this.menuStack.push(this),this._setItems(),this._setKeyManager(),this._handleFocus(),this._subscribeToMenuStackHasFocus(),this._subscribeToMenuOpen(),this._subscribeToMenuStackClosed(),this._setUpPointerTracker()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this.nativeElement),this.keyManager?.destroy(),this.destroyed.next(),this.destroyed.complete(),this.pointerTracker?.destroy()}focusFirstItem(e="program"){this.keyManager.setFocusOrigin(e),this.keyManager.setFirstItemActive()}focusLastItem(e="program"){this.keyManager.setFocusOrigin(e),this.keyManager.setLastItemActive()}setActiveMenuItem(e){this.keyManager?.setActiveItem(e)}_getTabIndex(){return this._tabIndexSignal()}closeOpenMenu(e,i){let{focusParentTrigger:n}=x({},i),r=this.keyManager,a=this.triggerItem;e===a?.getMenuTrigger()?.getMenu()&&(a?.getMenuTrigger()?.close(),n&&(a?r.setActiveItem(a):r.setFirstItemActive()))}_setItems(){this._allItems.changes.pipe(w(this._allItems),m(this.destroyed)).subscribe(e=>{this.items.reset(e.filter(i=>i._parentMenu===this)),this.items.notifyOnChanges()})}_setKeyManager(){this.keyManager=new $e(this.items).withWrap().withTypeAhead().withHomeAndEnd().skipPredicate(()=>!1),this.orientation==="horizontal"?this.keyManager.withHorizontalOrientation(this.dir?.value||"ltr"):this.keyManager.withVerticalOrientation()}_subscribeToMenuOpen(){let e=q(this.items.changes,this.destroyed);this.items.changes.pipe(w(this.items),ve(i=>i.filter(n=>n.hasMenu).map(n=>n.getMenuTrigger().opened.pipe(Se(n),m(e)))),Ie(),Oe(i=>(this.triggerItem=i,i.getMenuTrigger().closed)),m(this.destroyed)).subscribe(()=>this.triggerItem=void 0)}_subscribeToMenuStackClosed(){this.menuStack.closed.pipe(m(this.destroyed)).subscribe(({item:e,focusParentTrigger:i})=>this.closeOpenMenu(e,{focusParentTrigger:i}))}_subscribeToMenuStackHasFocus(){this.isInline&&this.menuStack.hasFocus.pipe(m(this.destroyed)).subscribe(e=>{this._menuStackHasFocus.set(e)})}_setUpPointerTracker(){this.menuAim&&(this.ngZone.runOutsideAngular(()=>{this.pointerTracker=new ke(this._renderer,this.items)}),this.menuAim.initialize(this,this.pointerTracker))}_handleFocus(){this._focusMonitor.monitor(this.nativeElement,!1).pipe(m(this.destroyed)).subscribe(e=>{e!==null&&e!=="mouse"&&this.focusFirstItem(e)})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=Ae(t)))(n||t)}})();static \u0275dir=k({type:t,contentQueries:function(i,n,r){if(i&1&&He(r,Ht,5),i&2){let a;Qe(a=Le())&&(n._allItems=a)}},hostAttrs:["role","menu"],hostVars:4,hostBindings:function(i,n){i&1&&p("focusin",function(){return n.menuStack.setHasFocus(!0)})("focusout",function(){return n.menuStack.setHasFocus(!1)}),i&2&&(ie("tabIndex",n._getTabIndex())("id",n.id),D("aria-orientation",n.orientation)("data-cdk-menu-stack-id",n.menuStack.id))},inputs:{id:"id"},features:[P]})}return t})(),Ti=(()=>{class t extends Qt{_parentTrigger=o(W,{optional:!0});closed=new b;orientation="vertical";isInline=!this._parentTrigger;constructor(){super(),this.destroyed.subscribe(this.closed),this._parentTrigger?.registerChildMenu(this)}ngAfterContentInit(){super.ngAfterContentInit(),this._subscribeToMenuStackEmptied()}ngOnDestroy(){super.ngOnDestroy(),this.closed.complete()}_handleKeyEvent(e){let i=this.keyManager;switch(e.keyCode){case 37:case 39:h(e)||(e.preventDefault(),i.setFocusOrigin("keyboard"),i.onKeydown(e));break;case 27:h(e)||(e.preventDefault(),this.menuStack.close(this,{focusNextOnEmpty:y.currentItem,focusParentTrigger:!0}));break;case 9:h(e,"altKey","metaKey","ctrlKey")||this.menuStack.closeAll({focusParentTrigger:!0});break;default:i.onKeydown(e)}}_toggleMenuFocus(e){let i=this.keyManager;switch(e){case y.nextItem:i.setFocusOrigin("keyboard"),i.setNextItemActive();break;case y.previousItem:i.setFocusOrigin("keyboard"),i.setPreviousItemActive();break;case y.currentItem:i.activeItem&&(i.setFocusOrigin("keyboard"),i.setActiveItem(i.activeItem));break}}_subscribeToMenuStackEmptied(){this.menuStack.emptied.pipe(m(this.destroyed)).subscribe(e=>this._toggleMenuFocus(e))}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkMenu",""]],hostAttrs:["role","menu",1,"cdk-menu"],hostVars:2,hostBindings:function(i,n){i&1&&p("keydown",function(a){return n._handleKeyEvent(a)}),i&2&&ne("cdk-menu-inline",n.isInline)},outputs:{closed:"closed"},exportAs:["cdkMenu"],features:[I([{provide:pt,useExisting:t},{provide:ye,useExisting:t},Bt("vertical")]),P]})}return t})();var Lt=pe.map(t=>{let s=t.overlayX==="start"?2:-2,e=t.overlayY==="top"?2:-2;return Ce(x({},t),{offsetX:s,offsetY:e})}),Si=(()=>{class t extends ft{_injector=o(S);_directionality=o(N,{optional:!0});_menuTracker=o(ht);_changeDetectorRef=o(re);disabled=!1;constructor(){super(),this._setMenuStackCloseListener()}open(e){this._open(null,e),this._changeDetectorRef.markForCheck()}close(){this.menuStack.closeAll()}_openOnContextMenu(e){this.disabled||(e.preventDefault(),e.stopPropagation(),this._menuTracker.update(this),this._open(e,{x:e.clientX,y:e.clientY}),e.button===2?this.childMenu?.focusFirstItem("mouse"):e.button===0?this.childMenu?.focusFirstItem("keyboard"):this.childMenu?.focusFirstItem("program"))}_getOverlayConfig(e){return new de({positionStrategy:this._getOverlayPositionStrategy(e),scrollStrategy:this.menuScrollStrategy(),direction:this._directionality||void 0})}_getOverlayPositionStrategy(e){return me(this._injector,e).withLockedPosition().withGrowAfterOpen().withPositions(this.menuPosition??Lt)}_setMenuStackCloseListener(){this.menuStack.closed.pipe(m(this.destroyed)).subscribe(({item:e})=>{e===this.childMenu&&this.isOpen()&&(this.closed.next(),this.overlayRef.detach(),this.childMenu=void 0,this._changeDetectorRef.markForCheck())})}_subscribeToOutsideClicks(e){if(this.overlayRef){let i=this.overlayRef.outsidePointerEvents();if(e){let[n,r]=xe(i,({type:a})=>a==="auxclick");i=q(r.pipe(we((a,kt)=>e.ctrlKey&&kt===0&&a.ctrlKey)),n.pipe(Ee(1)))}i.pipe(m(this.stopOutsideClicksListener)).subscribe(n=>{this.isElementInsideMenuStack(ce(n))||this.menuStack.closeAll()})}}_open(e,i){this.disabled||(this.isOpen()?(this.menuStack.closeSubMenuOf(this.childMenu),this.overlayRef.getConfig().positionStrategy.setOrigin(i),this.overlayRef.updatePosition()):(this.opened.next(),this.overlayRef?(this.overlayRef.getConfig().positionStrategy.setOrigin(i),this.overlayRef.updatePosition()):this.overlayRef=he(this._injector,this._getOverlayConfig(i)),this.overlayRef.attach(this.getMenuContentPortal()),this._subscribeToOutsideClicks(e)))}static \u0275fac=function(i){return new(i||t)};static \u0275dir=k({type:t,selectors:[["","cdkContextMenuTriggerFor",""]],hostVars:1,hostBindings:function(i,n){i&1&&p("contextmenu",function(a){return n._openOnContextMenu(a)}),i&2&&D("data-cdk-menu-stack-id",null)},inputs:{menuTemplateRef:[0,"cdkContextMenuTriggerFor","menuTemplateRef"],menuPosition:[0,"cdkContextMenuPosition","menuPosition"],menuData:[0,"cdkContextMenuTriggerData","menuData"],disabled:[2,"cdkContextMenuDisabled","disabled",ae]},outputs:{opened:"cdkContextMenuOpened",closed:"cdkContextMenuClosed"},exportAs:["cdkContextMenuTriggerFor"],features:[I([{provide:W,useExisting:t},{provide:g,useClass:be}]),P]})}return t})();var Di=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Ne({type:t});static \u0275inj=Fe({imports:[tt]})}return t})();var gt=class t{icon="";label="";truncate=!1;static \u0275fac=function(e){return new(e||t)};static \u0275cmp=V({type:t,selectors:[["POS-dropdown-item-more-action"]],inputs:{icon:"icon",label:"label",truncate:"truncate"},decls:6,vars:3,consts:[[1,"dropdown-item","px-1"],[1,"row","g-0","d-flex","align-items-center"],[1,"col-2","px-0"],["aria-hidden","true",1,"fs-3"],[1,"col-10","pe-0","ps-4","fs-6"]],template:function(e,i){e&1&&(ee(0,"div",0)(1,"div",1)(2,"div",2),qe(3,"i",3),te(),ee(4,"div",4),f(5),te()()()),e&2&&(c(3),Ve(i.icon),c(2),Y(" ",i.label," "))},dependencies:[it],encapsulation:2})};export{ct as a,Ht as b,Ti as c,Si as d,Di as e,gt as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-
|
|
1
|
+
import{a as ne}from"./chunk-AASKAWJ4.js";import{u as re,v as ae,w as se}from"./chunk-EGUIWOC3.js";import{O as le}from"./chunk-HYXSN2J6.js";import{a as J,c as z}from"./chunk-EQLHPWVB.js";import{e as oe}from"./chunk-QGYIPOLS.js";import{a as g}from"./chunk-2FWFPV5I.js";import{E as ee,G as te,c as Q,e as v,h as X,i as Y,t as Z,w as $}from"./chunk-OJ5SEYSF.js";import{a as M}from"./chunk-TS6CZC3J.js";import{Ad as A,Bb as d,Cb as r,Db as a,E as S,Eb as E,H as G,I as B,Nb as w,Pb as F,T as L,W as I,Wa as s,Xa as T,Y as N,aa as U,be as K,cb as P,cc as m,cd as W,e as h,ee as ie,fa as H,gb as q,la as V,n as k,na as j,o as R,p as x,pa as f,t as y,tc as O,ub as p,v as D,wb as u}from"./chunk-VS3RTXZC.js";import{k as C}from"./chunk-SNAKHGZS.js";var b=class{};var Ge=new j("baseURL"),_=class o extends b{connection;_cache=new Map;_Data=new h({});Data=this._Data.asObservable();previousCountByEpc={};httpService=f(ie);toastService=f(K);_isConnected=new h(!1);isConnected=this._isConnected.asObservable();_bufferTime=new h(100);set bufferTime(i){this._bufferTime.next(i)}get bufferTime(){return this._bufferTime.getValue()}intializeWebSocket(i="/"){return C(this,null,function*(){if(i.length<=0){this.toastService.error("RFID URL cannot be empty",g.Error);return}this.connection=new z().withUrl(i).configureLogging(J.Information).build();try{yield this.connection.start(),yield this.initiateGroupSubscription(),this.onWebSocketMessageReceived(),this._isConnected.next(!0),this.toastService.success("RFID Connected",g.Success)}catch(t){throw this._isConnected.next(!1),this.toastService.error(JSON.stringify(t),g.Error),setTimeout(()=>this.intializeWebSocket(),5e3),new Error(JSON.stringify(t))}})}initiateGroupSubscription(){return C(this,null,function*(){try{yield this.connection.invoke("SubscribeGroup",{CurrentID:"TransferOrder"})}catch(i){throw this.toastService.error(JSON.stringify(i),g.Error),new Error(JSON.stringify(i))}})}onWebSocketMessageReceived(){try{this.connection.on("ReceiveSignal",i=>{this._Data.next(i)})}catch(i){throw new Error(JSON.stringify(i))}}getVariantByCode(i,t=M.GuidEmpty){let e=[{key:"Code",value:i},{key:"EntityID",value:t}];return this.httpService.get(le.GetVariantByCode,e).pipe(B(n=>n instanceof A?R(null):x(()=>new Error(n.message))))}processGroupedData(i=M.GuidEmpty){return this._Data.pipe(S(t=>t!==null&&t&&Object.keys(t).length>0),G(this._bufferTime.getValue()),D(t=>k(t)),L(t=>t.epc),D(t=>t.pipe(I((e,n)=>[...e,n],[]),U(e=>{let n=t.key;if(this._cache.has(n))return this._cache.get(n).pipe(y(l=>({epc:n,items:e,response:l})));{let l=this.getVariantByCode(n,i).pipe(S(c=>c),H(c=>this._cache.set(n,R(c))));return this._cache.set(n,l),l.pipe(y(c=>({epc:n,items:e,response:c})))}}))),I((t,e)=>{let n=this.previousCountByEpc&&this.previousCountByEpc[e.epc]||0,l=e.items.length,c=l-n;return t[e.epc]={data:e.items,count:c,variant:e.response},this.previousCountByEpc[e.epc]=l,t},{}),N({bufferSize:1,refCount:!0}))}constructor(){super()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})};var ce=o=>({"is-invalid":o});function pe(o,i){o&1&&(r(0,"span"),m(1,"Host URL is required."),a())}function ue(o,i){if(o&1&&(r(0,"div",6),p(1,pe,2,0,"span"),E(2,"span"),a()),o&2){let t,e=F();s(),u((t=e.form.get("hostURL").errors)!=null&&t.required?1:-1)}}function de(o,i){o&1&&(r(0,"span"),m(1,"Host URL is required."),a())}function Ce(o,i){o&1&&(r(0,"span"),m(1,"BufferTime must be at least 100"),a())}function ge(o,i){if(o&1&&(r(0,"div",6),p(1,de,2,0,"span"),p(2,Ce,2,0,"span"),a()),o&2){let t,e,n=F();s(),u((t=n.form.get("bufferTime").errors)!=null&&t.required?1:-1),s(),u((e=n.form.get("bufferTime").errors)!=null&&e.min?2:-1)}}var me=class o{constructor(i){this.dialogRef=i;this.form=this.fb.group({hostURL:["https://localhost:5001/rfidhub",[v.required]],bufferTime:["100",[v.required,v.min(100)]]},{updateOn:"change"}),this.config.title="Connect RFID",this.config.customWidth="400px"}config=new re;isConnect=new T(!1);RFIDConnectionService=f(_);fb=f(ee);onOK=new T;form;ok(){return C(this,null,function*(){this.onOK.emit(this.form.value),this.dialogRef.close("void")})}close(){this.dialogRef.close()}onBlur(i){this.form.patchValue({bufferTime:Number(i.value)})}static \u0275fac=function(t){return new(t||o)(P(oe))};static \u0275cmp=q({type:o,selectors:[["POS-dialog-connect-rfid"]],outputs:{onOK:"onOK"},decls:15,vars:12,consts:[[3,"onCancel","onClose","onOk","dynamicValidated","config"],[1,"d-flex","flex-column",2,"row-gap","1rem"],[1,"fw-normal"],[1,"form-floating-outline",3,"formGroup"],["formControlName","hostURL","id","floatingInput","placeholder","https://localhost:5030/rfidhub","type","text",1,"form-control",3,"ngClass"],["for","floatingInput"],["id","",1,"invalid-feedback"],["formControlName","bufferTime","id","floatingInput","placeholder","100","type","text",1,"form-control",3,"blur","ngClass"]],template:function(t,e){t&1&&(r(0,"modal-material",0),w("onCancel",function(){return e.close()})("onClose",function(){return e.close()})("onOk",function(){return e.ok()}),r(1,"content")(2,"div",1)(3,"h4",2),m(4,"Please input the RFID Host URL:"),a(),r(5,"div",3),E(6,"input",4),r(7,"label",5),m(8,"Host URL"),a(),p(9,ue,3,1,"div",6),a(),r(10,"div",3)(11,"input",7),w("blur",function(){return e.onBlur(e.form.get("bufferTime"))}),a(),r(12,"label",5),m(13,"Buffer Time (ms)"),a(),p(14,ge,3,2,"div",6),a()()()()),t&2&&(d("dynamicValidated",e.form.valid)("config",e.config),s(5),d("formGroup",e.form),s(),d("ngClass",O(8,ce,e.form.invalid&&e.form.touched)),s(3),u(e.form.get("hostURL").invalid&&e.form.get("hostURL").touched?9:-1),s(),d("formGroup",e.form),s(),d("ngClass",O(10,ce,e.form.invalid&&e.form.touched)),s(3),u(e.form.get("bufferTime").invalid&&e.form.get("bufferTime").touched?14:-1))},dependencies:[se,ae,ne,te,Q,X,Y,Z,$,W],styles:[".form-control.is-invalid[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})};export{b as a,_ as b,me as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as zt,b as Yt}from"./chunk-JFLT7NX3.js";import{a as xo}from"./chunk-YXCPHYC5.js";import{a as Di}from"./chunk-W3VF2RCW.js";import{a as Bo}from"./chunk-2YGMAT2F.js";import{e as Eo}from"./chunk-TIBTGPW2.js";import{b as ko}from"./chunk-HPXDTBZD.js";import{d as Ao}from"./chunk-PVSXCHI3.js";import{a as No}from"./chunk-MSSTCYNC.js";import{a as Io}from"./chunk-LQDIK5ZH.js";import{a as he,b as Re,e as Lo}from"./chunk-LC5JP6E6.js";import{a as Do,b as Vo,c as Fo}from"./chunk-2SFQGHFV.js";import{a as Mo}from"./chunk-MLFDP74G.js";import{a as jo}from"./chunk-HNU2JIBP.js";import{b as Dn,c as Oo}from"./chunk-WPKJOXVT.js";import{a as lo}from"./chunk-WIYO452T.js";import{a as xt}from"./chunk-7NQ56KZ6.js";import{a as To}from"./chunk-CABP6X3M.js";import{a as Mi,b as xi,c as Ii}from"./chunk-27KLJCCF.js";import{b as wo}from"./chunk-JR6SBNDP.js";import{a as Ro}from"./chunk-PF3TLOCL.js";import{a as Ho}from"./chunk-T4MVTLYE.js";import{a as Ke}from"./chunk-J6U6UYNI.js";import{a as Oi,b as xe}from"./chunk-DDM5K7MP.js";import{a as Pn,b as Jt,c as On}from"./chunk-K6YQ5CRH.js";import{a as tt,b as dt,c as de}from"./chunk-NSNUUKNK.js";import{b as Po}from"./chunk-LIH722A3.js";import{a as So}from"./chunk-EE3OKRUQ.js";import{g as bo}from"./chunk-7H3GMZJN.js";import{d as Pi}from"./chunk-MCPXNQRW.js";import{p as mo}from"./chunk-RHVNZ2DF.js";import{d as co}from"./chunk-PY3PDRRW.js";import{g as po}from"./chunk-B7QNQTF3.js";import{a as go,c as Dt}from"./chunk-JHYJTTAR.js";import{B as _o,C as oe,D as Oe,G as yo,u as ie,v as ne,w as Ot}from"./chunk-YFMVQJRL.js";import{b as yi,c as $t}from"./chunk-HD6ETXDZ.js";import{F as Mt,N as Si,O as U,g as fo,n as bi,o as ho,q as Co,t as vo}from"./chunk-2525CDKJ.js";import{d as Pt,e as uo}from"./chunk-UARWMJ5H.js";import{a as rt}from"./chunk-235POOLV.js";import{a as fi,c as hi}from"./chunk-EQLHPWVB.js";import{a as ee,b as so,e as te,f as fe,g as Ee}from"./chunk-TY7JJASH.js";import{a as me}from"./chunk-2FWFPV5I.js";import{A as ro,B as ao,F as vi,c as Te,e as Ci,h as Pe,i as Xn,k as eo,l as et,n as to,o as we,p as io,s as St,x as no,y as oo}from"./chunk-PRROMENK.js";import{a as f,d as _i}from"./chunk-ODGFQ7QJ.js";import{a as Zn}from"./chunk-CTPHJSLU.js";import{$ as li,Ab as p,Ac as y,Ad as $n,Bb as a,Bc as x,Ca as R,Cb as s,Cc as X,Db as b,Dc as yt,E as ce,Eb as V,Ed as Jn,Fb as Q,Gb as Xe,Gc as Qn,Hb as Ct,I as nt,Ib as vt,Jb as pi,Jc as ae,Kb as w,Lb as Fn,M as ht,Mb as S,N as Qe,Nb as Ln,Nc as bt,Ob as d,Oc as qt,Q as Fe,Qa as Je,Ra as mt,Sa as Vn,Sb as Ut,Sc as gi,Tb as Wt,Ub as Gt,Wa as l,Xd as zn,Y as Le,Yb as ue,Yd as Yn,Zb as Bn,_d as Kn,aa as Y,ac as ui,ae as F,b as ri,bb as P,bc as m,bd as Be,cc as M,d as Me,da as Ie,dc as D,dd as Un,de as ge,e as be,ec as _t,ed as Wn,fa as le,fb as N,fc as Hn,gb as mi,gc as B,hc as A,hd as Gn,ic as H,id as qn,jd as ze,k as gt,la as I,lb as $,ld as Ye,ma as ci,n as An,nd as q,o as ke,oa as g,p as ft,pa as T,q as ai,qd as Se,r as si,rb as di,sc as j,t as J,ta as v,tb as h,tc as Ue,u as $e,ua as _,ub as Sn,v as kn,vb as C,vc as jn,wb as ot,xb as ve,yb as K,zb as Z}from"./chunk-LBIXL2NM.js";import{a as ni,i as Ze,k as oi}from"./chunk-SNAKHGZS.js";var We=class{constructor(e){this.roleService=e;e&&this.setRole()}_Retrieve;_DateEditor;_NumberEditor;_PriceVisible;_UnitPriceEditor;_PricebookSelector;_Cost;_Return;_Discount;_SalesPerson;_PriceMinimum;_Payment;_CreditSalesLock;_CustomerInputLock;_PaymentCodeLock;_Shipping;_Tax;_DeleteItem;_BundlingPrice;_EmailRestriction;_ParkedDeletionAuthorized;_SellEditor;_ContactCreate;_PrepaidPackageCreate;_Order;_Reprint;_Contacts;_ContactsCreate;_InventoryView;_DebtView;_ClearCart;_SellDelete;_DeliveryEditor;_CouponInputLock;_Park;_Commission;setRole(){this._Retrieve=this.roleService.sell.RetrieveR,this._DateEditor=this.roleService.global.Date,this._NumberEditor=this.roleService.sell.Number,this._PriceVisible=this.roleService.sell.PriceVisible,this._SalesPerson=this.roleService.sell.SalesPerson,this._UnitPriceEditor=this.roleService.sell.UnitPriceEditor,this._PricebookSelector=this.roleService.sell.PricebookSelector,this._Cost=this.roleService.product.Cost,this._Return=this.roleService.sell.Return,this._Discount=this.roleService.sell.Discount,this._PriceMinimum=this.roleService.sell.PriceMinimum,this._Payment=this.roleService.sell.Payment,this._CreditSalesLock=this.roleService.sell.CreditSalesLock,this._CustomerInputLock=this.roleService.sell.CustomerInputLock,this._PaymentCodeLock=this.roleService.sell.PaymentCodeLock,this._Shipping=this.roleService.sell.Shipping,this._Tax=this.roleService.sell.Tax,this._DeleteItem=this.roleService.sell.DeleteItem,this._BundlingPrice=this.roleService.sell.BundlingPrice,this._EmailRestriction=this.roleService.sell.Email,this._SellEditor=this.roleService.sell.Edit,this._ContactCreate=this.roleService.contact.Create,this._PrepaidPackageCreate=this.roleService.prepaidPackage.Create,this._Order=this.roleService.order.View,this._Contacts=this.roleService.contact.View,this._ContactsCreate=this.roleService.contact.Create,this._InventoryView=this.roleService.inventory.View,this._DebtView=this.roleService.debt.View,this._ClearCart=this.roleService.sell.DeleteItem,this._SellDelete=this.roleService.sell.Delete,this._DeliveryEditor=this.roleService.logistic.Edit,this._Reprint=this.roleService.order.Print,this._CouponInputLock=this.roleService.sell.CouponInputLock,this._Park=this.roleService.sell.Park,this._Commission=this.roleService.product.CommissionView}get Park(){return this._Park}get CouponInputLock(){return this._CouponInputLock}set CouponInputLock(e){this._CouponInputLock=e}get Retrieve(){return this._Retrieve}get DateEditor(){return this._DateEditor}set DateEditor(e){this._DateEditor=e}get NumberEditor(){return this._NumberEditor}set NumberEditor(e){this._NumberEditor=e}get PriceVisible(){return this._PriceVisible}get UnitPriceEditor(){return this._UnitPriceEditor}set UnitPriceEditor(e){this._UnitPriceEditor=e}get PricebookSelector(){return this._PricebookSelector}set PricebookSelector(e){this._PricebookSelector=e}get Cost(){return this._Cost}get Return(){return this._Return}set Return(e){this._Return=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get SalesPerson(){return this._SalesPerson}get PriceMinimum(){return this._PriceMinimum}get Payment(){return this._Payment}get CreditSalesLock(){return this._CreditSalesLock}get CustomerInputLock(){return this._CustomerInputLock}get PaymentCodeLock(){return this._PaymentCodeLock}get Shipping(){return this._Shipping}get Tax(){return this._Tax}set Tax(e){this._Tax=e}get DeleteItem(){return this._DeleteItem}set DeleteItem(e){this._DeleteItem=e}get BundlingPrice(){return this._BundlingPrice}get Email(){return this._EmailRestriction}get ParkedDeletionAuthorized(){return this._ParkedDeletionAuthorized}set ParkedDeletionAuthorized(e){this._ParkedDeletionAuthorized=e}get SellEditor(){return this._SellEditor}get PrepaidPackageCreate(){return this._PrepaidPackageCreate}get Order(){return this._Order}get Reprint(){return this._Reprint}get Contacts(){return this._Contacts}get ContactsCreate(){return this._ContactsCreate}get InventoryView(){return this._InventoryView}get DebtView(){return this._DebtView}get ClearCartRestriction(){return this._ClearCart}get SellDelete(){return this._SellDelete}get DeliveryEditor(){return this._DeliveryEditor}get Commission(){return this._Commission}};var Kt=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var Ti=class{Type;Amount;Notification;ApplyToProduct;Requirement};var G=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;Promotion;ContactName;SplitParkLabel;get cartQuantity(){let e=0;for(let t of this.CartItems)e+=t.Quantity;return e}constructor(){this.Order=new Dn,this.Invoice=new Jt,this.Shipping=new On,this.Action=new Kt,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let e=0;return this.Payments.forEach(t=>{e+=t.PaidAmount}),e}get RedeemableAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}get TotalQuantity(){let e=0;return this.CartItems.forEach(t=>{t.PromotionGift||(e+=t.Quantity)}),e}get CashOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}get PointOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==10)}GetAmountByCart(e){let t=0;return e.forEach(i=>{t+=i.Total}),t=t*(100-this.Order.Discount)/100,t=t*(100-this.Order.Discount2)/100,t}getRewards(){return this.CartItems.filter(t=>t.PromotionGift)}};Ze([tt(()=>Dn)],G.prototype,"Order",2),Ze([tt(()=>Jt)],G.prototype,"Invoice",2),Ze([tt(()=>On)],G.prototype,"Shipping",2),Ze([tt(()=>Kt)],G.prototype,"Action",2),Ze([tt(()=>Ke)],G.prototype,"Payments",2),Ze([tt(()=>Oi)],G.prototype,"Items",2),Ze([tt(()=>xe)],G.prototype,"CartItems",2),Ze([tt(()=>Ti)],G.prototype,"Promotion",2);var wi=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var It=class n{constructor(e,t,i,o){this.httpService=e;this._localDataService=t;this._onlineStatusService=i;this._toastrService=o;this._onlineStatusService.getOnlineStatus$().subscribe(r=>{this.isOnline=r})}_Data=new be(null);Data$=this._Data.pipe(Fe(),ce(e=>e!==null));isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}getSalesOrderPrint(e){return this.httpService.post("/API/POS/GetSalesOrderPrint",{TemplateID:e})}submitOrder(e,t){let i=this.generatePOSDataForSubmission(e,this.isOnline);if(this.isOnline)return this.submitOnline(i).pipe(this.handleTimeOutError(i));if(t.ModuleSell.EnableOfflineTransaction)return this._localDataService.syncOrder(i).pipe(J(()=>this.generateCompleteData(i)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(e){return this._localDataService.uploadSingleOrder(e).pipe(nt(t=>t?.message?.includes("objectStore does not exists")?this.submitOnline(e):ft(()=>t)))}submitOnline(e){return this.httpService.post(U.SubmitOrder,e,Zn.pos.submitOrderTimeout)}handleTimeOutError(e){return ri(nt(t=>{if(t instanceof si||t?.name=="TimeoutError"){let i=this.generateCompleteData(e);this.pushNewValue(i)}throw t}))}generatePOSDataForSubmission(e,t=!0){let i=Object.assign(new G,e);i.Items=[],i.Order.CustomerID==null&&(i.Order.CustomerID=f.GuidEmpty),i.Order.SalesID==null&&(i.Order.SalesID=f.GuidEmpty);let o=1;i.Payments=i.Payments.map(c=>(c.Date=i.Order.Date,c.Index=o,o++,delete c.TypeID,c));let r=1;for(let c of i.CartItems){let u=new Oi;u.ID=c.ID,u.VariantID=c.VariantID,u.Quantity=c.Quantity,u.Cost=c.Cost,u.Price=c.Price,u.Discount=c.Discount,u.DiscountAmount=c.DiscountAmount,u.Note=c.Note,u.Taxable=c.Variant.Taxable,u.LoyaltyPoint=c.LoyaltyPoint,u.UnitCost=c.Cost,u.UnitPrice=c.Price,u.UnitPriceOriginal=c.UnitPriceOriginal,u.UnitExpense=c.UnitExpense,u.EntityID=c.EntityID,u.Index=r,u.UnitQuantity=c.UnitQuantity,u.PriceTypeID=c.PriceTypeID,u.PriceNote=c.PriceNote,u.Splited=c.SplitQuantity>0,u.SplitQuantity=c.SplitQuantity,u.InventoryTypeID=c.Variant.TypeID,u.SalesID="",u.Serial=c.Serial,c.SalesID&&(u.SalesID=c.SalesID),delete c.CouponDiscount,i.Items.push(u),r++}return t?(delete i.CartItems,delete i.Order.ClientTimestamp):i.Order.ClientTimestamp=new Date,i}generateCompleteData(e){let t=new wi;return t.InvoiceNumber=e.Order.Number,t.OrderTimeString=new Date().toString(),t.PaymentStateID=e.Action?.Type,t.PaymentStateLabel="Offline",t.Success=!0,t.OutDeliveryID=e.Action.DeliveryEntityID,t}GetReturnInvoice(e,t){return this.httpService.get(U.ReturInvoice,[{key:"EntityID",value:t},{key:"Number",value:e}])}GetInvoiceBySoID(e){return this.httpService.get(U.GetPOSDataByID,[{key:"ID",value:e}])}UploadCSV(e,t){let i={CartItems:e,EntityID:t};return this.httpService.post(U.UploadCsv,i)}sendEmail(e,t){return new Promise((i,o)=>{this._localDataService.isProductFromServer().subscribe(r=>{if(r){let c={invoiceID:t,email:e};this.httpService.post(U.SendInvoiceEmail,c).subscribe({next:u=>{i(u)},error:u=>{o(u)}})}else o(oe.wrongOfflineAction)})})}sendWhatsaap(e,t){let i={InvoiceID:e,PhoneNumber:t};return this.httpService.post(U.SendInvoiceWhatsapp,i)}createCustomerByInvoice(e,t){let i={InvoiceID:e,Mobile:t};return this.httpService.post(U.CreateCustomerInvoice,i)}saveCommission(e,t){let i={SOID:e,commission:t};return this.httpService.POSText("/API/Transaction/SetCommission",i)}generateReceiptA4(e){let t={ID:e};return this.httpService.post(U.InvoiceA4,t)}getVacant(e){return this.httpService.get(U.GetVacant,[{key:"EntityID",value:e}])}static \u0275fac=function(t){return new(t||n)(g(ge),g(Oe),g(he),g(F))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var Xt=(r=>(r[r.cash=1]="cash",r[r.card=2]="card",r[r.emoney=3]="emoney",r[r.other=4]="other",r[r.ECR=99]="ECR",r))(Xt||{});var L=class n{constructor(e,t,i){this._OrderHttpService=e;this._customerHttpService=t;this._toastrService=i}_Data=new be(new G);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){if(e)this._Data.next(e);else{let t=this.Data;this._Data.next(t)}}submitOrder(e){return new Promise((t,i)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,e).subscribe({next:o=>{t(o)},error:o=>{this.Data.Items=[],i(o)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let t=this.Data.Payments.find(i=>i.TypeID==3);f.IsNotEmpty(t)&&f.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(e){return this.Data.Order.CustomerID=e,this.pushNewValue(this.Data),new Promise((t,i)=>{this._customerHttpService.GetPrivilegeByID(e,this.Data.Order.EntityID).subscribe({next:o=>{this._customerHttpService.Data=o,this.pushNewValue(this.Data),t(o)},error:o=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let r=o.error?.Message;o.status==409?this._toastrService.warning(r,"Warning"):this._toastrService.error(r,`API Error - ${o.status}`),i(o)}})})}static \u0275fac=function(t){return new(t||n)(g(It),g(Re),g(F))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var z=class n{constructor(e,t,i){this._localDataService=e;this._onlineStatusService=t;this._httpService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}_Data=new be(null);Data$=this._Data.asObservable().pipe(ce(e=>e!==null),Fe());isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}requestObservable(){return this.isOnline?this._httpService.get(U.GetPOSStorage).pipe(J(e=>({data:e,type:"Online"}))):this._localDataService.getPOSStorage().pipe(ce(e=>e!=null),J(e=>({data:e,type:"Offline"})))}getOutletName(e){return this.Data.Entities.find(i=>i.ID==e)?.Name}static \u0275fac=function(t){return new(t||n)(g(Oe),g(he),g(ge))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var De=class n{constructor(e){this.roleService=e;this.pushNewValue(new We(e))}_Data=new be(new We(null));get Data(){return this._Data.value}Data$=this._Data.asObservable();pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||n)(g(_i))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var ti=class{ID;Code;EntityID;Name;Description;Start;StartDisplay;State;Open;CashierID;OpeningCash;EntityName;LoginID;Active;CustomerDisplayEnabled;OvoConfigurationID;CustomerDisplayID;ListImage;Suspended};var Ei=class n{odsConfigType=R(0);setODSConfig(e){this.odsConfigType.set(e)}isEnabled(){return this.odsConfigType()>0}static \u0275fac=function(t){return new(t||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var sr=n=>({active:n}),lr=n=>({gray:n});function cr(n,e){if(n&1){let t=w();a(0,"span",15),S("click",function(o){v(t);let r=d().$implicit;return d().closeRegister(r),_(o.stopPropagation())}),s()}}function mr(n,e){n&1&&(a(0,"div")(1,"span",16),m(2,"VACANT"),s()())}function dr(n,e){if(n&1&&(a(0,"div")(1,"span",17),b(2,"i",18),a(3,"span",19),m(4),s()(),a(5,"span",20),b(6,"i",21),a(7,"span",19),m(8),s()()()),n&2){let t=d().$implicit;l(4),M(t.LoginID),l(4),D("",t.StartDisplay.split(" ")[3]," - Now")}}function pr(n,e){if(n&1){let t=w();a(0,"div",8)(1,"div",9)(2,"div",10)(3,"h5",11),S("click",function(){let o=v(t).$implicit,r=d();return _(r.select(o))}),a(4,"span"),b(5,"i",12),m(6),y(7,"limitTo"),s(),h(8,cr,1,0,"span",13),s(),a(9,"div",14),S("click",function(){let o=v(t).$implicit,r=d();return _(r.select(o))}),h(10,mr,3,0,"div")(11,dr,9,2,"div"),s()()()()}if(n&2){let t,i=e.$implicit,o=d();l(),p("ngClass",i.Active?"active":""),l(),p("ngClass",j(9,sr,(i==null?null:i.ID)==(o.selectedRegister==null?null:o.selectedRegister.ID))),l(),p("ngClass",j(11,lr,i!=o.selectedRegister)),l(3),M(X(7,6,i.Name,15)),l(2),C(i.State!="Close"?8:-1),l(2),C((t=i.State)==="Close"?10:t==="Open"?11:-1)}}var Ri=class n{constructor(e,t,i,o,r,c,u){this._dialogRef=e;this._outletService=t;this._posService=i;this._userRoleService=o;this.router=r;this.httpService=c;this._odsService=u}originalSelectedRegister=null;registers;searchInput="";selectedRegister=new ti;modalConfig=new ie;role;get AppConfigJSON(){return this._posService.Data.AppConfigJSON}destroy$=new Me;ngOnInit(){this.subscribeToObsChanges(),this.initModalConfig()}subscribeToObsChanges(){this._posService.Data$.pipe(Ie(this.destroy$)).subscribe(e=>{this.registers=e.Registers}),this._outletService.Data$.pipe(Ie(this.destroy$)).subscribe(e=>{this.selectedRegister=this.findOutletRegisterById(e.RegisterID),this.originalSelectedRegister=this.selectedRegister?ni({},this.selectedRegister):null}),this._userRoleService.Data$.pipe(Ie(this.destroy$)).subscribe(e=>{this.role=e})}findOutletRegisterById(e){let t=this.registers.find(i=>i.ID===e);return t||new ti}initModalConfig(){this.modalConfig.hideFooter=!0,this.modalConfig.hideScrollbar=!0,this.modalConfig.title="Choose an outlet"}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}onClose(){this._dialogRef.close()}select(e){if(this.AppConfigJSON.ModuleShift.Closure.Enabled)if(this.selectedRegister.ID!=null&&this.selectedRegister.Open&&e.CashierID==null)confirm("You already have an active register with "+this.selectedRegister.Name+`!
|
|
1
|
+
import{a as zt,b as Yt}from"./chunk-JFLT7NX3.js";import{a as xo}from"./chunk-YXCPHYC5.js";import{a as Di}from"./chunk-W3VF2RCW.js";import{a as Bo}from"./chunk-4CFMB4IK.js";import{e as Eo}from"./chunk-6DRTZA6S.js";import{b as ko}from"./chunk-FFOK3ZNC.js";import{d as Ao}from"./chunk-B5ORO5G4.js";import{a as No}from"./chunk-QCCKEP2R.js";import{a as Io}from"./chunk-5DXDXIDO.js";import{a as he,b as Re,e as Lo}from"./chunk-HDJJJAZJ.js";import{a as Do,b as Vo,c as Fo}from"./chunk-O4IQZBVW.js";import{a as Mo}from"./chunk-GDPQI6PI.js";import{a as jo}from"./chunk-GJIFUWGQ.js";import{b as Dn,c as Oo}from"./chunk-PROSYUA2.js";import{a as lo}from"./chunk-OTT6RJHI.js";import{a as xt}from"./chunk-3CZ6HKSM.js";import{a as To}from"./chunk-XTMUP2BA.js";import{a as Mi,b as xi,c as Ii}from"./chunk-PTQCXOVM.js";import{b as wo}from"./chunk-RPJIPLQS.js";import{a as Ro}from"./chunk-KNQEOPID.js";import{a as Ho}from"./chunk-MTU6753J.js";import{a as Ke}from"./chunk-J6U6UYNI.js";import{a as Oi,b as xe}from"./chunk-GWL7ZN37.js";import{a as Pn,b as Jt,c as On}from"./chunk-KPZU3ZPZ.js";import{a as tt,b as dt,c as de}from"./chunk-NSNUUKNK.js";import{b as Po}from"./chunk-JXXEYFN7.js";import{a as So}from"./chunk-NCT5IK4R.js";import{g as bo}from"./chunk-MREFZR3I.js";import{d as Pi}from"./chunk-I4WJ5CEN.js";import{p as mo}from"./chunk-YL6HCV6T.js";import{d as co}from"./chunk-ISY4SDFY.js";import{g as po}from"./chunk-3MU2GNGM.js";import{a as go,c as Dt}from"./chunk-AASKAWJ4.js";import{B as _o,C as oe,D as Oe,G as yo,u as ie,v as ne,w as Ot}from"./chunk-EGUIWOC3.js";import{b as yi,c as $t}from"./chunk-VQBUIUJC.js";import{F as Mt,N as Si,O as U,g as fo,n as bi,o as ho,q as Co,t as vo}from"./chunk-HYXSN2J6.js";import{d as Pt,e as uo}from"./chunk-2JU7KFOZ.js";import{a as rt}from"./chunk-DB3W42KN.js";import{a as fi,c as hi}from"./chunk-EQLHPWVB.js";import{a as ee,b as so,e as te,f as fe,g as Ee}from"./chunk-QGYIPOLS.js";import{a as me}from"./chunk-2FWFPV5I.js";import{A as ro,B as ao,F as vi,c as Te,e as Ci,h as Pe,i as Xn,k as eo,l as et,n as to,o as we,p as io,s as St,x as no,y as oo}from"./chunk-OJ5SEYSF.js";import{a as f,d as _i}from"./chunk-TS6CZC3J.js";import{a as Zn}from"./chunk-7EVERJPZ.js";import{$ as li,$d as Kn,Ab as Z,Bb as p,Bc as y,Bd as $n,Ca as R,Cb as a,Cc as x,Db as s,Dc as X,E as ce,Eb as b,Ec as yt,Fb as V,Fd as Jn,Gb as Q,Hb as Xe,Hc as Qn,I as nt,Ib as Ct,Jb as vt,Kb as pi,Kc as ae,Lb as w,M as ht,Mb as Fn,N as Qe,Nb as S,Ob as Ln,Oc as bt,Pb as d,Pc as qt,Q as Fe,Qa as Je,Ra as mt,Sa as Vn,Tb as Ut,Tc as gi,Ub as Wt,Vb as Gt,Wa as l,Y as Le,Yd as zn,Zb as ue,Zd as Yn,_b as Bn,aa as Y,b as ri,bc as ui,be as F,cb as P,cc as m,cd as Be,d as Me,da as Ie,dc as M,e as be,ec as D,ed as Un,ee as ge,fa as le,fc as _t,fd as Wn,gb as N,gc as Hn,hb as mi,hc as B,ic as A,id as Gn,jc as H,jd as qn,k as gt,kd as ze,la as I,ma as ci,mb as $,md as Ye,n as An,o as ke,oa as g,od as q,p as ft,pa as T,q as ai,r as si,rd as Se,sb as di,t as J,ta as v,tc as j,u as $e,ua as _,ub as h,uc as Ue,v as kn,vb as Sn,wb as C,wc as jn,xb as ot,yb as ve,zb as K}from"./chunk-VS3RTXZC.js";import{a as ni,i as Ze,k as oi}from"./chunk-SNAKHGZS.js";var We=class{constructor(e){this.roleService=e;e&&this.setRole()}_Retrieve;_DateEditor;_NumberEditor;_PriceVisible;_UnitPriceEditor;_PricebookSelector;_Cost;_Return;_Discount;_SalesPerson;_PriceMinimum;_Payment;_CreditSalesLock;_CustomerInputLock;_PaymentCodeLock;_Shipping;_Tax;_DeleteItem;_BundlingPrice;_EmailRestriction;_ParkedDeletionAuthorized;_SellEditor;_ContactCreate;_PrepaidPackageCreate;_Order;_Reprint;_Contacts;_ContactsCreate;_InventoryView;_DebtView;_ClearCart;_SellDelete;_DeliveryEditor;_CouponInputLock;_Park;_Commission;setRole(){this._Retrieve=this.roleService.sell.RetrieveR,this._DateEditor=this.roleService.global.Date,this._NumberEditor=this.roleService.sell.Number,this._PriceVisible=this.roleService.sell.PriceVisible,this._SalesPerson=this.roleService.sell.SalesPerson,this._UnitPriceEditor=this.roleService.sell.UnitPriceEditor,this._PricebookSelector=this.roleService.sell.PricebookSelector,this._Cost=this.roleService.product.Cost,this._Return=this.roleService.sell.Return,this._Discount=this.roleService.sell.Discount,this._PriceMinimum=this.roleService.sell.PriceMinimum,this._Payment=this.roleService.sell.Payment,this._CreditSalesLock=this.roleService.sell.CreditSalesLock,this._CustomerInputLock=this.roleService.sell.CustomerInputLock,this._PaymentCodeLock=this.roleService.sell.PaymentCodeLock,this._Shipping=this.roleService.sell.Shipping,this._Tax=this.roleService.sell.Tax,this._DeleteItem=this.roleService.sell.DeleteItem,this._BundlingPrice=this.roleService.sell.BundlingPrice,this._EmailRestriction=this.roleService.sell.Email,this._SellEditor=this.roleService.sell.Edit,this._ContactCreate=this.roleService.contact.Create,this._PrepaidPackageCreate=this.roleService.prepaidPackage.Create,this._Order=this.roleService.order.View,this._Contacts=this.roleService.contact.View,this._ContactsCreate=this.roleService.contact.Create,this._InventoryView=this.roleService.inventory.View,this._DebtView=this.roleService.debt.View,this._ClearCart=this.roleService.sell.DeleteItem,this._SellDelete=this.roleService.sell.Delete,this._DeliveryEditor=this.roleService.logistic.Edit,this._Reprint=this.roleService.order.Print,this._CouponInputLock=this.roleService.sell.CouponInputLock,this._Park=this.roleService.sell.Park,this._Commission=this.roleService.product.CommissionView}get Park(){return this._Park}get CouponInputLock(){return this._CouponInputLock}set CouponInputLock(e){this._CouponInputLock=e}get Retrieve(){return this._Retrieve}get DateEditor(){return this._DateEditor}set DateEditor(e){this._DateEditor=e}get NumberEditor(){return this._NumberEditor}set NumberEditor(e){this._NumberEditor=e}get PriceVisible(){return this._PriceVisible}get UnitPriceEditor(){return this._UnitPriceEditor}set UnitPriceEditor(e){this._UnitPriceEditor=e}get PricebookSelector(){return this._PricebookSelector}set PricebookSelector(e){this._PricebookSelector=e}get Cost(){return this._Cost}get Return(){return this._Return}set Return(e){this._Return=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get SalesPerson(){return this._SalesPerson}get PriceMinimum(){return this._PriceMinimum}get Payment(){return this._Payment}get CreditSalesLock(){return this._CreditSalesLock}get CustomerInputLock(){return this._CustomerInputLock}get PaymentCodeLock(){return this._PaymentCodeLock}get Shipping(){return this._Shipping}get Tax(){return this._Tax}set Tax(e){this._Tax=e}get DeleteItem(){return this._DeleteItem}set DeleteItem(e){this._DeleteItem=e}get BundlingPrice(){return this._BundlingPrice}get Email(){return this._EmailRestriction}get ParkedDeletionAuthorized(){return this._ParkedDeletionAuthorized}set ParkedDeletionAuthorized(e){this._ParkedDeletionAuthorized=e}get SellEditor(){return this._SellEditor}get PrepaidPackageCreate(){return this._PrepaidPackageCreate}get Order(){return this._Order}get Reprint(){return this._Reprint}get Contacts(){return this._Contacts}get ContactsCreate(){return this._ContactsCreate}get InventoryView(){return this._InventoryView}get DebtView(){return this._DebtView}get ClearCartRestriction(){return this._ClearCart}get SellDelete(){return this._SellDelete}get DeliveryEditor(){return this._DeliveryEditor}get Commission(){return this._Commission}};var Kt=class{DeliveryEntityID;Type;NewOrderID;constructor(){this.DeliveryEntityID="",this.Type=3}};var Ti=class{Type;Amount;Notification;ApplyToProduct;Requirement};var G=class{Order;Invoice;Shipping;Action;Payments;Items;CartItems;Promotion;ContactName;SplitParkLabel;get cartQuantity(){let e=0;for(let t of this.CartItems)e+=t.Quantity;return e}constructor(){this.Order=new Dn,this.Invoice=new Jt,this.Shipping=new On,this.Action=new Kt,this.Payments=Array(),this.Items=Array(),this.CartItems=Array(),this.ContactName=""}get TotalPaidAmount(){let e=0;return this.Payments.forEach(t=>{e+=t.PaidAmount}),e}get RedeemableAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}get TotalQuantity(){let e=0;return this.CartItems.forEach(t=>{t.PromotionGift||(e+=t.Quantity)}),e}get CashOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}get PointOnlyAmount(){let e=this.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}get PrepaidPackageItem(){return this.CartItems.filter(t=>t.Variant.TypeID==10)}GetAmountByCart(e){let t=0;return e.forEach(i=>{t+=i.Total}),t=t*(100-this.Order.Discount)/100,t=t*(100-this.Order.Discount2)/100,t}getRewards(){return this.CartItems.filter(t=>t.PromotionGift)}};Ze([tt(()=>Dn)],G.prototype,"Order",2),Ze([tt(()=>Jt)],G.prototype,"Invoice",2),Ze([tt(()=>On)],G.prototype,"Shipping",2),Ze([tt(()=>Kt)],G.prototype,"Action",2),Ze([tt(()=>Ke)],G.prototype,"Payments",2),Ze([tt(()=>Oi)],G.prototype,"Items",2),Ze([tt(()=>xe)],G.prototype,"CartItems",2),Ze([tt(()=>Ti)],G.prototype,"Promotion",2);var wi=class{Success;Message;message;ObjectID;SalesOrderID;OutDeliveryID;Contact;LoyaltyPoint;InvoiceNumber;Creator;OrderTimeString;PrintMode;PaymentStateID;PaymentStateLabel;Final;constructor(){this.Success=!0,this.Message="",this.ObjectID="",this.SalesOrderID="",this.OutDeliveryID="",this.Contact=null,this.LoyaltyPoint="",this.InvoiceNumber="",this.Creator="",this.OrderTimeString="",this.PrintMode=0,this.PaymentStateID=0,this.PaymentStateLabel="",this.Final=0}};var It=class n{constructor(e,t,i,o){this.httpService=e;this._localDataService=t;this._onlineStatusService=i;this._toastrService=o;this._onlineStatusService.getOnlineStatus$().subscribe(r=>{this.isOnline=r})}_Data=new be(null);Data$=this._Data.pipe(Fe(),ce(e=>e!==null));isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}getSalesOrderPrint(e){return this.httpService.post("/API/POS/GetSalesOrderPrint",{TemplateID:e})}submitOrder(e,t){let i=this.generatePOSDataForSubmission(e,this.isOnline);if(this.isOnline)return this.submitOnline(i).pipe(this.handleTimeOutError(i));if(t.ModuleSell.EnableOfflineTransaction)return this._localDataService.syncOrder(i).pipe(J(()=>this.generateCompleteData(i)));this._toastrService.warning("Offline order is not Supported!","Info!")}uploadOfflineOrder(e){return this._localDataService.uploadSingleOrder(e).pipe(nt(t=>t?.message?.includes("objectStore does not exists")?this.submitOnline(e):ft(()=>t)))}submitOnline(e){return this.httpService.post(U.SubmitOrder,e,Zn.pos.submitOrderTimeout)}handleTimeOutError(e){return ri(nt(t=>{if(t instanceof si||t?.name=="TimeoutError"){let i=this.generateCompleteData(e);this.pushNewValue(i)}throw t}))}generatePOSDataForSubmission(e,t=!0){let i=Object.assign(new G,e);i.Items=[],i.Order.CustomerID==null&&(i.Order.CustomerID=f.GuidEmpty),i.Order.SalesID==null&&(i.Order.SalesID=f.GuidEmpty);let o=1;i.Payments=i.Payments.map(c=>(c.Date=i.Order.Date,c.Index=o,o++,delete c.TypeID,c));let r=1;for(let c of i.CartItems){let u=new Oi;u.ID=c.ID,u.VariantID=c.VariantID,u.Quantity=c.Quantity,u.Cost=c.Cost,u.Price=c.Price,u.Discount=c.Discount,u.DiscountAmount=c.DiscountAmount,u.Note=c.Note,u.Taxable=c.Variant.Taxable,u.LoyaltyPoint=c.LoyaltyPoint,u.UnitCost=c.Cost,u.UnitPrice=c.Price,u.UnitPriceOriginal=c.UnitPriceOriginal,u.UnitExpense=c.UnitExpense,u.EntityID=c.EntityID,u.Index=r,u.UnitQuantity=c.UnitQuantity,u.PriceTypeID=c.PriceTypeID,u.PriceNote=c.PriceNote,u.Splited=c.SplitQuantity>0,u.SplitQuantity=c.SplitQuantity,u.InventoryTypeID=c.Variant.TypeID,u.SalesID="",u.Serial=c.Serial,c.SalesID&&(u.SalesID=c.SalesID),delete c.CouponDiscount,i.Items.push(u),r++}return t?(delete i.CartItems,delete i.Order.ClientTimestamp):i.Order.ClientTimestamp=new Date,i}generateCompleteData(e){let t=new wi;return t.InvoiceNumber=e.Order.Number,t.OrderTimeString=new Date().toString(),t.PaymentStateID=e.Action?.Type,t.PaymentStateLabel="Offline",t.Success=!0,t.OutDeliveryID=e.Action.DeliveryEntityID,t}GetReturnInvoice(e,t){return this.httpService.get(U.ReturInvoice,[{key:"EntityID",value:t},{key:"Number",value:e}])}GetInvoiceBySoID(e){return this.httpService.get(U.GetPOSDataByID,[{key:"ID",value:e}])}UploadCSV(e,t){let i={CartItems:e,EntityID:t};return this.httpService.post(U.UploadCsv,i)}sendEmail(e,t){return new Promise((i,o)=>{this._localDataService.isProductFromServer().subscribe(r=>{if(r){let c={invoiceID:t,email:e};this.httpService.post(U.SendInvoiceEmail,c).subscribe({next:u=>{i(u)},error:u=>{o(u)}})}else o(oe.wrongOfflineAction)})})}sendWhatsaap(e,t){let i={InvoiceID:e,PhoneNumber:t};return this.httpService.post(U.SendInvoiceWhatsapp,i)}createCustomerByInvoice(e,t){let i={InvoiceID:e,Mobile:t};return this.httpService.post(U.CreateCustomerInvoice,i)}saveCommission(e,t){let i={SOID:e,commission:t};return this.httpService.POSText("/API/Transaction/SetCommission",i)}generateReceiptA4(e){let t={ID:e};return this.httpService.post(U.InvoiceA4,t)}getVacant(e){return this.httpService.get(U.GetVacant,[{key:"EntityID",value:e}])}static \u0275fac=function(t){return new(t||n)(g(ge),g(Oe),g(he),g(F))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var Xt=(r=>(r[r.cash=1]="cash",r[r.card=2]="card",r[r.emoney=3]="emoney",r[r.other=4]="other",r[r.ECR=99]="ECR",r))(Xt||{});var L=class n{constructor(e,t,i){this._OrderHttpService=e;this._customerHttpService=t;this._toastrService=i}_Data=new be(new G);transaction_id;Data$=this._Data.asObservable();get Data(){return this._Data.value}pushNewValue(e){if(e)this._Data.next(e);else{let t=this.Data;this._Data.next(t)}}submitOrder(e){return new Promise((t,i)=>{this.checkTransactionId(),this._OrderHttpService.submitOrder(this.Data,e).subscribe({next:o=>{t(o)},error:o=>{this.Data.Items=[],i(o)}})})}uploadOfflineOrder(){return this.checkTransactionId(),this._OrderHttpService.uploadOfflineOrder(this.Data)}checkTransactionId(){let t=this.Data.Payments.find(i=>i.TypeID==3);f.IsNotEmpty(t)&&f.IsEmpty(this.transaction_id)&&this._toastrService.warning("Midtrans transaction_id is empty. Please verify manually!","Mobile Payment Failure")}updateCustomerID(e){return this.Data.Order.CustomerID=e,this.pushNewValue(this.Data),new Promise((t,i)=>{this._customerHttpService.GetPrivilegeByID(e,this.Data.Order.EntityID).subscribe({next:o=>{this._customerHttpService.Data=o,this.pushNewValue(this.Data),t(o)},error:o=>{this.Data.Order.CustomerID=null,this.Data.ContactName=null;let r=o.error?.Message;o.status==409?this._toastrService.warning(r,"Warning"):this._toastrService.error(r,`API Error - ${o.status}`),i(o)}})})}static \u0275fac=function(t){return new(t||n)(g(It),g(Re),g(F))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var z=class n{constructor(e,t,i){this._localDataService=e;this._onlineStatusService=t;this._httpService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}_Data=new be(null);Data$=this._Data.asObservable().pipe(ce(e=>e!==null),Fe());isOnline;get Data(){return this._Data.value}pushNewValue(e){this._Data.next(e)}requestObservable(){return this.isOnline?this._httpService.get(U.GetPOSStorage).pipe(J(e=>({data:e,type:"Online"}))):this._localDataService.getPOSStorage().pipe(ce(e=>e!=null),J(e=>({data:e,type:"Offline"})))}getOutletName(e){return this.Data.Entities.find(i=>i.ID==e)?.Name}static \u0275fac=function(t){return new(t||n)(g(Oe),g(he),g(ge))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var De=class n{constructor(e){this.roleService=e;this.pushNewValue(new We(e))}_Data=new be(new We(null));get Data(){return this._Data.value}Data$=this._Data.asObservable();pushNewValue(e){this._Data.next(e)}static \u0275fac=function(t){return new(t||n)(g(_i))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var ti=class{ID;Code;EntityID;Name;Description;Start;StartDisplay;State;Open;CashierID;OpeningCash;EntityName;LoginID;Active;CustomerDisplayEnabled;OvoConfigurationID;CustomerDisplayID;ListImage;Suspended};var Ei=class n{odsConfigType=R(0);setODSConfig(e){this.odsConfigType.set(e)}isEnabled(){return this.odsConfigType()>0}static \u0275fac=function(t){return new(t||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var sr=n=>({active:n}),lr=n=>({gray:n});function cr(n,e){if(n&1){let t=w();a(0,"span",15),S("click",function(o){v(t);let r=d().$implicit;return d().closeRegister(r),_(o.stopPropagation())}),s()}}function mr(n,e){n&1&&(a(0,"div")(1,"span",16),m(2,"VACANT"),s()())}function dr(n,e){if(n&1&&(a(0,"div")(1,"span",17),b(2,"i",18),a(3,"span",19),m(4),s()(),a(5,"span",20),b(6,"i",21),a(7,"span",19),m(8),s()()()),n&2){let t=d().$implicit;l(4),M(t.LoginID),l(4),D("",t.StartDisplay.split(" ")[3]," - Now")}}function pr(n,e){if(n&1){let t=w();a(0,"div",8)(1,"div",9)(2,"div",10)(3,"h5",11),S("click",function(){let o=v(t).$implicit,r=d();return _(r.select(o))}),a(4,"span"),b(5,"i",12),m(6),y(7,"limitTo"),s(),h(8,cr,1,0,"span",13),s(),a(9,"div",14),S("click",function(){let o=v(t).$implicit,r=d();return _(r.select(o))}),h(10,mr,3,0,"div")(11,dr,9,2,"div"),s()()()()}if(n&2){let t,i=e.$implicit,o=d();l(),p("ngClass",i.Active?"active":""),l(),p("ngClass",j(9,sr,(i==null?null:i.ID)==(o.selectedRegister==null?null:o.selectedRegister.ID))),l(),p("ngClass",j(11,lr,i!=o.selectedRegister)),l(3),M(X(7,6,i.Name,15)),l(2),C(i.State!="Close"?8:-1),l(2),C((t=i.State)==="Close"?10:t==="Open"?11:-1)}}var Ri=class n{constructor(e,t,i,o,r,c,u){this._dialogRef=e;this._outletService=t;this._posService=i;this._userRoleService=o;this.router=r;this.httpService=c;this._odsService=u}originalSelectedRegister=null;registers;searchInput="";selectedRegister=new ti;modalConfig=new ie;role;get AppConfigJSON(){return this._posService.Data.AppConfigJSON}destroy$=new Me;ngOnInit(){this.subscribeToObsChanges(),this.initModalConfig()}subscribeToObsChanges(){this._posService.Data$.pipe(Ie(this.destroy$)).subscribe(e=>{this.registers=e.Registers}),this._outletService.Data$.pipe(Ie(this.destroy$)).subscribe(e=>{this.selectedRegister=this.findOutletRegisterById(e.RegisterID),this.originalSelectedRegister=this.selectedRegister?ni({},this.selectedRegister):null}),this._userRoleService.Data$.pipe(Ie(this.destroy$)).subscribe(e=>{this.role=e})}findOutletRegisterById(e){let t=this.registers.find(i=>i.ID===e);return t||new ti}initModalConfig(){this.modalConfig.hideFooter=!0,this.modalConfig.hideScrollbar=!0,this.modalConfig.title="Choose an outlet"}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}onClose(){this._dialogRef.close()}select(e){if(this.AppConfigJSON.ModuleShift.Closure.Enabled)if(this.selectedRegister.ID!=null&&this.selectedRegister.Open&&e.CashierID==null)confirm("You already have an active register with "+this.selectedRegister.Name+`!
|
|
2
2
|
Do you want to end your session?`)&&(this.onClose(),this.router.navigate(["menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}));else if(!e.Open||this.selectedRegister.ID==e.ID)this.selectedRegister=e,this.onSubmitSelectedRegister();else{if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}alert("This Register has already active register, Are you sure you want to end this register?"),this.onClose(),this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}})}else this.selectedRegister=e,this.onSubmitSelectedRegister()}onSubmitSelectedRegister(){if(this.selectedRegister.ID==null){alert("Please select a register first!");return}this._outletService.pushNewRegister(this.selectedRegister),this.loadOdsConfig(this.selectedRegister.EntityID),this._dialogRef.close({selectedRegister:this.selectedRegister,openStartingCashDialog:this.selectedRegister.ID!=this.originalSelectedRegister?.ID})}closeRegister(e){let t=this.selectedRegister.ID;if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}t==e.ID?this.router.navigate(["/menu/Shift/Main/My_Shift"]):this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}),this.onClose()}loadOdsConfig(e){this.httpService.get(`/api/outlet/GetOrderDisplayBroadcastMode?EntityID=${e}`).pipe(le(t=>{this._odsService.setODSConfig(t.form.OrderDisplayBroadcastMode)})).subscribe()}static \u0275fac=function(t){return new(t||n)(P(te),P(re),P(z),P(De),P(zn),P(ge),P(Ei))};static \u0275cmp=N({type:n,selectors:[["pos-modal-register"]],standalone:!1,decls:12,vars:6,consts:[[3,"onClose","config"],[1,"ms-0","mb-8","search-container",3,"hidden"],[1,"input-group","mb-3","rounded-start-1"],[1,"input-group-text","txtFilter","rounded-end-0"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["data-cy","SearchOutlet","type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded-1","rounded-start-0",3,"ngModelChange","ngModel"],[1,"container","custom-scroll"],[1,"row",2,"width","600px"],["data-cy","registers",1,"col-4"],[1,"card","border-0",3,"ngClass"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0",3,"click","ngClass"],[1,"fa-solid","fa-house","pe-1","fs-6"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px"],[1,"card-text","px-0","py-2",3,"click"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px",3,"click"],[1,"idle"],[1,"cashier"],["aria-hidden","true",1,"fa","fa-user","pe-2"],[1,"d-inline"],[1,"open"],["aria-hidden","true",1,"fa-regular","fa-clock","pe-2"]],template:function(t,i){t&1&&(a(0,"modal-material",0),S("onClose",function(){return i.onClose()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"span",3),b(5,"i",4),s(),a(6,"input",5),H("ngModelChange",function(r){return A(i.searchInput,r)||(i.searchInput=r),r}),s()()(),a(7,"div",6)(8,"div",7),K(9,pr,12,13,"div",8,ve),y(11,"FilterByName"),s()()()()),t&2&&(p("config",i.modalConfig),l(2),p("hidden",i.registers.length<=6),l(4),B("ngModel",i.searchInput),l(3),Z(X(11,3,i.registers,i.searchInput)))},dependencies:[Be,Te,Pe,we,ne,bi,vo],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.search-container[_ngcontent-%COMP%]{transition:all .3s ease;width:97%}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#89b03e;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#7a9e37}.container[_ngcontent-%COMP%]{overflow-y:auto;overflow-x:hidden;max-height:260px;min-height:150px}.col-4[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{width:180px;min-height:95px;margin-right:17px;margin-bottom:17px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #B1AAAA;border-radius:5px;cursor:pointer}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{height:30px;border-radius:4px;padding:5px 10px;color:#fff;background:#b1aaaa;overflow:hidden}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover, .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%]{background:#89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:80px;padding:15px 10px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.col-4[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}"]})};var ur=["inputCash"],Ni=class n{constructor(e,t){this.dialogRef=e;this.data=t;this.generateModalTitle$.subscribe()}registerService=T(re);loadPOSService=T(z);register=this.registerService.Data;username=this.loadPOSService?.Data?.UserName;amount=R(0);config=new ie;currentRegisterName;generateModalTitle$=this.registerService.Data$.pipe(ce(e=>f.IsNotEmpty(e)),le(()=>{let e=this.registerService.getOutletRegister(),t=e?.Name?.length>18?`${e?.Name?.substring(0,18)}...`:e?.Name;this.config.title="Open Shift",this.currentRegisterName=t}),ee());today=new Date;inputCashEl;ngOnInit(){this.config.customWidth="350px",this.config.hideCancel=!0}ngAfterViewInit(){this.inputCashEl?.nativeElement?.focus()}onOk(){this.dialogRef.close({amount:this.amount()})}static \u0275fac=function(t){return new(t||n)(P(te),P(fe))};static \u0275cmp=N({type:n,selectors:[["POS-modal-opening-cash"]],viewQuery:function(t,i){if(t&1&&Ut(ur,5),t&2){let o;Wt(o=Gt())&&(i.inputCashEl=o.first)}},standalone:!1,decls:25,vars:8,consts:[["inputCash",""],[3,"onOk","onCancel","onClose","config"],[1,"table","fs-5","text"],[1,"py-3"],[1,"text-end","pe-3"],[1,"py-4"],[1,"text-end"],["data-cy","InputCash","autoNum","",1,"border","form-control-lg","text-end","w-100",3,"ngModelChange","ngModel"]],template:function(t,i){if(t&1){let o=w();a(0,"modal-material",1),S("onOk",function(){return v(o),_(i.onOk())})("onCancel",function(){return v(o),_(i.dialogRef.close())})("onClose",function(){return v(o),_(i.dialogRef.close())}),a(1,"content")(2,"table",2)(3,"tr")(4,"td",3),m(5,"Outlet Register"),s(),a(6,"td",4),m(7),s()(),a(8,"tr")(9,"td",5),m(10,"Current User"),s(),a(11,"td",4),m(12),s()(),a(13,"tr")(14,"td",5),m(15,"Starting Time"),s(),a(16,"td",4),m(17),y(18,"date"),s()(),a(19,"tr")(20,"td",3),m(21,"Starting Cash"),s(),a(22,"td",6)(23,"input",7,0),H("ngModelChange",function(c){return v(o),A(i.amount,c)||(i.amount=c),_(c)}),s()()()()()()}t&2&&(p("config",i.config),l(7),M(i.currentRegisterName),l(5),M(i.username),l(5),M(X(18,5,i.today,"EEEE, HH:mm")),l(6),B("ngModel",i.amount))},dependencies:[Te,Pe,we,ne,Dt,Ye],styles:[".table-title-width[_ngcontent-%COMP%]{width:120px}"]})};var Ai=class{OrderNumberElement;InvoiceNumberElement;NewOrderID};var wt=class n{constructor(e,t,i){this._httpService=e;this._onlineStatusService=t;this._localDataService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}isOnline;GenerateNumber(e,t){if(this.isOnline)return this._httpService.get(U.GenerateNumber,[{key:"EntityID",value:e},{key:"TypeID",value:1}]);{let i=new Ai;return f.IsNotEmpty(t.NumberElement)&&(t.NumberElement.Seed+=1),f.IsNotEmpty(t.InvoiceNumberElement)&&(t.InvoiceNumberElement.Seed+=1),i.InvoiceNumberElement=t.InvoiceNumberElement,i.OrderNumberElement=t.NumberElement,i.NewOrderID=f.Guid_NewGuid(),ke(i)}}findRegisterById(e){return new Promise(t=>{this._localDataService.isConfigFromServer().subscribe(i=>{i?this._httpService.get(U.GetRegisterInfo,[{key:"RegisterID",value:e}]).subscribe(o=>{t(o)}):this._localDataService.findRegisterByID(e).subscribe(o=>{t(o)})})})}recordOpeningCash(e){return ai(this._httpService.post("/API/POS/RecordOpeningCash",e))}static \u0275fac=function(t){return new(t||n)(g(ge),g(he),g(Oe))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var re=class n{constructor(e,t,i,o,r,c){this._signalRClientService=e;this._matDialog=t;this._posHttpResponseService=i;this._CoreHttpService=o;this._toastrService=r;this._roleService=c}datePipe=T(Ye);_Data=new be(null);Data$=this._Data.asObservable().pipe(ce(e=>e!==null),Fe());get Data(){return this._Data.value}getSalesname(e){return this.Data&&this.Data.ListSales?this._Data.value.ListSales.find(t=>t.ID==e)?.Name:""}setActiveRegisterFromOptions(e,t){let o=this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled;if(e.length>1){let r=e.find(c=>c.LoginID==t);if(r)this.pushNewRegister(r);else{let c=this.getOutletRegisterFromLocalStorage(),u=this.Data?.RegisterID?this.Data.RegisterID:c?.ID;e.some(k=>k.ID==u)?o?this.openChooseRegisterModal():this.initRegisterFromLocalStorage():this.openChooseRegisterModal()}}e.length==1&&(this.pushNewRegister(e[0]),f.IsEmpty(e[0].LoginID)&&f.IsEmpty(e[0].CashierID)&&this.openOpeningCashModal(e[0].ID)),e.length==0&&this._toastrService.warning("You do not have access to any OUTLET","Warning")}openChooseRegisterModal(){this._matDialog.open(Ri,{id:"registerModal",disableClose:!0}).afterClosed().pipe(ce(e=>f.IsNotEmpty(e?.selectedRegister))).subscribe(e=>{e.selectedRegister&&this.openOpeningCashModal(e.selectedRegister.ID)})}openOpeningCashModal(e){this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled&&this._matDialog.open(Ni,{disableClose:!0}).afterClosed().pipe(ce(o=>f.IsNotEmpty(o))).subscribe(o=>{let r={RegisterID:e,OpAmount:o.amount};this._CoreHttpService.recordOpeningCash(r).then(()=>{this.updateRegisterList(r)})})}updateRegisterList(e){let i=this._posHttpResponseService.Data.Registers.map(r=>r.ID==e.RegisterID?this.mapRegisterAsActiveRegister(r,e):r),o=this._posHttpResponseService.Data;o.Registers=i,this._posHttpResponseService.pushNewValue(o)}mapRegisterAsActiveRegister(e,t){let i=localStorage.getItem("AccountInfo");if(i){let r=JSON.parse(i);e.LoginID=r.UserName}e.OpeningCash=t.OpAmount,e.Open=!0,e.State="Open";let o=this.datePipe.transform(new Date,"dd MM yyyy HH:mm");return e.StartDisplay=o,e}initRegisterFromLocalStorage(){if(this._roleService.Data.DeleteItem==!1){let t=this.getOutletRegisterFromLocalStorage();t&&this.pushNewRegister(t)}}pushNewRegister(e){let t=this._Data.value,i=t?t.RegisterID:null;i!=e.ID&&this._CoreHttpService.findRegisterById(e.ID).then(o=>{o.RegisterCode=e.Code,o.DefaultPrintTemplate=o.PrintTemplate,this._signalRClientService.SubscribeGroup(o.RegisterID,i),this.saveOutletRegisterToLocalStorage(e),this.pushNewValue(o)})}getOutletRegister(){let e=this.Data.RegisterID;return this._posHttpResponseService.Data.Registers.find(o=>o.ID==e)}pushNewValue(e){this._Data.next(e)}saveOutletRegisterToLocalStorage(e){if(this._roleService.Data.DeleteItem==!1){let i=JSON.stringify(e);localStorage.setItem("outlet_register",i)}}getOutletRegisterFromLocalStorage(){let e=this._roleService.Data.DeleteItem,t=localStorage.getItem("outlet_register"),i=null;return t&&(e?localStorage.removeItem("outlet_register"):i=JSON.parse(t)),i}findOutletRegisterById(e){return this._posHttpResponseService.Data.Registers.find(o=>o.ID===e)}static \u0275fac=function(t){return new(t||n)(g(rt),g(Ee),g(z),g(wt),g(F),g(De))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};function gr(n,e){if(n&1&&(a(0,"span",5),m(1),y(2,"number"),s()),n&2){let t=d(3);l(),D("-",x(2,1,t.coupon.Amount),"%")}}function fr(n,e){if(n&1&&(a(0,"span",5),m(1),y(2,"number"),s()),n&2){let t=d(3);l(),D(" -",x(2,1,t.coupon.Amount)," ")}}function hr(n,e){if(n&1){let t=w();a(0,"button",9),S("click",function(){v(t);let o=d().$implicit,r=d(2);return _(r.onRemoveCouponDiscount(o))}),m(1," Remove "),s()}}function Cr(n,e){if(n&1){let t=w();a(0,"button",10),S("click",function(){v(t);let o=d().$implicit,r=d(2);return _(r.onApplyCouponDiscount(o))}),m(1," Apply "),s()}if(n&2){let t=d(3);p("disabled",t.hasAppliedCouponDiscount())}}function vr(n,e){if(n&1&&(a(0,"tr")(1,"td"),m(2),s(),a(3,"td"),m(4),s(),a(5,"td",4),m(6),y(7,"number"),s(),a(8,"td",4),h(9,gr,3,3,"span",5)(10,fr,3,3,"span",5),s(),a(11,"td",6),h(12,hr,2,0,"button",7)(13,Cr,2,1,"button",8),s()()),n&2){let t=e.$implicit,i=d(2);l(2),M(t==null||t.Variant==null?null:t.Variant.Name),l(2),M(t==null||t.Variant==null?null:t.Variant.Code),l(2),M(x(7,5,t.UnitPrice)),l(3),C((i.coupon==null||i.coupon.Requirement==null?null:i.coupon.Requirement.Type)==i.couponType.DiscountPercentage?9:10),l(3),C((t==null?null:t.CouponDiscount)>0?12:13)}}function _r(n,e){if(n&1&&K(0,vr,14,7,"tr",null,ot),n&2){let t=d();Z(t.eligibleItems())}}function yr(n,e){n&1&&(a(0,"tr")(1,"td",11),b(2,"app-empty-state",12),s()())}var ki=class n{constructor(e){this.data=e;this.coupon=this.data.coupon,this.initModalConfig(),this.initEligibleItems()}dialogRef=T(te);config;eligibleItems=R([]);coupon;couponType=zt;hasAppliedCouponDiscount=R(!1);initModalConfig(){this.config=new ie,this.config.title="Choose Item to Apply Discount",this.config.hideFooter=!0}initEligibleItems(){let e=this.data.coupon?.ApplyToProduct.map(t=>t.ID);e&&(this.eligibleItems.update(()=>this.data.cartItems.filter(i=>e.includes(i.VariantID))),this.hasAppliedCouponDiscount.update(()=>this.eligibleItems().some(t=>t.CouponDiscount>0)))}onApplyCouponDiscount(e){let t=[e];this.hasAppliedCouponDiscount.update(()=>!0),this.dialogRef.close(t)}onRemoveCouponDiscount(e){this.eligibleItems.update(t=>{let i=t.findIndex(o=>o.VariantID===e.VariantID);return i>-1&&(t[i].Discount=0,t[i].CouponDiscount=0),t}),this.hasAppliedCouponDiscount.update(()=>!1)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)(P(fe))};static \u0275cmp=N({type:n,selectors:[["app-modal-coupon-selected-item"]],decls:17,vars:2,consts:[[3,"onCancel","onClose","config"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[1,"text-end"],[1,"text-danger"],[1,"text-center"],[1,"btn","btn-sm","btn-danger"],[1,"btn","btn-sm","btn-success",3,"disabled"],[1,"btn","btn-sm","btn-danger",3,"click"],[1,"btn","btn-sm","btn-success",3,"click","disabled"],["colspan","5"],["title","No eligible products","message","No products in the cart qualify for coupon use"]],template:function(t,i){t&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),a(1,"content")(2,"table",1)(3,"thead",2)(4,"tr")(5,"th",3),m(6,"Name"),s(),a(7,"th",3),m(8,"Code"),s(),a(9,"th",3),m(10,"Price"),s(),a(11,"th",3),m(12,"Discount"),s(),b(13,"th",3),s()(),a(14,"tbody"),h(15,_r,2,0)(16,yr,3,0,"tr"),s()()()()),t&2&&(p("config",i.config),l(15),C(i.eligibleItems().length!==0?15:16))},dependencies:[Se,Ot,ne,So,q],encapsulation:2})};var st=class{ModuleSell;ApplicationLoyalty;ApplicationMath;CoreDefaults;ModuleDelivery;ApplicationParkAndRetrieve;ApplicationRegisterClosure;PaymentConfigGopay;PaymentConfigLink;PrintConfigInvoice;CorePrint;PaymentConfigEmpatKali;ApplicationSettings;PrintConfigGeneral;ModuleProducts;ModuleContact;ApplicationTransactionNumbering;ModuleOrders;ModuleShift;ModuleBuy;ModuleAdjustment;TadaCouponVisible;CouponRedemptionType;ProviderOption};var se=class n{constructor(e,t,i,o){this._orderDataService=e;this._posService=t;this.POSMATH=i;this.decimalPipe=o;this._orderDataService.Data$.pipe(Y(r=>this._posService.Data$.pipe(J(c=>({appConfig:c.AppConfigJSON,salesOrder:r}))))).subscribe(r=>{this.salesOrderData=r.salesOrder,this.appConfigJSON=r.appConfig,this.calculateDiscountAmount(),this.pushNewValue(this.grandTotal)})}_Data=new be(0);Data$=this._Data.asObservable().pipe(Fe());tax=new xo;discountAfterTax=0;currencySymbol="Rp";get Data(){return this._Data.value}salesOrderData=new G;appConfigJSON=new st;pushNewValue(e){this._Data.next(e)}get grandTotal(){let e=this.TotalAfterSurcharge;return isNaN(e)?0:e}setDecimalDigit(e){let t=this.decimalPipe.transform(e,"1.0-4");return e=parseFloat(t.split(",").join("")),e}get TotalAfterTax(){let e=this.TaxAmount,t=this.TotalBeforeTax+e;return t=this.POSMATH.Round(t,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm),t}get TotalBeforeTax(){let e=this.tax?.CalculationTypeID===1,t=0;return e?t=this.DiscountTotal-this.TaxAmount:t=this.DiscountTotal,t}get TotalAfterSurcharge(){let e=this.TotalAfterTax+this.SurchargeAmount;return this.POSMATH.Round(e,this.appConfigJSON.ApplicationMath.RoundingDigit.DecimalPlaceValue,this.appConfigJSON.ApplicationMath.RoundingDigit.RoundAlgorithm)}get TotalAfterDiscountTaxable(){return this.GrossTotalTaxable-this.DiscountTotal}get TaxAmount(){if(this.tax!=null){let e=0,t=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.DecimalPlaceValue,i=this.appConfigJSON.ApplicationMath.RoundingTaxDigit.RoundAlgorithm,o=this.GrossTotalTaxable;return this.tax.CalculationTypeID==1?e=this.tax.Rate/(100+this.tax.Rate)*o:e=this.tax.Rate/100*o,e=this.POSMATH.Round(e,t,i),e}else return 0}get SurchargeAmount(){return this.TotalAfterTax*this.salesOrderData.Invoice.SurchargePcg/100}get Discount1Amount(){return this.GrossTotal*this.salesOrderData.Order.Discount/100}get AfterDiscount1Amount(){return this.GrossTotal-this.Discount1Amount}get Discount2Amount(){return this.AfterDiscount1Amount*this.salesOrderData.Order.Discount2/100}get AfterDiscount2Amount(){return this.AfterDiscount1Amount-this.Discount2Amount}get DiscountTotal(){return this.AfterDiscount2Amount-this.salesOrderData.Order.DiscountAmount}calculateDiscountAmount(){let e=this.salesOrderData.Order.DiscountAmount,t=0;this.AfterDiscount2Amount>=0&&e>0&&e>this.AfterDiscount2Amount&&(t=this.AfterDiscount2Amount),t!==0&&t<=e&&this.GrossTotal!==0&&(e=t),this.salesOrderData.Order.DiscountAmount=e}get GrossTotal(){return this.sum(this.salesOrderData.CartItems,"Total")}get GrossTotalTaxable(){let e=this.salesOrderData.CartItems.filter(i=>i.Taxable),t=this.sum(e,"Total");if(e.length!==0){let i=this.calculateDiscountTaxableItem(e);t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-i}return t}calculateDiscountTaxableItem(e){let t=this.GrossTotal,i=this.salesOrderData.Order.DiscountAmount,o=0,r=0,c=0,u=0;for(let O of e)o=O.getItemAfterDiscount/t,r=o*i,u=r*O.Quantity,c+=u;return c}get GrossTotalNonTaxable(){let e=this.salesOrderData.CartItems.filter(i=>i.Taxable==!1),t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t=t-this.salesOrderData.Order.DiscountAmount,t}sum(e,t){let i=e.reduce((o,r)=>o+r[t],0);return i=this.setDecimalDigit(i),i}GetPointOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==2);return this.GetAmountByCart(e)}GetCashOnlyAmount(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID==1);return this.GetAmountByCart(e)}GetCashAndPointAmountCart(){let e=this.salesOrderData.CartItems.filter(t=>t.Variant.PaymentTypeID!=1);return this.GetAmountByCart(e)}GetAmountByCart(e){let t=this.sum(e,"Total");return t=t*(100-this.salesOrderData.Order.Discount)/100,t=t*(100-this.salesOrderData.Order.Discount2)/100,t}calculateGrossTotal(e){return this.sum(e,"Total")}static \u0275fac=function(t){return new(t||n)(g(L),g(z),g(Io),g(q))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var Vi=class{Code;Provider;EntityID;Customer;ShoppingCart};var Et=class n{salesOrderService=T(L);registerService=T(re);customerService=T(Re);orderCalculator=T(se);generateRedeemCouponDto(e,t){let i=new Vi,o=this.registerService.Data?.EntityID;return i.Code=e,i.Provider=t,i.ShoppingCart={Amount:this.orderCalculator.Data,Items:this.generateItems()},i.EntityID=o,i.Customer=this.generateCustomer(t),i}generateItems(){return this.salesOrderService.Data.CartItems.map(i=>({Price:i.Price,Quantity:i.Quantity,VariantID:i.VariantID,Code:i?.Variant?.Code}))}generateCustomer(e){let t=this.customerService.Data,i=this.salesOrderService?.Data?.Order?.CustomerID,o=null;return f.IsNotEmpty(i)&&(o={Phone:t.Mobile,Email:t.Email},e==="Internal"&&(o=ni({ID:i},o))),o}static \u0275fac=function(t){return new(t||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var Rt=class n{constructor(e,t,i,o,r,c){this._httpService=e;this._orderDataService=t;this._userRoleService=i;this.toastr=o;this._invoiceCalculatorService=r;this.promotionCouponFactoryService=c;this.subscribeToObservable()}dialog=T(Ee);role;originalRoleData;_coupon=R(null);salesOrderBeforePromotion=R(null);isShowToastrInApplyCoupon=R(!1);get coupon(){return this._coupon()}subscribeToObservable(){this._userRoleService.Data$.subscribe(e=>{this.role=e,f.IsEmpty(this.originalRoleData)&&(this.originalRoleData=de(We,e))})}RedeemCoupon(e,t,i=!1){i||(this.isShowToastrInApplyCoupon.set(!0),this.copyOriginalSalesOrder());let o=this.promotionCouponFactoryService.generateRedeemCouponDto(e,"Internal");this._httpService.post(U.ValidateInternalCoupon,o).subscribe({next:r=>{switch(this._orderDataService.Data.Order.PromotionCoupon=e,this._orderDataService.Data.Order.PromotionNote=t,this._orderDataService.Data.Order.CouponType=1,r.Requirement?.Type){case 1:this.HandleDiscountPercentage(r);break;case 2:this.HandleDiscountAmount(r);break;case 3:this.handleCouponReturnAccess(r);break;case 4:this.handleCouponParkedDeletionAccess();break;case 5:this.handleFullAccessCoupon();break;case 6:this.handleDeleteItemCoupon();break}this._coupon.set(r),this.isShowToastrInApplyCoupon.set(!1)},error:r=>{this.removeAppliedCoupon(!1),this.isShowToastrInApplyCoupon.set(!1)}})}setCouponOnEdit(e){this._coupon.set(e),this.generateOriginalSalesOrderOnEdit()}generateOriginalSalesOrderOnEdit(){let e=de(G,this._orderDataService.Data);e.Order.PromotionCoupon=null,e.Order.PromotionNote=null,e.Order.Discount=0,e.Order.DiscountAmount=0,this.salesOrderBeforePromotion.set(e)}copyOriginalSalesOrder(){let e=de(G,this._orderDataService.Data);this.salesOrderBeforePromotion.set(e)}HandleDiscountPercentage(e,t=!1){e.Amount>0?e.Requirement?.MaximumDiscount>0?this.applyConfigMaxDiscount(e,t):e.Requirement?.FullPriceProductOnly?this.applyFullPriceDisc(e,t):this.applyDiscountPercentage(e,t):(this.role.Discount=t?this.originalRoleData.Discount:!0,this._userRoleService.pushNewValue(this.role))}applyFullPriceDisc(e,t=!1){let i=this._orderDataService.Data,o=this.filterItemWithDisc(i.CartItems),r=this.filterItemWithCouponDisc(i.CartItems);if(t)r.length>0?(i.CartItems=this.resetItemsDisc(i.CartItems),this._orderDataService.pushNewValue()):this.applyDiscountPercentage(e,t);else if(o.length>0){let c=this.filterItemWithoutDisc(i.CartItems);c.length>0?this.applyConfigItemsScope(e,c).subscribe(u=>{let O=this.applyItemsDisc(u,e);i.CartItems=this.updateCartItems(O,e),this._orderDataService.pushNewValue(i),this.showToastr(e)}):(this.removeAppliedCoupon(!1),this._orderDataService.pushNewValue(),this.toastr.error("No products in the cart qualify for coupon use","Coupon Not Applied"))}else this.applyDiscountPercentage(e,t)}updateCartItems(e,t){let o=this._orderDataService.Data.CartItems.map((r,c)=>{let u=e.find(O=>this.isSameCartItem(O,r));return u||r});return o=this.applyOneOfFirstQuantity(o,t),o}applyOneOfFirstQuantity(e,t){if(t?.Requirement?.RequirementDiscountType==2){let i=e.findIndex(o=>o.CouponDiscount>0);if(e[i]?.Quantity>1){let o=dt(xe,e[i]);o.Quantity=1,o.ID=f.GuidEmpty,e[i].Quantity=e[i].Quantity-1,e[i].CouponDiscount=0,e[i].Discount=0,e[i].DiscountAmount=0,e.push(o)}}return e}filterItemWithDisc(e){return e.filter(i=>i.Discount>0||i.DiscountAmount>0||i.Price!=i?.Variant?.UnitPrice||f.IsNotEmpty(i.PriceBookID)||i.PriceTypeID==2)}filterItemWithoutDisc(e){return e.filter(i=>this.itemConditionFullPriceOnly(i))}filterItemWithCouponDisc(e){return e.filter(i=>i.CouponDiscount>0)}applyDiscountPercentage(e,t=!1){let i=this._orderDataService.Data.Order.CustomerDiscountRate,o=e.Amount;if(t){let r=this._orderDataService.Data;this._orderDataService.Data.Order.Discount=0,r.CartItems=this.resetItemsDisc(r.CartItems),this._orderDataService.pushNewValue(r)}else o>=i?e.ApplyToProduct?.length>0?this.applyDiscountRequiredItems(e):(this._orderDataService.Data.Order.Discount=e.Amount,this._orderDataService.pushNewValue(),this.showToastr(e)):(this.toastr.warning("Member discount is applied because member discount is greater than Coupon Discount","Warning"),this.removeAppliedDiscountOnCustomerChange())}applyDiscountRequiredItems(e){let i=this._orderDataService.Data.CartItems.filter(o=>e.ApplyToProduct.map(r=>r.ID)?.includes(o.VariantID));this.applyConfigItemsScope(e,i).subscribe(o=>{let r=o.map(u=>(u.Discount=e.Amount,u.CouponDiscount=e.Amount,u)),c=this.updateCartItems(r,e);this._orderDataService.Data.CartItems=c,this._orderDataService.pushNewValue(),this.showToastr(e)})}showToastr(e){let t=e?.Requirement?.Notify;f.IsNotEmpty(t)&&this.isShowToastrInApplyCoupon()&&this.toastr.success(t,"Coupon Applied")}applyConfigMaxDiscount(e,t=!1){let i=this._orderDataService.Data.CartItems;e.Requirement?.FullPriceProductOnly&&(i=i.filter(o=>this.itemConditionFullPriceOnly(o))),this.applyConfigItemsScope(e,i,t).subscribe(o=>{this.applyMaxDiscount(e,o,t)})}applyConfigItemsScope(e,t,i=!1){let o=e.Requirement?.RequirementDiscountType;return(o==1||o==2)&&i==!1?this.dialog.open(ki,{data:{coupon:e,cartItems:t},id:"modal-coupon-selected-item"}).afterClosed().pipe(le(c=>{let k=this._orderDataService.Data.CartItems.some(W=>W.CouponDiscount>0);!c&&!k&&this.removeAppliedDiscountOnCustomerChange()}),ce(c=>!!c)):ke(t)}applyMaxDiscount(e,t,i=!1){let o=this._invoiceCalculatorService.calculateGrossTotal(t),r=this._orderDataService.Data,c=o*e.Amount/100,u=e.Requirement?.MaximumDiscount,O=t;c>=u?(r.Order.DiscountAmount=i?0:u,O=this.resetItemsDisc(t)):(r.Order.DiscountAmount=0,O=i?this.resetItemsDisc(t):this.applyItemsDisc(t,e)),r.CartItems=this.updateCartItems(O,e),this._orderDataService.pushNewValue(r),i||this.showToastr(e)}resetItemsDisc(e){return this.coupon?.Requirement?.RequirementDiscountType==2?e=this.resetConfigOneOfFirstQuantity(e):e=e.map(t=>(t.CouponDiscount>0&&(t.Discount=0,t.DiscountAmount=0,t.CouponDiscount=0),t)),e}resetConfigOneOfFirstQuantity(e){let t=e.findIndex(i=>i.CouponDiscount>0);if(t!==-1){let i=e.findIndex(o=>o.CouponDiscount==0&&e[t]?.VariantID==o?.VariantID);i!==-1?(e.splice(t,1),e[i].Quantity+=1):(e[t].CouponDiscount=0,e[t].Discount=0,e[t].DiscountAmount=0)}return e}applyItemsDisc(e,t){return t.ApplyToProduct?.length>0?e=this.applyDiscByVariant(e,t):e=e.map(i=>(i.Discount=t.Amount,i.CouponDiscount=t.Amount,i)),e}applyDiscByVariant(e,t){return e=e.map(i=>(t.ApplyToProduct.find(r=>r.ID==i.VariantID)&&this.itemConditionFullPriceOnly(i)&&(i.Discount=t.Amount,i.CouponDiscount=t.Amount),i)),e}itemConditionFullPriceOnly(e){return(e.Discount==0||e.CouponDiscount>0)&&e.DiscountAmount==0&&e.Price==e?.Variant?.UnitPrice&&f.IsEmpty(e.PriceBookID)}HandleDiscountAmount(e,t=!1){e.Amount>0?(e.ApplyToProduct?.length>0?this.applyDiscountInItem(e,t):(t?this._orderDataService.Data.Order.DiscountAmount=0:(this._orderDataService.Data.Order.DiscountAmount=e.Amount,this.showToastr(e)),this._orderDataService.pushNewValue()),this.resetCustomerPoint(t)):(this.role.Discount=t?this.originalRoleData.Discount:!0,this._userRoleService.pushNewValue(this.role))}applyDiscountInItem(e,t=!1){let i=this._orderDataService.Data;if(t)i.CartItems=this.resetItemsDisc(i.CartItems);else{let r=i.CartItems.filter(c=>e.ApplyToProduct.map(u=>u.ID)?.includes(c.VariantID));this.applyConfigItemsScope(e,r,t).subscribe(c=>{let u=c.map(O=>(O.DiscountAmount=e.Amount,O.CouponDiscount=e.Amount,O));i.CartItems=this.updateCartItems(u,e),this._orderDataService.pushNewValue(i),this.showToastr(e)})}}resetCustomerPoint(e){if(!e){let t=this._orderDataService.Data;t.Order.PointUsed=0}}handleCouponReturnAccess(e){let t=de(We,this.role);t.Return=!0,this._userRoleService.pushNewValue(t),this.isShowToastrInApplyCoupon()&&this.toastr.success("You got access to return a sales transaction!","Coupon Applied")}handleCouponParkedDeletionAccess(){let e=de(We,this.role);e.ParkedDeletionAuthorized=!0,this._userRoleService.pushNewValue(e),this.isShowToastrInApplyCoupon()&&this.toastr.success("You Have Access to delete park and delete item when retrieve!","Coupon Applied")}handleFullAccessCoupon(){let e=de(We,this.role);e.UnitPriceEditor=!0,e.Discount=!0,e.Return=!0,e.Tax=!0,e.NumberEditor=!0,e.DateEditor=!0,e.PricebookSelector=!0,e.DeleteItem=!0,e.ParkedDeletionAuthorized=!0,this._userRoleService.pushNewValue(e),this.isShowToastrInApplyCoupon()&&this.toastr.success("You now have Full Access for this Order!","Coupon Applied")}handleDeleteItemCoupon(){let e=de(We,this.role);e.DeleteItem=!0,this._userRoleService.pushNewValue(e),this.isShowToastrInApplyCoupon()&&this.toastr.success("You Have Access to delete item","Coupon Applied")}removeAppliedCoupon(e=!0){this._userRoleService.pushNewValue(this.originalRoleData),this._orderDataService.pushNewValue(this.salesOrderBeforePromotion()),this.salesOrderBeforePromotion.set(null),this._coupon.set(null),e&&this.toastr.warning("Coupon Cancelled","Warning")}resetCouponOnNewTransaction(){this._userRoleService.pushNewValue(this.originalRoleData),this._coupon.set(null)}removeAppliedDiscountOnCustomerChange(){if(this.coupon)switch(this.coupon.Requirement?.Type){case 1:this.HandleDiscountPercentage(this._coupon(),!0),this.removeAppliedCouponOnCustomerChange();break;case 2:this.HandleDiscountAmount(this._coupon(),!0),this.removeAppliedCouponOnCustomerChange();break}}removeAppliedCouponOnCustomerChange(){if(this.coupon){let e=this._orderDataService.Data;e.Order.PromotionCoupon=null,e.Order.PromotionNote=null,this._coupon.set(null),this._userRoleService.pushNewValue(this.originalRoleData),this._orderDataService.pushNewValue(e)}}isSameCartItem(e,t){return e.VariantID===t.VariantID&&e.Quantity===t.Quantity&&e.Price===t.Price&&e.Discount===t.Discount&&e.PriceBookID===t.PriceBookID}static \u0275fac=function(t){return new(t||n)(g(ge),g(L),g(De),g(F),g(se),g(Et))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};var Nt=class{CommissionID;ReturNumber;parkTemporaryItem;posState;InputTextValue;constructor(){this.posState=0,this.CommissionID="",this.ReturNumber="",this.parkTemporaryItem=[],this.InputTextValue=""}};var Fi=class n{constructor(e,t,i){this._promotionEventService=e;this._dialogRef=t;this.data=i;this.modalConfig=new ie,this.modalConfig.hideCancel=!0,this.modalConfig.hideClose=!0,this.modalConfig.headerType=me.Warning,this.modalConfig.title="Promotion Requirement unfulfilled!",this.modalConfig.customWidth="350px",this.modalConfig.okText="Ok",this.selectedPromotion=e.selectedPromotion}modalConfig;selectedPromotion;onOk(){this._promotionEventService.restoreOrder(),this._dialogRef.close()}static \u0275fac=function(t){return new(t||n)(P(Ae),P(te),P(fe))};static \u0275cmp=N({type:n,selectors:[["POS-modal-promotion-confirm"]],standalone:!1,decls:9,vars:4,consts:[[3,"onOk","config"],[1,"fst-italic","text-danger","mb-3"],[1,"mb-0"]],template:function(t,i){t&1&&(a(0,"modal-material",0),S("onOk",function(){return i.onOk()}),a(1,"content")(2,"div")(3,"h5"),m(4),s(),a(5,"p",1),m(6),s(),a(7,"p",2),m(8),s()()()()),t&2&&(p("config",i.modalConfig),l(4),M(i.selectedPromotion==null?null:i.selectedPromotion.Name),l(2),M(i.selectedPromotion==null?null:i.selectedPromotion.Description),l(2),M(i.data==null?null:i.data.message))},dependencies:[ne],encapsulation:2})};var Li=class extends xe{};var Vt=class n{constructor(e,t,i,o,r,c,u,O,k,W){this.variantService=e;this._posService=t;this._orderDataService=i;this.toastr=o;this._orderProcessorService=r;this._customerHttpService=c;this.promotionCouponService=u;this.promotionCouponExternalService=O;this.userRoleService=k;this.decimalPipe=W;this.subscribeToObservable()}salesOrderData;appConfigJson;entityID;audio=new Audio;subscribeToObservable(){this._posService.Data$.pipe(ee()).subscribe(e=>{this.appConfigJson=e.AppConfigJSON}),this._orderDataService.Data$.pipe(ee()).subscribe(e=>{this.salesOrderData=e,this.entityID=e.Order.EntityID}),this._orderProcessorService.Data$.pipe(ee()).subscribe(e=>{e.posState==3&&this.clearCartItemsInLocalStorage()})}addCartItemById(e,t,i=!0){return new Promise((o,r)=>{this.variantService.findVariantByID(e,this.entityID,i).then(c=>{this.createNewCartItem(c,t),o(c)}).catch(c=>{r(c)})})}addCartItemByCode(e){return new Promise((t,i)=>{let o=this.appConfigJson.ModuleSell.DigitalScale;o.Digit>0&&f.IsNotEmpty(o.Regex)&&e.length==o.Digit?this.parseDigitalScaleBarcodeWithRegex(e,o).then(c=>{c||(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.findVariantByCode(e).then(u=>t(u)).catch(u=>i(u)))}):this.findVariantByCode(e).then(c=>t(c)).catch(c=>i(c))})}findVariantByCode(e){let t=this.appConfigJson.ModuleSell.BarcodeSerialEnabled;return new Promise((i,o)=>{this.variantService.findVariantByCode(e,this.entityID,t).then(r=>{i(r),this.createNewCartItem(r)}).catch(r=>{this.playBellRing(),o(r)})})}addItemBySerial(e){this.variantService.findVariantBySerial(e,this.entityID).subscribe(t=>{let i=this.salesOrderData.CartItems;if(i.length>0){let o,r=[],c=i.findIndex(u=>u.Variant.ID==t.ID);r=[],c!==-1?(o=i[c].Serial?.findIndex(u=>u.Number==e),r=[...i[c].Serial?i[c].Serial:[]],o==-1?(r.push({Number:e,Quantity:1}),i[c].Quantity=r.length):r.length>0?r[o].Quantity+=1:(r=[{Number:e,Quantity:1}],this.addNewSerials(t,e)),i[c].Serial=[...r],i[c].Quantity=i[c].calculateSerialQty(),this.updateCartItem(i[c],c)):this.addNewSerials(t,e)}else this.addNewSerials(t,e)})}addNewSerials(e,t){e.Serial=[{Number:t,Quantity:1}],this.createNewCartItem(e)}playBellRing(){this.audio.src="//res.cloudinary.com/pos/video/upload/v1659947782/POS/Music/bell_ring.mp3",this.audio.load(),this.audio.play()}updateCartItem(e,t){this.salesOrderData.CartItems[t]=e,this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint(),this.reApplyPromotionCoupon(),this.saveItemsToLocalStorage()}deleteCartItem(e){this.salesOrderData.CartItems=this.salesOrderData.CartItems.filter(t=>t!==e),this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint(),this.isRemoveItemRequirement(e)&&this.reApplyPromotionCoupon()}parseDigitalScaleBarcodeWithRegex(e,t){return new Promise(i=>{let o=this.appConfigJson.ModuleSell.BarcodeSerialEnabled,r=new RegExp(t.Regex),c=e.match(r);if(console.log(c),f.IsNotEmpty(c)){let u=c[1],O=parseFloat(c[2]);console.log(O,"productQuantity"),O=O/t.QuantityDivider,this.variantService.findVariantByCode(u,this.entityID,o).then(k=>{this.createNewCartItem(k,null,O),i(!0)}).catch(()=>{i(!1)})}else i(!1)})}createNewCartItem(e,t,i){let o=new xe,r=this.appConfigJson.ModuleSell.ProductNotes.CopyProductDescription,c=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;o.patchByVariant(e,r,c),o=this.applyReward(o,t),f.IsEmpty(t)&&(o=this.applyPriceBook(o)),this.validateCartItem(o)&&(o.Quantity=i||o.Quantity,t?.PromotionType==2?this.handlingPromotionQuantity(o):this.pushNewItemToArray(o,o.PromotionGift),this.applyCustomerPoint()),this.addAvailableComponent(o)}applyCustomerPoint(){let e=this.salesOrderData.Order.CustomerID,t=f.IsEmpty(e);this._orderProcessorService.reedemPointToDiscount(t)}handlingPromotionQuantity(e){let t=de(xe,this.salesOrderData.CartItems),i=t.findIndex(o=>o.VariantID==e.VariantID&&o.PromotionGift);i!==-1?t[i].Quantity+=e.Quantity?e.Quantity:1:t=[...t,e],this.salesOrderData.CartItems=t,this._orderDataService.pushNewValue(this.salesOrderData)}applyPromotionProduct(e){let t=e.Variant.DiscountAmount;return t&&(e.Price=e.UnitPriceOriginal-t),e}applyReward(e,t){if(t){let i=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;e.Discount=t.Discount,e.Price=t.OriginalPrice;let o=t.OriginalPrice-t.UnitPrice;e.Price=e.UnitPriceOriginal-o,e.UnitPrice=e.UnitPriceOriginal-o,e.PromotionGift=!0,e.PromotionID=t.PromotionID,e.Quantity=t.Quantity?t.Quantity:1,e.PriceTypeID=3,e.Cost+=t.ExtraCost,e.UnitCost+=t.ExtraCost,e.PriceNote=t.PromotionName,i&&(e.Note=`${e.Note?e.Note:""} ${t.PromotionName} `)}return e}addAvailableComponent(e){let t=e.Price!=0,i=this.appConfigJson.ModuleSell.SellProductComponentDefaultPrice,o=e.Variant;if(o.Component!=null&&o.Component.length>0)for(let r of o.Component){let c=new Li;c.patchByVariant(r),c.Quantity=e.Quantity*r.Quantity,t&&!i&&(r.UnitPrice=0),c.Price=r.UnitPrice,this.pushNewItemToArray(c)}}pushNewItemToArray(e,t=!1){let i=this.salesOrderData.CartItems.findIndex(o=>o.VariantID==e.VariantID);if(e=this.applyPromotionProduct(e),i==-1||t)this.salesOrderData.CartItems.push(e);else{let o=this.appConfigJson.ModuleSell.QuickKey.NewRowBehaviour;if(o==2)this.salesOrderData.CartItems.push(e);else if(o==1)this._orderProcessorService.Data.posState==4?this.salesOrderData.CartItems.push(e):this.addingQuantityItem(i,e);else{if(!this.validatePrepaidPackage(e,i)){this.toastr.error("This prepaid package is already in the cart while editing. Please remove it first before adding again.","Cannot Add Item");return}this.addingQuantityItem(i,e)}}this._orderDataService.pushNewValue(this.salesOrderData),this.saveItemsToLocalStorage(),this.reApplyPromotionCoupon()}saveItemsToLocalStorage(){let e=this.userRoleService.Data.DeleteItem,t=this._orderProcessorService.Data?.posState;if(!e&&t!==4){let i=this._orderDataService.Data,o=i?.Order?.Number,r=i.CartItems,c={Number:o,CartItems:r};try{localStorage.setItem("cart_items",JSON.stringify(c))}catch(u){console.error("Error saving cart items to localStorage:",u)}}}clearCartItemsInLocalStorage(){localStorage.getItem("cart_items")&&(this.userRoleService.Data?.DeleteItem?this.clearCartItemsBasedOnCoupon():this.clearCartItemsStorage())}clearCartItemsBasedOnCoupon(){let e=this.promotionCouponService?.coupon;e&&(e.Requirement?.Type==5||e.Requirement?.Type==6)&&this.clearCartItemsStorage()}clearCartItemsStorage(){try{localStorage.removeItem("cart_items")}catch(e){console.error("Error clearing cart items from localStorage:",e)}}validatePrepaidPackage(e,t){let i=this.salesOrderData.CartItems[t],o=this._orderProcessorService.Data.posState,r=e.Variant.TypeID==10,c=f.IsNotEmpty(i.ID),u=!0;return o==2&&r&&c&&(u=!1),u}reApplyPromotionCoupon(){let e=this.salesOrderData.Order.CouponProvider,t=e=="Internal"||f.IsEmpty(e),i=this.salesOrderData.Order.PromotionCoupon,o=this.salesOrderData.Order.PromotionNote;f.IsNotEmpty(i)&&(t?this.promotionCouponService.RedeemCoupon(i,o,!0):this.promotionCouponExternalService.redeemCoupon(i,"External",o))}isRemoveItemRequirement(e){let t=this.promotionCouponService?.coupon,i=t?.ApplyToProduct,o=!0;return f.IsNotEmpty(t)&&i?.length>0&&(o=i.some(r=>r.ID==e.VariantID)),o}addingQuantityItem(e,t){let i=this.salesOrderData.CartItems.filter(u=>u.VariantID==t.VariantID),o=i.length,r=i.find(u=>!u.PromotionGift);this.salesOrderData.CartItems[e].PromotionGift&&o==1?this.salesOrderData.CartItems.push(t):(r.Quantity+=t.Quantity,r=this.applyPromotionProduct(r)),r&&(r=this.applyPriceBook(r))}validateCartItem(e){return e.Variant.CategoryTypeID==-1?(this.toastr.info(e.Variant.Name+" cannot be sold, check Category "+e.Variant.CategoryName+" settings","info"),!1):!(!this.validatePriceMinimum(e)||!this.validateSerialItem(e))}validatePriceMinimum(e){let t=!0,i=this.userRoleService.Data.PriceMinimum,o=this.appConfigJson.ModuleSell.ProductDialog.PriceMinimumTypeID;if(i){let r=0;switch(o){case 1:r=e.UnitPrice;break;case 2:r=e.UnitCost;break;case 3:r=e.UnitPriceMinimum;break}if(e.Price<r){t=!1;let c=f.StringFormat("You have no right to sell this item lower than {0}",this.decimalPipe.transform(r));alert(c)}}return t}validateSerialItem(e){let t=!0;if(e?.Serial?.length>0&&e.Variant.TypeID==4&&e.Quantity>0){let i=0;e?.Serial?.forEach(o=>{i+=o.Quantity}),i!=e.Quantity&&(this.toastr.error("Serial must be equal with the quantity","Error"),t=!1)}return t}applyPriceBook(e){let t=e.Variant.PriceBook!=null?e.Variant.PriceBook:[],i=this.findCustomerPricebook(t);if(t&&t.length!==0){let o=t.sort(function(r,c){return c.MinimumQuantity-r.MinimumQuantity}).filter(r=>e.Quantity>=r.MinimumQuantity&&r.MinimumQuantity!=0);o.length>0||f.IsNotEmpty(i)?f.IsNotEmpty(i)?e=this.applyPricebookToItem(e,i):e=this.applyPricebookToItem(e,o[0]):e=this.resetAppliedPricebook(e)}return e}resetAppliedPricebook(e){let i=(e?.Variant?.PriceBook).find(o=>o.ID==e.PriceBookID);return f.IsNotEmpty(i)&&(e.Discount=e.Variant.PriceDiscount,e.PriceBookID=f.GuidEmpty,e.Price=e.Variant.UnitPrice,e.UnitPrice=e.Variant.UnitPrice,e.PriceTypeID=0,e=this.applyPromotionProduct(e),e=this.removePromotionNote(e)),e}removePromotionNote(e){let t=this.appConfigJson.ModuleSell.ProductNotes;if(this.appConfigJson?.ModuleSell?.Pricebook?.PricebookVisible&&(e.Note=e.Note?.replace(e.PriceNote,""),e.PriceNote=""),t.CopyPromotionName){let o=e.Variant?.PriceNote;e.Note=`${o||""} ${e.Note?e.Note:""}`,e.PriceNote=o}return e}applyPricebookToItem(e,t){return e.Discount=t.PriceDiscount,e.UnitPrice=t.UnitPrice,e.PriceBookID=t.ID,e.Price=t.UnitPrice,e.PriceTypeID=2,e=this.assignItemNote(e,t),e}assignItemNote(e,t){return this.appConfigJson?.ModuleSell?.Pricebook?.PricebookVisible?(e.Note?.includes(e.PriceNote)?e.Note=e.Note?.replace(e.PriceNote,t.Name):e.Note=`${t.Name} ${e.Note?e.Note:""}`,e.PriceNote=t.Name):(e.Note="",e.PriceNote=""),e}findCustomerPricebook(e=[]){let t=this._customerHttpService.Data,i;return t&&(i=e.find(o=>o.ID==t.PricebookID)),i}static \u0275fac=function(t){return new(t||n)(g(Mo),g(z),g(L),g(F),g(je),g(Re),g(Rt),g(Bi),g(De),g(q))};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})};function Or(n,e){if(n&1&&(a(0,"div",2)(1,"div",4),b(2,"input",8),s()()),n&2){let t=d();l(2),p("formControl",t.searchControl)}}function Dr(n,e){n&1&&(a(0,"span"),m(1,"Apply"),s())}function Mr(n,e){n&1&&(a(0,"span"),m(1,"Applying..."),s())}function xr(n,e){if(n&1){let t=w();a(0,"tr")(1,"td"),m(2),s(),a(3,"td"),m(4),s(),a(5,"td",9),m(6),y(7,"number"),s(),a(8,"td",9),m(9),y(10,"number"),s(),a(11,"td",10)(12,"button",11),S("click",function(){let o=v(t).$implicit,r=d();return _(r.onSelectReward(o))}),h(13,Dr,2,0,"span"),h(14,Mr,2,0,"span"),s()()()}if(n&2){let t=e.$implicit,i=d();l(2),M(t.VariantName),l(2),M(t.VariantCode),l(2),M(x(7,7,t.OriginalPrice)),l(3),M(x(10,9,t.UnitPrice)),l(3),p("disabled",i.isApplyingReward()),l(),C(i.isApplyingReward()?-1:13),l(),C(i.isApplyingReward()?14:-1)}}var ji=class n{constructor(e,t,i,o,r,c){this._dialogRef=e;this._matDialog=t;this._shoppingCartService=i;this._promotionEventService=o;this._toastr=r;this.data=c;this.selectedPromotion=this._promotionEventService.selectedPromotion}modalConfig=new ie;selectedPromotion;rewards$;searchControl=new et;isApplyingReward=R(!1);ngOnInit(){this.modalConfig.title="Select a Reward",this.modalConfig.hideFooter=!0,this.initRewards(!0)}initRewards(e){this.rewards$=this.searchControl.valueChanges.pipe(li(""),ht(e?0:500),Fe(),Y(t=>{let i;return i=ke(this.data.rewards).pipe(J(o=>o.filter(r=>this.findKeywordInValue(t,r?.VariantCode)||this.findKeywordInValue(t,r?.VariantName)))),e=!0,i}))}findKeywordInValue(e,t){return t?.toUpperCase()?.indexOf(e?.toUpperCase())>-1}onSelectReward(e){return oi(this,null,function*(){if(!this.isApplyingReward()){this.isApplyingReward.set(!0);try{e.PromotionType=this.data.promotion.TypeID,yield this._shoppingCartService.addCartItemById(e.VariantID,e,!0).then(()=>{this._matDialog.closeAll(),this._promotionEventService.pushNewValue(this._promotionEventService.Data),this.showToastAppliedPromo()})}finally{this.isApplyingReward.set(!1)}}})}showToastAppliedPromo(){this._toastr.success("Applied "+this.selectedPromotion.Name+" to order!","Applied successfully!")}close(){this._dialogRef.close()}static \u0275fac=function(t){return new(t||n)(P(te),P(Ee),P(Vt),P(Ae),P(F),P(fe))};static \u0275cmp=N({type:n,selectors:[["POS-modal-select-item"]],standalone:!1,decls:23,vars:8,consts:[[3,"onCancel","onClose","config"],[1,"container"],[1,"row","mb-3"],[1,"row"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],["type","text","placeholder","Type to filter reward",1,"form-control",3,"formControl"],[1,"text-end"],[1,"text-center"],[1,"btn","btn-sm","btn-success",3,"click","disabled"]],template:function(t,i){t&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.close()})("onClose",function(){return i.close()}),a(1,"content")(2,"div",1),h(3,Or,3,1,"div",2),a(4,"div",3)(5,"div",4)(6,"table",5)(7,"thead",6)(8,"tr")(9,"th",7),m(10,"Name"),s(),a(11,"th",7),m(12,"Code"),s(),a(13,"th",7),m(14,"Price"),s(),a(15,"th",7),m(16,"Promo"),s(),b(17,"th",7),s()(),a(18,"tbody"),K(19,xr,15,11,"tr",null,ve),y(21,"async"),y(22,"sortBy"),s()()()()()()()),t&2&&(p("config",i.modalConfig),l(3),C((i.data==null||i.data.rewards==null?null:i.data.rewards.length)>5?3:-1),l(16),Z(yt(22,4,x(21,2,i.rewards$),"desc","VariantCode")))},dependencies:[Te,Pe,St,ne,ze,q,Mt],styles:[".table-scroll[_ngcontent-%COMP%]{max-height:400px;overflow-y:auto}table[_ngcontent-%COMP%]{max-width:600px!important;overflow-x:hidden}"]})};function Ir(n,e){if(n&1&&(a(0,"div",3)(1,"div",5),b(2,"input",10),s()()),n&2){let t=d();l(2),p("formControl",t.searchCtrl)}}function Tr(n,e){n&1&&(a(0,"th",9),m(1,"Qty"),s())}function wr(n,e){n&1&&b(0,"th",8)}function Er(n,e){if(n&1){let t=w();a(0,"td")(1,"input",13),H("ngModelChange",function(o){v(t);let r=d().$implicit;return A(r.Quantity,o)||(r.Quantity=o),_(o)}),s()()}if(n&2){let t=d().$implicit;l(),B("ngModel",t.Quantity)}}function Rr(n,e){n&1&&(a(0,"span"),m(1,"Apply"),s())}function Nr(n,e){n&1&&(a(0,"span"),m(1,"Applying..."),s())}function Ar(n,e){if(n&1){let t=w();a(0,"td",12)(1,"button",14),S("click",function(){v(t);let o=d().$implicit,r=d();return _(r.onApplyReward(o))}),h(2,Rr,2,0,"span"),h(3,Nr,2,0,"span"),s()()}if(n&2){let t=d(2);l(),p("disabled",t.isApplyingReward()),l(),C(t.isApplyingReward()?-1:2),l(),C(t.isApplyingReward()?3:-1)}}function kr(n,e){if(n&1&&(a(0,"tr")(1,"td"),m(2),s(),a(3,"td"),m(4),s(),a(5,"td",11),m(6),y(7,"number"),s(),a(8,"td",11),m(9),y(10,"number"),s(),h(11,Er,2,1,"td")(12,Ar,4,3,"td",12),s()),n&2){let t=e.$implicit,i=d();l(2),M(t.VariantName),l(2),M(t.VariantCode),l(2),M(x(7,5,t.OriginalPrice)),l(3),M(x(10,7,t.UnitPrice)),l(2),C(i.rewardQuantity>1?11:12)}}var Qi=class n{constructor(e,t,i,o,r,c){this.data=e;this.shoppingCartService=t;this.promotionEventService=i;this.dialogRef=o;this.matDialog=r;this.toastr=c;this.searchCtrl=new et,this.rewardQuantity=e.rewardQuantity,this.sourceRewards=[...e.rewards]}modalConfig;rewards$;rewardQuantity;rewards;sourceRewards=[];searchCtrl;isApplyingReward=R(!1);ngOnInit(){this.initModalConfig(),this.initSearchCtrl(!0)}initModalConfig(){this.modalConfig=new ie,this.modalConfig.title="Select a Reward",this.rewardQuantity<2&&(this.modalConfig.hideFooter=!0)}initSearchCtrl(e){this.rewards$=this.searchCtrl.valueChanges.pipe(li(""),ht(e?0:500),Fe(),Y(t=>{let i;return i=ke(this.sourceRewards).pipe(J(o=>(o.length===1&&(o[0].Quantity=this.rewardQuantity),o)),J(o=>o.filter(r=>this.findKeywordInValue(t,r?.VariantCode)||this.findKeywordInValue(t,r?.VariantName)))),e=!1,i}),le(t=>{this.rewards=t}))}findKeywordInValue(e,t){return t?.toUpperCase()?.indexOf(e.toUpperCase())>-1}onApplyReward(e){return oi(this,null,function*(){if(!this.isApplyingReward()){this.isApplyingReward.set(!0);try{yield this.addRewardToShoppingCart(e)}finally{this.isApplyingReward.set(!1)}}})}onClose(){this.dialogRef.close()}onOk(){this.calculateRewardQty()>this.rewardQuantity?this.toastr.warning("Product reward exceeds the maximum amount earned","Warning"):[...this.rewards].filter(i=>i.Quantity>0).forEach(i=>{this.addRewardToShoppingCart(i)})}calculateRewardQty(){let e=0;return this.rewards.forEach(t=>{e+=t.Quantity?t.Quantity:0}),e}addRewardToShoppingCart(e){return e.PromotionType=this.data.promotion.TypeID,this.shoppingCartService.addCartItemById(e.VariantID,e,!0).then(()=>{this.matDialog.closeAll(),this.promotionEventService.pushNewValue(this.promotionEventService.Data)})}static \u0275fac=function(t){return new(t||n)(P(fe),P(Vt),P(Ae),P(te),P(Ee),P(F))};static \u0275cmp=N({type:n,selectors:[["app-modal-quantity-reward"]],standalone:!1,decls:27,vars:10,consts:[[3,"onCancel","onOk","onClose","config"],[1,"ms-3"],[1,"container"],[1,"row","mb-3"],[1,"row","table-scroll"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],["scope","col",2,"width","66px"],["type","text","placeholder","Type to filter reward",1,"form-control",3,"formControl"],[1,"text-end"],[1,"text-center"],["type","text","autoNum","","min","0",1,"form-control",3,"ngModelChange","ngModel"],[1,"btn","btn-sm","btn-success",3,"click","disabled"]],template:function(t,i){t&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.onClose()})("onOk",function(){return i.onOk()})("onClose",function(){return i.onClose()}),a(1,"header")(2,"small",1),m(3),s()(),a(4,"content")(5,"div",2),h(6,Ir,3,1,"div",3),a(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),m(13,"Name"),s(),a(14,"th",8),m(15,"Code"),s(),a(16,"th",8),m(17,"Price"),s(),a(18,"th",8),m(19,"Promo"),s(),h(20,Tr,2,0,"th",9)(21,wr,1,0,"th",8),s()(),a(22,"tbody"),K(23,kr,13,9,"tr",null,ve),y(25,"async"),y(26,"sortBy"),s()()()()()()()),t&2&&(p("config",i.modalConfig),l(3),D(" ( ",i.rewardQuantity," products reward ) "),l(3),C((i.sourceRewards==null?null:i.sourceRewards.length)>5?6:-1),l(14),C(i.rewardQuantity>1?20:21),l(3),Z(yt(26,6,x(25,4,i.rewards$),"desc","VariantCode")))},dependencies:[Te,Pe,we,St,ne,Dt,ze,q,Mt],encapsulation:2})};var Ae=class n{constructor(e,t,i,o,r,c,u,O,k){this._orderDataService=e;this._outletService=t;this._invoiceCalculatorService=i;this._dialog=o;this._httpService=r;this._posService=c;this._toastr=u;this._signalrService=O;this.decimalPipe=k;this.previousQuantity=0,this.previousTotalEligible=0,this.subscribeNotification(),this._posService.Data$.subscribe(W=>{this.taxes=W.Taxes}),this._outletService.Data$.subscribe(W=>{this.loadPromotions(W.Promotion)}),this._orderDataService.Data$.pipe(ce(W=>{this.salesOrderData=W;let ye=this.calculateOrderReward(W.getRewards()),_n=this.calculateOrderReward(this.previousRewards);return this.previousQuantity!=W.TotalQuantity||_n<ye||this.isRestroreOrder}),ht(100)).subscribe(W=>{this.isRestroreOrder=!1,this.checkQtyPromotion(),this.applyQuantityPromotion(),this.previousRewards=[...W.getRewards()]}),this._invoiceCalculatorService.Data$.subscribe(W=>{this.checkEligiblePromotionWithMinSpend()})}_Data=new be([]);get Data(){return this._Data.getValue()}Data$=this._Data.asObservable();selectedPromotion=null;onClickToastPromo=new Me;previousQuantity;salesOrderData;orderDataBeforePromotion;taxes=[];previousTotalEligible;previousRewards=[];isRestroreOrder=!1;calculateOrderReward(e){let t=0;return e.length>0&&(t=e.map(i=>i.Quantity).reduce((i,o)=>i+o)),t}checkQtyPromotion(){let e=this._orderDataService.Data;this.checkEligibleQtyPromotion(e.CartItems),this.checkEligibleTierPromotion(e.CartItems),this.previousQuantity=e.TotalQuantity}subscribeNotification(){this._signalrService.OnPromotionEventChange.pipe(ee(),Y(()=>{let e=this._outletService.Data?.RegisterID;return this.getPromotions(e)})).subscribe(()=>{this._toastr.info("Promotion Event Updated","Promotion Update")})}getPromotions(e){return this._httpService.get(U.GetListPromotion,[{key:"RegisterID",value:e}]).pipe(le(t=>{this.loadPromotions(t)}))}loadPromotions(e){let t=this.getPromotionDesc(e);this.pushNewValue(t),this.checkQtyPromotion(),this.checkEligiblePromotionWithMinSpend()}pushNewValue(e){this.showToastEligiblePromotion(),this._Data.next(e)}checkSelectedPromotionRequirement(e){this.selectedPromotion!=null&&this.selectedPromotion.TypeID==e&&this.Data.find(i=>i.ID===this.selectedPromotion.ID)?.Eligible===!1&&(this._dialog.open(Fi,{id:"modal-promotion-confirm",data:{message:"Order will be restored to before the promotion is applied"},disableClose:!0}),this.isRestroreOrder=!0)}restoreOrder(){this._orderDataService.pushNewValue(this.orderDataBeforePromotion),this.selectedPromotion=null}getPromotionDesc(e=[]){return e?.map(i=>(i.Description=this.generatePromotionDesc(i),i))}checkEligiblePromotionWithMinSpend(){let e=this._invoiceCalculatorService.Data,t=this.Data?.filter(o=>(o.TypeID===1||o.TypeID==3)&&!this.checkExpiredPromotion(o)).map(o=>(e>=o.MinimumAmount?o.Eligible=!0:o.Eligible=!1,o)),i=this.mappingEligiblePromotion(t);this.pushNewValue(i),this.checkSelectedPromotionRequirement(1),this.checkSelectedPromotionRequirement(3)}checkEligibleQtyPromotion(e){let t=0,i=this.Data?.filter(r=>r.TypeID===2&&!this.checkExpiredPromotion(r)).map(r=>(r.Eligible=!1,r.ListVariant.length>0?(t=this.getQuantityByRequirementType(e,"variant",r.ListVariant),t>=r.MinimumAmount&&(r.Eligible=!0)):r.ListCategory.length>0?(t=this.getQuantityByRequirementType(e,"category",r.ListCategory),t>=r.MinimumAmount&&(r.Eligible=!0)):this.salesOrderData.TotalQuantity>=r.MinimumAmount&&(r.Eligible=!0),r)),o=this.mappingEligiblePromotion(i);this.pushNewValue(o)}checkEligibleTierPromotion(e){let t,i=this.Data?.filter(r=>r.TypeID===5&&!this.checkExpiredPromotion(r)).map(r=>(r.Eligible=!1,r.ListVariant.length>0?t=this.getQuantityByRequirementType(e,"variant",r.ListVariant):r.ListCategory.length>0?t=this.getQuantityByRequirementType(e,"category",r.ListCategory):t=this.salesOrderData.TotalQuantity,r.PromotionTieredQuantity.forEach(c=>{t>=c.Quantity&&(r.Eligible=!0)}),r)),o=this.mappingEligiblePromotion(i);this.pushNewValue(o)}getQuantityByRequirementType(e,t,i){let o=0,r;return t=="variant"?e.forEach(c=>{r=i.findIndex(u=>u.ID===c.VariantID),r!==-1&&(o+=c.Quantity)}):e.forEach(c=>{c.Variant&&(r=i.findIndex(u=>u.ID===c.Variant.CategoryID),r!==-1&&(o+=c.Quantity))}),o}mappingEligiblePromotion(e=[]){let t=this.Data;if(e?.length>0){let i;t=this.Data?.map(o=>(i=e.findIndex(r=>r.ID==o.ID),i!==-1&&(o=e[i]),o))}return t}checkExpiredPromotion(e){let t=new Date,i=new Date(e.StartDate),r=(f.IsEmpty(e.StartTime)?"00:00:00":e.StartTime).split(":").map(k=>parseInt(k));i.setHours(r[0],r[1],r[2]);let c=new Date(e.ExpirationDate),O=(f.IsEmpty(e.EndTime)?"23:59:59":e.EndTime).split(":").map(k=>parseInt(k));return c.setHours(O[0],O[1],O[2]),!(t.getTime()>=i.getTime()&&t.getTime()<=c.getTime())}showToastEligiblePromotion(){let e=this.getTotalEligiblePromotion(),t=f.IsNotEmpty(this.salesOrderData.Order.ID);this.previousTotalEligible!==e&&e>0&&!t&&this._toastr.info(e+" promotion(s) can be applied!","Promo available!",{timeOut:2e4}).onTap.pipe(Qe(1)).subscribe(()=>{this.onClickToastPromo.next(!0)}),this.previousTotalEligible=e}getTotalEligiblePromotion(){return this.Data?.filter(t=>t.Eligible).length}generatePromotionDesc(e){let t="";switch(e.TypeID){case 2:t+="Minimum "+this.decimalPipe.transform(e.MinimumAmount)+" ",e.ListVariant.length>0?(t=t+" piece of ",t+=this.generateItemListDescription(e.ListVariant)):e.ListCategory.length>0?(t+="from category ",t+=this.generateItemListDescription(e.ListCategory)):t+="items";break;case 1:t+="Minimum spend Rp. "+this.decimalPipe.transform(e.MinimumAmount);break;case 3:t+=`Apply
|
|
3
3
|
${e.Discount1!==0?"discount1 = "+e.Discount1+"%":""}
|
|
4
4
|
${e.Discount1!==0&&e.Discount2!==0?" and ":""}
|